Get StartedComponentsStylingThemingMath & Science
MCP

Science

Plot 3D

A 3D viewer on a plain 2D canvas with its own perspective projection and painter's algorithm, so it needs no three.js. Drag to orbit, scroll or pinch to zoom.

Scenes come from @indoku/science (moleculeScene, pipeFlowScene, dnaScene, surfaceScene, ...) or from any object matching Scene3DLike.

Markdown

Import

tsx
import { Plot3D } from "@indoku/ui"import { moleculeScene } from "@indoku/science"

Examples

Molecule

Pick a molecule; atoms and bonds are generated for you.

0.00 / 12.00 s

Pipe flow

Tracers speed up in the narrow section: A₁v₁ = A₂v₂.

0.00 / 4.77 s

DNA helix

Length 25 bpGC 56 %Turns 2.5Height 8.5 nm
0.00 / 10.00 s

Props

Plot3D

PropTypeDefaultDescription
scene*Scene3DLike–
tnumber–Controlled time (seconds). Omit to let the component animate itself.
controlsboolean–Show play/pause/scrubber when the scene is animated. Default true.
heightnumber–Canvas height in px. Default 360.
autoRotateboolean–Slowly orbit the camera. Default false.
renderLatex(latex: string) => ReactNode–Render scene.latex strings (e.g. with KaTeX). Omit to hide them.

* required. Style props and HTML attributes are accepted as well.

Notes

  • Fine for a few thousand primitives. Pass t to control time yourself, or controls={false} to hide the play bar.

Created by @indokudev