LuciferYang commented on code in PR #43307:
URL: https://github.com/apache/spark/pull/43307#discussion_r1352726658
##########
sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js:
##########
@@ -269,3 +270,47 @@ function togglePlanViz() { // eslint-disable-line
no-unused-vars
planVizContainer().style("display", "none");
}
}
+
+/*
+ * Light up the selected node and its linked nodes and edges.
+ */
+function setupSelectionForSparkPlanNode(g) {
+ const linkedNodes = new Map();
+ const linkedEdges = new Map();
+
+ g.edges().forEach(function (e) {
+ const edge = g.edge(e);
+ const from = g.node(e.v);
+ const to = g.node(e.w);
+ collectLinks(linkedNodes, from.id, to.id);
+ collectLinks(linkedNodes, to.id, from.id);
+ collectLinks(linkedEdges, from.id, edge.arrowheadId);
+ collectLinks(linkedEdges, to.id, edge.arrowheadId);
+ });
+
+ linkedNodes.forEach((linkedNodes, selectNode) => {
Review Comment:
It appears that each click currently clears and resets the class of all
nodes and edges. Is it possible to update only those nodes and edges that
actually change? Please correct me if I'm wrong.
##########
sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js:
##########
@@ -269,3 +270,47 @@ function togglePlanViz() { // eslint-disable-line
no-unused-vars
planVizContainer().style("display", "none");
}
}
+
+/*
+ * Light up the selected node and its linked nodes and edges.
+ */
+function setupSelectionForSparkPlanNode(g) {
+ const linkedNodes = new Map();
+ const linkedEdges = new Map();
+
+ g.edges().forEach(function (e) {
+ const edge = g.edge(e);
+ const from = g.node(e.v);
+ const to = g.node(e.w);
+ collectLinks(linkedNodes, from.id, to.id);
+ collectLinks(linkedNodes, to.id, from.id);
+ collectLinks(linkedEdges, from.id, edge.arrowheadId);
+ collectLinks(linkedEdges, to.id, edge.arrowheadId);
+ });
+
+ linkedNodes.forEach((linkedNodes, selectNode) => {
Review Comment:
It seems that each click currently clears and resets the class of all nodes
and edges. Is it possible to update only those nodes and edges that actually
change? Please correct me if I'm wrong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]