Skip to content

Interface: Plot3DOptions

Defined in: plot3d/plot3d.ts:19

Properties

aspectMode?

ts
optional aspectMode?: "data" | "cube";

Defined in: plot3d/plot3d.ts:48

How data extents map into the view cube. "cube" (default) stretches each axis independently to fill it — best for surfaces, where relative shape matters more than units. "data" uses one shared scale so proportions are preserved: a long, thin scene stays long and thin.


autoRotate?

ts
optional autoRotate?: number | boolean;

Defined in: plot3d/plot3d.ts:72

Auto-orbit the camera: true for a default speed, or radians/frame. Default off.


axisLabels?

ts
optional axisLabels?: {
  x?: string;
  y?: string;
  z?: string;
};

Defined in: plot3d/plot3d.ts:25

Axis titles drawn along the x / y (height) / z edges.

x?

ts
optional x?: string;

y?

ts
optional y?: string;

z?

ts
optional z?: string;

azimuth?

ts
optional azimuth?: number;

Defined in: plot3d/plot3d.ts:21


background?

ts
optional background?: [number, number, number, number];

Defined in: plot3d/plot3d.ts:20


colorbar?

ts
optional colorbar?: 
  | boolean
  | {
  label?: string;
};

Defined in: plot3d/plot3d.ts:33

Show a colorbar for the first colormapped layer. Default true when one exists.


distance?

ts
optional distance?: number;

Defined in: plot3d/plot3d.ts:23


downloadButton?

ts
optional downloadButton?: boolean;

Defined in: plot3d/plot3d.ts:39

Show a download-PNG button. Default true.


elevation?

ts
optional elevation?: number;

Defined in: plot3d/plot3d.ts:22


gridPlanes?

ts
optional gridPlanes?: boolean;

Defined in: plot3d/plot3d.ts:41

Draw grid lines on the back walls of the cube. Default true.


hover?

ts
optional hover?: boolean;

Defined in: plot3d/plot3d.ts:35

Hover tooltip on the nearest pickable point. Default true.


legend?

ts
optional legend?: boolean;

Defined in: plot3d/plot3d.ts:31

Show a legend of named solid-colored layers. Default false.


lightControls?

ts
optional lightControls?: boolean;

Defined in: plot3d/plot3d.ts:27

Render a small on-canvas panel with light-angle + ambient sliders.


offscreenCulling?

ts
optional offscreenCulling?: boolean;

Defined in: plot3d/plot3d.ts:62

Skip drawing while the chart is scrolled out of view, and draw once as it comes back. Default false — a chart draws whenever it is asked to.

Turn it on for a page that holds many charts. A frame costs the same whether or not anyone can see it, and most charts on a long page are off-screen at any moment. The saving is largest in Firefox, where reading the shared WebGL canvas back into a chart's own canvas costs ~1ms per chart per frame: on a 52-chart page that is 15fps against 58. Photon can only skip its own drawing, so ask Plot.isOnScreen before regenerating the data too.


projection?

ts
optional projection?: "perspective" | "orthographic";

Defined in: plot3d/plot3d.ts:70

Camera projection. "perspective" (default) is the natural choice for surfaces and point clouds; "orthographic" removes the perspective divide, so a long scene keeps a constant scale end-to-end — the right pick for diagrams. distance then sets the visible half-height instead of the eye distance. Volume raymarching assumes perspective and ignores this.


resetButton?

ts
optional resetButton?: boolean;

Defined in: plot3d/plot3d.ts:37

Show a reset-view (home) button. Default true.


showAxes?

ts
optional showAxes?: boolean;

Defined in: plot3d/plot3d.ts:50

Draw the bounding box, tick marks and axis labels. Default true.


title?

ts
optional title?: string;

Defined in: plot3d/plot3d.ts:29

Plot title, drawn top-center.

MIT licensed. WebGL2 required.