mma-server/src/main/resources/com/aliyun/odps/mma/server/ui/static/dag-viz.js
/*
 * (Job page only) Helper function to draw edges that cross stage boundaries.
 * We need to do this manually because we render each stage separately in dagre-d3.
 */
(Job page only) Helper function to draw edges that cross stage boundaries.
We need to do this manually because we render each stage separately in dagre-d3.
( Job page only ) Helper function to draw edges that cross stage boundaries . We need to do this manually because we render each stage separately in dagre - d3 .
function drawCrossStageEdges(edges, svgContainer) {
  if (edges.length == 0) {
    return;
  }
  var edgesContainer = svgContainer.append("g").attr("id", "cross-stage-edges");
  for (var i = 0; i < edges.length; i++) {
    var fromRDDId = edges[i][0];
    var toRDDId = edges[i][1];
    connectRDDs(fromRDDId, toRDDId, edgesContainer, svgContainer);
  }
  var dagreD3Marker = svgContainer.select("g.edgePaths marker");
  if (!dagreD3Marker.empty()) {
    svgContainer
    .append(function() { return dagreD3Marker.node().cloneNode(true); })
    .attr("id", "marker-arrow");
    svgContainer.selectAll("g > path").attr("marker-end", "url(#marker-arrow)");
    svgContainer.selectAll("g.edgePaths def").remove(); 
  }
}
function drawCrossStageEdges ( edges , svgContainer ) { if ( edges . length == 0 ) { return ; } var edgesContainer = svgContainer . append ( "g" ) . attr ( "id" , "cross-stage-edges" ) ; for ( var i = 0 ; i < edges . length ; i ++ ) { var fromRDDId = edges [ i ] [ 0 ] ; var toRDDId = edges [ i ] [ 1 ] ; connectRDDs ( fromRDDId , toRDDId , edgesContainer , svgContainer ) ; } var dagreD3Marker = svgContainer . select ( "g.edgePaths marker" ) ; if ( ! dagreD3Marker . empty ( ) ) { svgContainer . append ( function ( ) { return dagreD3Marker . node ( ) . cloneNode ( true ) ; } ) . attr ( "id" , "marker-arrow" ) ; svgContainer . selectAll ( "g > path" ) . attr ( "marker-end" , "url(#marker-arrow)" ) ; svgContainer . selectAll ( "g.edgePaths def" ) . remove ( ) ; } }
(Job page only) Helper function to draw edges that cross stage boundaries.
( Job page only ) Helper function to draw edges that cross stage boundaries .
// Draw the paths first // Now draw the arrows by borrowing the arrow marker generated by dagre-d3 // We no longer need these