Open dmb0058 opened 1 year ago
This works for me:
// reposition the controls
const controls = document.querySelector('g[id="svg-pan-zoom-controls"]');
//get height and width of svg
const svgHeight = svg.getBoundingClientRect().height;
const svgWidth = svg.getBoundingClientRect().width;
//set the controls to be 15% from the top of the svg and 100px from the right
controls.setAttribute('transform', 'translate(' + (svgWidth - 100) + ', ' + (svgHeight * 0.15) + ')');
I also wrap this in a function that fires on window resize.
Hi!
Amazing work - thank you so much. A small question: how to re-position the zoom controls to the top-left ?
I found this https://github.com/bumbu/svg-pan-zoom/issues/312#issuecomment-418888511 and I think the custom controls approach is what I need, but the link to the example is broken.
Thanks for any help,
David