You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2023/09/20 02:02:02 UTC

[spark] branch master updated: [SPARK-45192][UI] Fix overdue lineInterpolate parameter for graphviz edge

This is an automated email from the ASF dual-hosted git repository.

yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 2325983c83fa [SPARK-45192][UI] Fix overdue lineInterpolate parameter for graphviz edge
2325983c83fa is described below

commit 2325983c83fa84a414054060e1e8b2cc2cdd1cd1
Author: Kent Yao <ya...@apache.org>
AuthorDate: Wed Sep 20 10:01:45 2023 +0800

    [SPARK-45192][UI] Fix overdue lineInterpolate parameter for graphviz edge
    
    ### What changes were proposed in this pull request?
    
    The `edge.lineInterpolate` no longer takes effect for drawing edges. It shall be replaced by d3.curve
    
    ### Why are the changes needed?
    
    trivial bugfix for ui.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    #### Before
    ![image](https://github.com/apache/spark/assets/8326978/8b7741e7-aa76-4404-ba57-688dc2972c0c)
    #### After
    ![image](https://github.com/apache/spark/assets/8326978/6ddb704c-3af8-4822-aeca-f8f1d97d6ac8)
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    no
    
    Closes #42969 from yaooqinn/SPARK-45192.
    
    Authored-by: Kent Yao <ya...@apache.org>
    Signed-off-by: Kent Yao <ya...@apache.org>
---
 .../main/resources/org/apache/spark/ui/static/spark-dag-viz.js | 10 +++++-----
 .../org/apache/spark/sql/execution/ui/static/spark-sql-viz.js  | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
index 73336b9f8e0a..952ca64d9cd1 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
@@ -328,11 +328,11 @@ function preprocessGraphLayout(g, forJob) {
     }
   }
   // Curve the edges
-  var edges = g.edges();
-  for (var j = 0; j < edges.length; j++) {
-    var edge = g.edge(edges[j]);
-    edge.lineInterpolate = "basis";
-  }
+  g.edges().forEach(function (edge) {
+    g.setEdge(edge.v, edge.w, {
+      curve: d3.curveBasis
+    })
+  })
   // Adjust vertical separation between nodes
   if (forJob) {
     g.graph().rankSep = JobPageVizConstants.rankSep;
diff --git a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
index a47a588f8c44..a926376f3c00 100644
--- a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
+++ b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
@@ -115,11 +115,11 @@ function preprocessGraphLayout(g) {
     });
   }
   // Curve the edges
-  var edges = g.edges();
-  for (var j = 0; j < edges.length; j++) {
-    var edge = g.edge(edges[j]);
-    edge.lineInterpolate = "basis";
-  }
+  g.edges().forEach(function (edge) {
+    g.setEdge(edge.v, edge.w, {
+      curve: d3.curveBasis
+    })
+  })
 }
 
 /*


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org