Skip to content

Interface: MeshPrimitive ​

Experimental

See the module comment.

Implements ​

Properties ​

PropertyModifierTypeDescription
objectreadonlyMeshExperimental Root object to add to a viewport's scene.

Accessors ​

data ​

Get Signature ​

ts
get data(): Readonly<MeshData>;

Experimental

The resolved data.

Returns ​

Readonly<MeshData>


layout ​

Get Signature ​

ts
get layout(): Readonly<MeshLayout>;

Experimental

The drawn layout (expanded or indexed, counts).

Returns ​

Readonly<MeshLayout>


material ​

Get Signature ​

ts
get material(): Material;

Experimental

The material drawing the mesh: the Plotly-model shader or a three.js material.

Returns ​

Material


pickCount ​

Get Signature ​

ts
get pickCount(): number;

Experimental

Number of ids the pick material may write (e.g. drawn instances).

Returns ​

number

Implementation of ​

ts
PickablePrimitive.pickCount;

pickKind ​

Get Signature ​

ts
get pickKind(): "vertex" | "triangle";

Experimental

What a pick id offset counts (e.g. 'point' for markers).

Returns ​

"vertex" | "triangle"

Implementation of ​

ts
PickablePrimitive.pickKind;

translucent ​

Get Signature ​

ts
get translucent(): boolean;

Experimental

Whether the mesh draws translucent (sorted, no depth writes).

Returns ​

boolean

Methods ​

createPickMaterial() ​

ts
createPickMaterial(): PickMaterialHandle;

Experimental

The GPU-picking variant of the Plotly-model shader (see the module comment).

Returns ​

PickMaterialHandle

Implementation of ​

ts
PickablePrimitive.createPickMaterial;

dispose() ​

ts
dispose(): void;

Experimental

Release GPU resources. The primitive must not be used afterwards.

Returns ​

void

Implementation of ​

ts
Primitive.dispose;

setLightRig() ​

ts
setLightRig(rig): void;

Experimental

Use the lights of a scene's rig (layout.lighting) in Plotly's model, scaled by the trace's lighting; null (default): Plotly's own light at lightposition. three.js material types are lit by the rig's three.js lights in the scene either way.

Parameters ​

ParameterType
rigLightRig | null

Returns ​

void


setTransform() ​

ts
setTransform(transform): void;

Experimental

Set the data → world transform (cheap: uniforms only, no buffer uploads).

Parameters ​

ParameterType
transformDataTransform

Returns ​

void

Implementation of ​

ts
Primitive.setTransform;

setViewport() ​

ts
setViewport(size): void;

Experimental

Update viewport-dependent uniforms (resolution, pixel ratio).

Parameters ​

ParameterType
sizeViewportSize

Returns ​

void

Implementation of ​

ts
Primitive.setViewport;

triangleVertices() ​

ts
triangleVertices(t): [number, number, number];

Experimental

Input vertices of triangle t (e.g. to map a triangle pick to a vertex).

Parameters ​

ParameterType
tnumber

Returns ​

[number, number, number]


update() ​

ts
update(patch): void;

Experimental

Replace or patch the primitive's data. Omitted fields keep their previous values.

Parameters ​

ParameterType
patchPartial<MeshData>

Returns ​

void

Implementation of ​

ts
Primitive.update;

Released under the MIT License.