fix: zoomTo to use svg size and not graph size

This commit is contained in:
Azgaar 2024-08-02 11:35:51 +02:00
parent b267e832b5
commit c6dd331eb6
3 changed files with 3 additions and 3 deletions

View file

@ -457,7 +457,7 @@ function handleZoom(isScaleChanged, isPositionChanged) {
// Zoom to a specific point
function zoomTo(x, y, z = 8, d = 2000) {
const transform = d3.zoomIdentity.translate(x * -z + graphWidth / 2, y * -z + graphHeight / 2).scale(z);
const transform = d3.zoomIdentity.translate(x * -z + svgWidth / 2, y * -z + svgHeight / 2).scale(z);
svg.transition().duration(d).call(zoom.transform, transform);
}