Skip to content

pivotick v3.0.0


pivotick / GraphUI / MainHeader

Interface: MainHeader ​

Defined in: interfaces/GraphUI.ts:777

Define what should be displayed in the sidebar's main header slot for node or edges.

These maps also name elements elsewhere — the tooltip's header, the table's Name column, [[node]] note references — so they are about naming, not about one panel. The strip along the top of the canvas is a different thing entirely: switch that off with GraphUI.topBar.

Properties ​

edgeHeaderMap ​

edgeHeaderMap: HeaderMapEntry<Edge>

Defined in: interfaces/GraphUI.ts:779


nodeHeaderMap ​

nodeHeaderMap: HeaderMapEntry<Node>

Defined in: interfaces/GraphUI.ts:778


render? ​

optional render: string | HTMLElement | (element, ctx) => FallbackRenderResult

Defined in: interfaces/GraphUI.ts:797

Custom renderer for the main header. This content will override the default sidebar main header.

Default ​

ts
undefined

Examples ​

ts
(element) => `element id: ${element.id}`
ts
// A custom header for a lone element, the default counts for everything else.
(element) => (element && !Array.isArray(element)) ? headerFor(element) : undefined

Remarks ​

A returned string renders as plain text; return an HTMLElement to render HTML. May be async: the slot shows a placeholder until it resolves, and a result arriving after the selection moved on is dropped.

Return (or resolve to) undefined to hand the selection back to the default header: the nodeHeaderMap / edgeHeaderMap title for one element, the selection count for several, the canvas total for none. Return null to draw nothing.