spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewo...@apache.org
Subject spark git commit: [SPARK-7347] DAG visualization: add tooltips to RDDs
Date Thu, 07 May 2015 19:30:06 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.4 800c0fc8d -> 1b742a414


[SPARK-7347] DAG visualization: add tooltips to RDDs

This is an addition to #5729.

Here's an example with ALS.
<img src="https://issues.apache.org/jira/secure/attachment/12731039/tooltip.png" width="400px"></img>

Author: Andrew Or <andrew@databricks.com>

Closes #5957 from andrewor14/viz-hover2 and squashes the following commits:

60e3758 [Andrew Or] Add tooltips for RDDs on job page

(cherry picked from commit 88717ee4e7542ac8d5d2e5756c912dd390b37e88)
Signed-off-by: Andrew Or <andrew@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1b742a41
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1b742a41
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1b742a41

Branch: refs/heads/branch-1.4
Commit: 1b742a414eb6357360a6cfd729220f178cbed67f
Parents: 800c0fc
Author: Andrew Or <andrew@databricks.com>
Authored: Thu May 7 12:29:56 2015 -0700
Committer: Andrew Or <andrew@databricks.com>
Committed: Thu May 7 12:30:03 2015 -0700

----------------------------------------------------------------------
 .../org/apache/spark/ui/static/spark-dag-viz.js     | 16 ++++++++++++++++
 .../apache/spark/ui/scope/RDDOperationGraph.scala   |  5 +++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1b742a41/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
----------------------------------------------------------------------
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 cda27ca..a0e3e91 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
@@ -218,6 +218,7 @@ function renderDagVizForJob(svgContainer) {
     });
   });
 
+  addTooltipsForRDDs(svgContainer);
   drawCrossStageEdges(crossStageEdges, svgContainer);
 }
 
@@ -424,6 +425,21 @@ function connectRDDs(fromRDDId, toRDDId, edgesContainer, svgContainer)
{
   edgesContainer.append("path").datum(points).attr("d", line);
 }
 
+/* (Job page only) Helper function to add tooltips for RDDs. */
+function addTooltipsForRDDs(svgContainer) {
+  svgContainer.selectAll("g.node").each(function() {
+    var node = d3.select(this);
+    var tooltipText = node.attr("name");
+    if (tooltipText) {
+      node.select("circle")
+        .attr("data-toggle", "tooltip")
+        .attr("data-placement", "right")
+        .attr("title", tooltipText)
+    }
+  });
+  $("[data-toggle=tooltip]").tooltip({container: "body"});
+}
+
 /* Helper function to convert attributes to numeric values. */
 function toFloat(f) {
   if (f) {

http://git-wip-us.apache.org/repos/asf/spark/blob/1b742a41/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
index edf005f..2b2db9e 100644
--- a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
+++ b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
@@ -178,10 +178,11 @@ private[ui] object RDDOperationGraph extends Logging {
    * On the stage page, it is displayed as a box with an embedded label.
    */
   private def makeDotNode(node: RDDOperationNode, forJob: Boolean): String = {
+    val label = s"${node.name} (${node.id})"
     if (forJob) {
-      s"""${node.id} [label=" " shape="circle" padding="5" labelStyle="font-size: 0"]"""
+      s"""${node.id} [label="$label" shape="circle" padding="5" labelStyle="font-size: 0"]"""
     } else {
-      s"""${node.id} [label="${node.name} (${node.id})" padding="5" labelStyle="font-size:
10"]"""
+      s"""${node.id} [label="$label" padding="5" labelStyle="font-size: 10"]"""
     }
   }
 


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


Mime
View raw message