Description
What is the feature or improvement you would like to see?
Graphs can currently support arbitrary attributes on each vertex and edge. Furthermore, graphs written to some external file formats (such as GraphViz .dot) support attaching id
and class
and other SVG attributes. But iGraph's SVG writer drops these attributes.
Preserving attributes, primarily, class
, in SVG output would allow users to export their network plots with metadata that allows interactive styling in browsers (or perhaps other applications). Just preserving the class
and related attributes opens up the possibility of CSS and JavaScript manipulation of vertices and edges without requiring additional work within the iGraph library itself.
Use cases for the feature
One of the major benefits of SVG output is that it permits on-the-fly styling of network elements via CSS. Such as highlighting edges with a particular attribute in their class
.
Notably, GraphViz already supports this, and GraphViz-exported SVGs can be controlled in-browser with styling tools. E.g., "bolding" the edges connecting some subset of vertices or changing the color of some vertex, just by using CSS rules and a .class
selector
References
This is standard CSS; nothing out of the ordinary.