Comments (9)
You need to reapply the plugin.
from snap.svg.zpd.
Hi @GAZ082,
the plugin works by putting all elements in your svg into a separate group (a g-element) and applying all transformations to the elements in this group.
Hence it should work as expected if you add the new elements to the zpd group instead of the svg-element
from snap.svg.zpd.
cool @tikiatua ! Your graph is very understandable and clear.
Seems this question is already being asked for several times.
Should we add this graph to the README?
This graph should be highlighted.
from snap.svg.zpd.
Hi @huei90, thanks for the praise - and good idea.
It would probably help people to understand the inner working of the plugin a little better.
from snap.svg.zpd.
@tikiatua
Help yourself to highlight them 😄
from snap.svg.zpd.
Why this is not working then. The only way i found to make it work is loading zpd inside the onSVGload function:
var paper = Snap('#svg');
var image = Snap.load("image.svg", onSVGloaded);
function onSVGloaded(data) {
paper.append(data);
}
paper.zpd();
Nor this:
var paper = Snap('#map');
var options = {
zoomScale: 2,
zoomThreshold: [0.2, 2]
};
var group2 = paper.group(paper.circle(20, 20, 20), paper.circle(50, 50, 50));
group2.zpd(options);
This works:
var paper = Snap('#svg');
var image = Snap.load("image.svg", onSVGloaded);
function onSVGloaded(data) {
paper.append(data);
paper.zpd();
}
from snap.svg.zpd.
Snap.load
is ajax call,
you should use the third example you gave.
from snap.svg.zpd.
Mmm, thank you. Now I'll go to annoy the Google Groups with a question related to this. Hehe.
Issue closed!
from snap.svg.zpd.
🍻
from snap.svg.zpd.
Related Issues (20)
- Zoom and Pan at the same time? HOT 1
- Chrome 48 removes SVGGraphicsElement.getTransformToElement() HOT 6
- 'SVGElement.offsetParent' is deprecated HOT 5
- Zoom to element help HOT 1
- Zoom behaviors in demo 1 and 2 aren't working HOT 2
- zoom on SVG document with offset position HOT 1
- [LIMITED the POWER] This usually use on present view only. NOT for the purpose of Storing or Modifying the paper.
- _getEventPoint() using clientX/clientY HOT 5
- bower install snap.svg.zpd --save installs old version HOT 5
- load: not working HOT 6
- new feature: limit pan directions HOT 4
- wheel events no longer working in chrome/opera/firefox in the presence of both a touch pad and a mouse HOT 5
- onClick not working in Ionic IOS HOT 4
- Implemented a new feature: pan/drag in boundaries
- zpd prevent others elements to fire onblur events HOT 1
- plugin on npm is not up to date
- how to use this plugin with typescript and snapsvg-cjs HOT 2
- zoomThreshold not working
- e2e test spec
- paper.zpd('origin') only resets zoom level, not position
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.svg.zpd.