-
Notifications
You must be signed in to change notification settings - Fork 73
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
Print Cell Labels in Heatmap #42
Comments
I was thinking of adding this, I can have a look today if you're not actively working on it |
Sounds good. (I won't get to it this month, so go ahead)
Tal
|
Unfortunately...
For now, I could implement separate mouseover values using cellnote |
Apologies, that was with geom_label. geom_text works. |
Seems to work okay thusfar, though unfortunately the mouseover currently hides the main matrix mouseover. Hopefully this is fixable. Okay, the way I see it, we need a We will also need a text color parameter, or we could try to figure out what the cell colour will be based on the value and colour scale, or we could try to use a white outline to make the text readable. Options 2 and 3 are my preferred options. http://stackoverflow.com/questions/10686054/outlined-text-with-ggplot2 I will try to mimic this with plot_ly soon, along with the side_colour_plots |
Good progress.
I think option 3 is probably best. If people would need extra control over
this in the future, this could be re-evaluated.
Thanks :)
|
So this is basically working, but is there a parameter for choosing the color? or a way to make the text have a halo? (right now the text is in black, which doesn't work with our color scheme). |
I can add the text color parameter and make it work with |
Sounds good :)
|
Can't add outline to plotly text layers, I'll add an issue over there. For now, it's at least slightly better. |
@talgalili check out the "autocolor" branch, I implemented a method for predicting the cell color value based on the heatmap's color scale and then testing the luminosity of it (there are probably better ways to calculate luminosity but it's a quick hack for now). It's definitely not a long term solution as it relies on the internal structure of plotly objects. Do you think this is a useful stopgap while we wait for another method of making the text clear? (outline is still my favourite) |
Hi @alanocallaghan could you share here a screenshot of how it looks? |
There's a slight disparity between the plotly and ggplot2 methods currently due to how I mapped to colours (I found the nearest neighbour for plotly, which does not have exact matches from each heatmap value to a colour, rather than doing linear interpolation - simply to save time) The top is with ggplot2, the bottom with plotly |
I added interpolation and the colors now match. I also found a bug with heatmaply master which meant color palettes such as RdBu could not be used with plot_method = "plotly", I've pushed a fix to master |
I looked at the screenshot, it looks much better @alanocallaghan |
I'll add an argument to control alignment; personally I find this left alignment easier to read for numbers, but it's just a preference |
ok, then we'll keep it as is. |
Like asked here: talgalili/d3heatmap#74
The text was updated successfully, but these errors were encountered: