-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Ability to use SVG.js from inside an SVG document #19
Comments
This hack will let the library create a SVG element inside the initial SVG doc. Ideally the document root should become the SVG object used by the lib. the "dirty" fix:
|
I'm not quite sure what you want to achieve. If it is an svg document inside the parent svg document you can use the var draw = SVG('canvas')
var svg = draw.nested() |
Yes.. this is because github does not let me post all the code correctly :| I will try to explain: I have a file1.svg that points to svg.js lib (there is no HTML here) <script src="js/svg.js" type="text/javascript" charset="utf-8"></script> of course the SVG DOM does not work the same as HTML DOM and you don't need to create the root element. In SVG it already exists and I would like to use the extant. |
Ok, I can see now what you are getting at. |
Can you send me an example of your setup to my email address (in my profile). Then I can fiddle with it. |
v.0.12 addresses this. |
This feature is described here: |
It would be nice to have SVG.js able to work from inside the SVG. In this case you could build your SVG editor as a SVG document and achieve from the very beginning resolution independency.
If this has been done already, needs documenting. For now I get
"Uncaught TypeError: Cannot set property 'cssText' of null svg.min.js:2
SVG.Doc.stage svg.min.js:2
SVG.Doc svg.min.js:2
SVG svg.min.js:2
(anonymous function)"
sorry. the code has more text, but gitbub's MD does not want to show it...
The text was updated successfully, but these errors were encountered: