Skip to Content

Heatmap

A heatmap in REAVIZ visualizes data values within a matrix using color variations. This method, first termed by Cormac Kinney in 1991, is effective for showing patterns in correlations across multiple variables. Heatmaps are particularly useful in displaying large datasets and identifying trends that might not be obvious through other chart types.

Types supported by reaviz:

Where to use:

  • Visualize Variance: Ideal for displaying variance across multiple variables.
  • Identify Patterns: Useful for identifying patterns and correlations in data.
  • Analyze Complex Data: Great for analyzing large datasets with multiple variables.

Quick Start

To create a Heatmap, use import the Heatmap and give it data. The chart will automatically configure itself with the default options exposed via props.

Examples

Heatmap

Year Calendar

Month Calendar

API

HeatmapΒ 

NameTypeDefault
dataChartNestedDataShape[]

Data the chart will receive to render.

[]
seriesReactElement<HeatmapSeriesProps, FC<Partial<HeatmapSeriesProps>>>

The series component that renders the cell components.

`<HeatmapSeries padding={0.3} />`
yAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the Y Axis of the chart.

`<LinearYAxis type="category" axisLine={null} tickSeries={<LinearYAxisTickSeries line={null} label={<LinearYAxisTickLabel padding={5} />} />} />`
xAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the X Axis of the chart.

`<LinearXAxis type="category" axisLine={null} tickSeries={<LinearXAxisTickSeries line={null} label={<LinearXAxisTickLabel padding={5} />} />} />`
secondaryAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[]

Any secondary axis components. Useful for multi-axis charts.

idstring

Id of the chart.

widthnumber

Width of the chart. If not provided will autosize.

heightnumber

Height of the chart. If not provided will autosize.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

CalendarHeatmapΒ 

NameTypeDefault
dataChartShallowDataShape[]

Chart data shape.

heightnumber

Height of the component.

widthnumber

Width of the component.

viewCalendarView

View of the calendar renderer.

'year'
seriesReactElement<HeatmapSeriesProps, FC<Partial<HeatmapSeriesProps>>>

The series component that renders the cell components.

`<HeatmapSeries padding={0.3} />`
yAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the Y Axis of the chart.

`<LinearYAxis type="category" axisLine={null} tickSeries={<LinearYAxisTickSeries line={null} label={<LinearYAxisTickLabel padding={5} />} />} />`
xAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>

The linear axis component for the X Axis of the chart.

`<LinearXAxis type="category" axisLine={null} tickSeries={<LinearXAxisTickSeries line={null} label={<LinearXAxisTickLabel padding={5} />} />} />`
secondaryAxisReactElement<LinearAxisProps, FC<Partial<LinearAxisProps>>>[]

Any secondary axis components. Useful for multi-axis charts.

idstring

Id of the chart.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

HeatmapSeriesΒ 

NameTypeDefault
paddingnumber

Padding between cells.

0.1
idstring

Id set by Heatmap.

dataChartInternalNestedDataShape[]

Parsed data set by Heatmap.

xScaleany

D3 scale for X Axis. Set internally by Heatmap.

yScaleany

D3 scale for Y Axis. Set internally by Heatmap.

colorSchemeColorSchemeType | ColorSchemeStyleArray

Color scheme for the chart.

['rgba(28, 107, 86, 0.5)', '#2da283']
emptyColorstring

Color for the empty cell of the chart.

'rgba(200,200,200,0.08)'
animatedboolean

Whether the chart is animated or not.

true
cellReactElement<HeatmapCellProps, FC<Partial<HeatmapCellProps>>>

Cell component that will be rendered.

`<HeatmapCell />`
selectionsany

Selected cell(s) in active state

HeatmapCellΒ 

NameTypeDefault
xnumber

X Position set by HeatmapSeries.

ynumber

Y Position set by HeatmapSeries.

rxnumber

rx SVG Attribute.

2
rynumber

ry SVG Attribute.

2
heightnumber

Height of cell set by HeatmapSeries.

widthnumber

Width of cell set by HeatmapSeries.

cellCountnumber

Total count of cells set by HeatmapSeries.

tooltipReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | null

Tooltip component.

`<ChartTooltip modifiers={[flip()]} />`
fillstring

Fill color set by HeatmapSeries.

strokestring

Stroke color set by HeatmapSeries.

symbol(data: ChartInternalShallowDataShape) => ReactNode

Symbol element to render.

dataChartInternalShallowDataShape

Data object set by Heatmap.

animatedboolean

Whether cell is animated or not set by HeatmapSeries.

cellIndexnumber

Cell index set by HeatmapSeries.

cursorstring

Cursor style attribute.

'auto'
onClick(event: any) => void

Event for when the bar is clicked.

onMouseEnter(event: any) => void

Event for when the bar has mouse enter.

onMouseLeave(event: any) => void

Event for when the bar has mouse leave.

classNameany

Classnames to apply to the element.

styleany

CSS styles to apply to the element.

Last updated on