()
| 527 | const graph = this.graphRender.initGraph(config); |
| 528 | this.graph = graph; |
| 529 | const cb = () => { |
| 530 | if (this.config.zoom !== undefined) { |
| 531 | this.zoom(this.config.zoom); |
| 532 | } |
| 533 | if (this.config.center !== undefined) { |
| 534 | this.graphRender.setCenter({ x: this.config.center[0], y: this.config.center[1] }); |
| 535 | } |
| 536 | }; |
| 537 | this.graph.on('afterlayout', cb); |
| 538 | return graph; |
| 539 | } |