Skip to content

pivotick v3.0.0


pivotick / GraphUI / PropertiesPanel

Interface: PropertiesPanel ​

Defined in: interfaces/GraphUI.ts:843

Represents the configuration for the properties panel in the graph UI's sidebar

Defines how to compute and display properties for nodes and edges.

Default ​

ts
All key/value pairs from node.getData() or edge.getData()

Properties ​

edgePropertiesMap() ​

edgePropertiesMap: (edge, ctx) => PropertyEntry[] | Promise<PropertyEntry[]>

Defined in: interfaces/GraphUI.ts:867

A function that computes the list of edge properties to display.

May be async — return a promise of the entries and the panel shows a placeholder until it resolves.

Parameters ​

edge ​

Edge

ctx ​

RenderContext

Returns ​

PropertyEntry[] | Promise<PropertyEntry[]>

Default ​

ts
All key/value pairs from edge.getData()

enabled? ​

optional enabled: boolean

Defined in: interfaces/GraphUI.ts:849

Whether the sidebar shows a properties panel at all. false removes it and its separator, leaving the header, the neighbours panel and any extra panels.

Default ​

ts
true

nodePropertiesMap() ​

nodePropertiesMap: (node, ctx) => PropertyEntry[] | Promise<PropertyEntry[]>

Defined in: interfaces/GraphUI.ts:858

A function that computes the list of node properties to display.

May be async — return a promise of the entries and the panel shows a placeholder until it resolves.

Parameters ​

node ​

Node

ctx ​

RenderContext

Returns ​

PropertyEntry[] | Promise<PropertyEntry[]>

Default ​

ts
All key/value pairs from node.getData()

render? ​

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

Defined in: interfaces/GraphUI.ts:884

Custom renderer for the property panel. This content will override the default sidebar property panel.

Default ​

ts
undefined

Examples ​

ts
(element) => `element id: ${element.id}`
ts
// A custom view for a lone node, the aggregated table for everything else.
(element) => (element instanceof Node) ? viewFor(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 panel: the nodePropertiesMap / edgePropertiesMap rows for one element, the aggregated table for several. Return null to draw nothing.