Open interrogator opened 4 years ago
@interrogator Thanks for the feedback. This can currently be done through the conditional formatting, but you are right that it's neither as nice, performant, or flexible as real native heatmaps support. While there's been some background discussions about this in the last few months, there's currently no timeline for supporting this feature.
@interrogator as a workaround, check out the heatmap chart type in plotly
too: https://plot.ly/python/heatmaps/
There is a figure factory that generates a heatmap with nicely formatted text as well: https://plot.ly/python/annotated_heatmap/
Thanks for the feedback. @chriddyp I already do use the plotly heatmap, it works well, but I do also have some data tables that could also benefit. @Marc-Andre-Rivet, yes, I suppose I'll do it via conditional formatting, probably just by copying how pandas does it, their result looks nice. Will post recipe if I do.
@interrogator et al - I just published some recipes on how to do this in the conditional formatting chapter: https://dash.plotly.com/datatable/conditional-formatting & https://community.plotly.com/t/datatable-conditional-formatting-documentation/38763.
There are ways we could make this easier & faster going forward, but this should work for now. 🥂
@interrogator et al - I just published some recipes on how to do this in the conditional formatting chapter: https://dash.plotly.com/datatable/conditional-formatting & https://community.plotly.com/t/datatable-conditional-formatting-documentation/38763.
There are ways we could make this easier & faster going forward, but this should work for now. 🥂
Please note some examples are failing on https://dash.plotly.com/datatable/conditional-formatting For example: Highlighting a Range of Values
I use a combination of pandas and dash-table, as I guess many do.
pandas can output tables to HTML. In addition, they've made it possible that you can pass in colourmaps, which, in combination with a cell's numerical content, can be used to make a simple heatmap. Example from the docs
I believe that something like this would already be possible using datatable, by comparing cell contents to a colourmap and using these to derive a background colour. (I wonder if anyone has a recipe for this?)
Even so, I think this would make a nice feature for the datatable, since you could in many ways copy the implementation inside pandas,
background_gradient
orcmap
or whatever during instantiation of the datatable. If not, a recipe using conditional styling would still be great.There was support for heatmaps here, but the issue ended after conditional formatting was added.