MAIDR JavaScript API
    Preparing search index...
    • Finds the mark groups that make up a Plot.tree or Plot.cluster.

      Neither is a mark. Both are three of them — a link for the edges, a dot for the nodes, and a text for the names, which Plot draws as two text marks because leaf labels and internal-node labels sit on opposite sides of their dot. Read individually the hierarchy disappears: the dots become a scatter whose coordinates are where the layout algorithm put each node, and the links, which are the only place the structure lives, produce no layer at all (#1168).

      What identifies it is not the arrangement but a fact in the markup. Plot gives every tree node a <title> holding its full path from the root, and — measured across delimiters — always joined with / whatever the caller's own delimiter was:

      Plot.tree(['Company', 'Company/Sales', …])           <title>/Company/Sales</title>
      Plot.tree(['Company.Sales', …], {delimiter: '.'})    <title>/Company/Sales</title>
      

      So the test is whether the node titles form a rooted hierarchy: every one begins with /, and every one's parent prefix is either empty or another title. A labelled scatter whose labels happen to look like paths fails that as soon as one of its parents is missing, and a link mark on its own keeps the span reading #1094 gave it.

      One tree per plot. Two of them share a pair of scales and draw on top of one another, so the chart is not one anybody makes; the first is read and the second is left as it was rather than the two being merged into a hierarchy neither draws.

      Parameters

      • groups: readonly { label: string; group: Element }[]

        The plot's mark groups, in draw order.

      Returns TreeComposite | null

      The tree's groups, or null when the plot does not draw one.