toJson method

String toJson()

Implementation

String toJson() {
  var jsonString = {
    'nodes': [
     ..._nodes.map((e) => e.hashCode.toString())
    ],
    'edges': [
      ..._edges.map((e) =>   {'from': e.source.hashCode.toString(), 'to': e.destination.hashCode.toString()})
    ]
  };

  return json.encode(jsonString);
}