Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to highlight selected points, not tracks #53

Open
aganders3 opened this issue Mar 14, 2024 · 2 comments · May be fixed by #96
Open

Add a way to highlight selected points, not tracks #53

aganders3 opened this issue Mar 14, 2024 · 2 comments · May be fixed by #96
Assignees
Labels
enhancement New feature or request

Comments

@aganders3
Copy link
Collaborator

We should be able to highlight individual points as they are selected (this works currently) and have the selection follows those points through time along their tracks (this is not implemented). Ideally we would be able to modify multiple properties of the points - color, size, shape, etc.

This is something we want for visualizing the ink-style virtual experiments. It also may be something we start to visualize while tracks are still loading.

This was effectively "free" when I was calculating the track highlights on the CPU early in #42. However, with highlights calculated in the shader we no longer know which point on the track is at the current timepoint.

Setting the track length quite short kind of works, but visually is not as nice as showing an actual point.

My first thought is we need to store these in a new data structure on the PointCanvas. I am thinking an array with length numTimes, where each entry in the array would be a list of pointIDs to highlight, or a list of highlights with ID and/or location, plus addition attributes.

So something like this:

class Selection {
    color: Color;
    size: number;
    ids: number[];
    coords: Float32Array;
}

const selections: Selection[] = Array.from({length: numTimes}, () => new Selection());

I think this would have to be filled in as part of addTrack?

Then when the time slider changes, we have a couple options:

  1. render points in a new Points object, separately from the regular PointCanvas.points
  2. use the ids to modify the properties of individual points in PointCanvas.points
  3. something else?
@aganders3 aganders3 added the enhancement New feature or request label Mar 14, 2024
@andy-sweet
Copy link
Collaborator

I'm currently fighting with React about how to use our current effects to populate the existing selection and trigger the fetch/renders in the order that guarantees their display.

My instinct is that storing the selection of the points canvas and allowing it to be set directly (rather than through the react dispatcher and associated effect) could help, but I don't trust my instinct when it comes to React yet...

@aganders3
Copy link
Collaborator Author

Yeah this has to be held by PointCanvas for rendering anyway, so maybe just skip the React state if that makes it easier.

@andy-sweet andy-sweet linked a pull request Jun 5, 2024 that will close this issue
@andy-sweet andy-sweet self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants