Merged
Conversation
ThomasKroes
approved these changes
Aug 29, 2025
Contributor
ThomasKroes
left a comment
There was a problem hiding this comment.
I think this is a nice addition!
From an architectural point of view, I would argue that we should try to avoid too much bespoke (niche) solution for individual viewers in bread-and-butter plugins. Having said that, doing it here now is logical, as the core does not facilitate more advanced color mapping schemes. There are several other types of viewers that can benefit from mapping schemes with more room to maneuver, so I will put this on the long-term agenda.
alxvth
added a commit
that referenced
this pull request
Aug 29, 2025
sree2712
pushed a commit
that referenced
this pull request
Oct 3, 2025
* WIP: color by selection mapping * Add explanations * Delay check * Better be safe * Add Reverse mapping as well * Fix false parent * Move new functions to own file * Centralize & inline check * Simpler return types and checks * Single swap * WIP: map means to HSNE embedding * Fix mapping from source of position to color by linked data * Remove debug prints * Delay surjection check for faster UI response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #185
Currently points in the scatterplot can be recolored based on other data if the other data...
a. has the same number of points
b. is derived from a parent that has the same number of points (e.g. for HSNE embeddings)
This PR adds:
c. data which has a fully-covering selection mapping (linked data)
For mapping the colors from the color data to the point data we use in (b) the global indices and in (c) the linked data.
There are several possible mappings handled and checked in this order:
This new feature is required for the Basal Ganglia project, specifically for recoloring HSNE and UMAP embeddings with means on cluster expression (these are the linked data).
Implementing mappings for opacity and size could be done similarly, but would not be nicely contained like here, since the opacity and size values are extracted in a different way at a different location in code.