From b926dd3526de183dedb5e461902d2585daf38575 Mon Sep 17 00:00:00 2001 From: exyi Date: Mon, 28 Sep 2020 21:25:41 +0000 Subject: [PATCH] Fix strange behavor on page resize --- frontend/src/Graph.svelte | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index d086e03..1c48c1b 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -75,15 +75,7 @@ // start simulation and center view on create onMount(() => { // set center of the SVG at (0,0) - let svg = d3 - .select(svgElement) - .attr("viewBox", [ - -clientWidth / 2, - -clientHeight / 2, - clientWidth, - clientHeight, - ]) - .select("g"); + let svg = d3.select(svgElement) // setup zoom function zoomed(e) { @@ -118,7 +110,7 @@
- + {#each edges as edge}