copy method

SchematicGraph copy()

Create a deep copy of this graph.

Useful for toggle operations that need a fresh state.

Implementation

SchematicGraph copy() {
  // Deep copy by serializing and deserializing
  final json = toJson();
  return SchematicGraph.fromJson(jsonEncode(json), hierarchy: hierarchy);
}