toTree<K> method

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

Returns a Map representation of this graph.

Implementation

Map<K, dynamic> toTree<K>(
    {K Function(T value)? keyCast,
    bool sortByInputDependency = false,
    bool bfs = false}) {
  var rootValues = roots.map((e) => e.value).toList();
  return toTreeFrom<K>(rootValues,
      keyCast: keyCast,
      sortByInputDependency: sortByInputDependency,
      bfs: bfs);
}