question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Smooth zooming and moveing to a bounding box in svg

See original GitHub issue

I have a svg graphic and upon an event I want to move and zoom smoothly to a specific bounding box.

Lets say we have this circle

<circle id="circle" r="100" cy="200" cx="200" style="..." />

upon an event I want to move and zoom the scene to the bounding box

top = 90
left = 90
right = 310
bottom = 310

but the functions smoothZoomAbs and smoothMoveTo seam ill fit since they do not operate together and smoothZoomAbs does zoom according to screen coordinates.

How could I accomplish this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Timo-Weikecommented, Nov 26, 2020

@attilam I will try to commit my changes into a fork or new branch this weekend. But I can’t promise it.

But besides the call to cancelAllAnimations(); the version of smoothShowRectangle in my third post should be a drop-in into the index.js file with minor changes in the api object and the index.d.ts file.

1reaction
Aerobrakingcommented, Aug 15, 2021

Can we exepect that the #221 will be merged into the master branch? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

svg-pan-zoom pan/zoom to any object - Stack Overflow
getSizes() and the center of the target element's client bounding rectangle. Now the issue is trying to make an animated zoom.
Read more >
Developers - Smooth zooming and moveing to a bounding box in svg -
I have a svg graphic and upon an event I want to move and zoom smoothly to a specific bounding box. Lets say...
Read more >
Zoom to Bounding Box / D3 - Observable
Pan and zoom, or click to zoom into a particular state using zoom.transform transitions. The bounding box is computed using path.bounds.
Read more >
Proposals/Performance in panning & zooming - SVG
R1: Smooth start of panning & zooming. R2: Smooth transition during panning & zooming. R3: Crisp view after finishing panning & zooming ......
Read more >
How to blend objects in Illustrator - Adobe Support
Example of using a blend to distribute color smoothly between two objects ... distance between the bounding box edges of the two objects....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found