Function hierarchy

  • Constructs a root node from the specified hierarchical data.

    Type Parameters

    • Datum

    Parameters

    • data: Datum

      The root specified data. If data is a Map, it is implicitly converted to the entry [undefined, data], and the children accessor instead defaults to (d) => Array.isArray(d) ? d[1] : null;.

    • Optional children: ((d) => Iterable<Datum>)

      The specified children accessor function is invoked for each datum, starting with the root data, and must return an iterable of data representing the children, if any. If children is not specified, it defaults to: (d) => d.children.

        • (d): Iterable<Datum>
        • Parameters

          • d: Datum

          Returns Iterable<Datum>

    Returns HierarchyNode<Datum>