Skip to content

HeatMap

widgetsdata

HeatMap: 2D matrix displayed with character-density shading

Installation

$ bunx termuijs add heat-map

Copies the source into src/components/heat-map/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { HeatMap } from '@termuijs/widgets'
ts
new HeatMap(matrix: number[][], style: Partial<Style> = {}, opts: HeatMapOptions = {})

API Reference

HeatMap

PropTypeRequiredDescription
matrixnumber[][]required
highColorColoroptionalColor for maximum value cells
lowColorColoroptionalColor for minimum value cells
rowLabelsstring[]optionalRow labels (left side)
colLabelsstring[]optionalColumn labels (top)
#data#heat-map