Coder Social home page Coder Social logo

disable pan and zoom about svg.panzoom.js HOT 11 CLOSED

svgdotjs avatar svgdotjs commented on June 3, 2024
disable pan and zoom

from svg.panzoom.js.

Comments (11)

nkpdn avatar nkpdn commented on June 3, 2024

For particular functionality I need to disable pan.

from svg.panzoom.js.

Fuzzyma avatar Fuzzyma commented on June 3, 2024

Please create a jsfiddle showing your issue. I looked into the code and cannot find a way this issue can happen

from svg.panzoom.js.

nkpdn avatar nkpdn commented on June 3, 2024

https://jsfiddle.net/nkpd/pqa97L1m/24/

Here is the example,
if I call "draw.panZoom(false)" in line number 34(in setTime out function) it will works , but when I call in line number 15( i.e on panEnd function) it will not disable pan.

from svg.panzoom.js.

Fuzzyma avatar Fuzzyma commented on June 3, 2024

https://github.com/svgdotjs/svg.panzoom.js/blob/master/src/svg.panzoom.js#L137

Move that line down so it sits at the end of the body of the function. It should work now. Please report back.

from svg.panzoom.js.

nkpdn avatar nkpdn commented on June 3, 2024

Thank you.

from svg.panzoom.js.

nkpdn avatar nkpdn commented on June 3, 2024

But this is not working

from svg.panzoom.js.

Fuzzyma avatar Fuzzyma commented on June 3, 2024

Just tried it, it worked

from svg.panzoom.js.

nkpdn avatar nkpdn commented on June 3, 2024

Yup, its working. Thank you and I have one more question -> How enable any one functionality like enable only zooming not panning.?

from svg.panzoom.js.

Fuzzyma avatar Fuzzyma commented on June 3, 2024

There is no function like this atm. You would need to register or unregister the events yourself

from svg.panzoom.js.

nkpdn avatar nkpdn commented on June 3, 2024

Thanks a lot.

from svg.panzoom.js.

Fuzzyma avatar Fuzzyma commented on June 3, 2024

Feel free to make this little change a PR. I think its useful for other peoples, too

from svg.panzoom.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.