This is an automated email from the ASF dual-hosted git repository.
gengliang 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 f59ebde [SPARK-31558][UI] Code clean up in spark-sql-viz.js
f59ebde is described below
commit f59ebdef5b9c03dab99835527554ba8bebe38548
Author: Gengliang Wang <[email protected]>
AuthorDate: Sat Apr 25 13:43:52 2020 -0700
[SPARK-31558][UI] Code clean up in spark-sql-viz.js
### What changes were proposed in this pull request?
1. Remove console.log(), which seems unnecessary in the releases.
2. Replace the double equals to triple equals
3. Reuse jquery selector.
### Why are the changes needed?
For better code quality.
### Does this PR introduce any user-facing change?
No
### How was this patch tested?
Existing tests + manual test.
Closes #28333 from gengliangwang/removeLog.
Authored-by: Gengliang Wang <[email protected]>
Signed-off-by: Gengliang Wang <[email protected]>
---
.../org/apache/spark/sql/execution/ui/static/spark-sql-viz.js | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
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 bb393d9..301183f 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
@@ -61,7 +61,7 @@ function planVizContainer() { return
d3.select("#plan-viz-graph"); }
* node, it will display the details of this SparkPlan node in the right.
*/
function setupTooltipForSparkPlanNode(nodeId) {
- var nodeTooltip = d3.select("#plan-meta-data-" + nodeId).text()
+ var nodeTooltip = d3.select("#plan-meta-data-" + nodeId).text();
d3.select("svg g .node_" + nodeId)
.each(function(d) {
var domNode = d3.select(this).node();
@@ -122,10 +122,8 @@ function preprocessGraphLayout(g) {
*/
function resizeSvg(svg) {
var allClusters = svg.selectAll("g rect")[0];
- console.log(allClusters);
var startX = -PlanVizConstants.svgMarginX +
toFloat(d3.min(allClusters, function(e) {
- console.log(e);
return getAbsolutePosition(d3.select(e)).x;
}));
var startY = -PlanVizConstants.svgMarginY +
@@ -178,7 +176,7 @@ function getAbsolutePosition(d3selection) {
// Climb upwards to find how our parents are translated
obj = d3.select(obj.node().parentNode);
// Stop when we've reached the graph container itself
- if (obj.node() == planVizContainer().node()) {
+ if (obj.node() === planVizContainer().node()) {
break;
}
}
@@ -210,8 +208,8 @@ function postprocessForAdditionalMetrics() {
checkboxNode.click(function() {
onClickAdditionalMetricsCheckbox($(this));
});
- var isChecked = window.localStorage.getItem("stageId-and-taskId-checked") ==
"true";
- $("#stageId-and-taskId-checkbox").prop("checked", isChecked);
+ var isChecked = window.localStorage.getItem("stageId-and-taskId-checked")
=== "true";
+ checkboxNode.prop("checked", isChecked);
onClickAdditionalMetricsCheckbox(checkboxNode);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]