toTreeFrom<K> method

Map<K, dynamic> toTreeFrom<K>(
  1. List<T> roots, {
  2. K keyCast(
    1. T value
    )?,
  3. bool sortByInputDependency = false,
  4. bool bfs = false,
})

Returns a Map representation of this graph from roots.

Implementation

Map<K, dynamic> toTreeFrom<K>(List<T> roots,
    {K Function(T value)? keyCast,
    bool sortByInputDependency = false,
    bool bfs = false}) {
  return GraphWalker<T>(
          sortByInputDependency: sortByInputDependency, bfs: bfs)
      .toTreeFrom<K>(roots,
          nodeProvider: (s, v) => getNode(v),
          outputsProvider: (s, n) => n._outputs);
}