pivotick - v2.0.1
    Preparing search index...

    Interface TableColumn<T>

    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.

    { key: 'severity', label: 'Severity', type: 'numberRange', align: 'right', filterable: true }
    
    interface TableColumn<T extends Node | Edge = Node> {
        accessor?: (element: T) => unknown;
        align?: "center" | "right" | "left";
        filterable?: boolean;
        format?: (value: unknown, element: T) => string | HTMLElement;
        hidden?: boolean;
        key: string;
        label?: string;
        order?: number;
        sortable?: boolean;
        type: FilterFacetType;
        width?: string | number;
    }

    Type Parameters

    Hierarchy

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

    Properties

    accessor?: (element: T) => unknown

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

    align?: "center" | "right" | "left"

    'right' for numberRange, 'left' otherwise

    filterable?: boolean

    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.

    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?: (value: unknown, element: T) => string | HTMLElement

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

    String(value)

    hidden?: boolean

    Start hidden (still listed in the column picker).

    false
    
    key: string

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

    label?: string

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

    order?: number

    Display order in the panel.

    declaration order
    
    sortable?: boolean
    true
    
    type: FilterFacetType
    width?: string | number

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

    sized from its content