Skip to content

pivotick v3.0.0


pivotick / GraphUI / LegendSection

Interface: LegendSection ​

Defined in: interfaces/GraphUI.ts:584

One section of the legend: a key for one dimension of the data. These are LegendOptions minus position — a section never claims a corner of the canvas, the card it is stacked in does (see LegendGroupOptions).

Extended by ​

Properties ​

collapsed? ​

optional collapsed: boolean

Defined in: interfaces/GraphUI.ts:626

Start collapsed.

Default ​

ts
false

collapsible? ​

optional collapsible: boolean

Defined in: interfaces/GraphUI.ts:624

Default ​

ts
true

enabled? ​

optional enabled: boolean

Defined in: interfaces/GraphUI.ts:586

Default ​

ts
true when the block is present

entries? ​

optional entries: LegendEntry[] | (graph) => LegendEntry[]

Defined in: interfaces/GraphUI.ts:622

Declared entries, or a function re-resolved against the live graph every time the legend rebuilds (so the list can follow the data).


filterable? ​

optional filterable: boolean

Defined in: interfaces/GraphUI.ts:630

Clicking an entry filters the graph. false renders a pure key.

Default ​

ts
true

highlightOnHover? ​

optional highlightOnHover: boolean

Defined in: interfaces/GraphUI.ts:637

Hovering an entry reads its category off the canvas: the elements it stands for keep their look, everything else dims until the pointer leaves. Works on a filterable: false key too — pointing at a category asks nothing of the graph.

Default ​

ts
true

id? ​

optional id: string

Defined in: interfaces/GraphUI.ts:605

Stable identity: the section's own filter key (__legend:<id>) and the section field of the legendToggle event.

Default ​

key, else section-<index>


key? ​

optional key: string

Defined in: interfaces/GraphUI.ts:617

Derived mode: the data key whose distinct values become the entries, each swatch sampled from the renderer's resolved style. Read off nodes, or off edges when scope is 'edge'. Also supplies the default predicate when entries are declared without one.


maxVisibleEntries? ​

optional maxVisibleEntries: number

Defined in: interfaces/GraphUI.ts:639

Entries shown before the list scrolls.

Default ​

ts
12

scope? ​

optional scope: LegendScope

Defined in: interfaces/GraphUI.ts:599

Which collection this section keys on. 'edge' lists the graph's relation kinds with a line swatch — stroke colour, dash and marker as the renderer resolved them — and its toggles hide edge layers: the nodes stay put, and so do the layout, the selection and the camera.

An edge section filters whether or not UI.filter.edgeFacets declares its key: given one it drives that facet, so the panel and the legend are two views of one filter; without one it reserves a facet of its own.

Default ​

ts
'node'

showCounts? ​

optional showCounts: boolean

Defined in: interfaces/GraphUI.ts:628

Show a per-entry element count.

Default ​

ts
true

title? ​

optional title: string

Defined in: interfaces/GraphUI.ts:610

Header text, used verbatim (so it can be translated).

Default ​

a prettified key, else 'Legend'