Skip to content

Class: Boxes3DLayer

Defined in: plot3d/boxes3d.ts:106

Independently sized, lit cuboids drawn as one instanced call — voxels, bounding boxes, 3D waterfalls, and the layer blocks of a model diagram. Unlike Bar3DLayer every box carries its own center and 3-axis size.

Implements

Constructors

Constructor

ts
new Boxes3DLayer(gl, opts): Boxes3DLayer;

Defined in: plot3d/boxes3d.ts:126

Parameters

ParameterType
glWebGL2RenderingContext
optsBoxes3DOptions

Returns

Boxes3DLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: plot3d/boxes3d.ts:109

A solid CSS color for the legend swatch (solid-colored layers only).

Implementation of

Layer3D.colorCss


id

ts
readonly id: string;

Defined in: plot3d/boxes3d.ts:107

Implementation of

Layer3D.id


name?

ts
readonly optional name?: string;

Defined in: plot3d/boxes3d.ts:108

Series name for the legend (optional).

Implementation of

Layer3D.name

Methods

bounds3()

ts
bounds3(): Bounds3 | null;

Defined in: plot3d/boxes3d.ts:204

Returns

Bounds3 | null

Implementation of

Layer3D.bounds3


dispose()

ts
dispose(): void;

Defined in: plot3d/boxes3d.ts:235

Returns

void

Implementation of

Layer3D.dispose


draw()

ts
draw(gl, mvp): void;

Defined in: plot3d/boxes3d.ts:223

Parameters

ParameterType
glWebGL2RenderingContext
mvpMat4

Returns

void

Implementation of

Layer3D.draw


pickData()

ts
pickData(): 
  | {
  label: (i) => string;
  positions: Float32Array<ArrayBuffer>;
}
  | {
  label?: undefined;
  positions: Float32Array<ArrayBuffer>;
}
  | null;

Defined in: plot3d/boxes3d.ts:208

Data-space points for hover picking (xyz triples), with an optional per-point tooltip label builder. Null if the layer isn't pickable.

Returns

| { label: (i) => string; positions: Float32Array<ArrayBuffer>; } | { label?: undefined; positions: Float32Array<ArrayBuffer>; } | null

Implementation of

Layer3D.pickData


setData()

ts
setData(boxes): void;

Defined in: plot3d/boxes3d.ts:200

Replace every box. Call plot.refresh() afterwards to re-fit + redraw.

Parameters

ParameterType
boxesBox3D[]

Returns

void


setLight()

ts
setLight(dir, ambient): void;

Defined in: plot3d/boxes3d.ts:218

Set the light direction (world space) and ambient term (0..1).

Parameters

ParameterType
dir[number, number, number]
ambientnumber

Returns

void

MIT licensed. WebGL2 required.