SVG
SVG copied to clipboard
Modifying SvgElement attributes
There appears to be no simple way to change attribute values, remove an attribute, nor add an attribute for an SvgElement because its attribute collection is private and the access methods that involve the collection are either protected or internal or both. How can I do this without forking the code?
This is also related to #270. I think there is indeed no easy way to do this (I could be wrong, of course), so the fastest way is probably creating a PR that implements that....
@dee-fee If you are loading the SVG from an XML document you could consider doing the transformations on the XML before generating the SVG. I had to do this in the past (doing manipulation in a template to render chart-like output) and created a set of helper function to get specific XML elements by ID, class or other identifier (like certain attributes) and manipulate them (or remove them from the XML), before generating the SVG based on the XML.
Since the SVG is basically an XML it could be possible to add some additional functions to the library to further manipulate the XML that forms the SVG. This however might be something to think about on architectural level since exposing and allowing further manipulation is something that might affect the library in various ways.
Edit: I misread the thread a bit, I thought that manipulation was not possible at all, but there seems to be some options for manipulation.
Any information on this? There are certain standard attributes (i.e. href) that would be very useful to modify in this model and not have to change it all over to Xml.
What do you expect from this issue ?
Even in the current interface, adding and updating are possible from each property.
Although there is no deletion(reset to initial value).