Skip to content

pivotick v3.0.0


pivotick / GraphUI / EmptyStateOptions

Interface: EmptyStateOptions ​

Defined in: interfaces/GraphUI.ts:309

UI.emptyState: the card an empty canvas shows.

The card is click-through, so panning and the canvas menu work over it, except for interactive content inside it (a button, a link, a form control, anything with a tabindex), which receives its own clicks.

Example ​

js
UI: {
    emptyState: {
        render: ({ initial }) => {
            const box = document.createElement('div')
            box.textContent = initial ? 'Nothing is related to this record.' : 'The canvas is empty.'
            return box
        },
    },
}

Extends ​

Properties ​

enabled? ​

optional enabled: boolean

Defined in: interfaces/GraphUI.ts:30

Default ​

ts
true

Inherited from ​

FeatureToggle.enabled


render? ​

optional render: string | HTMLElement | (ctx) => RenderResult

Defined in: interfaces/GraphUI.ts:317

The card's content. Run each time the card appears, not on every change while it is up, so it can say something different once the graph has held a node. A returned string renders as plain text; return an HTMLElement to render your own markup. May be async.

Default ​

ts
'Nothing on the canvas yet'