Im currently facing the issue with the zoom level in d3.js
I got the dimentions for <g className ="_zoomElement"> element with the help of this function
const g = select("._zoomElement")
console.log(g.node().getBBox())
I want to fit the group element into the svg Canvus according to the svg dimentions with the help of one button click I got the svg canvus width and height dimentions too
Explanation Image
i dont know how to find the scale value with the help of dimentions
i thought like this
if parent element dimetions would be like this
width = 1000px height = 500px
i will reduct 2% from that values we get the fit ratio
but my concern how can we get zoom scale value with that values
