* @return {module:echarts/data/Graph}
()
| 299 | * @return {module:echarts/data/Graph} |
| 300 | */ |
| 301 | clone() { |
| 302 | const graph = new Graph(this._directed); |
| 303 | const nodes = this.nodes; |
| 304 | const edges = this.edges; |
| 305 | for (let i = 0; i < nodes.length; i++) { |
| 306 | graph.addNode(nodes[i].id, nodes[i].dataIndex); |
| 307 | } |
| 308 | for (let i = 0; i < edges.length; i++) { |
| 309 | const e = edges[i]; |
| 310 | graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); |
| 311 | } |
| 312 | return graph; |
| 313 | }; |
| 314 | |
| 315 | |
| 316 | } |
no test coverage detected