Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Built-in heatmap-style cell background colours #659

Open
@interrogator

Description

@interrogator

May 1, 2020 Update by @chriddyp - This is now possible with conditional formatting. See https://dash.plotly.com/datatable/conditional-formatting & https://community.plotly.com/t/datatable-conditional-formatting-documentation/38763.
We're keeping this issue open for built-in heatmap formatting that doesn't require code-intensive conditional formatting constructs.

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

colormap

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 or cmap 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions