interface VariantGraph.NonEmpty<N>
A non-empty type-variant immutable graph. See the Graph documentation and the VariantGraph API documentation
Extends: Streamable.NonEmpty<T>, VariantGraph<N>
Type parameters
| Name | Description |
|---|---|
| N | the node type |
Properties
linkMap
Returns the nested Map representation of the graph connections.
linkMapDefinition
readonly linkMap: VariantMap.NonEmpty<N, VariantSet<N>>;
example
ArrowValuedGraphHashed.of([1, 2, 'a'], [2, 3, 'b']).linkMap.toArray()
// => [[1, HashMap(2 -> 'a')], [2, HashMap(3 -> 'b')]]
Overrides
Methods
stream
Returns a non-empty Stream containing all graph elements of this collection as single tuples for isolated nodes and 2-valued tuples of nodes for connections.
streamStream containing all graph elements of this collection as single tuples for isolated nodes and 2-valued tuples of nodes for connections.Definition
stream(): Stream.NonEmpty<[N] | Link<N>>;
example
ArrowGraphHashed.of([1], [2, 3]).stream().toArray() // => [[1], [2, 3]]