owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

✨ (grapher) improve SVG output for manual manipulation

Open sophiamersmann opened this issue 9 months ago • 2 comments

Resolves #3607

Adds labels to SVG groups and elements for more intuitive manual inspection and manipulation.

Figma displays an element's ID as its title. I researched if there is a way to customize this and show something else as an element's title, e.g. a data-name attribute or so, but I couldn't find anything. Since it's a bit odd to assign IDs to elements like that, I added a makeIdForHumanConsumption function that communicates that these IDs are for human inspection only and are not used in code, thus can be safely deleted.

I also made an effort to groups elements together, e.g. a tick's line and label is rendered into one group element.

PS: I also fixed this annoyance 👇🏻

Screenshot 2024-05-21 at 11 27 08
Figma screenshot Screenshot 2024-05-21 at 11 18 46

sophiamersmann avatar May 21 '24 08:05 sophiamersmann