From 445dafd0baeecce369cb85abfccb809b7e1190c4 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 24 Feb 2022 02:36:59 +0100 Subject: [PATCH] more cleanup --- docs/morphisms/js/d3_visualisation.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/morphisms/js/d3_visualisation.js b/docs/morphisms/js/d3_visualisation.js index 770b598..8fcb3b5 100644 --- a/docs/morphisms/js/d3_visualisation.js +++ b/docs/morphisms/js/d3_visualisation.js @@ -1,7 +1,7 @@ function drag(simulation) { function dragstarted(event, d) { - if (!event.active) simulation.alphaTarget(0.3).restart(); + if (!event.active) simulation.alphaTarget(0.4).restart(); d.fx = d.x; d.fy = d.y; } @@ -59,10 +59,6 @@ function dehighlight(node) { ; } -function _union(...arr) { - return arr.reduce((first, second) => [...new Set(first.concat(second))]); -} - async function create_svg( data, width, @@ -89,6 +85,7 @@ async function create_svg( .force("x", d3.forceX()) .force("y", d3.forceY().y(d => 100 * (2 * d.level + 1))) .force("radial", d3.forceRadial(d => 20 * (2*d.level), width/2, 0)) + ; const svg = d3.create("svg") .attr("preserveAspectRatio", "xMinYMin meet") @@ -139,7 +136,6 @@ async function create_svg( ) ; return all_desc; - // return _union(desc, _union(...desc.map(l=>find_descendants(l.target)))); } };