The root specified data.
Error on missing id, ambiguous id, cycle, multiple roots or no root.
Returns the current id accessor, which defaults to: (d) => d.id
.
Returns the current id accessor, which defaults to: (d) => d.id
.
Sets the id accessor to the given function. The id accessor is invoked for each element in the input data passed to the stratify operator. The returned string is then used to identify the node's relationships in conjunction with the parent id. For leaf nodes, the id may be undefined, null or the empty string; otherwise, the id must be unique.
The id accessor.
Returns the current parent id accessor, which defaults to: (d) => d.parentId
.
Returns the current parent id accessor, which defaults to: (d) => d.parentId
.
Sets the parent id accessor to the given function. The parent id accessor is invoked for each element in the input data passed to the stratify operator. The returned string is then used to identify the node's relationships in conjunction with the id. For the root node, the parent id should be undefined, null or the empty string. There must be exactly one root node in the input data, and no circular relationships.
The parent id accessor.
Returns the current path accessor, which defaults to undefined.
If path is specified, sets the path accessor to the given function and returns this stratify operator. Otherwise, returns the current path accessor, which defaults to undefined. If a path accessor is set, the id and parentId arguments are ignored, and a unix-like hierarchy is computed on the slash-delimited strings returned by the path accessor, imputing parent nodes and ids as necessary.
The path accessor.
Generates a new hierarchy from the specified tabular data. Each node in the returned object has a shallow copy of the properties from the corresponding data object, excluding the following reserved properties: id, parentId, children.