How it works
d3-3d does the math, React draws the SVG.
d3-3d does the math
d3-3d never touches the DOM. It turns 3D points into projected 2D points, the centroid of every shape and the orientation of every face. chart3d/cn projects the data on every render and returns plain <path> and <circle> elements.
One camera per chart
ChartContainer3D keeps the view, the yaw and the tilt, in React state and builds a camera3D() from it. Every shape of the chart hangs on that camera with .camera(camera), so a drag changes the state and the next render projects everything again.
Depth by the order of the elements
SVG has no depth buffer: what comes later in the document is drawn on top. The charts sort their elements back to front with d3-3d's sort, and stable React keys make React move the existing DOM nodes rather than rebuild them. What stands side by side on a floor - bars, the ribbons of an area, the cells of a surface - sorts by its footprint: how high a mark reaches says nothing about what it hides. Bars draw only the faces turned towards the camera, the ones d3-3d marks ccw.
Rendered on the server
Because the charts are SVG, the first frame is part of the HTML. The pages of this site are rendered at build time, and the charts in them are visible before any JavaScript runs.
Limits
Sorting is exact for points and for what stands side by side on one floor - bars, the ribbons of an area, the cells of a surface - with perspective too. Geometry that intersects itself can show artifacts, such as a surface whose columns or rows do not ascend and so folds back over itself. SVG stays fast up to a few thousand elements; beyond that the canvas renderer is the better fit.