OptionalbadgesThe main color of the node
OptionalfocusThe drawing used while this node is hovered, or selected on its own — whatever the zoom. This is where a node says everything about itself.
It merges over the resolved base style rather than over the active tier, so a chip
tier's shape or html cannot leak into it, and it holds a constant size on screen
however far the graph is zoomed out. It never changes the node's geometry: edges keep
landing on the tier underneath and nothing moves.
When it fires is GraphRendererOptions.focusTierTrigger's to say.
OptionalfocusOptionalhtmlThe html to be used inside the node as an SVGForeignObject element.
Resolved like every other channel, so a card can be declared at any level —
nodeStyleMap[type].html gives one kind of node a card while the rest keep their
shapes, and a single node's own style overrides that. Returning nothing draws no
card, so one callback can card some nodes and leave the others alone.
Pair it with shape: 'none' for a card that is the node. Otherwise the shape is
still drawn behind it, and size is the smallest the node can be.
The card is measured and the node grows to it, so it is never clipped and edges land
on its border. You do not have to make the returned element self-sizing — it is
measured inside a shrink-to-fit box, so width: 100% resolves against its own
content rather than against the placeholder.
Trusted HTML only. Whatever this returns is inserted as-is, so build it with
textContent (or escape it) rather than interpolating node data into a markup string.
OptionaliconOptionaliconOptionalimageHow an imagePath picture sits on the node's shape. Resolvable per node so
different nodes can mix modes (e.g. screenshots 'cover', other attachments 'icon').
OptionalimageURL of a picture to draw on the node. Restricted to the http:, https:, data: and
blob: schemes; anything else is ignored. Rendering it fetches the URL.
OptionallayoutThe half-width of the box this node reserves for itself in the layout, in graph units. This is the only size the simulation ever sees: set it and the drawing no longer drives the collision radius, so a node can change how it is drawn without moving anything.
Leave it unset and the drawing owns the spacing, as it always has — a shape spaces by
its size, an HTML card by what it measures.
The shape of the node, either a standard shape or a custom SVG path
OptionalstyleCallback to dynamically override style properties based on the node.
Where it sits depends on which style block declares it. On a node's own
style it wins outright, and nodeStyleMap is skipped entirely. On
render.defaultNodeStyle it is the computed form of the default slot: it fills
only what neither the node nor nodeStyleMap set (and what a per-node styleCb
left out), and its result still loses to both.
Runs once per node per render, so keep it cheap.
OptionalsvgInline SVG markup drawn inside the node. Sanitized before it reaches the DOM (scripting
and event handlers are stripped), but a remote <image href> inside it is still fetched
when the node renders — see the security guide.
OptionaltextThe text to be used inside the node as an SVGText element
OptionaltextFont size of the node's label, in graph units (CSS pixels at zoom 1). The label's offset, its built-in character budget and the zoom gate all follow it.
The horizontal shift applied to the node's label position. A value of 0 means it is centered to the node, a value of 1 is east of the node, -1 is west of the node. Other values are also accepted, e.g., 0.5 would be halfway between the center and the east of the node.
OptionaltextWidest a node label may be drawn, in graph units (CSS pixels at zoom 1). A longer label
is shortened with a middle ellipsis to fit. Replaces the built-in budget, which is sized
to the node. Ignored when textTruncate is false.
Rotation degree applied to the node's label. Positive values rotate clockwise, negative values rotate counter-clockwise.
Shorten an over-wide label with a middle ellipsis (head…tail); false draws it
in full, on a themed pill where it spills past the node.
The vertical shift applied to the node's label position. A value of 0 means it is centered to the node, a value of 1 is north of the node, -1 is south of the node. Other values are also accepted, e.g., 0.5 would be halfway between the center and the north of the node.
OptionaltiersAlternative drawings of this node, chosen by how large it currently renders — a glyph on an overview, a labelled chip once there is room for one, a card once there is room for that. Ordered smallest first; the richest one that fits wins, and the base style is the floor when none do.
The node's footprint never changes with the drawing (see layoutSize), so swapping tiers moves nothing.
Small indicators pinned to the node's rim, independent of every other channel — see NodeBadge.
Resolved like any other channel: the narrowest declaration wins outright rather than merging, so a node's own
badgesreplaces whatevernodeStyleMapordefaultNodeStylegave it. An empty array is the way to say "this one wears none";undefinedrenders no badge group at all.Four fit on a plain node, two on one with children (the expand affordance reserves the East corners). Anything beyond that collapses into a
+nbadge naming the rest.