Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

How to add svg element into a certain position #117

Description

@daphna-kaplan

I am new to dealing with creating dynamic svg files so maybe it's obvious.
I have different drawings that I add paths to by:

dwg = svgwrite.Drawing(filename=save_path)
dwg.viewbox(width=view_width, height=view_height)
path = svgwrite.path.Path(p)
dwg.add(path)

I now need to "merge" the different drawing into one, where they are stacked one on top of the other (in the Y axis)
I can't find the right way to do so.

Any help is appreciated.

Activity

  1. rawlins commented on Sep 24, 2023

    @rawlins

    If you haven't resolved this issue, you might get some mileage out of looking at how classes in the svgling.figure package combines multiple svgwrite elements: e.g. https://github.com/rawlins/svgling/blob/a19669d1b2f3c5d5b45248132f7a0438076a561b/svgling/figure.py#L57

    That is, I think if you use something like the svgling.figure.SideBySide.get_svg code without adjusting the x coord, you would get almost exactly what you want. (Most of the infrastructure is ignorable for your purposes, that function is dealing with svgwrite elements.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions