Surface Chart 3D
A shaded surface over a grid of heights.
Every 2 × 2 heights side by side make a quad of the surface, so a grid needs at least two rows and two columns: a single row, column or cell draws the box and no surface.
Uneven spacing
Where the columns or rows were not measured at even steps, x and z name
the value of each: here a lake sampled on the days the boat went out, at the
depths of its sensors. The surface joins the columns and the rows in the
order of the data, so give them ascending; a column or row without a finite
value drops out, and its neighbours join.
Installation
npx shadcn@latest add niekes/chart3dcn/surface-chart-3d#v1.2.0Update
Press Update: the surface morphs into the new wave over the animationDuration
of the container, and its color ramp follows the heights.
Enter and leave
The grid may grow and shrink. Coming and going is a fade in place: new border cells fade in where they belong while the axes make room - held inside the box until there is room for them - and shrunken away, they fade out where they stand, inside the box, and leave when the glide is done - the mirror of their entering (see Enter in the glossary). The surface itself never moves where data merely appears or disappears.
Renderers
The same chart on every renderer, side by side. The marks are data the chart hands to the container, and "svg" and "canvas" draw them all - where the browser has no canvas, as SVG.
Many marks
An 80 by 80 grid, over six thousand cells - and the chart stays interactive.
The scene is one list of marks, so the demo starts on "canvas", the renderer
for many marks, and the select shows the same scene on SVG.
API Reference
Prop
Type