Skip to content

Class: RasterPrimitive ​

Experimental

One pixel grid, one draw call. See the module header.

Implements ​

Constructors ​

Constructor ​

ts
new RasterPrimitive(context, data): RasterPrimitive;

Experimental

Parameters ​

ParameterType
contextPrimitiveContext
dataRasterInput

Returns ​

RasterPrimitive

Properties ​

PropertyModifierTypeDescription
objectreadonlyMesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, ShaderMaterial>Experimental Root object to add to a viewport's scene.
uniformsreadonlyRasterUniformsExperimental

Accessors ​

current ​

Get Signature ​

ts
get current(): Readonly<RasterData>;

Experimental

The current data (with defaults applied).

Returns ​

Readonly<RasterData>


ready ​

Get Signature ​

ts
get ready(): Promise<void>;

Experimental

Resolves (never rejects) once the pixels of the last load are uploaded, or it failed; chart.ready waits for it.

Returns ​

Promise<void>

Methods ​

dispose() ​

ts
dispose(): void;

Experimental

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

Returns ​

void

Implementation of ​

Primitive.dispose


load() ​

ts
load(pixels): void;

Experimental

Show pixels that arrive later (e.g. a decoded picture): until then the current pixels stay; undefined or a rejection keeps them.

Parameters ​

ParameterType
pixelsPromise<RasterPixels | undefined>

Returns ​

void


setTransform() ​

ts
setTransform(transform): void;

Experimental

Uniforms only: the texture is never touched.

Parameters ​

ParameterType
transformDataTransform

Returns ​

void

Implementation of ​

Primitive.setTransform


setViewport() ​

ts
setViewport(size): void;

Experimental

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

Parameters ​

ParameterType
sizeViewportSize

Returns ​

void

Implementation of ​

Primitive.setViewport


update() ​

ts
update(patch): void;

Experimental

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

Parameters ​

ParameterType
patchPartial<RasterData>

Returns ​

void

Implementation of ​

Primitive.update

Released under the MIT License.