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

color cells by scalar value; colorbar #308

Open
rheiland opened this issue Apr 21, 2023 · 3 comments
Open

color cells by scalar value; colorbar #308

rheiland opened this issue Apr 21, 2023 · 3 comments
Labels
ux UX design and research tasks

Comments

@rheiland
Copy link

It's possible I simply don't understand what is possible in the simularium trajectory info, but can I associate scalar values to the cells and then color the cells based on those scalars, plus the use of a colorbar? This is commonly done in vis libraries, e.g., matplotlib, VTK, etc. Here's an example using PhysiCell, where each cell is colored based on a calculated pressure scalar value.

Screen Shot 2023-04-21 at 6 34 42 AM

@meganrm
Copy link
Contributor

meganrm commented Apr 21, 2023

Current you have to just assign the color. I've used matplotlib to make a color map though before I save the simularium file

        colormap = matplotlib.cm.Reds(values)
        for index, value in enumerate(values):
            name = f"{incoming_name}#{value}"
            self.display_data[name] = DisplayData(
                name=name,
                display_type=DISPLAY_TYPE.SPHERE,
                url="",
                color=matplotlib.colors.to_hex(colormap[index]),
            )

@blairlyons blairlyons added the ux UX design and research tasks label Oct 9, 2023
@blairlyons blairlyons moved this to 🌳 Backlog in Simularium Planning Oct 9, 2023
@blairlyons
Copy link
Contributor

@lynwilhelm it would be nice to consider how we could support this functionality better

@toloudis
Copy link
Contributor

toloudis commented Oct 9, 2023

Viewer implementation thoughts: currently we use a single global discrete color map and it does not scale to large amounts of colors (I think). My first instinct is that gradients mapped to scalar agent data should probably be an "extra" thing, and it breaks the assumptions of the global color map. Maybe it gets us all the way to having a per-agent color (not per-agent-type). We have to do some data design for that too - where are the per-agent scalar values? Do the colors have to be mapped on the fly or can the colors be precomputed and baked into the data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux UX design and research tasks
Projects
Status: 🌳 Backlog
Development

No branches or pull requests

4 participants