Class: Plot3D
Defined in: plot3d/plot3d.ts:113
A 3D scatter/surface plot with an orbit camera, axis ticks, and lighting.
Constructors
Constructor
new Plot3D(container, options?): Plot3D;Defined in: plot3d/plot3d.ts:184
Parameters
| Parameter | Type |
|---|---|
container | HTMLElement |
options | Plot3DOptions |
Returns
Plot3D
Methods
addBar3D()
addBar3D(opts): Bar3DLayer;Defined in: plot3d/plot3d.ts:349
3D bars (columns) on an x/z grid, lit and optionally colormapped.
Parameters
| Parameter | Type |
|---|---|
opts | Bar3DOptions |
Returns
addBoxes3D()
addBoxes3D(opts): Boxes3DLayer;Defined in: plot3d/plot3d.ts:359
Independently sized lit cuboids (voxels, bounding boxes, model layer blocks).
Parameters
| Parameter | Type |
|---|---|
opts | Boxes3DOptions |
Returns
addContour3D()
addContour3D(opts): Contour3DLayer;Defined in: plot3d/plot3d.ts:388
3D iso-height contour lines of a grid, stacked at their level heights.
Parameters
| Parameter | Type |
|---|---|
opts | Contour3DOptions |
Returns
addIsosurface()
addIsosurface(opts): IsosurfaceLayer;Defined in: plot3d/plot3d.ts:397
A marching-cubes isosurface of a 3D scalar volume (lit, solid-colored).
Parameters
| Parameter | Type |
|---|---|
opts | IsosurfaceOptions |
Returns
addLabel3D()
addLabel3D(label): () => void;Defined in: plot3d/plot3d.ts:420
Pin a text label to a point in data space. It is re-projected every frame, so it tracks the point as the camera orbits. Returns a disposer that removes just this label.
Parameters
| Parameter | Type |
|---|---|
label | Label3D |
Returns
() => void
addLine3D()
addLine3D(opts): Line3DLayer;Defined in: plot3d/plot3d.ts:340
A 3D polyline / path.
Parameters
| Parameter | Type |
|---|---|
opts | Line3DOptions |
Returns
addPointCloud()
addPointCloud(opts): PointCloudLayer;Defined in: plot3d/plot3d.ts:331
Parameters
| Parameter | Type |
|---|---|
opts | PointCloudOptions |
Returns
addQuiver3D()
addQuiver3D(opts): Quiver3DLayer;Defined in: plot3d/plot3d.ts:379
A 3D vector field (arrows), optionally colored by magnitude.
Parameters
| Parameter | Type |
|---|---|
opts | Quiver3DOptions |
Returns
addSurface()
addSurface(opts): SurfaceLayer;Defined in: plot3d/plot3d.ts:322
Parameters
| Parameter | Type |
|---|---|
opts | SurfaceOptions |
Returns
addVolume()
addVolume(opts): VolumeLayer;Defined in: plot3d/plot3d.ts:407
Direct volume rendering (GPU raymarch) of a 3D scalar field.
Parameters
| Parameter | Type |
|---|---|
opts | VolumeOptions |
Returns
clearLabels3D()
clearLabels3D(): void;Defined in: plot3d/plot3d.ts:433
Remove every data-space label.
Returns
void
copyToClipboard()
copyToClipboard(opts?): Promise<void>;Defined in: plot3d/plot3d.ts:589
Copy the current view to the clipboard as a PNG.
Parameters
| Parameter | Type |
|---|---|
opts | ExportOptions |
Returns
Promise<void>
destroy()
destroy(): void;Defined in: plot3d/plot3d.ts:603
Returns
void
downloadImage()
downloadImage(
filename?,
type?,
opts?): Promise<void>;Defined in: plot3d/plot3d.ts:584
Download the current view as an image (PNG by default).
Parameters
| Parameter | Type | Default value |
|---|---|---|
filename | string | "chart.png" |
type | string | "image/png" |
opts | ExportOptions | {} |
Returns
Promise<void>
isOnScreen()
isOnScreen(): boolean;Defined in: plot3d/plot3d.ts:599
Whether this chart is currently on screen (plus a small margin), as offscreenCulling judges it. Photon already skips its own drawing while a chart is out of view; a streaming app should check this before regenerating data and calling setData, which uploads to the GPU regardless.
Returns
boolean
refresh()
refresh(): void;Defined in: plot3d/plot3d.ts:550
Re-fit the axes to the data and redraw — call after a layer's setData(...).
Returns
void
removeLayer()
removeLayer(layer): void;Defined in: plot3d/plot3d.ts:539
Remove a layer, re-fit, and redraw.
Parameters
| Parameter | Type |
|---|---|
layer | Layer3D |
Returns
void
render()
render(): void;Defined in: plot3d/plot3d.ts:774
Returns
void
requestRender()
requestRender(): void;Defined in: plot3d/plot3d.ts:717
Returns
void
resetView()
resetView(): void;Defined in: plot3d/plot3d.ts:471
Restore the initial camera orientation and zoom.
Returns
void
setAutoRotate()
setAutoRotate(speed): void;Defined in: plot3d/plot3d.ts:457
Auto-orbit the camera. true = default speed, number = radians/frame, false/0 stops.
Parameters
| Parameter | Type |
|---|---|
speed | number | boolean |
Returns
void
setLight()
setLight(params): void;Defined in: plot3d/plot3d.ts:440
Update the light direction (azimuth/elevation, radians) and ambient (0..1).
Parameters
| Parameter | Type |
|---|---|
params | { ambient?: number; azimuth?: number; elevation?: number; } |
params.ambient? | number |
params.azimuth? | number |
params.elevation? | number |
Returns
void
toBlob()
toBlob(type?, opts?): Promise<Blob | null>;Defined in: plot3d/plot3d.ts:579
Export the current view as a Blob (default PNG).
Parameters
| Parameter | Type | Default value |
|---|---|---|
type | string | "image/png" |
opts | ExportOptions | {} |
Returns
Promise<Blob | null>
toDataURL()
toDataURL(type?, opts?): string;Defined in: plot3d/plot3d.ts:574
Export the current view as a data URL (default PNG).
Parameters
| Parameter | Type | Default value |
|---|---|---|
type | string | "image/png" |
opts | ExportOptions | {} |
Returns
string