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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
|
DESIGN-IT USER MANUAL
=====================
design-it is a fast diagram editor for software architecture: structs,
classes, interfaces, modules, services, storage, state machines and the
relationships between them. It is keyboard first (vim style) but
everything also works with the mouse. Diagrams are plain text files you
can keep in git.
This manual is built into the program. Open it any time with F1 or
:help, jump to a topic with :help <word> (for example :help edges, :help
keys, :help dsl). Scroll with j / k, the mouse wheel, Page Up / Page
Down.
CONTENTS
1. Getting started
2. Opening files and drag and drop
3. The workspace: panels, tabs and views
4. Modes and the command bar
5. Canvas: mouse
6. Canvas: keyboard
7. Tables: outline, inspector, edges, layers, ...
8. Panels and tabs: keyboard
9. Nodes: kinds, sections and members
10. Edges: kinds, creating, routing
11. Layout and alignment
12. Layers and focus mode
13. Saving and exporting
14. The .dit.txt text format
15. Scanning C / C++ code
16. All commands
17. Settings and color schemes
18. Command line options
19. Platform notes: Windows, macOS, Linux
20. Troubleshooting
1. GETTING STARTED
------------------
Start design-it with no arguments and it opens a showcase diagram. To
start from something else:
- drag a .dit / .dit.txt file onto the window (see 2)
- type :open path/to/file.dit.txt and press Enter
- type :tpl uml (or arch, ecs, microservices, compiler, stress)
- drag a source folder onto the window to scan its C / C++ headers
A first diagram in five steps:
1. press :clear Enter start empty
2. move the mouse onto the canvas,
press a add a node, type a name, Enter
3. press a again somewhere else a second node
4. right-drag from one node onto
the other connect them with an edge
5. :save my_design.dit.txt Enter save it as text
Press Escape to cancel anything (typing, a command, a selection).
Press u to undo and Ctrl+r (or Ctrl+z for undo) to redo.
2. OPENING FILES AND DRAG AND DROP
----------------------------------
Drag and drop works on every platform:
- drop a .dit or .dit.txt file on the window: it opens
- drop a folder: its C / C++ headers are scanned into a diagram (see
15)
- drop several files: the first one opens (one diagram at a time)
Opening replaces the current diagram, but it is undoable: press u to
get the previous diagram back.
Other ways to open:
design-it file.dit.txt from a terminal
:open file.dit.txt from the command bar (Tab completes)
double click / "Open With" on macOS with the design-it.app bundle
drop on the dock icon macOS, with the design-it.app bundle
File types:
.dit.txt readable text (recommended, diffable, editable by hand)
.dit compact binary snapshot, loads instantly, not for editing
3. THE WORKSPACE: PANELS, TABS AND VIEWS
----------------------------------------
The window is split into panels. Each panel holds tabs, each tab shows
a view. Every view follows the same selection: click a node on the
canvas and the outline, inspector and edges views jump to it.
Views (open any with :view <name>):
canvas the diagram. Open several, each has its own camera
outline tree of modules > nodes > sections > members
inspector every property of the selected node or edge, editable
edges table of all relationships
layers tags with node / edge counts, hide or dim them
palette add nodes by kind, load templates
source the live .dit.txt text of the diagram
views list of every view, Enter opens one
help this manual
appearance, colors, canvas, layout, behaviour, performance, info
settings groups (see 17)
frame, memory, heap, arenas, threads, process, gpu, fonts, diagram
built in profiler
Mouse:
drag a tab onto another panel's middle join that panel's tabs
drag a tab onto a panel's edge split the panel
drag the gap between panels resize
middle click a tab close it
double click the empty tab bar maximize the window
drag the empty tab bar move the window
:reset puts the default layout back.
4. MODES AND THE COMMAND BAR
----------------------------
The status bar (bottom left) shows the mode:
NORMAL keys are commands (this is where you are most of the time)
EDIT you are typing a name, label or value: Enter accepts,
Escape cancels
COMMAND after pressing : type a command, Tab completes, Enter runs
SEARCH after pressing / type to search, Enter jumps, n / N repeat
Commands can be shortened to any unique prefix and show completions as
you type. Section 16 lists all of them.
Counts: like vim, a number before a key repeats it. 5j moves down five
rows, 10l pans right ten steps.
5. CANVAS: MOUSE
----------------
Left click select a node or edge
Shift + left click add to / remove from the selection
Left drag on empty space box select
Left drag a node move it (snaps to the grid when snap is on,
shows alignment guides)
Drag the bottom right
corner of a node resize it
Double click a node rename it
Double click an edge edit its label
Right drag node to node create an edge (of the current edge tool, e)
Drag a port dot create an edge (port dots show on hover)
Middle drag, or right
drag on empty space pan
Scroll wheel zoom toward the cursor
Shift + wheel /
touchpad sideways pan horizontally
Minimap (bottom right) click or drag to jump around
[-] / [+] on a header collapse / expand that section or module
The floating inspector the card next to the selected node or edge
(see below): click a value to edit it in
place, click < > to change a choice
6. CANVAS: KEYBOARD
-------------------
h j k l / arrows pan (with a count: 5l)
H J K L nudge the selected node by one grid step
+ / - zoom in / out
0 zoom 100%
f fit the whole diagram
Z fit the selection
a add a node at the mouse and rename it
Enter step into the floating inspector (below)
i rename the node, or edit the selected edge's label
I floating inspector on / off
c collapse / expand the selected node
yy duplicate the selected node
dd / Delete delete the selection
u / Ctrl+r undo / redo (Ctrl+z also undoes)
e cycle the edge tool (-> ..> -|> ..|> *-> o-> ...)
r cycle default routing: orthogonal, straight, bezier
L automatic layout (layered)
F focus mode on / off (see 12)
G grid style: dots, lines, off
S snap to grid on / off
m minimap on / off
Tab select the next node and pan to it
/ search nodes, members, types and labels
: command bar
F1 this manual
The floating inspector is a small card next to the selected node or
edge. It holds the Inspector's everyday fields (name, kind,
stereotype, color, tag, note, sections and members) so you can edit
without leaving the canvas. It hides while you drag, when more than
one node is selected, and when the selection scrolls out of view.
Mouse click a value, member or section title to edit it in place;
< and > step a choice (kind, routing); + on a section adds a
member, x on a member deletes it; [-] collapses a section;
the x in the corner closes the card until you click the
node again. Clicking elsewhere keeps what you typed.
Keys Enter steps in from the canvas, then
j / k move
h / l change a choice, collapse / expand a section
Enter edit the value in place (Enter saves, Esc cancels)
a / A add a member / a section
dd, Delete delete the member or section
Esc / Tab back to the canvas
Turn it off for good with :set floating inspector=off (or :view canvas).
7. TABLES: OUTLINE, INSPECTOR, EDGES, LAYERS, ...
--------------------------------------------------
Every view except the canvas is a table with a row cursor.
j / k / arrows move the cursor
gg / G first / last row (5G goes to row 5)
Home / End first / last row
Page Up / Down one page
Ctrl+d / Ctrl+u half a page down / up
l / Right expand a tree row, or next value of a choice
h / Left collapse a tree row, or previous value of a choice
Enter / Space / o activate: edit a value, toggle, open
a inspector: add a member to the current section
A inspector: add a section
dd delete the row's item (member, section, node, edge)
drag a column
header reorder / resize columns (:columns shows hidden)
Inspector, for a node: name, kind, stereotype, border, accent color,
tag, note, geometry, collapsed, pinned, then its sections and members.
For an edge: relationship, routing, label, multiplicities, ports, tag,
color. Choice fields (kind, routing, ...) change with h / l.
8. PANELS AND TABS: KEYBOARD
----------------------------
Ctrl+h j k l focus the panel left / below / above / right
Ctrl+w h j k l same
Ctrl+w v split the panel vertically (same view, new tab)
Ctrl+w s split horizontally
Ctrl+w c close the focused tab
Ctrl+w = make all splits equal
gt / gT next / previous tab in the panel
Ctrl+Tab next tab anywhere (Ctrl+Shift+Tab: previous)
Ctrl+= / Ctrl+- bigger / smaller interface (Ctrl+0 resets)
:vs <view> split right with a view
:sp <view> split below with a view
9. NODES: KINDS, SECTIONS AND MEMBERS
-------------------------------------
Kind Looks like Use it for
struct card, accent bar data layouts, plain structs
class card, accent bar classes, managers, controllers
interface dashed border traits, protocols, interfaces
enum double accent bar enums, tagged unions, variants
module dashed frame around children packages, subsystems, processes
system accent header services, engines, threads
storage slab on top databases, queues, caches
state rounded pill state machine states, phases
note folded corner notes, decisions, legends
Change the kind any time: inspector, move to "kind", press h or l.
Sections are named boxes inside a node (fields, methods, ports,
memory, invariants: any name). A node can have any number of them.
Members are the lines in a section. Type them like this:
+ rect[4] : f32 [0x00]
| | | |
| name | badge (optional, shown as a pill)
| type (optional, after the colon)
visibility (optional): + public - private # protected
~ package @ port / event * bullet
Modules are containers: nodes inside a module move with it, and the
module grows to fit them. Collapse a module with [-] to hide its
children.
10. EDGES: KINDS, CREATING, ROUTING
-----------------------------------
Symbol Kind Means
-> association uses, references, calls
..> dependency weak / compile time dependency
-|> inheritance extends
..|> implements implements an interface
*-> composition owns (filled diamond at the owner)
o-> aggregation holds, shared (hollow diamond)
==> dataflow hot data path, stream (thick line)
~> async message, event, queue
<-> bidirectional two way
-- link undirected
Create: right-drag from a node onto another, or drag a port dot, or
:connect <key1> <key2>. The new edge uses the current edge tool (press
e to change it, the status bar shows edge:->).
Edit: select the edge, then the inspector shows relationship, label,
routing (auto / orthogonal / straight / bezier), multiplicities like 1
and 0..*, ports (north / south / east / west) and a tag.
:route ortho|straight|bezier sets the default routing for the diagram.
11. LAYOUT AND ALIGNMENT
------------------------
L layered layout (top to bottom)
:layout layered same
:layout lr layered, left to right (good for pipelines)
:layout force spring layout, untangles dense graphs
:layout grid simple grid
Select several nodes (shift click or box select), then:
:align left | right | top | bot | cx | cy line them up
:align dh | dv distribute evenly
Pinned nodes (inspector: pinned) are left alone by automatic layout.
12. LAYERS AND FOCUS MODE
-------------------------
Give nodes and edges a tag (inspector: tag, or tag= in the text
format). The layers view lists every tag with node / edge counts.
Enter on a tag hides it (and everything carrying it), Enter again
shows it.
Focus mode (F) dims everything that isn't within one hop of the
selected node. :set focus hops=2 widens it to two hops.
13. SAVING AND EXPORTING
------------------------
:save save to the opened file (or diagram.dit.txt)
:save name.dit.txt save as readable text
:save name.dit save as binary
:export name.svg export a vector image in the current colors
The format is chosen by extension: .dit is binary, anything else is
text. Exporting without a window: design-it file.dit.txt
--export-svg=out.svg
14. THE .dit.txt TEXT FORMAT
----------------------------
A diagram file is plain text. The source view always shows the text of
the current diagram, so the quickest way to learn it is to look there.
diagram "Task Queue" routing=orthogonal
module "Runtime" id=rt tag=core {
interface "Job" id=job stereo="<<interface>>" {
section "contract" {
+ run(ctx) : void [pure]
}
}
struct "JobQueue" id=queue {
note "lock free ring"
section "fields" {
+ head : atomic<u64> [0x00]
- slots : Job*[] [ring]
}
}
}
queue o-> job : "buffers" [1 -> 0..*]
rt ==> job : "runs" route=bezier tag=hot
Nodes: <kind> "<name>" [id=key] [stereo="text"] [tag=name]
[color=#RRGGBB] [x=N y=N] [w=N h=N] [collapsed=1] [{ body }]
Body: note "text", section "title" { members }, child nodes
Edges: <key> <symbol> <key> [: "label"] [[from -> to]]
[route=mode] [tag=x]
Comments start with # or //.
Leave out x= / y= and the diagram is laid out automatically when it
loads, which makes the format easy to generate from scripts.
15. SCANNING C / C++ CODE
-------------------------
:scan path/to/src, design-it --scan=path, or drop the folder on the
window.
Reads .h / .hpp files (four folder levels deep), skipping build,
protocols and node_modules. Every folder becomes a module; struct,
class and enum definitions become nodes with their fields; base
classes become inheritance edges, embedded fields composition edges
and pointer fields association edges, attached to the field's row. The
result is laid out automatically.
Tips: press F and click a struct to see only its neighborhood, hide
helper headers in the layers view, :save the result to keep your
changes.
16. ALL COMMANDS
----------------
:help [topic] this manual, jump to a topic
:open <file> open a .dit / .dit.txt (or scan a folder)
:save [file] save (.dit binary, otherwise text)
:export <file.svg> export an svg
:scan <file or folder> build a diagram from C / C++ headers
:tpl <name> arch ecs microservices compiler uml ...
:clear empty diagram
:add <kind> <name> add a node
:connect <key> <key> connect two nodes by key
:layout layered|lr|force|grid automatic layout
:align left|right|top|bot|cx|cy|dh|dv
:route ortho|straight|bezier default edge routing
:focus focus mode on / off
:fit fit the diagram in the canvas
:view <view> open or focus a view
:vs <view> / :sp <view> split right / below with a view
:set <name>=<value> change a setting (see 17)
:zoom <0.6 - 3> interface size
:columns show hidden table columns again
:reset default panel layout
:q quit (settings and layout are saved)
17. SETTINGS AND COLOR SCHEMES
------------------------------
Open a settings group as a view (:view appearance, colors, canvas,
layout, behaviour, performance) and edit with h / l / Enter, or set by
name:
:set color scheme=nord
:set grid style=lines
:set font=Built-in Sans
Color schemes: mono dark, mono light, amber, green phosphor, gruvbox,
nord, solarized, high contrast, custom (edit single colors in :view
colors).
Some settings: zoom, color scheme, text weight, font, bold font, mono
font, font size, small font size, grid style, grid size, snap to grid,
default routing, minimap, edge labels, node shadows, smart guides,
port handles, focus hops, row height, scroll smoothing, wheel lines,
double click, frame rate. "reset all settings" in :view info restores
the defaults.
Fonts: design-it carries its own fonts (Built-in Sans, Built-in Sans
Bold, Built-in Mono) and also lists the usual system fonts of your
platform.
Settings and the panel layout are saved when you quit, in:
Windows %APPDATA%\design-it\state.bin
macOS ~/Library/Application Support/design-it/state.bin
Linux ~/.local/share/design-it/state.bin ($XDG_DATA_HOME if set)
Delete that file to start over with defaults.
18. COMMAND LINE OPTIONS
------------------------
design-it [file.dit | file.dit.txt] [options]
--template=<name> start from a template (arch ecs microservices
compiler uml stress)
--scan=<path> start from scanned C / C++ headers
--export-svg=<file> write an svg and exit (no window needed)
--set="name=value" change a setting for this run (repeatable)
--open=<view> open or focus a view at startup
--layer overlay window (no frame, always on top)
--anchor=<edges> overlay position: top, bottom, left, right,
top-right, ... (implies --layer)
--screenshot=<file> render one frame to a .ppm image and exit
--manual print this manual and exit
--help print the options and exit
19. PLATFORM NOTES
------------------
Every release build is a single executable with nothing to install. It
needs a graphics driver with Vulkan, which every current driver for
NVIDIA, AMD, Intel, Apple and Qualcomm GPUs includes.
Windows (10 or newer, x64 or ARM64)
- design-it.exe, double click it or drop a .dit file on it
- the interface follows the display scale (125%, 150%, ...)
macOS (11 or newer, Apple silicon and Intel)
- the design-it binary runs from Terminal or Finder; design-it.app
is the same program as a bundle, for "Open With", double clicking
.dit files and dropping files on the dock icon
- Cmd works like Ctrl: Cmd+z undo, Cmd+r redo, Cmd+w then v split,
...
- Option types characters as usual (@, [, ~ on many layouts)
- Cmd+q quits, Cmd+h hides, Cmd+m minimizes
- a download from the internet may need right click > Open the first
time (Gatekeeper)
Linux (x86_64 or ARM64, glibc 2.35 or newer)
- works on Wayland and on X11; Wayland is used when available
- force one with DESIGN_IT_BACKEND=x11 or DESIGN_IT_BACKEND=wayland
- needs libwayland-client, libxkbcommon and libX11, which every
desktop has, plus the Vulkan loader (libvulkan.so.1) and your
GPU's driver
20. TROUBLESHOOTING
-------------------
"Vulkan was not found" / "could not start Vulkan"
Install or update the graphics driver. On Linux install the Vulkan
loader and driver (for example vulkan-loader and
mesa-vulkan-drivers). In a virtual machine, enable 3D
acceleration.
The window opens but text looks wrong
:set font=Built-in Sans and :set mono font=Built-in Mono
Everything is too small or too big
Ctrl+= / Ctrl+- or :zoom 1.4
I lost my panels
:reset
A file won't open
Check the status bar message. Text files must follow section 14;
the source view of any diagram shows correct examples.
Start completely fresh
Delete state.bin (see 17).
|