pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Is it possible to prevent panning and generally interacting with the Svelvet canvas?

Open metroite opened this issue 2 years ago • 1 comments

When there is a Svelvet canvas on the website, that canvas prevents the default behaiviour of scrolling with mouse wheel and instead zooms out in the canvas which are both undesirable. Is it possible to prevent every interaction with a Svelvet canvas and instead use the standard initial view set by the developer (possibly set to fitView)?

metroite avatar Oct 18 '23 18:10 metroite

I have the same requirement. The Svelvet component has a fixedZoom property that prevents zoom. It's not in the documentation, and I've opened a request to update documentation: https://github.com/open-source-labs/Svelvet/pull/482

To prevent pan, I've tried two methods - adding css style pointer-events: none to the parent div, and adding an overlay component with high z-index on top of the canvas. Both don't seem to have an effect on the panning. It does seem v6 has a method to disable pan

If the canvas is optional, take a look at https://anseki.github.io/leader-line/

jagwarrx avatar Oct 26 '23 22:10 jagwarrx