Browse Source

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
mj-deploy
Standa Lukeš 4 years ago
parent
commit
31c91be77c
  1. 2
      frontend/src/Graph.svelte

2
frontend/src/Graph.svelte

@ -104,7 +104,7 @@
function zoomed(e) { function zoomed(e) {
svg.attr("transform", e.transform); 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); zoomer.on("zoom", zoomed);
d3.select(container).call(zoomer); d3.select(container).call(zoomer);
}); });