svg_utils
svg_utils copied to clipboard
Unique ids
Hi,
I tried to put a collection of svg in a single figure and ran into problems with elements with same ids in the different files. This problem caused all kind of strange artifacts in the resulting SVG file. I fixed it by adding a unique prefix to every id attribute in the fromfile function.
/Henrik
Thanks for the PR. Your solution looks mostly fine, but there are some small problem. Since it is a bigger PR, it would be cool to have a unit test.
this PR has been stalled for some time, it need rebasing (that is making up-to-date with the version on master) and fixing the issues in the comments.
My impression is that this pull request is "not fully supported" any more. The problem it tries to solve is an important one, though, I think. I have run into the issue myself before and my workaround was to rename IDs manually, where it was needed: That approach doesn't scale well.
@btel if we pretended that we had no suggested implementation yet at all, what would be your requirements about any implementation other than being covered by tests? Can you share what comes to mind on that topic?
yes, i think the idea is very good. The main requirement is that we find and replace all possible instances of the id and its referrers. We could either prefix them or change them to something unique like uuid.
My impression is that this pull request is "not fully supported" any more. The problem it tries to solve is an important one, though, I think. I have run into the issue myself before and my workaround was to rename IDs manually, where it was needed: That approach doesn't scale well.
I just wanted to add, that I had the exact same issue and also ended up sed-ing .svg files. So any work on this is very much appreciated =) Thanks alot!