]> granicus.if.org Git - graphviz/commitdiff
Add documentation for SVG class attribute
authorMark Hansen <mark@markhansen.co.nz>
Thu, 21 May 2020 07:44:17 +0000 (17:44 +1000)
committerMark Hansen <mark@markhansen.co.nz>
Thu, 21 May 2020 07:44:17 +0000 (17:44 +1000)
This was introduced in 2015 in be2d19fb48, but wasn't documented.

doc/infosrc/attrs

index 091234aa1b67e85b50f27ce42978df5b6aec9154..13fd5d9cd14bf78d43f31dc45649a4ae9f0c5e89 100644 (file)
@@ -155,6 +155,25 @@ equivalently,
 <TT>"Latin1"</TT>. The <B>charset</B> attribute is case-insensitive.
 Note that if the character encoding used in the input does not
 match the <B>charset</B> value, the resulting output may be very strange.
+:class:ENCG:string:"":;svg
+Classnames to attach to the node, edge, graph, or cluster's SVG element.
+Combine with <a href="#d:stylesheet">stylesheet</a> for styling SVG output
+using CSS classnames.
+<p>
+Multiple space-separated classes are supported.
+<p>
+<pre>
+digraph G {
+  graph [class="cats"];
+
+  subgraph cluster_big {
+    graph [class="big_cats"];
+
+    "Lion" [class="yellow social"];
+    "Snow Leopard" [class="white solitary"];
+  };
+}
+</pre>
 :clusterrank:G:clusterMode:local;  dot
 Mode used for handling clusters. If <B>clusterrank</B> is "local", a
 subgraph whose name begins with "cluster" is given special treatment.
@@ -1337,7 +1356,8 @@ making all edges invisible, a specific edge can overrride this via:
 <P>
 Of course, the component can also explicitly set its <TT>style</TT> attribute to the desired value.
 :stylesheet:G:string:"";  svg
-A URL or pathname specifying an XML style sheet, used in SVG output.
+A URL or pathname specifying an XML style sheet, used in SVG output. Combine
+with <a href="#d:class">class</a> to style elements using CSS selectors.
 :tailURL:E:escString:""; map,svg
 If <B>tailURL</B> is defined, it is
 output as part of the tail label of the edge.