Skip to content

Class: PatchesLayer

Defined in: layers/patches.ts:72

Filled polygons (Bokeh patches). Each ring is triangulated once on the CPU with ear-clipping (holes supported), then rendered as a static per-vertex-color triangle soup — only the transform uniforms change per frame.

Implements

Constructors

Constructor

ts
new PatchesLayer(gl, opts): PatchesLayer;

Defined in: layers/patches.ts:96

Parameters

ParameterType
glWebGL2RenderingContext
optsPatchesOptions

Returns

PatchesLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: layers/patches.ts:75


id

ts
readonly id: string;

Defined in: layers/patches.ts:73

Implementation of

Layer.id


name

ts
readonly name: string;

Defined in: layers/patches.ts:74


yAxis

ts
readonly yAxis: string;

Defined in: layers/patches.ts:76

The y axis this layer is bound to.

Implementation of

Layer.yAxis

Methods

bounds()

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

Defined in: layers/patches.ts:224

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/patches.ts:220

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/patches.ts:239

Returns

void

Implementation of

Layer.dispose


draw()

ts
draw(state): void;

Defined in: layers/patches.ts:229

Parameters

ParameterType
stateDrawState

Returns

void

Implementation of

Layer.draw


setData()

ts
setData(patches): void;

Defined in: layers/patches.ts:211

Replace the patches and re-upload (for streaming).

Parameters

ParameterType
patchesPatch[]

Returns

void

MIT licensed. WebGL2 required.