ForceDirectedGraph<T> class

Constructors

ForceDirectedGraph.new({GraphConfig config = const GraphConfig()})
Create an empty graph.
ForceDirectedGraph.fromJson(String json, {NodeDataDeserializer<T>? deserializeData, bool resetPosition = false, GraphConfig config = const GraphConfig()})
Create a graph from json. resetPosition will reset the position of the nodes.
ForceDirectedGraph.generateNNodes({required int nodeCount, required T generator(), GraphConfig config = const GraphConfig()})
Generate a graph with n nodes, no edges. nodeCount is the node count. generator is the generator of the node data. Make sure the data is unique.
ForceDirectedGraph.generateNTree({required int nodeCount, required int maxDepth, required int n, required T generator(), GraphConfig config = const GraphConfig()})
Generate a random tree graph. nodeCount is the max node count. maxDepth is the max depth of the tree. n is the max children count of a node. generator is the generator of the node data. Make sure the data is unique.

Properties

config GraphConfig
final
edges List<Edge>
final
hashCode int
The hash code for this object.
no setterinherited
nodes List<Node<T>>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEdge(Edge edge) → void
addNode(Node<T> node) → void
deleteEdge(Edge edge) → void
deleteNode(Node node) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson({NodeDataSerializer<T>? serializeData}) String
toString() String
A string representation of this object.
override
unStaticAllNodes() → void
updateAllNodes() bool

Operators

operator ==(Object other) bool
The equality operator.
inherited