Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/data/heatmap

Exports of @dioramajs/data/heatmap.

View as Markdown
On this page
import { dayOf, default, MAX_CELLS } from '@dioramajs/data/heatmap'

Functions

dayOfDays since 1970-01-01 of a date in a cell: `<time datetime>`, `data-dio-date` or the text.
rampA color at `t` 0..1 along stops, blended in OKLab so the steps look even.
readCalendarA 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.
readGridA matrix: the header row names the columns, the first cell of each row names the row.
shadeWhere 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.
weekStartThe first day of the week where the page's language is spoken: 0 Sunday, 1 Monday.

Constants

defaultA `<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_CELLSMost cells one heatmap draws: ten years of days.

Interfaces

HeatCellOne value at a row and a column.
HeatDataWhat the heatmap shows.