pivotick - v2.0.1
    Preparing search index...

    Interface LegendEntry

    One row in the legend: a swatch, a label, and how to tell which elements it stands for — nodes, or edges in an edge-scoped section.

    { id: 'hub', label: 'Hub', color: '#7EA2FB',
    predicate: (node) => node.getData()?.type === 'hub' }
    interface LegendEntry {
        color: string;
        id: string;
        label?: string;
        order?: number;
        predicate?: ((node: Node) => boolean) | ((edge: Edge) => boolean);
    }
    Index

    Properties

    color: string

    The swatch colour — any CSS colour. Sampled from the renderer in derived mode: the node's fill, or an edge's stroke in an edge-scoped section.

    id: string

    Stable identity: the toggle key, and the value written to the filter.

    label?: string

    Human label, used verbatim (so it can be translated).

    a prettified id

    order?: number

    Display order, ascending.

    declaration (or first-seen) order
    
    predicate?: ((node: Node) => boolean) | ((edge: Edge) => boolean)

    Which elements this entry stands for. Defaults to matching id against LegendOptions.key on the element's data, when a key is declared.

    Receives a Node, or an Edge when the section declares scope: 'edge'.