svg_utils icon indicating copy to clipboard operation
svg_utils copied to clipboard

Unique ids

Open henjo opened this issue 11 years ago • 5 comments

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

henjo avatar Sep 26 '13 06:09 henjo

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.

btel avatar Sep 27 '13 16:09 btel

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.

btel avatar Oct 01 '20 11:10 btel

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?

hartwork avatar Feb 11 '21 13:02 hartwork

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.

btel avatar Feb 11 '21 13:02 btel

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!

Leonard-Reuter avatar Jun 25 '21 10:06 Leonard-Reuter