Skip to content

Commit 3c0d4f0

Browse files
author
Andrew Or
committed
Guard against JS error by rendering arrows only if needed
1 parent f23e15b commit 3c0d4f0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,13 @@ function drawCrossStageEdges(edges, svgContainer) {
334334
}
335335
// Now draw the arrows by borrowing the arrow marker generated by dagre-d3
336336
var dagreD3Marker = svgContainer.select("g.edgePaths marker").node();
337-
svgContainer
338-
.append(function() { return dagreD3Marker.cloneNode(true); })
339-
.attr("id", "marker-arrow")
340-
svgContainer.selectAll("g > path").attr("marker-end", "url(#marker-arrow)");
341-
svgContainer.selectAll("g.edgePaths def").remove(); // We no longer need these
337+
if (!dagreD3Marker.empty()) {
338+
svgContainer
339+
.append(function() { return dagreD3Marker.cloneNode(true); })
340+
.attr("id", "marker-arrow")
341+
svgContainer.selectAll("g > path").attr("marker-end", "url(#marker-arrow)");
342+
svgContainer.selectAll("g.edgePaths def").remove(); // We no longer need these
343+
}
342344
}
343345

344346
/*

0 commit comments

Comments
 (0)