Heatmap

A heatmap chat built with D3 primitives and React.

Example

1020304050152535455551525354501020304012223242528075706560858075706590858075709590858075100959085801000100210041006100810021004100610081010100410061008101010121006100810101012101410081010101210141016581215186101417204711141736101316711151821
Temperature (°C)
Humidity (%)
Pressure (hPa)
Wind Speed (m/s)

Installation

components/charts/Heatmap.tsx

How It Works

The Heatmap is built using a compound component pattern that allows for multiple heatmap tiles to be displayed in a single visualization. Each Heatmap.Tile component manages its own color scale and data visualization, while sharing the same container dimensions. The Tooltip primitive provides interactive data display on hover, and the Legend component shows all the different heatmap tiles and their corresponding colors.

The component accepts a data structure where each key represents a different heatmap tile, containing its own data array, color, and label. This allows for easy comparison between different datasets in the same visualization space.