GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Plot area nearest graphics method · Issue #514 · fastplotlib/fastplotlib

Plot area nearest graphics method  #514

New issue
Copy link
New issue
Copy link
Closed
#519
Closed
Plot area nearest graphics method #514
#519
Copy link

Description

@kushalkolar
kushalkolar
opened on Jun 8, 2024
Issue body actions

A method on plot area that returns the nearest n graphics could be useful. Just get world bounding sphere of all graphics and return closest in order.. Will need to see if this is fast enough. We could cache the world bounding spheres and update them whenever graphic data, offset or rotation changes.

Activity

  1. kushalkolar commented on Jun 8, 2024

    @kushalkolar
    kushalkolar
    on Jun 8, 2024
    MemberAuthor
    More actions

    If it's slow, we could store the bounding sphere of a graphic when it's added to a PlotArea and update it whenever data, offset, or rotation changes. We could have a config option on each graphic to enable/disable this because updating all these could be slow if for example the data of a line collection is being constantly changed in a live data stream.

  2. clewis7 commented on Jun 16, 2024

    @clewis7
    clewis7
    on Jun 16, 2024
    Member
    More actions

    the nearest graphics relative to what?

  3. clewis7 commented on Jun 16, 2024

    @clewis7
    clewis7
    on Jun 16, 2024
    Member
    More actions

    I think we should provide option for "edge" vs "center" and choose one as the default (prob "center" imo)

  4. kushalkolar commented on Jun 17, 2024

    @kushalkolar
    kushalkolar
    on Jun 17, 2024
    MemberAuthor
    More actions

    the nearest graphics relative to what?

    to a passed point in world space

    idea of current signature:

        def get_nearest_graphics(
            self,
            pos: tuple[float, float, float],
            n_graphics: int = None,
            method: str = "center",
            subset: tuple[Graphic] = None,
        ) -> tuple[Graphic]:
            """
            Returns the nearest ``n_graphics`` to the passed position ``pos`` in world space
    
            Parameters
            ----------
            pos: (x, y, z)
                position in world space, not data space
    
            n_graphics: int | None
                nearest number of graphics to return, if ``None`` returns all graphics
    
            method: "center" | "edge"
                determine the nearest objects using the "center" of graphics or the "edge"
    
            Returns
            -------
            tuple[Graphic]
                nearest graphics to ``pos`` in order
    
            """
    
            pass
  5. kushalkolar
    closed this as completedin #519on Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.