You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/09 03:04:47 UTC

[GitHub] [airflow] bbovenzi commented on a change in pull request #16253: Client-side filter dag dependencies

bbovenzi commented on a change in pull request #16253:
URL: https://github.com/apache/airflow/pull/16253#discussion_r647931429



##########
File path: airflow/www/static/js/dag_dependencies.js
##########
@@ -187,10 +179,50 @@ function searchboxHighlighting(s) {
   }
 }
 
-setUpNodeHighlighting();
-setUpZoomSupport();
-
 d3.select('#searchbox').on('keyup', () => {
   const s = document.getElementById('searchbox').value;
   searchboxHighlighting(s);
 });
+
+const renderGraph = () => {
+  g = new dagreD3.graphlib.Graph()
+    .setGraph({
+      nodesep: 15,
+      ranksep: 15,
+      rankdir: arrange,
+    })
+    .setDefaultEdgeLabel(() => ({ lineInterpolate: 'basis' }));
+
+  // set nodes
+  nodes.forEach((node) => {
+    g.setNode(node.id, node.value);
+  });
+
+  // Set edges
+  edges.forEach((edge) => {
+    g.setEdge(edge.u, edge.v);
+  });
+
+  innerSvg.call(render, g);
+  setUpNodeHighlighting();
+  setUpZoomSupport();
+};
+
+// rerender graph when filtering dags with dependencies or not
+$('#deps-filter').on('change', function onChange() {
+  // reset searchbox
+  document.getElementById('searchbox').value = '';

Review comment:
       Good idea, we already have too much vanilla document and jquery.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org