diff --git a/src/static/graph.ts b/src/static/graph.ts index 75f5ccd92..1b8f65894 100644 --- a/src/static/graph.ts +++ b/src/static/graph.ts @@ -24,7 +24,6 @@ export function drawGraph(opts, content) { // check that a valid graph was rendered if (buildGraphElement === null || buildGraphElement.node() === null) { - console.log('unable to continue drawing graph, root element is invalid'); return; } diff --git a/src/static/index.ts b/src/static/index.ts index 6802ca1d7..4cabff514 100644 --- a/src/static/index.ts +++ b/src/static/index.ts @@ -142,13 +142,19 @@ var opts = { app.ports.renderBuildGraph.subscribe(function (graphData) { const graphviz = Graphviz.load().then(res => { var content = res.layout(graphData.dot, 'svg', 'dot'); - // construct graph building options opts.isRefreshDraw = opts.currentBuild === graphData.build_id; opts.centerOnDraw = graphData.center_on_draw; - opts.currentBuild = graphData.build_id; opts.contentFilter = graphData.filter; + + // track the currently drawn build + opts.currentBuild = graphData.build_id; + opts.onGraphInteraction = app.ports.onGraphInteraction; - Graph.drawGraph(opts, content); + + // dispatch the draw command to avoid elm/js rendering order issues + setTimeout(() => { + Graph.drawGraph(opts, content); + }, 0); }); });