refactor: layers basic typization

This commit is contained in:
Azgaar 2022-07-05 20:33:28 +03:00
parent 7c2c624417
commit 1847772d74
15 changed files with 337 additions and 194 deletions

View file

@ -33,6 +33,10 @@ window.Zoom = (function () {
invokeActiveZooming();
}
function force() {
zoom.scaleBy(svg, 1.00001); // enforce browser re-draw;
}
// zoom to a specific point
function to(x, y, z = 8, d = 2000) {
const transform = d3.zoomIdentity.translate(x * -z + graphWidth / 2, y * -z + graphHeight / 2).scale(z);
@ -59,5 +63,5 @@ window.Zoom = (function () {
zoom.scaleTo(element, scale);
}
return {setZoomBehavior, invoke, to, reset, scaleExtent, translateExtent, scaleTo};
return {setZoomBehavior, invoke, force, to, reset, scaleExtent, translateExtent, scaleTo};
})();