pivotick - v2.0.1
    Preparing search index...

    Interface NodeBadge

    A small indicator pinned to a node's rim — what KeyLines and ReGraph call a glyph.

    Badges are a decoration channel of their own, so a node can carry a fact that color, shape, size, iconClass and imagePath are already spent on. They describe only the node they sit on: a collapsed cluster does not aggregate its children's badges — walk node.children yourself if you want that.

    defaultNodeStyle: {
    badges: node => node.getData().notes
    ? [{ text: String(node.getData().notes), title: 'Notes', onClick: () => openNotes(node) }]
    : [],
    }
    interface NodeBadge {
        color?: string;
        iconClass?: string;
        iconUnicode?: string;
        onClick?: (event: PointerEvent, node: Node, badge: NodeBadge) => void;
        position?: NodeBadgePosition;
        svgIcon?: string;
        text?: string;
        title?: string;
    }
    Index

    Properties

    color?: string

    Any CSS colour.

    var(--pvt-badge-color)

    iconClass?: string
    iconUnicode?: string
    onClick?: (event: PointerEvent, node: Node, badge: NodeBadge) => void

    Called when the badge is clicked, before InterractionCallbacks.onBadgeClick.

    Declaring it makes the badge take the pointer cursor and consume the click, so the node is not also selected. A badge without one stays transparent to the node underneath. Pressing a badge still drags the node either way.

    Which corner to sit on. Omit it and the badge is auto-placed in the first free corner, clockwise from 'ne'. An explicit position is honoured verbatim, even where that overlaps another badge or the expand affordance.

    svgIcon?: string

    Inline SVG markup, sanitized before it reaches the DOM.

    text?: string

    A count, or one or two characters. Longer text grows the badge into a pill; past three characters it renders as 99+. Takes precedence over any icon on the same badge.

    title?: string

    Native tooltip, rendered as a real <title>. Does not suppress the graph's own tooltip.