Open BDOXHN opened 2 years ago
Currently, there is no panning limit, only a zoom limit -
Which you can control by overriding chart.scaleExtent([0.001, 20])
If it helps, you can get the current width and height of the graph using chart.svgWidth()
and chart.svgHeight()
Good day! By default panning of chart - infinite. User can hide the chart from the screen, which I would really not like in my situation.
Is there any way the panning to be only be inside the chart rather outside of it? Or maybe panning with limit by tree size (with dynamically update by opened or closed subtrees)
I tried edit code in d3-org-chart.js at line:
behaviors.zoom = d3.zoom().on("zoom", (evenbt, d) => this.zoomed(event, d).scaleExtent(attrs.scaleExtent)
with adding:
.translateExtent([[-1000, -1000],[1000, 1000]])
but I dont know how can i get current width and height of chart, that will be update after i open or close subtrees.