From f820cd6714547203413b5d17080681fe51580aab Mon Sep 17 00:00:00 2001 From: knsv Date: Sat, 26 Sep 2015 18:33:17 +0200 Subject: [PATCH] Fix for issue #210, classDef broken also added some documentation on how to predefine classes in the css and set them from the graph definition. --- index.html | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index c71f62bdf1..b837ed634f 100644 --- a/index.html +++ b/index.html @@ -449,11 +449,27 @@ id1(Start)-->id2(Stop) style id1 fill:#f9f,stroke:#333,stroke-width:4px style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5

Classes

-

More convenient then defining the style everytime is to define a class of styles and attach this class to the nodes that
should have a different look.

+

More convenient then defining the style every time is to define a class of styles and attach this class to the nodes that
should have a different look.

a class definition looks like the example below:

    classDef className fill:#f9f,stroke:#333,stroke-width:4px;

Attachment of a class to a node is done as per below:

    class nodeId1 className;

It is also possible to attach a class to a list of nodes in one statement:

-
    class nodeId1,nodeId2 className;

Default class

+
    class nodeId1,nodeId2 className;

Css classes

+

It is also possible to pre dine classes in css styles that can be applied from the graph definition as in the example
below:
Example style

+

Example definition

+
graph LR;
+    A-->B[AAABBB];
+    B-->D;
+    class A cssClass;
+ + + +

Default class

If a class is named default it will be assigned to all classes without specific class definitions.

    classDef default fill:#f9f,stroke:#333,stroke-width:4px;