Skip to content

pivotick v3.0.0


pivotick / GraphUI / TableColumn

Interface: TableColumn<T> ​

Defined in: interfaces/GraphUI.ts:1527

One column of the data dock.

Deliberately an extension of FilterFacet: a facet already says how to read a value off an element and what kind of value it is, which is exactly what a column needs. So declaring UI.filter.facets describes your data once and the filter panel and the table agree about it.

Example ​

js
{ key: 'severity', label: 'Severity', type: 'numberRange', align: 'right', filterable: true }

Extends ​

  • Pick<FilterFacet, "key" | "label" | "type" | "order">

Type Parameters ​

T ​

T extends Node | Edge = Node

Properties ​

accessor()? ​

optional accessor: (element) => unknown

Defined in: interfaces/GraphUI.ts:1532

How to read this column off an element. Defaults to element.getData()[key], which is what makes a FilterFacet usable as a column unchanged.

Parameters ​

element ​

T

Returns ​

unknown


align? ​

optional align: "center" | "right" | "left"

Defined in: interfaces/GraphUI.ts:1536

Default ​

'right' for numberRange, 'left' otherwise


filterable? ​

optional filterable: boolean

Defined in: interfaces/GraphUI.ts:1552

Give this column a filter control in its header, typed off its type — a Min/Max pair for a numberRange, a dropdown of the values present for a select, a substring box otherwise.

It narrows the rows; the canvas is left alone unless someone presses the dock's Apply to graph button (see TableOptions.filterGraph), so reading and filtering stay separate acts.

Default ​

false for a column you declare — but true throughout the derived column set, which infers its filters off the types it already inferred. Declare columns and you get exactly what you asked for.


format()? ​

optional format: (value, element) => string | HTMLElement

Defined in: interfaces/GraphUI.ts:1560

Render the cell. A string is inserted as text, an HTMLElement as markup. Ignored by export, which always writes the raw value.

Parameters ​

value ​

unknown

element ​

T

Returns ​

string | HTMLElement

Default ​

String(value)


hidden? ​

optional hidden: boolean

Defined in: interfaces/GraphUI.ts:1554

Start hidden (still listed in the column picker).

Default ​

ts
false

key ​

key: string

Defined in: interfaces/GraphQueryEngine.ts:73

Filter identity, and the GraphFilters key setFilter / getFilters use.

Inherited from ​

Pick.key


label? ​

optional label: string

Defined in: interfaces/GraphQueryEngine.ts:78

Human label for the form control, used verbatim (so it can be translated). Defaults to a prettified key.

Inherited from ​

Pick.label


order? ​

optional order: number

Defined in: interfaces/GraphQueryEngine.ts:99

Display order in the panel.

Default ​

ts
declaration order

Inherited from ​

Pick.order


sortable? ​

optional sortable: boolean

Defined in: interfaces/GraphUI.ts:1538

Default ​

ts
true

type ​

type: FilterFacetType

Defined in: interfaces/GraphQueryEngine.ts:79

Inherited from ​

Pick.type


width? ​

optional width: string | number

Defined in: interfaces/GraphUI.ts:1534

Column width — a pixel count, or any CSS length.

Default ​

ts
sized from its content