Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

NodeDataTexture

Defined in: packages/sigma/src/rendering/node-data-texture.ts:28

Manages a GPU texture storing node data (x, y, size, shapeId).

The texture is a 2D RGBA32F texture where each texel contains:

  • R: x position (graph coordinates)
  • G: y position (graph coordinates)
  • B: size
  • A: shapeId (integer ID for shape registry lookup)

Node index N maps to texel coordinates: x = N % textureWidth y = N / textureWidth

Extends

Constructors

Constructor

new NodeDataTexture(gl, initialCapacity?): NodeDataTexture

Defined in: packages/sigma/src/rendering/node-data-texture.ts:29

Parameters

gl

WebGL2RenderingContext

initialCapacity?

number

Returns

NodeDataTexture

Overrides

DataTexture.constructor

Methods

allocate()

allocate(key): number

Defined in: packages/sigma/src/rendering/data-texture.ts:138

Allocates a texture index for an item. Returns existing index if item already allocated.

Parameters

key

string | number

Returns

number

Inherited from

DataTexture.allocate


bind()

bind(textureUnit): void

Defined in: packages/sigma/src/rendering/data-texture.ts:255

Binds the texture to a texture unit.

Parameters

textureUnit

number

Returns

void

Inherited from

DataTexture.bind


clear()

clear(): void

Defined in: packages/sigma/src/rendering/data-texture.ts:306

Clears all item allocations (but keeps the texture).

Returns

void

Inherited from

DataTexture.clear


free()

free(key): void

Defined in: packages/sigma/src/rendering/data-texture.ts:165

Frees an item’s texture index for reuse.

Parameters

key

string | number

Returns

void

Inherited from

DataTexture.free


getCapacity()

getCapacity(): number

Defined in: packages/sigma/src/rendering/data-texture.ts:271

Gets the current capacity (max items).

Returns

number

Inherited from

DataTexture.getCapacity


getCount()

getCount(): number

Defined in: packages/sigma/src/rendering/data-texture.ts:292

Gets the number of allocated items.

Returns

number

Inherited from

DataTexture.getCount


getIndex()

getIndex(key): number

Defined in: packages/sigma/src/rendering/data-texture.ts:185

Gets the texture index for an item. Returns -1 if item not found.

Parameters

key

string | number

Returns

number

Inherited from

DataTexture.getIndex


getTexelsPerItem()

getTexelsPerItem(): number

Defined in: packages/sigma/src/rendering/data-texture.ts:285

Gets the number of texels per item.

Returns

number

Inherited from

DataTexture.getTexelsPerItem


getTexture()

getTexture(): WebGLTexture | null

Defined in: packages/sigma/src/rendering/data-texture.ts:264

Gets the WebGL texture object.

Returns

WebGLTexture | null

Inherited from

DataTexture.getTexture


getTextureWidth()

getTextureWidth(): number

Defined in: packages/sigma/src/rendering/data-texture.ts:278

Gets the texture width (needed for 2D coordinate calculation in shaders).

Returns

number

Inherited from

DataTexture.getTextureWidth


has()

has(key): boolean

Defined in: packages/sigma/src/rendering/data-texture.ts:192

Checks if an item has been allocated.

Parameters

key

string | number

Returns

boolean

Inherited from

DataTexture.has


isDirty()

isDirty(): boolean

Defined in: packages/sigma/src/rendering/data-texture.ts:299

Checks if there are pending changes to upload.

Returns

boolean

Inherited from

DataTexture.isDirty


kill()

kill(): void

Defined in: packages/sigma/src/rendering/data-texture.ts:319

Destroys the texture and clears all data.

Returns

void

Inherited from

DataTexture.kill


updateNode()

updateNode(nodeKey, x, y, size, shapeId): void

Defined in: packages/sigma/src/rendering/node-data-texture.ts:36

Updates all data for a node.

Parameters

nodeKey

string

x

number

y

number

size

number

shapeId

number

Returns

void


upload()

upload(): void

Defined in: packages/sigma/src/rendering/data-texture.ts:209

Uploads dirty data to the GPU texture. With 2D layout and multiple texels per item, uploads affected rows.

Returns

void

Inherited from

DataTexture.upload