NodeDataTexture
Defined in: packages/sigma/src/rendering/node-data-texture.ts:32
Manages a GPU texture storing node data, two RGBA32F texels per node.
Texel 0 — geometry, read by every node-data consumer:
- R: x position (graph coordinates)
- G: y position (graph coordinates)
- B: size
- A: shapeId (integer ID for shape registry lookup)
Texel 1 — per-node rotation flags (0 = viewport/screen-upright, 1 = graph):
- R: nodeRotation (shape orientation follows the camera)
- G: labelRotation (label orbits/turns with the camera)
- B, A: reserved
Node index N maps to a base texel N * 2; consumers fetch texel 0 there and
the flags at N * 2 + 1 (see GLSL_READ_NODE_DATA / GLSL_READ_NODE_FLAGS).
Extends
Constructors
Constructor
new NodeDataTexture(
gl,initialCapacity?):NodeDataTexture
Defined in: packages/sigma/src/rendering/node-data-texture.ts:33
Parameters
gl
WebGL2RenderingContext
initialCapacity?
number
Returns
NodeDataTexture
Overrides
Methods
allocate()
allocate(
key):number
Defined in: packages/sigma/src/rendering/data-texture.ts:141
Allocates a texture index for an item. Returns existing index if item already allocated.
Parameters
key
string | number
Returns
number
Inherited from
bind()
bind(
textureUnit):void
Defined in: packages/sigma/src/rendering/data-texture.ts:260
Binds the texture to a texture unit.
Parameters
textureUnit
number
Returns
void
Inherited from
clear()
clear():
void
Defined in: packages/sigma/src/rendering/data-texture.ts:320
Clears all item allocations (but keeps the texture).
Returns
void
Inherited from
free()
free(
key):void
Defined in: packages/sigma/src/rendering/data-texture.ts:168
Frees an item’s texture index for reuse.
Parameters
key
string | number
Returns
void
Inherited from
getCapacity()
getCapacity():
number
Defined in: packages/sigma/src/rendering/data-texture.ts:276
Gets the current capacity (max items).
Returns
number
Inherited from
getCount()
getCount():
number
Defined in: packages/sigma/src/rendering/data-texture.ts:297
Gets the number of allocated items.
Returns
number
Inherited from
getHighWaterMark()
getHighWaterMark():
number
Defined in: packages/sigma/src/rendering/data-texture.ts:306
Highest index ever allocated + 1. Unlike getCount, this spans freed
holes, so it bounds every live item’s row (what a per-row gl_VertexID
pass must cover).
Returns
number
Inherited from
getIndex()
getIndex(
key):number
Defined in: packages/sigma/src/rendering/data-texture.ts:188
Gets the texture index for an item. Returns -1 if item not found.
Parameters
key
string | number
Returns
number
Inherited from
getTexelsPerItem()
getTexelsPerItem():
number
Defined in: packages/sigma/src/rendering/data-texture.ts:290
Gets the number of texels per item.
Returns
number
Inherited from
getTexture()
getTexture():
WebGLTexture|null
Defined in: packages/sigma/src/rendering/data-texture.ts:269
Gets the WebGL texture object.
Returns
WebGLTexture | null
Inherited from
getTextureWidth()
getTextureWidth():
number
Defined in: packages/sigma/src/rendering/data-texture.ts:283
Gets the texture width (needed for 2D coordinate calculation in shaders).
Returns
number
Inherited from
has()
has(
key):boolean
Defined in: packages/sigma/src/rendering/data-texture.ts:195
Checks if an item has been allocated.
Parameters
key
string | number
Returns
boolean
Inherited from
isDirty()
isDirty():
boolean
Defined in: packages/sigma/src/rendering/data-texture.ts:313
Checks if there are pending changes to upload.
Returns
boolean
Inherited from
kill()
kill():
void
Defined in: packages/sigma/src/rendering/data-texture.ts:333
Destroys the texture and clears all data.
Returns
void
Inherited from
updateNode()
updateNode(
nodeKey,x,y,size,shapeId,nodeRotation?,labelRotation?):void
Defined in: packages/sigma/src/rendering/node-data-texture.ts:41
Updates all data for a node. nodeRotation and labelRotation are the
per-node rotation-alignment flags (0 = viewport, 1 = graph).
Parameters
nodeKey
string
x
number
y
number
size
number
shapeId
number
nodeRotation?
number = 0
labelRotation?
number = 0
Returns
void
upload()
upload():
void
Defined in: packages/sigma/src/rendering/data-texture.ts:212
Uploads dirty data to the GPU texture. With 2D layout and multiple texels per item, uploads affected rows.
Returns
void