Skip to content

@graphty/graphty-element / index / NodeLabel

Interface: NodeLabel ​

Defined in: graphty-element/src/managers/LabelDeclutter.ts:52

One node's label as the element draws it.

Since ​

3.15.0

Properties ​

closeRect? ​

readonly optional closeRect?: object

Defined in: graphty-element/src/managers/LabelDeclutter.ts:72

Where a click reaches the label's close button, in CSS pixels from the graph canvas's top-left corner, as of the last frame. Undefined when the label's style has no closeButton, when the label is not drawn, or when it is behind the camera.

height ​

readonly height: number

width ​

readonly width: number

x ​

readonly x: number

y ​

readonly y: number

Since ​

3.29.0


drawn ​

readonly drawn: boolean

Defined in: graphty-element/src/managers/LabelDeclutter.ts:65

False when the label is not drawn: its node is hidden (a filter or the time window), or layoutBehavior.labels.declutter hid it because it would overlap a label it kept (or, with labels.avoidNodesAndEdges, another node). A label outside the current view still reads true, as it does in NodeLabelCounts.


text ​

readonly text: string

Defined in: graphty-element/src/managers/LabelDeclutter.ts:58

The words drawn, after the label's text was bound to the node's data and its markup (<bold>, <color='...'>) was applied: markup tags are not part of it. Lines are joined with "\n".