Heatmap
A grid shaded by value. Negative values take the second colour, which makes it a ready-made correlation matrix.
| Name | Type | What it does |
|---|---|---|
heatmap(data, options) | component | data: { rows, columns, values: [[…], …] } |
{ values: false } | modifier | Option: hide the number in each cell |
{ cell } | modifier | Option: cell size (default 46) |
{ label } | modifier | Option: a description read out by screen readers |
Correlation matrix
<script type="module" src="node_modules/glimmer-ui/charts.js"></script>
<gl-chart type="heatmap" data='{"rows":["Price","Size","Age","Rooms","Dist"],"columns":["Price","Size","Age","Rooms","Dist"],"values":[[1,0.82,-0.35,0.74,-0.52],[0.82,1,-0.12,0.88,-0.2],[-0.35,-0.12,1,-0.08,0.31],[0.74,0.88,-0.08,1,-0.15],[-0.52,-0.2,0.31,-0.15,1]]}'></gl-chart>