Interface Stratify<LinkDatum, Ops>

The operator that constructs a MutGraph from stratified tabularesque data.

Create a default operator with graphStratify. The accessors for a node's id or parents' ids can be altered, or parentData can be specified to specify parent ids and attach data to the edge for that parent.

Type Parameters

Hierarchy

  • Stratify
  • create a graph from stratify data

    Type Parameters

    • N extends unknown

    Parameters

    • data: readonly N[]

      the node data to create a graph from

    Returns MutGraph<N, LinkDatum>

    graph - the graph representation of the data

Methods

  • Sets the id accessor to the given Id and returns a Stratify. The default operator is:

    function id(d) {
    return d.id;
    }

    Type Parameters

    • NewId extends Id<never>

    Parameters

    • id: NewId

    Returns Stratify<LinkDatum, U<Ops, "id", NewId>>

  • Gets the current id accessor.

    Returns Ops["id"]

  • Sets the parentData accessor to the given ParentData and returns an updated operator.

    Type Parameters

    • NewLinkDatum

    • NewParentData extends ParentData<never, NewLinkDatum>

    Parameters

    • data: NewParentData & ParentData<never, NewLinkDatum>

    Returns Stratify<NewLinkDatum, {
        id: Ops["id"];
        parentData: NewParentData;
        parentIds: WrappedParentData<NewParentData>;
    }>

  • Gets the current parentData accessor. If parentIds was passed, this will wrap that to just return the ids with undefined data.

    Returns Ops["parentData"]

  • Sets the parentIds accessor to the given ParentIds and returns an update operator. The default operator is:

    function parentIds(d) {
    return d.parentIds;
    }

    Type Parameters

    Parameters

    • ids: NewParentIds

    Returns Stratify<undefined, {
        id: Ops["id"];
        parentData: WrappedParentIds<NewParentIds>;
        parentIds: NewParentIds;
    }>

  • Gets the current parent ids accessor. If parentData was passed, the returned function will wrap that to just return the ids.

    Returns Ops["parentIds"]

Generated using TypeDoc