This repository has been archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
example.dot
108 lines (84 loc) · 3.02 KB
/
example.dot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
digraph ClassDiagram {
#//////////////////////////////// Introduction \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/*
This graph is meant as a starting point to help you create UML Class
Diagrams by providing a preset for edges and nodes.
To use it, you need to take the folowing steps:
- Copy and paste (or "save as") this graph into a new file
- Rename the relevant labels (anything with the word "Example" in it).
- Add nodes (inside subgraphs when needed)
- Add connections for the nodes
Make sure you place your connections under the right headers, otherwise the
decoration won't match the UML specifications.
For each module you should use a separate subgraph. Make sure the name of
your subgraph starts with `cluster_`
If you don't like the colors, the easiest way to ammend this is by changing
the defined colorscheme (currently "pastel13") in the "General Styles"
section to any other 3-scheme. All available colorschemes can be found at
http://www.graphviz.org/doc/info/colors.html#brewer
*/
#/////////////////////////////// General Styles \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
graph [
label = "Example \n Class Diagram"
labelloc = t
//dpi = 200
ranksep=0.65
nodesep=0.40
rankdir=BT
bgcolor="#FFFFDD"
style="dotted, filled"
fillcolor="#FFFFFF"
]
edge [arrowhead=none]
node [
labeljust="l"
colorscheme="pastel13"
style=filled
fillcolor=3
shape=record
]
#/////////////////////////////////// Legend \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
subgraph cluster_legend {
label = "Legend"
style="solid"
ranksep=0.05
nodesep=0.01
labelloc = b
len=0
class [label="Class", fillcolor=3]
abstract [label="Abstract", fillcolor=2]
interface [label="Interface", fillcolor=1]
class -> abstract -> interface [style="invis"]
}
#/////////////////////////// Sub Graphs and Clusters \\\\\\\\\\\\\\\\\\\\\\\\\\\
subgraph cluster_ExampleModule {
label = "Example Module"
{// Interface
node [style=filled, fillcolor=1]
ExampleInterface [label="{«interface»\nExampleInterface|properties|methods}"]
}
{// Abstracts
node [fillcolor=2]
AbstractExample
}
// Concrete Classes
ExampleFoo
ExampleBar
ExampleBaz
}
#//////////////////////////////// Connections \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
{// Implements
edge [arrowhead=empty, style=dashed]
AbstractExample -> ExampleInterface
ExampleFoo -> AbstractExample
}
{// Extends
edge [arrowhead=empty]
// -------------------------------------------------------------------------
ExampleBar -> ExampleFoo
}
{// Composits
edge [arrowtail=diamond, arrowhead=none]
ExampleBar -> ExampleBaz
}
}//ClassDiagram