Skip to content
sigma.js sigma.js
v4.0.6 Docs Examples GitHub 12.2K

LabelOptions

Defined in: packages/sigma/src/rendering/nodes/types.ts:395

Options for configuring labels rendered by the LabelProgram.

Per-item label position is set via the style system (labelPosition style), not here — the primitives scope only configures program-wide defaults that styles can override.

optional color?: string

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

Default label color (CSS color string). Default: “#000000”


optional font?: LabelFontOptions

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

Font configuration for labels.


optional margin?: number

Defined in: packages/sigma/src/rendering/nodes/types.ts:400

Default margin between node edge and label in pixels. Default: 5


optional zoomToLabelSizeRatioFunction?: (ratio) => number

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

Function that maps camera zoom ratio to a label size ratio. The label size is divided by this value, so returning values < 1 makes labels bigger. Default: () => 1 (labels stay at fixed pixel size regardless of zoom). Example: Math.sqrt makes labels scale with zoom like nodes do.

number

number