@@ -294,11 +294,12 @@ export default {
294
294
}
295
295
},
296
296
297
- mounted () {
297
+ async mounted () {
298
+ // compile & instantiate graphviz wasm
299
+ this .graphviz = await Graphviz .load ()
298
300
// allow render to happen before we go configuring svgPanZoom
299
- const self = this
300
- this .$nextTick (function () {
301
- self .updateTimer ()
301
+ this .$nextTick (() => {
302
+ this .updateTimer ()
302
303
})
303
304
this .mountSVGPanZoom ()
304
305
},
@@ -586,7 +587,7 @@ export default {
586
587
587
588
// layout the graph
588
589
try {
589
- await this .layout (nodes, edges, nodeDimensions)
590
+ this .layout (nodes, edges, nodeDimensions)
590
591
} catch (e) {
591
592
// something went wrong, allow the layout to retry later
592
593
this .graphID = null
@@ -624,14 +625,12 @@ export default {
624
625
}
625
626
},
626
627
/** re-layout the graph after any new nodes have been rendered */
627
- async layout (nodes , edges , nodeDimensions ) {
628
- const graphviz = await Graphviz .load ()
629
-
628
+ layout (nodes , edges , nodeDimensions ) {
630
629
// generate the GraphViz dot code
631
630
const dotCode = this .getDotCode (nodeDimensions, nodes, edges)
632
631
633
632
// run the layout algorithm
634
- const jsonString = graphviz .layout (dotCode, ' json' )
633
+ const jsonString = this . graphviz .layout (dotCode, ' json' )
635
634
const json = JSON .parse (jsonString)
636
635
637
636
// update graph node positions
0 commit comments