-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments
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]),
) |
@lynwilhelm it would be nice to consider how we could support this functionality better |
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? |
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.
The text was updated successfully, but these errors were encountered: