dimanche 4 janvier 2015

Wrap existing SVG elements using the svg.js library


How can I wrap existing <svg> element in svg.js?


For example:



<svg>
<circle r="10" cx="10" cy="10" fill="red"></circle>
</svg>


I know this can be built with svg.js very easy, but I take it as example for my question.



var existingSvg = Svg.<some-method>(document.querySelector("svg"));
existingSvg.children(); // circle


How can I do this?


I tried using SVG('<id-ofsvg-element>'), but children() returns an empty array.





Aucun commentaire:

Enregistrer un commentaire