Bar Field Chart 3D
A field of bars over a grid of values, colored by height.
Data
The chart draws what the data says and decides nothing of its own:
data[row][column] is the value of one bar. Its row and column place it -
the columns along x, the rows along z, evenly over the values domain names
or at the values x and z give each of them - the smallest gap between two
columns and two rows gives its footprint, its value its height from 0, and
the ramp between the two colors at the lowest and the highest value its
color. A value that is not a finite number draws no bar, and neither does a
column or row without a finite place. The gap between two bars is fixed, a
fifth of the cell, so neighbours stay apart.
Uneven spacing
Where the columns or rows were not measured at even steps, x and z name
the value of each: here wells sampled at the distances they stand at and the
depths they were drilled to. Every bar keeps the footprint of the smallest
gap, so a wide gap stays a gap and never makes a bigger bar.
Installation
npx shadcn@latest add niekes/chart3dcn/bar-field-chart-3d#v1.2.0Update
Press Update: the hills move, and every bar glides to its new height over
the animationDuration of the container, its color following.
Enter and leave
The grid may grow and shrink, while every bar keeps its value. A new bar grows from the floor as it fades in, while the axes make room; a gone one shrinks back into it as it fades out, the mirror of its entering (see Enter in the glossary).
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
A 40 by 40 field, sixteen hundred bars - 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