Skip to content

InstancedLines

Defined in: webgl/instanced.ts:794

new InstancedLines(device, data, width?, height?, pick?, head?): InstancedLines

Defined in: webgl/instanced.ts:827

A lines layer, or an arrows layer with head: "arrow".

Device

LineLaneData

number = 0

number = 0

boolean = false

LinkHead = "none"

InstancedLines

count: number

Defined in: webgl/instanced.ts:795


readonly head: LinkHead

Defined in: webgl/instanced.ts:820

The layer’s head (#542), fixed per layer by its primitive: a change recreates (like samples).

get capacity(): number

Defined in: webgl/instanced.ts:799

Instances the buffers have room for (≥ count): kept on a shrink, at least doubled on a grow.

number

destroy(): void

Defined in: webgl/instanced.ts:1006

void


render(pass): void

Defined in: webgl/instanced.ts:999

RenderPass

void


renderPick(pass): void

Defined in: webgl/instanced.ts:1003

Draw the id-encoded pick pass (#141). No-op unless built with pick.

RenderPass

void


setHighlight(h): void

Defined in: webgl/instanced.ts:925

Set shader-highlight uniforms (#162) — recolour/dim with no geometry touch (shared with the pick twin).

InstancedHighlight

void


setPickBase(base): void

Defined in: webgl/instanced.ts:921

Offset added to the pick pass’s instance id (#447), so two pickable link layers decode to disjoint ids.

number

void


setSizeMode(mode): void

Defined in: webgl/instanced.ts:917

"world" | "screen"

void


setTransform(m): void

Defined in: webgl/instanced.ts:911

Float32Array

void


setViewport(width, height): void

Defined in: webgl/instanced.ts:914

number

number

void


update(device, data, head?): boolean

Defined in: webgl/instanced.ts:940

Update the instance data in place (no object recreation). Uses gl.bufferSubData when data.count ≤ current buffer capacity; reallocates the per-instance buffers (but keeps the SAME InstancedLines object) when the new count exceeds capacity. If data.samples changed (the vertex template must be rebuilt), the caller must destroy+recreate instead — this method returns false in that case so updateInstancedLayer falls back to setInstancedLayer.

The pick model tracks the same instance buffers (shared references), so endpoint moves are automatically reflected in the pick pass — ids/count are unchanged, only positions moved.

Device

LineLaneData

LinkHead = "none"

boolean