svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

How to import and use .svg file #1195

Closed pyuyu closed 3 years ago

pyuyu commented 3 years ago

How to import and manipulate and svg file ? I tried the following code to use an .svg file

 let use  = draw.use('shape1', '/public/svg/test.svg').move(0,0).size(100, 100)

and the /public/svg/test.svg is accessible however, it didn't work What if i want to import svg file and use it?

Fuzzyma commented 3 years ago

For questions please refer to stackoverflow. This is an issue tracker. To manipulate svgs you have to load them into the accessible dom somehow. The use element doesn't do that

pyuyu commented 3 years ago

For questions please refer to stackoverflow. This is an issue tracker. To manipulate svgs you have to load them into the accessible dom somehow. The use element doesn't do that

thanks!