GitHubGitHub
← All widgets
Charts / widget

Heatmap

A grid heatmap (hour × day and similar shapes) with an adjustable visual scale in library colors.

Auto scaleFixed scale
import { Heatmap } from '@chanrg/4ui/echarts';<Heatmap {xLabels} {yLabels} {values} unit="ms" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Heatmap } from '@chanrg/4ui';import { Heatmap } from '@chanrg/4ui/echarts';<Heatmap {xLabels} {yLabels} {values} unit="ms" />

API reference

Props

PropTypeDefaultDescription
xLabels / yLabelsstring[][]Axis categories.
values[x, y, value][][]Cell values; null renders empty.
min / maxnumberautoVisual scale bounds.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Tooltip exposes exact cell values; the scale slider is keyboard-operable.

Dependencies

echarts (optional peer — install alongside)