pivotick - v2.0.1
    Preparing search index...

    Interface NodeStyle

    interface NodeStyle {
        badges?: ((node: Node) => NodeBadge[]) | NodeBadge[];
        color: string | ((node: Node) => string);
        fontFamily: string;
        html?: (node: Node) => string | void | HTMLElement;
        iconClass?: string;
        iconUnicode?: string;
        imageFit?: ((node: Node) => ImageFit) | ImageFit;
        imagePath?: string;
        shape: ((node: Node) => NodeShape) | NodeShape;
        size: number | ((node: Node) => number);
        strokeColor: string | ((node: Node) => string);
        strokeWidth: string | number;
        styleCb?: (node: Node) => Partial<NodeStyle>;
        svgIcon?: string;
        text?: string | ((node: Node) => string);
        textAnchorPosition: "end" | "start" | "middle";
        textColor: string | ((node: Node) => string);
        textHorizontalShift: number | ((node: Node) => number);
        textRotateDegree: number | ((node: Node) => number);
        textTruncate: boolean | ((node: Node) => boolean);
        textVerticalShift: number | ((node: Node) => number);
    }
    Index

    Properties

    badges?: ((node: Node) => NodeBadge[]) | NodeBadge[]

    Small indicators pinned to the node's rim, independent of every other channel — see NodeBadge.

    Resolved like any other channel: the narrowest declaration wins outright rather than merging, so a node's own badges replaces whatever nodeStyleMap or defaultNodeStyle gave it. An empty array is the way to say "this one wears none"; undefined renders no badge group at all.

    Four fit on a plain node, two on one with children (the expand affordance reserves the East corners). Anything beyond that collapses into a +n badge naming the rest.

    color: string | ((node: Node) => string)

    The main color of the node

    'var(--pvt-node-color, #007acc)'
    
    fontFamily: string
    'var(--pvt-font-family)'
    
    html?: (node: Node) => string | void | HTMLElement

    The html to be used inside the node as an SVGForeignObject element.

    Resolved like every other channel, so a card can be declared at any level — nodeStyleMap[type].html gives one kind of node a card while the rest keep their shapes, and a single node's own style overrides that. Returning nothing draws no card, so one callback can card some nodes and leave the others alone.

    Pair it with shape: 'none' for a card that is the node. Otherwise the shape is still drawn behind it, and size is the smallest the node can be.

    The card is measured and the node grows to it, so it is never clipped and edges land on its border. You do not have to make the returned element self-sizing — it is measured inside a shrink-to-fit box, so width: 100% resolves against its own content rather than against the placeholder.

    Trusted HTML only. Whatever this returns is inserted as-is, so build it with textContent (or escape it) rather than interpolating node data into a markup string.

    iconClass?: string
    iconUnicode?: string
    imageFit?: ((node: Node) => ImageFit) | ImageFit

    How an imagePath picture sits on the node's shape. Resolvable per node so different nodes can mix modes (e.g. screenshots 'cover', other attachments 'icon').

    'icon'
    
    imagePath?: string

    URL of a picture to draw on the node. Restricted to the http:, https:, data: and blob: schemes; anything else is ignored. Rendering it fetches the URL.

    shape: ((node: Node) => NodeShape) | NodeShape

    The shape of the node, either a standard shape or a custom SVG path

    circle
    
    size: number | ((node: Node) => number)
    10
    
    strokeColor: string | ((node: Node) => string)
    'var(--pvt-node-stroke, #fff)'
    
    strokeWidth: string | number
    'var(--pvt-node-stroke-width, 2)'
    
    styleCb?: (node: Node) => Partial<NodeStyle>

    Callback to dynamically override style properties based on the node.

    Where it sits depends on which style block declares it. On a node's own style it wins outright, and nodeStyleMap is skipped entirely. On render.defaultNodeStyle it is the computed form of the default slot: it fills only what neither the node nor nodeStyleMap set (and what a per-node styleCb left out), and its result still loses to both.

    Runs once per node per render, so keep it cheap.

    svgIcon?: string

    Inline SVG markup drawn inside the node. Sanitized before it reaches the DOM (scripting and event handlers are stripped), but a remote <image href> inside it is still fetched when the node renders — see the security guide.

    text?: string | ((node: Node) => string)

    The text to be used inside the node as an SVGText element

    textAnchorPosition: "end" | "start" | "middle"
    'middle'
    
    textColor: string | ((node: Node) => string)
    'var(--pvt-node-text-color, #fff)'
    
    textHorizontalShift: number | ((node: Node) => number)

    The horizontal shift applied to the node's label position. A value of 0 means it is centered to the node, a value of 1 is east of the node, -1 is west of the node. Other values are also accepted, e.g., 0.5 would be halfway between the center and the east of the node.

    0
    
    textRotateDegree: number | ((node: Node) => number)

    Rotation degree applied to the node's label. Positive values rotate clockwise, negative values rotate counter-clockwise.

    0
    
    textTruncate: boolean | ((node: Node) => boolean)

    Shorten an over-wide label with a middle ellipsis (head…tail); false draws it in full, on a themed pill where it spills past the node.

    true
    
    textVerticalShift: number | ((node: Node) => number)

    The vertical shift applied to the node's label position. A value of 0 means it is centered to the node, a value of 1 is north of the node, -1 is south of the node. Other values are also accepted, e.g., 0.5 would be halfway between the center and the north of the node.

    0