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

LabelOptions

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

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.

Properties

color?

optional color?: string

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

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


font?

optional font?: LabelFontOptions

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

Font configuration for labels.


margin?

optional margin?: number

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

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


zoomToLabelSizeRatioFunction?

optional zoomToLabelSizeRatioFunction?: (ratio) => number

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

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.

Parameters

ratio

number

Returns

number