Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,6 @@ function styleDagViz(forJob) {
.style("stroke", VizConstants.stageColor)
.style("strokeWidth", "6px");

// Put an arrow at the end of every edge
// We need to do this because we manually render some edges ourselves
// For these edges, we borrow the arrow marker generated by dagre-d3
var dagreD3Marker = graphContainer().select("svg g.edgePaths marker").node();
graphContainer().select("svg")
.append(function() { return dagreD3Marker.cloneNode(true); })
.attr("id", "marker-arrow")
.select("path")
.attr("fill", VizConstants.edgeColor)
.attr("strokeWidth", "0px");
graphContainer().selectAll("svg g > path").attr("marker-end", "url(#marker-arrow)");
graphContainer().selectAll("svg g.edgePaths def").remove(); // We no longer need these

// Apply any job or stage specific styles
if (forJob) {
styleDagVizForJob();
Expand All @@ -284,6 +271,22 @@ function styleDagViz(forJob) {

/* Apply job-page-specific style to the visualization. */
function styleDagVizForJob() {

// Put an arrow at the end of every edge
// We need to do this because we manually render some edges ourselves
// For these edges, we borrow the arrow marker generated by dagre-d3
var dagreD3Marker = graphContainer().select("svg g.edgePaths marker");
if (!dagreD3Marker.empty()) {
graphContainer().select("svg")
.append(function() { return dagreD3Marker.node().cloneNode(true); })
.attr("id", "marker-arrow")
.select("path")
.attr("fill", VizConstants.edgeColor)
.attr("strokeWidth", "0px");
graphContainer().selectAll("svg g > path").attr("marker-end", "url(#marker-arrow)");
graphContainer().selectAll("svg g.edgePaths def").remove(); // We no longer need these
}

graphContainer().selectAll("svg g.node circle")
.style("fill", VizConstants.rddColor);
// TODO: add a legend to explain what a highlighted dot means
Expand Down