Skip to content

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.

Properties

color?

optional color?: string

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

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


font?

optional font?: LabelFontOptions

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

Font configuration for labels.


margin?

optional margin?: number

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

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: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.

Parameters

ratio

number

Returns

number