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.