From 31c91be77c141d392b8aa919406076a2ff7419ef Mon Sep 17 00:00:00 2001 From: exyi Date: Wed, 30 Sep 2020 22:06:02 +0000 Subject: [PATCH] Set zoom click distance to 10px prevents a glitch that occurs when clicking on nodes - instead of seeting the click event, the view moves by few pixes and task is not selected --- frontend/src/Graph.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index df377db..7072d94 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -104,7 +104,7 @@ function zoomed(e) { svg.attr("transform", e.transform); } - const zoomer = d3.zoom().scaleExtent([0.1, 2]) + const zoomer = d3.zoom().scaleExtent([0.1, 2]).clickDistance(10) zoomer.on("zoom", zoomed); d3.select(container).call(zoomer); });