Skip to content
Scientific & mathematicalGenerated from the public API

ScatterMatrixChart

Read a field, a geometry or a spectrum, with the scale handled for you.

@luc/ui/charts

What it shows

Scan pairwise relationships among several numeric variables in a matrix of small scatters.

Live preview

Three variables, so six panels: the pairs without the diagonal, each one an ordinary scatter.

<ScatterMatrixChart
  variables={[
    { key: "ret", label: "Return", format: { kind: "percent", decimals: 1 } },
    { key: "vol", label: "Volatility", format: { kind: "number", decimals: 1 } },
    { key: "sharpe", label: "Sharpe", format: { kind: "number", decimals: 2 } },
  ]}
  rows={[
    { ret: 0.9, vol: 14.2, sharpe: 1.24 },
    { ret: 1.4, vol: 18.6, sharpe: 1.02 },
    { ret: -0.4, vol: 11.1, sharpe: -0.36 },
    { ret: 2.1, vol: 22.4, sharpe: 0.94 },
    { ret: 0.6, vol: 9.8, sharpe: 0.88 },
    { ret: -1.2, vol: 15.7, sharpe: -0.76 },
    { ret: 1.8, vol: 19.3, sharpe: 1.11 },
    { ret: 0.2, vol: 12.6, sharpe: 0.32 },
  ]}
  cellSize={110}
  height={360}
  ariaLabel="Pairs across three variables"
/>

Controls

Height

360px

A chart measures its container, so it always needs a definite height.

State

The surface the chart is in — loading, empty and error are drawn by the component.

Accessible name

A drawing is not readable by a screen reader, so it needs a name that states what it shows.

The same fixture as the live preview above; the controls change how it is drawn, not what it measures.

Code
import { ScatterMatrixChart } from "@luc/ui/charts";

<ScatterMatrixChart
  variables={[
    { key: "ret", label: "Return", format: { kind: "percent", decimals: 1 } },
    { key: "vol", label: "Volatility", format: { kind: "number", decimals: 1 } },
    { key: "sharpe", label: "Sharpe", format: { kind: "number", decimals: 2 } },
  ]}
  rows={[
    { ret: 0.9, vol: 14.2, sharpe: 1.24 },
    { ret: 1.4, vol: 18.6, sharpe: 1.02 },
    { ret: -0.4, vol: 11.1, sharpe: -0.36 },
    { ret: 2.1, vol: 22.4, sharpe: 0.94 },
    { ret: 0.6, vol: 9.8, sharpe: 0.88 },
    { ret: -1.2, vol: 15.7, sharpe: -0.76 },
    { ret: 1.8, vol: 19.3, sharpe: 1.11 },
    { ret: 0.2, vol: 12.6, sharpe: 0.32 },
  ]}
  cellSize={110}
  height={360}
  ariaLabel="Pairs across three variables"
  state="ready"
/>

Not controllable here

  • series / rows — The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `ScatterMatrixChart` from Luc UI. It is: Read a field, a geometry or a spectrum, with the scale handled for you.

Import it with: import { ScatterMatrixChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.

Chosen configuration: `height={360}`, `state="ready"`, `ariaLabel="Pairs across three variables"`.

Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.

Reproduce this state:
```tsx
<ScatterMatrixChart
  variables={[
    { key: "ret", label: "Return", format: { kind: "percent", decimals: 1 } },
    { key: "vol", label: "Volatility", format: { kind: "number", decimals: 1 } },
    { key: "sharpe", label: "Sharpe", format: { kind: "number", decimals: 2 } },
  ]}
  rows={[
    { ret: 0.9, vol: 14.2, sharpe: 1.24 },
    { ret: 1.4, vol: 18.6, sharpe: 1.02 },
    { ret: -0.4, vol: 11.1, sharpe: -0.36 },
    { ret: 2.1, vol: 22.4, sharpe: 0.94 },
    { ret: 0.6, vol: 9.8, sharpe: 0.88 },
    { ret: -1.2, vol: 15.7, sharpe: -0.76 },
    { ret: 1.8, vol: 19.3, sharpe: 1.11 },
    { ret: 0.2, vol: 12.6, sharpe: 0.32 },
  ]}
  cellSize={110}
  height={360}
  ariaLabel="Pairs across three variables"
  state="ready"
/>
```

Usage

The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.

It is drawn by the ECharts engine.

Worked examples with real data are on the family overview: Scientific & mathematical

import { ScatterMatrixChart } from "@luc/ui/charts";
<ScatterMatrixChart
  variables={[
    { key: "ret", label: "Return", format: { kind: "percent", decimals: 1 } },
    { key: "vol", label: "Volatility", format: { kind: "number", decimals: 1 } },
    { key: "sharpe", label: "Sharpe", format: { kind: "number", decimals: 2 } },
  ]}
  rows={[
    { ret: 0.9, vol: 14.2, sharpe: 1.24 },
    { ret: 1.4, vol: 18.6, sharpe: 1.02 },
    { ret: -0.4, vol: 11.1, sharpe: -0.36 },
    { ret: 2.1, vol: 22.4, sharpe: 0.94 },
    { ret: 0.6, vol: 9.8, sharpe: 0.88 },
    { ret: -1.2, vol: 15.7, sharpe: -0.76 },
    { ret: 1.8, vol: 19.3, sharpe: 1.11 },
    { ret: 0.2, vol: 12.6, sharpe: 0.32 },
  ]}
  cellSize={110}
  height={360}
  ariaLabel="Pairs across three variables"
/>

Data contract

`variables` defines the ordered axes; `rows` contains one numeric value per variable; `cellSize` controls the panel geometry. Missing values stay missing and are not imputed.

Important configuration

Use a panel size that keeps points distinguishable, order variables by the analytical question, and read only off-diagonal pairs as relationships.

Guidelines

When not to use

Do not treat the matrix as causal evidence or compare variables whose units make the pairwise shapes misleading.

Configuration

Exported symbols
ExportKindSignature
ScatterMatrixChart14 documented props({ variables, rows, pointTone, cellSize, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: ScatterMatrixChartProps) => import("@types/react").JSX.E…

ScatterMatrixChart props

Type: ScatterMatrixChartProps

Values the compiler reads from the declaration.

ScatterMatrixChart props
PropTypeDefaultNotes
ariaDescription?string | undefined—
ariaLabel?string | undefined—
cellSize?number | undefined—Cell height in px. The grid grows to fit. Default 120.
className?string | undefined—
description?string | undefined—
eager?boolean | undefined—Create the engine on mount rather than when the surface is approached.
height?string | number | undefined—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
pointTone?((row: Record<string, number>, index: number) => string | undefined) | undefined—Point colour, resolved by the caller (e.g. its cluster).
rowsreadonly Record<string, number>[]—One row per observation, keyed by variable.
state?ChartState | undefined—
title?string | undefined—
variablesreadonly { key: string; label: string; format?: ChartFormat; }[]—Variables in the order they should appear on both axes.

Accessibility

A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.

What happens on the server, and when hydration changes it.

Luc UI v1.0ScatterMatrixChartdark theme