Plotly.NET
Plotly.NET copied to clipboard
Annotated Heatmap: automatic font color
Given an annotated heatmap I would expect the cell text to contrast with the cell color. (Not doing so leads to the readability issues in the current documentation/example of Annotated Heatmap: https://plotly.net/simple-charts/heatmaps.html)
A good contrast is shown and discussed on the python side of plotly: https://github.com/plotly/plotly.py/issues/1300
When I did not find a way to do that, I looked at the implementation of AnnotatedHeatmap.
Here the configuration of the annotations is not dependent on the actual cell values - I could only apply a workaround of setting a background color.
I did not find/check the actual layouting step if there is a better place to compute correct font color.