Surface3DChart
Read a field, a geometry or a spectrum, with the scale handled for you.
@luc/ui/chartsWhat it shows
Show a supplied gridded scalar field as a projected three-dimensional surface without a WebGL dependency.
Live preview
A supplied grid of ratios, projected without a 3D engine: no cell is interpolated to fill a hole.
<Surface3DChart
z={[
[0.22, 0.19, 0.18, 0.2],
[0.2, 0.17, 0.16, 0.18],
[0.19, 0.16, 0.15, 0.17],
[0.21, 0.18, 0.17, 0.19],
]}
xLabels={[90, 95, 100, 105]}
yLabels={[0.25, 0.5, 1, 2]}
xLabel="Strike"
yLabel="Maturity (years)"
zLabel="Implied volatility"
mode="surface"
height={380}
ariaLabel="Volatility grid"
/>Controls
Height
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 { Surface3DChart } from "@luc/ui/charts";
<Surface3DChart
z={[
[0.22, 0.19, 0.18, 0.2],
[0.2, 0.17, 0.16, 0.18],
[0.19, 0.16, 0.15, 0.17],
[0.21, 0.18, 0.17, 0.19],
]}
xLabels={[90, 95, 100, 105]}
yLabels={[0.25, 0.5, 1, 2]}
xLabel="Strike"
yLabel="Maturity (years)"
zLabel="Implied volatility"
mode="surface"
height={380}
ariaLabel="Volatility grid"
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 `Surface3DChart` from Luc UI. It is: Read a field, a geometry or a spectrum, with the scale handled for you.
Import it with: import { Surface3DChart } 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={380}`, `state="ready"`, `ariaLabel="Volatility grid"`.
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
<Surface3DChart
z={[
[0.22, 0.19, 0.18, 0.2],
[0.2, 0.17, 0.16, 0.18],
[0.19, 0.16, 0.15, 0.17],
[0.21, 0.18, 0.17, 0.19],
]}
xLabels={[90, 95, 100, 105]}
yLabels={[0.25, 0.5, 1, 2]}
xLabel="Strike"
yLabel="Maturity (years)"
zLabel="Implied volatility"
mode="surface"
height={380}
ariaLabel="Volatility grid"
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 an ECharts custom series whose geometry the library computes, without WebGL.
Worked examples with real data are on the family overview: Scientific & mathematical
import { Surface3DChart } from "@luc/ui/charts";<Surface3DChart
z={[
[0.22, 0.19, 0.18, 0.2],
[0.2, 0.17, 0.16, 0.18],
[0.19, 0.16, 0.15, 0.17],
[0.21, 0.18, 0.17, 0.19],
]}
xLabels={[90, 95, 100, 105]}
yLabels={[0.25, 0.5, 1, 2]}
xLabel="Strike"
yLabel="Maturity (years)"
zLabel="Implied volatility"
mode="surface"
height={380}
ariaLabel="Volatility grid"
/>Data contract
`z` is a complete two-dimensional numeric grid; `xLabels` and `yLabels` name its axes; `mode` controls the projection/rendering mode. The grid is not interpolated.
Important configuration
Label all three axes, choose the projection `mode` for the reading angle, and keep the grid orientation stable across comparisons.
Guidelines
When not to use
Do not call the surface a fitted model or use it to hide holes in a sparse grid; absent cells are not zeroes.
Configuration
| Export | Kind | Signature |
|---|---|---|
Surface3DChart | 24 documented props | ({ z, xLabels, yLabels, xLabel, yLabel, zLabel, azimuth, elevation, onViewChange, mode, zScale, xFormat, yFormat, zFormat, title, description, state, height, className, ariaLabel, ariaDescription, on… |
Surface3DChart props
Type: Surface3DChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
azimuth? | number | undefined | — | View azimuth in degrees. Pair with `onViewChange` to control it. |
className? | string | undefined | — | |
description? | string | undefined | — | |
eager? | boolean | undefined | — | Create the engine on mount rather than when the surface is approached. |
elevation? | number | undefined | — | View elevation in degrees (0 = edge-on, 90 = straight down). |
height? | string | number | undefined | — | |
mode? | "surface" | "wireframe" | undefined | — | `surface` paints shaded quads, `wireframe` draws only the mesh. Default `surface`. |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
onViewChange? | ((view: { azimuth: number; elevation: number; }) => void) | undefined | — | |
state? | ChartState | undefined | — | |
title? | string | undefined | — | |
xFormat? | ChartFormat | undefined | — | |
xLabel? | string | undefined | — | |
xLabels? | readonly (string | number)[] | undefined | — | |
yFormat? | ChartFormat | undefined | — | |
yLabel? | string | undefined | — | |
yLabels? | readonly (string | number)[] | undefined | — | |
z | readonly (readonly number[])[] | — | `z[row][column]`. One row per `yLabel`. Non-finite cells are holes. |
zFormat? | ChartFormat | undefined | — | |
zLabel? | string | undefined | — | |
zScale? | number | undefined | — | Height of the z range relative to the base plane. Default 0.72. |
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.
Family
Scientific & mathematical
Fields, geometry and spectra for scientific readers.
Related