diff --git a/src/elm/Pages/Build/Graph.elm b/src/elm/Pages/Build/Graph.elm index 99fafac7b..8e7f9b022 100644 --- a/src/elm/Pages/Build/Graph.elm +++ b/src/elm/Pages/Build/Graph.elm @@ -1,4 +1,4 @@ -module Pages.Build.Graph exposing (renderBuildGraph, renderBuildGraphDOT) +module Pages.Build.Graph exposing (renderBuildGraph) import Dict exposing (Dict) import Focus @@ -47,7 +47,7 @@ renderBuildGraph model centerOnDraw = Success g -> Interop.renderBuildGraph <| encodeBuildGraphRenderData - { dot = renderBuildGraphDOT model g + { dot = renderDOT model g , buildID = RemoteData.unwrap -1 .id bm.build , filter = gm.filter , showServices = gm.showServices @@ -60,7 +60,7 @@ renderBuildGraph model centerOnDraw = Cmd.none -{-| renderBuildGraphDOT : constant for organizing the layout of build graph nodes +{-| builtInClusterID : constant for organizing the layout of build graph nodes -} builtInClusterID : Int builtInClusterID = @@ -81,12 +81,12 @@ serviceClusterID = 0 -{-| renderBuildGraphDOT : takes model and build graph, and returns a string representation of a DOT graph using the extended Graph DOT package +{-| renderDOT : takes model and build graph, and returns a string representation of a DOT graph using the extended Graph DOT package -} -renderBuildGraphDOT : BuildModel.PartialModel a -> BuildGraph -> String -renderBuildGraphDOT model buildGraph = +renderDOT : BuildModel.PartialModel a -> BuildGraph -> String +renderDOT model buildGraph = let -- todo: BUG: single step "step" sleep 10 pipeline when you hover -- the text changes color??? diff --git a/src/static/graph.ts b/src/static/graph.ts index ad2ec8334..774c9c553 100644 --- a/src/static/graph.ts +++ b/src/static/graph.ts @@ -16,6 +16,8 @@ export function drawGraph(opts, content) { edge: '.elm-build-graph-edge', }; + console.log('this sometimes happens too fast ' + opts.centerOnDraw); + var buildGraphElement = drawBaseGraphWithZoom( opts, graphSelectors.root, @@ -122,6 +124,7 @@ function drawBaseGraphWithZoom(opts, selector, content) { resetZoomAndCenter(opts, zoom); } if (opts.centerOnDraw) { + console.log("recentering"); resetZoomAndCenter(opts, zoom); } diff --git a/src/static/index.ts b/src/static/index.ts index 194ff379b..76e6ca463 100644 --- a/src/static/index.ts +++ b/src/static/index.ts @@ -142,10 +142,8 @@ var opts = { }; app.ports.renderBuildGraph.subscribe(function (graphData) { - const dot = graphData.dot; - const graphviz = Graphviz.load().then(res => { - var content = res.layout(dot, 'svg', 'dot'); + var content = res.layout(graphData.dot, 'svg', 'dot'); // construct graph building options opts.isRefreshDraw = opts.currentBuild === graphData.build_id; @@ -153,7 +151,6 @@ app.ports.renderBuildGraph.subscribe(function (graphData) { opts.currentBuild = graphData.build_id; opts.contentFilter = graphData.filter; opts.onGraphInteraction = app.ports.onGraphInteraction; - Graph.drawGraph(opts, content); }); });