View as Markdown

API reference: @salmonui/charts/heat-map

HeatMapPropsinterface

import type { HeatMapProps } from '@salmonui/charts/heat-map';
interface HeatMapProps {
    readonly data: readonly unknown[];
    readonly xField?: string | undefined;
    readonly yField?: string | undefined;
    readonly valueField?: string | undefined;
    readonly sizeField?: string | undefined;
    readonly xAxis?: HeatMapAxis | undefined;
    readonly yAxis?: HeatMapAxis | undefined;
    readonly colorScale?: HeatMapColorScale | undefined;
    readonly cells?: HeatMapCellsOptions | undefined;
    readonly legend?: boolean | HeatMapLegendOptions | undefined;
    readonly tooltip?: boolean | {
        readonly render?: ((cell: HeatMapCell) => ReactNode) | undefined;
    } | undefined;
    readonly selection?: boolean | {
        readonly multiple?: boolean | undefined;
    } | undefined;
    readonly selectedCells?: readonly HeatMapCellRef[] | undefined;
    readonly defaultSelectedCells?: readonly HeatMapCellRef[] | undefined;
    readonly onSelectedCellsChange?: ((cells: readonly HeatMapCellRef[], event: HeatMapChangeEvent) => void) | undefined;
    readonly hiddenItems?: readonly number[] | undefined;
    readonly defaultHiddenItems?: readonly number[] | undefined;
    readonly onHiddenItemsChange?: ((hidden: readonly number[], event: HeatMapChangeEvent) => void) | undefined;
    readonly onCellClick?: ((cell: HeatMapCell, event: HeatMapChangeEvent) => void) | undefined;
    readonly onCellDoubleClick?: ((cell: HeatMapCell) => void) | undefined;
    readonly onCellHover?: ((cell: HeatMapCell | null) => void) | undefined;
    readonly formatCell?: ((cell: HeatMapCell) => string) | undefined;
    readonly getCellStyle?: ((cell: HeatMapCell) => {
        readonly color?: string | undefined;
    } | undefined) | undefined;
    readonly renderer?: 'svg' | 'canvas' | 'auto' | undefined;
    readonly width?: number | undefined;
    readonly height?: number | undefined;
    readonly title?: string | undefined;
    readonly subtitle?: string | undefined;
    readonly description?: string | undefined;
    readonly locale?: string | undefined;
    readonly text?: Partial<HeatMapText> | undefined;
    readonly timeZone?: string | undefined;
    readonly showDataTable?: boolean | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly id?: string | undefined;
    readonly ref?: Ref<HeatMapApi> | undefined;
    readonly onResize?: ((size: {
        readonly width: number;
        readonly height: number;
    }) => void) | undefined;
    readonly animated?: boolean | undefined;
}
HeatMapProps members (39)
NameSignatureDescription
datareadonly data: readonly unknown[];

A 2D table (data[row][column]) or records with xField / yField / valueField.

xFieldoptionalreadonly xField?: string | undefined;
yFieldoptionalreadonly yField?: string | undefined;
valueFieldoptionalreadonly valueField?: string | undefined;
sizeFieldoptionalreadonly sizeField?: string | undefined;

Bubble size value.

xAxisoptionalreadonly xAxis?: HeatMapAxis | undefined;
yAxisoptionalreadonly yAxis?: HeatMapAxis | undefined;
colorScaleoptionalreadonly colorScale?: HeatMapColorScale | undefined;
cellsoptionalreadonly cells?: HeatMapCellsOptions | undefined;
legendoptionalreadonly legend?: boolean | HeatMapLegendOptions | undefined;
tooltipoptionalreadonly tooltip?: boolean | { readonly render?: ((cell: HeatMapCell) => ReactNode) | undefined; } | undefined;
selectionoptionalreadonly selection?: boolean | { readonly multiple?: boolean | undefined; } | undefined;
selectedCellsoptionalreadonly selectedCells?: readonly HeatMapCellRef[] | undefined;
defaultSelectedCellsoptionalreadonly defaultSelectedCells?: readonly HeatMapCellRef[] | undefined;
onSelectedCellsChangeoptionalreadonly onSelectedCellsChange?: ((cells: readonly HeatMapCellRef[], event: HeatMapChangeEvent) => void) | undefined;
hiddenItemsoptionalreadonly hiddenItems?: readonly number[] | undefined;

Indices of steps stops whose cells are hidden (legend toggles).

defaultHiddenItemsoptionalreadonly defaultHiddenItems?: readonly number[] | undefined;
onHiddenItemsChangeoptionalreadonly onHiddenItemsChange?: ((hidden: readonly number[], event: HeatMapChangeEvent) => void) | undefined;
onCellClickoptionalreadonly onCellClick?: ((cell: HeatMapCell, event: HeatMapChangeEvent) => void) | undefined;
onCellDoubleClickoptionalreadonly onCellDoubleClick?: ((cell: HeatMapCell) => void) | undefined;
onCellHoveroptionalreadonly onCellHover?: ((cell: HeatMapCell | null) => void) | undefined;
formatCelloptionalreadonly formatCell?: ((cell: HeatMapCell) => string) | undefined;

Cell label text.

getCellStyleoptionalreadonly getCellStyle?: ((cell: HeatMapCell) => { readonly color?: string | undefined; } | undefined) | undefined;

Cell data color override.

rendereroptionalreadonly renderer?: 'svg' | 'canvas' | 'auto' | undefined;

auto draws marks on canvas from 10,000 cells. Default auto.

widthoptionalreadonly width?: number | undefined;
heightoptionalreadonly height?: number | undefined;
titleoptionalreadonly title?: string | undefined;
subtitleoptionalreadonly subtitle?: string | undefined;
descriptionoptionalreadonly description?: string | undefined;
localeoptionalreadonly locale?: string | undefined;
textoptionalreadonly text?: Partial<HeatMapText> | undefined;

Built-in text (over the nearest LocaleProvider's heatMap entry).

timeZoneoptionalreadonly timeZone?: string | undefined;
showDataTableoptionalreadonly showDataTable?: boolean | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;
idoptionalreadonly id?: string | undefined;
refoptionalreadonly ref?: Ref<HeatMapApi> | undefined;
onResizeoptionalreadonly onResize?: ((size: { readonly width: number; readonly height: number; }) => void) | undefined;
animatedoptionalreadonly animated?: boolean | undefined;

Entrance and update transitions, default true: client only (never in server markup), off under prefers-reduced-motion. The CSS is the opt-in @salmonui/charts/viz-animations.css.