EdgeLayer
Defined in: packages/sigma/src/rendering/edges/types.ts:341
EdgeLayer - defines a visual layer for the edge body.
Layers determine how the edge body is colored/textured. The simplest layer is plain solid color; more complex layers can implement dashes, gradients, or textures.
Multiple layers can be composited using alpha blending (TO BE DONE).
Properties
attributes
attributes:
AttributeSpecification[]
Defined in: packages/sigma/src/rendering/edges/types.ts:373
Additional per-edge attributes required by this layer.
glsl
glsl:
string
Defined in: packages/sigma/src/rendering/edges/types.ts:363
GLSL code defining the layer color function.
Function signature: vec4 layer_{name}(EdgeContext ctx)
The EdgeContext provides information about the current fragment:
- t: position along path [0, 1]
- sdf: signed distance from path centerline
- thickness: edge thickness
- edgeLength: total path length
- etc.
Returns: RGBA color for this fragment
lifecycle?
optionallifecycle?: (context) =>EdgeLifecycleHooks
Defined in: packages/sigma/src/rendering/edges/types.ts:386
Optional lifecycle factory for layers that need async resources.
Parameters
context
Returns
name
name:
string
Defined in: packages/sigma/src/rendering/edges/types.ts:346
Unique identifier for this layer type (e.g., “plain”, “dashed”, “gradient”). Used to generate GLSL function names: layer_{name}
needsNodeColors?
optionalneedsNodeColors?:boolean
Defined in: packages/sigma/src/rendering/edges/types.ts:381
When true, the shaders expose v_sourceColor and v_targetColor
varyings carrying the source and target node colors (straight alpha),
read from the node data texture. They stay in sync with node styles
without any per-edge data.
uniforms
uniforms:
UniformSpecification[]
Defined in: packages/sigma/src/rendering/edges/types.ts:368
Additional uniforms required by this layer.