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

createLabelProgram

createLabelProgram<N, E, G>(options): LabelProgramType<N, E, G>

Defined in: packages/sigma/src/rendering/nodes/labels/factory.ts:103

Creates a label program from an SDF shape.

The resulting program renders text labels with shape-aware positioning, using the shape’s SDF to compute exact edge distances for any direction.

Type Parameters

N

N extends Attributes = Attributes

E

E extends Attributes = Attributes

G

G extends Attributes = Attributes

Parameters

options

CreateLabelProgramOptions

Configuration for the label program

Returns

LabelProgramType<N, E, G>

A LabelProgram class constructor

Example

const SquareLabelProgram = createLabelProgram({
shape: sdfSquare({ cornerRadius: 0.1 }),
});
const sigma = new Sigma(graph, container, {
labelProgramClasses: { default: SquareLabelProgram },
});