Git Product home page Git Product logo

Comments (9)

hueitan avatar hueitan commented on May 23, 2024

You need to reapply the plugin.

from snap.svg.zpd.

tikiatua avatar tikiatua commented on May 23, 2024

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

snap svg zpd

from snap.svg.zpd.

hueitan avatar hueitan commented on May 23, 2024

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.

tikiatua avatar tikiatua commented on May 23, 2024

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.

hueitan avatar hueitan commented on May 23, 2024

@tikiatua
Help yourself to highlight them 😄

from snap.svg.zpd.

GAZ082 avatar GAZ082 commented on May 23, 2024

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.

hueitan avatar hueitan commented on May 23, 2024

Snap.load is ajax call,
you should use the third example you gave.

from snap.svg.zpd.

GAZ082 avatar GAZ082 commented on May 23, 2024

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.

hueitan avatar hueitan commented on May 23, 2024

🍻

from snap.svg.zpd.

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.