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

EdgeContextFields

Defined in: packages/sigma/src/rendering/edges/types.ts:397

EdgeContext - available to all edge GLSL functions.

This struct is populated in the fragment shader and provides information about the current fragment’s position on the edge.

GLSL definition:

struct EdgeContext {
float t; // Position along path [0, 1]
float sdf; // Signed distance from centerline
vec2 position; // World position of fragment
vec2 tangent; // Path tangent at current point
vec2 normal; // Path normal at current point
float thickness; // Edge thickness in world units
float aaWidth; // Anti-aliasing width
float edgeLength; // Total path length
float tStart; // Where edge starts (after source node)
float tEnd; // Where edge ends (before target node)
float distanceFromSource; // Arc distance from source
float distanceToTarget; // Arc distance to target
};

Properties

aaWidth

aaWidth: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:411

Anti-aliasing width in world units


distanceFromSource

distanceFromSource: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:419

Arc distance from source node boundary to current position


distanceToTarget

distanceToTarget: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:421

Arc distance from current position to target node boundary


edgeLength

edgeLength: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:413

Total arc length of the edge path


normal

normal: "vec2"

Defined in: packages/sigma/src/rendering/edges/types.ts:407

Unit normal vector at current position (perpendicular to tangent)


position

position: "vec2"

Defined in: packages/sigma/src/rendering/edges/types.ts:403

World position of the current fragment


sdf

sdf: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:401

Signed distance from path centerline (negative = left, positive = right)


t

t: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:399

Position along path [0, 1] where 0 = source, 1 = target


tangent

tangent: "vec2"

Defined in: packages/sigma/src/rendering/edges/types.ts:405

Unit tangent vector at current position (direction of travel)


tEnd

tEnd: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:417

Parameter t where edge actually ends (before target node boundary)


thickness

thickness: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:409

Edge thickness in world units


tStart

tStart: "float"

Defined in: packages/sigma/src/rendering/edges/types.ts:415

Parameter t where edge actually starts (after source node boundary)