@dioramajs/data/heatmap
Exports of @dioramajs/data/heatmap.
On this page
import { dayOf, default, MAX_CELLS } from '@dioramajs/data/heatmap'Functions
dayOf | Days since 1970-01-01 of a date in a cell: `<time datetime>`, `data-dio-date` or the text. |
ramp | A color at `t` 0..1 along stops, blended in OKLab so the steps look even. |
readCalendar | A calendar from dated values: rows of a `<table>` (date, value), a `<dl>` of `<dt>` dates and `<dd>` values, or list items with a `<time>` and `data-dio-value`. A column per week, a row per weekday; days without a value are empty cells. |
readGrid | A matrix: the header row names the columns, the first cell of each row names the row. |
shade | Where a value sits on the color scale, 0..1. Amounts run from 0 (an empty cell) to `top`; values on both sides of 0 run from -top to top with 0 in the middle. `steps` > 0 snaps to that many even bins, as a legend can name them. |
weekStart | The first day of the week where the page's language is spoken: 0 Sunday, 1 Monday. |
Constants
default | A `<table>` drawn as a heatmap: a matrix of rows and columns, or a calendar of days like a contributions chart, colored on an even scale, that sweeps in when it scrolls into view. The pointer over a cell shows its value as written; the table stays for screen readers. |
MAX_CELLS | Most cells one heatmap draws: ten years of days. |