Hacker News new | ask | show | jobs
by ditdatdave 3230 days ago
Is it possible to attach id's and other custom attributes to shapes and have them preserved when exporting to SVG ? This would make the output a lot easier to use in downstream applications.
1 comments

Currently, there's no mechanism to do that. However, I'm intrigued -- can you explain more about the use case you're thinking of?
We use SVG diagrams as the basis of numerous displays in our system. From basic navigation controls (we draw a 'curated' subset of a complex hierarchy) to some relatively static dashboards. We often want to enrich those diagrams to add basic interactivity (do something when particular section is clicked, modify the style of elements based upon an external property etc). This job s made far simpler if we can add additional data to the nodes in the diagram itself. Visio sort of supports it through custom properties but they are clunky to use and parse.