Open bernstei opened 5 days ago
Adding new palettes should be very easy, they are all defined in https://github.com/lab-cosmo/chemiscope/blob/main/src/map/colorscales.ts.
lead to an only partially helpful error message (in particular the "are you sure" part):
Good point, this is a leftover from the time where the only way to save settings was to change them manually & export them. I'll update this.
I think just letting me set the min and max of the mapping would be enough.
You can already do this (or I am not getting your point). In the map settings, colors => more options => there is a min and max setting here that will be used.
Are you interested in a patch with just the tab10 palette (from matplotlib)? Or only if it's part of a more complete PR that supports color for categorical variables more cleanly?
That plus setting the limits manually to 0 - 10 (since the categorical values are mapped to integers, and the palette has 10 slots) give me the behavior I want.
Doesn't hurt. Maybe you could do all the four tabXXX colormaps https://matplotlib.org/stable/users/explain/colors/colormaps.html so there's some choice and the PR is a tad more substantial. It'd be important that the colormap is defined so there are really sharp changes, I think it can be achieved by having each point twice, with the left and the right colors, but you may have to play a bit with it.
My local branch has them with n * 0.1 - 1e-6
and n * 0.1
, which is very (but not perfectly) sharp. I can try identical values. And yes, I can grab the other discontinuous ones. Do you want me to clone, or add me as a contributor to this repo?
invited you. IDK if they can be identical, worth checking as it'd be cleaner. I just added you
As far as I can tell, the only truly categorical visual property that's available is symbol, but I find that it can be hard to find the one circle in a sea of squares, etc. I would find it very helpful if color could be used for a categorical property. That works now, but with very little control.
At a minimum, that could be done by allowing more standard matplotlib palettes, e.g.
tab10
, which currently lead to an only partially helpful error message (in particular the "are you sure" part):Additional control, e.g. mapping specific categorical values to numerical values in the scale, would be even better, but I think just letting me set the min and max of the mapping would be enough.