Closed SanggyuChong closed 1 month ago
That would be fine with me. We would need to change the _colors
function
https://github.com/lab-cosmo/chemiscope/blob/634136b3d09cc32c9b951d1eb76293b2a872ec9a/src/map/map.ts#L1050
to look more like the _sizes
function, likely with a calculateColors
function on the map options.
I am reopening this as there are a number of bugs that need to be addressed. For starters, if log is called for a properties that has negative or zero values, it yields an error. That might be a reasonable thing to do, but it should be possible e.g. to set a minimum value >0 and then show this properly. In general, there are a number of quirks related to setting the extremes of the plot range, that make this option basically unusable. The zeolite dataset with volume as a color option is a good example of the problems that occur.
I would try to copy / reuse the behavior and option layout of the Cartesian axes
Ok, it does seem that there are some additional bugs to be fixed and design decisions to be made.
Elaborating on what @ceriottm has pointed out, the behavior is different between the cartesian log scale and color log scale in terms of the values that it tries to plot. One critical thing is that when the log scale is invoked in the coloring, it takes the natural log instead of log base 10. Also, the error that it throws when one tries to apply log coloring to volume per Si in the zeolite example (" The inserted values are such that min > max! ...") should not occur.
The ticks should become log scale as well in the color bar, but it doesn't and just displays raw exponent values. Behavior of the cartesian axes when log is invoked should be adopted here as well.
Regarding the negative values, to me it makes the most sense for us to invoke symlog when negative values are involved. I was quite confused to see the negative values discarded. If it's not too much of a hassle, having a separate symlog option might be nice.
I will follow up with @angerossi and get these taken care of. Thanks all.
I think that the most important thing is to make sure the behavior (and the UI) is consistent with what happens for Cartesian axes. Adding a symlog function would be nice and perhaps not too hard if we use the same code.
Any progress on fixing the color options for good? It seems to be subtly broken in many different ways.
I have had a meeting with @SanggyuChong and I am currently busy correcting the implementation. It will be finished shortly after the Easter break.
The ticks should become log scale as well in the color bar, but it doesn't and just displays raw exponent values. Behavior of the cartesian axes when log is invoked should be adopted here as well.
Is this even possible in plotly?
@SanggyuChong we were discussing this today, right? Is this still a problem or can we close the issue?
possibly relevant stackoverflow https://stackoverflow.com/questions/68368745/logarithmic-heatmap-in-plotly
Fixed by #280
Hello,
It would be great if an option to take the log of the data for the coloring of data points is available within Chemiscope. Currently, it seems that the user has to save the log of the data manually for this to take place. I was told that this feature was available before -- has there been some decisions against this? Thanks!
Best, Raymond