Skip to content
sigma.js sigma.js
v4.0.6 Docs Examples GitHub 12.2K

EdgeLabelProgram

Defined in: packages/sigma/src/rendering/edges/labels/factory.ts:740

Base class for label program implementations.

Label programs render text labels using WebGL (SDF-based rendering). Unlike node/edge programs, labels are processed per-character.

Visibility is handled by processing only visible labels each frame (determined by LabelGrid), so all characters in the buffer are rendered.

The DataType generic allows reuse by both node labels (LabelDisplayData) and edge labels (EdgeLabelDisplayData) via EdgeLabelProgram.

N extends Attributes = Attributes

E extends Attributes = Attributes

G extends Attributes = Attributes

ATTRIBUTES: ProgramAttributeSpecification[]

Defined in: packages/sigma/src/rendering/program.ts:98

LabelProgram.ATTRIBUTES


ATTRIBUTES_ITEMS_COUNT: number

Defined in: packages/sigma/src/rendering/program.ts:103

LabelProgram.ATTRIBUTES_ITEMS_COUNT


capacity: number = 0

Defined in: packages/sigma/src/rendering/program.ts:117

LabelProgram.capacity


CONSTANT_ATTRIBUTES: ProgramAttributeSpecification[]

Defined in: packages/sigma/src/rendering/program.ts:100

LabelProgram.CONSTANT_ATTRIBUTES


CONSTANT_DATA: number[][]

Defined in: packages/sigma/src/rendering/program.ts:101

LabelProgram.CONSTANT_DATA


constantArray: Float32Array

Defined in: packages/sigma/src/rendering/program.ts:116

LabelProgram.constantArray


debugStats: object

Defined in: packages/sigma/src/rendering/program.ts:132

bufferUploadBytes: number = 0

drawCalls: number = 0

verticesDrawn: number = 0

LabelProgram.debugStats


floats: Float32Array

Defined in: packages/sigma/src/rendering/program.ts:113

LabelProgram.floats


FRAGMENT_SHADER_SOURCE: string

Defined in: packages/sigma/src/rendering/program.ts:96

LabelProgram.FRAGMENT_SHADER_SOURCE


ints: Uint32Array

Defined in: packages/sigma/src/rendering/program.ts:114

LabelProgram.ints


isInstanced: boolean

Defined in: packages/sigma/src/rendering/program.ts:140

LabelProgram.isInstanced


METHOD: number

Defined in: packages/sigma/src/rendering/program.ts:99

LabelProgram.METHOD


normalProgram: ProgramInfo

Defined in: packages/sigma/src/rendering/program.ts:137

LabelProgram.normalProgram


pickProgram: ProgramInfo<string> | null = null

Defined in: packages/sigma/src/rendering/program.ts:138

LabelProgram.pickProgram


renderer: Sigma<N, E, G>

Defined in: packages/sigma/src/rendering/program.ts:106

LabelProgram.renderer


STRIDE: number

Defined in: packages/sigma/src/rendering/program.ts:104

LabelProgram.STRIDE


UNIFORMS: readonly string[]

Defined in: packages/sigma/src/rendering/program.ts:97

LabelProgram.UNIFORMS


VERTEX_SHADER_SOURCE: string

Defined in: packages/sigma/src/rendering/program.ts:95

LabelProgram.VERTEX_SHADER_SOURCE


VERTICES: number

Defined in: packages/sigma/src/rendering/program.ts:94

LabelProgram.VERTICES


verticesCount: number = 0

Defined in: packages/sigma/src/rendering/program.ts:118

LabelProgram.verticesCount

drawWebGL(method, __namedParameters): void

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:102

Render all characters in the buffer. Since we only process visible labels, all buffered characters should be rendered.

number

ProgramInfo

void

LabelProgram.drawWebGL


abstract ensureGlyphsReady(texts, fontKey?): void

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:39

Ensure all glyphs for the given texts are generated and available.

string[]

string

void

LabelProgram.ensureGlyphsReady


abstract getDefinition(): InstancedProgramDefinition<string> | ProgramDefinition<string>

Defined in: packages/sigma/src/rendering/program.ts:142

InstancedProgramDefinition<string> | ProgramDefinition<string>

LabelProgram.getDefinition


hasNothingToRender(): boolean

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:94

Check if there’s nothing to render.

boolean

LabelProgram.hasNothingToRender


invalidateBuffers(): void

Defined in: packages/sigma/src/rendering/program.ts:384

Mark GPU buffers as needing re-upload. Call this after modifying the array data outside of reallocate.

void

LabelProgram.invalidateBuffers


kill(): void

Defined in: packages/sigma/src/rendering/program.ts:201

void

LabelProgram.kill


abstract measureLabel(text, fontSize, fontKey?): object

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:45

Measure a label using the same glyph metrics as rendering.

string

number

string

object

height: number

textHeight: number

width: number

LabelProgram.measureLabel


measureLabelAtlasWidth(text, fontKey?): number

Defined in: packages/sigma/src/rendering/edges/labels/factory.ts:746

string

string

number


processEdgeLabel(labelKey, offset, data): number

Defined in: packages/sigma/src/rendering/edges/labels/factory.ts:745

string

number

EdgeLabelDisplayData

number


processLabel(_labelKey, offset, data): number

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:64

Process a label and write its character data to the GPU buffer.

string

number

EdgeLabelDisplayData

number

LabelProgram.processLabel


reallocate(characterCount): void

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:118

Reallocate buffers if needed and set the character count for this frame. Only reallocates GPU buffers when capacity is exceeded.

number

Number of characters to render this frame

void

LabelProgram.reallocate


abstract registerFont(family, weight?, style?): string

Defined in: packages/sigma/src/rendering/nodes/labels/base.ts:42

Register a font for use in labels and return its lookup key.

string

string

string

string

LabelProgram.registerFont


render(params, offset?, count?): void

Defined in: packages/sigma/src/rendering/program.ts:415

RenderParams

number

number

void

LabelProgram.render


resetDebugStats(): void

Defined in: packages/sigma/src/rendering/program.ts:206

void

LabelProgram.resetDebugStats


abstract setUniforms(params, programInfo): void

Defined in: packages/sigma/src/rendering/program.ts:397

RenderParams

ProgramInfo

void

LabelProgram.setUniforms