Viv JavaScript Runtime - v0.10.2
    Preparing search index...

    Interface ConstructTreeDiagramArgs

    Arguments parameterizing a request to construct a causal tree diagram.

    These are the effective arguments to constructTreeDiagram.

    interface ConstructTreeDiagramArgs {
        actionID: string;
        anchorMarker?: string;
        ansi?: boolean;
        formatLabel?: (actionID: string) => string;
        maxChildren?: number;
    }
    Index

    Properties

    actionID: string

    Entity ID for the anchor action.

    The diagram will render the complete causal tree containing this action, and the anchor will be highlighted with anchorMarker (or a default).

    anchorMarker?: string

    The string used to mark the anchor action in the diagram.

    If the default collides with text produced by the formatLabel callback, a more distinctive marker can be supplied here. Otherwise, the default value here will not appear elsewhere in the diagram (making it easy to search for the anchor action).

    "*"
    
    ansi?: boolean

    Whether to include ANSI escape codes for stylized text display in terminal settings.

    When enabled, certain elements will be displayed in color and/or with other style.

    false
    
    formatLabel?: (actionID: string) => string

    An optional callback that renders the label for each node in the diagram.

    The callback receives the action's entity ID, and should return a string to use as the node label. If omitted, the action name will be used as the label.

    The callback must be synchronous.

    Type Declaration

      • (actionID: string): string
      • Parameters

        • actionID: string

          The entity ID for the action to produce a label for.

        Returns string

        A label for a tree node for the given action.

    maxChildren?: number

    The maximum number of children to render per node.

    When a node has more children than this limit, the excess members are replaced with an indicator showing the number of hidden siblings among the node's children.

    If omitted, all children are rendered.

    Infinity