Skip to content

Bundle requirement

Requires velo-plot/scientific or velo-plot/trading (or velo-plot/full). Core entry throws for heatmap series.

Heatmaps API

Heatmaps visualize 3D data (X, Y, and Z intensity) as a 2D colored grid. They are extremely efficient for large matrices.

Adding a Heatmap

Use the addHeatmap method to add a heatmap series.

typescript
import { createChart } from 'velo-plot/scientific'

const chart = createChart({ container: document.getElementById('chart')! })

chart.addHeatmap({
  id: 'surface-data',
  data: {
    xValues: [0, 1, 2],
    yValues: [0, 1, 2],
    zValues: [
      10, 20, 30, // Y=0 (X=0, 1, 2)
      15, 25, 35, // Y=1 (X=0, 1, 2)
      20, 30, 40  // Y=2 (X=0, 1, 2)
    ]
  },
  style: {
    colorScale: {
      name: 'viridis',
      min: 0,
      max: 50
    },
    interpolation: 'bilinear'
  }
});

HeatmapOptions

PropertyTypeDescription
idstringUnique identifier.
type'heatmap'Must be 'heatmap'.
dataHeatmapDataGrid coordinates and Z values.
styleHeatmapStyleColormap and interpolation settings.

HeatmapData

PropertyTypeDescription
xValuesnumber[] | TypedArrayX coordinates for each column (Length: W).
yValuesnumber[] | TypedArrayY coordinates for each row (Length: H).
zValuesnumber[] | TypedArrayFlattened 1D matrix in row-major order (Length: W * H).

HeatmapStyle

PropertyTypeDescription
colorScaleColorScaleMapping of Z values to colors.
interpolation'nearest' | 'bilinear'Rendering mode (default: 'bilinear').
opacitynumberOverall layer transparency.
showColorbarbooleanWhether to display a color legend.

ColorScale

PropertyTypeDescription
nameColorScaleNamePredefined colormap (e.g., 'viridis', 'plasma', 'jet').
minnumberValue mapped to the lowest color.
maxnumberValue mapped to the highest color.
logScalebooleanUse logarithmic color mapping (Coming soon).

Known limitations

  • Bundle entry — pick velo-plot, velo-plot/trading, velo-plot/scientific, or velo-plot/full. See Bundle Architecture.
  • WebGPU renderer (renderer: 'webgpu') requires an extended bundle entry and is experimental — use WebGL (default) for production.
  • SVGexportSVG() and renderer: 'svg' require an extended bundle. LaTeX labels and contour overlays are partial; 3D is not supported in SVG. See SVG examples.
  • See Plugin status registry for plugin maturity (complete, partial, experimental).

Released under the MIT License.