-
Notifications
You must be signed in to change notification settings - Fork 206
/
Copy pathindex.html
305 lines (253 loc) · 10 KB
/
index.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A tool for drawing sassy UML diagrams based on syntax. Provides instant feedback and has a customizable styling.">
<title>nomnoml</title>
<link rel="stylesheet" href="codemirror/codemirror.css">
<link rel="stylesheet" href="codemirror/solarized.nomnoml.css">
<link rel="stylesheet" href="nomnoml.css?v=1">
<link rel="shortcut icon" href="favicon.png">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.nomnoml.com">
<meta property="og:title" content="Nomnoml">
<meta property="og:description" content="A tool for drawing diagrams based on syntax. Supercharge your boxes and arrows.">
<meta property="og:image" content="https://www.nomnoml.com/img/example.png">
</head>
<body>
<div class="wrap">
<canvas id="canvas"></canvas>
<textarea id="textarea" spellcheck="false"></textarea>
<div id="linenumbers"></div>
<div id="canvas-panner">
<div canvas-tools></div>
</div>
<div id="reference" class="sidebar">
<div class="content">
<h2>Association types</h2>
<b>association</b> -<br>
<b>association</b> -><br>
<b>association</b> <-><br>
<b>dependency</b> --><br>
<b>dependency</b> <--><br>
<b>generalization</b> -:><br>
<b>implementation</b> --:><br>
<b>composition</b> +-<br>
<b>composition</b> +-><br>
<b>aggregation</b> o-<br>
<b>aggregation</b> o-><br>
<b>ball and socket</b> -o)<br>
<b>ball and socket</b> o<-)<br>
<b>ball and socket</b> ->o<br>
<b>note</b> --<br>
<b>hidden</b> -/-<br>
<h2>Class diagram types</h2>
<pre append-nomnoml-preview>[class]</pre>
<pre append-nomnoml-preview>[<abstract> abstract]</pre>
<pre append-nomnoml-preview>[<instance> instance]</pre>
<pre append-nomnoml-preview>[<reference> reference]</pre>
<pre append-nomnoml-preview>[<package> package|components]</pre>
<pre append-nomnoml-preview>[<frame> frame|]</pre>
<h2>Component diagram types</h2>
<pre append-nomnoml-preview>[Component] - [<socket> socket]</pre>
<pre append-nomnoml-preview>[<lollipop> lollipop] - [Component]</pre>
<h2>Flow chart types</h2>
<pre append-nomnoml-preview>[<start> start]</pre>
<pre append-nomnoml-preview>[<end> end]</pre>
<pre append-nomnoml-preview>[<state> state]</pre>
<pre append-nomnoml-preview>[<choice> choice]</pre>
<pre append-nomnoml-preview>[<sync> sync]</pre>
<pre append-nomnoml-preview>[<input> input]</pre>
<pre append-nomnoml-preview>[<sender> sender]</pre>
<pre append-nomnoml-preview>[<receiver> receiver]</pre>
<pre append-nomnoml-preview>[<transceiver> transceiver]</pre>
<h2>Use case types</h2>
<pre append-nomnoml-preview>[<actor> actor]</pre>
<pre append-nomnoml-preview>[<usecase> usecase]</pre>
<h2>Miscalleneous types</h2>
<pre append-nomnoml-preview>[<note> note]</pre>
<pre append-nomnoml-preview>[<label> label]</pre>
<pre append-nomnoml-preview>[<hidden> hidden]</pre>
<pre append-nomnoml-preview>[<database> database]</pre>
<pre append-nomnoml-preview>[<pipe> pipe]</pre>
<pre append-nomnoml-preview>[<table> table| a | 5 || b | 7]</pre>
<h2>Comments</h2>
Comments are supported at the start of a line
<pre append-nomnoml-preview>//[commented]
[not //commented]</pre>
<h2>Id attribute</h2>
Two distinct nodes can have the same display name with the id attribute.
<pre append-nomnoml-preview>[<actor id=a>User]
[<actor id=b>User]
[a] -- [b]</pre>
<h2>Directives</h2>
#import: filename<br>
#arrowSize: 1<br>
#bendSize: 0.3<br>
#direction: down | right<br>
#gutter: 5<br>
#edgeMargin: 0<br>
#gravity: 1<br>
#edges: hard | rounded<br>
#background: transparent<br>
#fill: #eee8d5; #fdf6e3<br>
#fillArrows: false<br>
#font: Calibri<br>
#fontSize: 12<br>
#leading: 1.35<br>
#lineWidth: 3<br>
#padding: 8<br>
#spacing: 40<br>
#stroke: #33322E<br>
#title: filename<br>
#zoom: 1<br>
#acyclicer: greedy<br>
#ranker: network-simplex | tight-tree | longest-path<br>
<h2>Custom classifier styles</h2>
<p>A directive that starts with "." define a classifier style. The style is written as a space separated list of modifiers and key/value pairs.</p>
<pre append-nomnoml-preview>#.box: fill=#8f8 dashed
#.blob: visual=ellipse title=bold
[<box> GreenBox]
[<blob> Blobby]</pre>
<h3>Modifiers</h3>
dashed<br>
<h3>Key/value pairs</h3>
fill=(any css color)<br><br>
stroke=(any css color)<br><br>
align=center<br>
align=left<br><br>
direction=right<br>
direction=down<br><br>
visual=actor<br>
visual=class<br>
visual=database<br>
visual=ellipse<br>
visual=end<br>
visual=frame<br>
visual=hidden<br>
visual=input<br>
visual=none<br>
visual=note<br>
visual=package<br>
visual=pipe<br>
visual=receiver<br>
visual=rhomb<br>
visual=roundrect<br>
visual=sender<br>
visual=start<br>
visual=sync<br>
visual=table<br>
visual=transceiver<br>
<h3>Style title and text body</h3>
title=left,italic,bold<br>
body=center,italic,bold<br>
<h3>Text modifiers</h3>
bold<br>
center<br>
italic<br>
left<br>
underline<br>
</div>
</div>
<div id="about" class="sidebar">
<div class="content">
<h2>Welcome to nomnoml</h2>
<p>A tool for drawing UML diagrams based on a simple syntax.
<p>Try and edit the code on the left and watch the diagram change. Any changes are saved to the browser's <i>localStorage</i>, so your diagram should be here the next time, (but no guarantees).</p>
<p>Created by <a href="mailto:[email protected]">Daniel Kallin</a> and hosted on <a href="https://github.com/skanaar/nomnoml" rel="noopener" target="_blank">GitHub</a> for your perusal.</p>
<h2>Interaction</h2>
<p>The canvas can be panned and zoomed by dragging and scrolling in the right hand third of the canvas.
</p>
<img src="img/interaction-tutorial.svg" alt="interaction tutorial">
<p>The editor supports a subset of <i>Sublime Text's</i> <a href="https://codemirror.net/demo/sublime.html" rel="noopener" target="_blank">keymappings</a>.
</p>
<h2>Usage</h2>
<h3>Car has an Engine</h3>
<pre append-nomnoml-preview>[Car]->[Engine]</pre>
<h3>Car owns an arbitrary number of blemished</h3>
<pre append-nomnoml-preview>[Car] +-> 0..* [RustPatch]</pre>
<h3>Car knows its Manufacturer and is the parent of Pickup</h3>
<pre append-nomnoml-preview>[Car]o->[Manufacturer]
[Car]<:-[Pickup]</pre>
<h3>Car has some attributes</h3>
<pre append-nomnoml-preview>[Car|speed: Number;valves: Valve\[\] ]</pre>
<h3>Engine has an operation</h3>
<pre append-nomnoml-preview>[Engine||start()]</pre>
<h3>Engine has internal parts</h3>
<pre append-nomnoml-preview>[Engine|
[Cylinder]->1[Piston]
[Cylinder]->2[Valve]
]</pre>
<h3>Engine depends on components</h3>
<pre append-nomnoml-preview>[Engine] - [<socket>Tank]
[Tank] -->o [Big Fuel Tank]
</pre>
<h3>Set font</h3>
<pre append-nomnoml-preview>#font: Times
Text with serifs
</pre>
<h3>Layout the diagram really tight</h3>
<pre append-nomnoml-preview>#fontSize: 8
#spacing: 12
#padding: 3
[Lorem ipsum]-[dolor sit amet]</pre>
<h3>Tables</h3>
<pre append-nomnoml-preview>[<table>Fruits|
Apples | 17 ||
Oranges | 4711
]</pre>
<h3>Create your own styles</h3>
<pre append-nomnoml-preview>#.box: fill=#8f8 dashed
[<box> GreenBox]</pre>
<h3>Divide into multiple files</h3>
<pre publish-as-file="blobby_styles">#.blob: fill=pink</pre>
<pre append-nomnoml-preview>#import: blobby_styles
[<blob> Blobby]</pre>
</div>
</div>
<div id="export" class="sidebar">
<div class="content" export-menu></div>
</div>
<div id="files" class="sidebar">
<div class="content" file-menu></div>
</div>
<div menu>
<div class="tools">
<a class="logo"><h1>nomnoml</h1> </a>
<a href="javascript:app.discardCurrentGraph()" title="Discard this diagram">
<svg width="24" height="24" viewBox="0 0 24 24">
<path d="M18 7h-1v-1c0-1.1-.8-2-2-2h-7c-1.1 0-2 .8-2 2v1h-1c-.5 0-1 .4-1 1s.4 1 1 1v8c0 2.2 1.7 4 4 4h5c2.2 0 4-1.7 4-4v-8c.5 0 1-.4 1-1s-.4-1-1-1zm-10-1h7v1h-7v-1zm8 11c0 1.1-.8 2-2 2h-5c-1.1 0-2-.8-2-2v-8h9v8zM8.5 10.5c-.2 0-.5.2-.5.5v6c0 .2.2.5.5.5s.5-.2.5-.5v-6c0-.2-.2-.5-.5-.5zM10.5 10.5c-.2 0-.5.2-.5.5v6c0 .2.2.5.5.5s.5-.2.5-.5v-6c0-.2-.2-.5-.5-.5zM12.5 10.5c-.2 0-.5.2-.5.5v6c0 .2.2.5.5.5s.5-.2.5-.5v-6c0-.2-.2-.5-.5-.5zM14.5 10.5c-.2 0-.5.2-.5.5v6c0 .2.2.5.5.5s.5-.2.5-.5v-6c0-.2-.2-.5-.5-.5z"/>
</svg>
</a>
</div>
</div>
</div>
<!--div class=alert-list daily-tip></div-->
<script type="text/vnd.nomnoml.class" id="defaultGraph">[<start>start] -> [<state>plunder] -> [<choice>more loot] -> [start]
[more loot] no ->[<end>e]
[Pirate|
[beard]--[parrot]
[beard]-:>[foul mouth]
]
[<table>mischief| bawl | sing || yell | drink ]
[<abstract>Marauder]<:--[Pirate]
[Pirate] - 0..7[mischief]
[<actor id=sailor>Jolly;Sailor]
[sailor]->[Pirate]
[sailor]->[rum]
[Pirate]-> *[rum|tastiness: Int|swig()]
</script>
<script src="codemirror/codemirror-compressed.js"></script>
<script src="codemirror/nomnoml.codemirror-mode.js"></script>
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/[email protected]/dist/jszip.min.js"></script>
<script src="dist/webapp.js"></script>
<script>
WebApp.bootstrap(CodeMirror)
</script>
<script src="additionals.js"></script>
</body>
</html>