Skip to content

Class: ScatterLayer

Defined in: layers/scatter.ts:144

A drawable data series backed by GPU buffers.

Implements

Constructors

Constructor

ts
new ScatterLayer(gl, opts): ScatterLayer;

Defined in: layers/scatter.ts:173

Parameters

ParameterType
glWebGL2RenderingContext
optsScatterOptions

Returns

ScatterLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: layers/scatter.ts:147


id

ts
readonly id: string;

Defined in: layers/scatter.ts:145

Implementation of

Layer.id


name

ts
readonly name: string;

Defined in: layers/scatter.ts:146


yAxis

ts
readonly yAxis: string;

Defined in: layers/scatter.ts:148

The y axis this layer is bound to.

Implementation of

Layer.yAxis

Methods

bounds()

ts
bounds(): 
  | {
  x: Range;
  y: Range;
}
  | null;

Defined in: layers/scatter.ts:306

Data-space bounds of this layer, for autoscaling. null if empty.

Returns

| { x: Range; y: Range; } | null

Implementation of

Layer.bounds


colorInfo()

ts
colorInfo(): ColorInfo | null;

Defined in: layers/scatter.ts:302

Colormap + value range, when this layer maps values to colours — the plot uses it to draw a colorbar. null/absent for solid-coloured layers.

Returns

ColorInfo | null

Implementation of

Layer.colorInfo


dispose()

ts
dispose(): void;

Defined in: layers/scatter.ts:375

Returns

void

Implementation of

Layer.dispose


draw()

ts
draw(state): void;

Defined in: layers/scatter.ts:359

Parameters

ParameterType
stateDrawState

Returns

void

Implementation of

Layer.draw


infoAt()

ts
infoAt(index): string[] | null;

Defined in: layers/scatter.ts:325

User-supplied text for a point, shown when it is clicked.

Parameters

ParameterType
indexnumber

Returns

string[] | null


pick()

ts
pick(
   mode, 
   cursorPx, 
   cursorPy, 
   project): Picked | null;

Defined in: layers/scatter.ts:311

Parameters

ParameterType
modePickMode
cursorPxnumber
cursorPynumber
projectPickProjection

Returns

Picked | null


setData()

ts
setData(x, y): void;

Defined in: layers/scatter.ts:331

Replace point positions and re-upload (for streaming). Keeps uniform color.

Parameters

ParameterType
xArrayLike<number>
yArrayLike<number>

Returns

void

MIT licensed. WebGL2 required.