-
Notifications
You must be signed in to change notification settings - Fork 75
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
Any way to create group inside svg #243
Comments
@psicomante May I ask if there is any specific reason why this must be done? Typically, the details inside an SVG are managed by the svgcanvas library. Manually modifying them could potentially create issues. |
@zenozeng personally I would love to be able to create groups (and specify their id) since that is the way to set a rendering order and visibility when sending plots to my axidraw. |
@zenozeng i know this approach could lead to severe issues, but if I use a single group my plot ideas cannot be plotted in any way. maybe I could create a new method exposing this approach and write some tests? Do you know any specific issues this approach is creating? thanks |
@psicomante @bkuri I now understand your scenario and there may be a new API in future versions to specify the group. Currently, there is no particularly good and safe way to specify where the next drawing should occur within a group, and it may also require modifications to the implementation details of svgcanvas. |
@bkuri @psicomante I share your goal, but solved it a different (maybe bit cumbersome) way: I keep an array of Graphics objects as a sort of layers, and assign parts of my drawing to different layers. When I save my file, I save every Graphics layer separately, and clear the canvas in between. This way I can plot each layer as a separate svg (or as different layers in Inkscape). I wrote a LayerManager class that does this stuff:
I use th layer manager in a sketch like this:
Let me know if this works for you. |
Hello everybody,
I would like to easily add a SVG Group during drawing, I found the following method:
where P5 is the global P5 instance or the P5 imported using Typescript or modules:
Any better way is available?
Thanks
The text was updated successfully, but these errors were encountered: