ForceDirectedGraph<T>.generateNNodes constructor
ForceDirectedGraph<T>.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.
Implementation
ForceDirectedGraph.generateNNodes({
required int nodeCount,
required T Function() generator,
this.config = const GraphConfig(),
}) {
for (int i = 0; i < nodeCount; i++) {
final node = Node(generator());
nodes.add(node);
}
}