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 (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 ): 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 split right with a view :sp 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 . 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="<>" { section "contract" { + run(ctx) : void [pure] } } struct "JobQueue" id=queue { note "lock free ring" section "fields" { + head : atomic [0x00] - slots : Job*[] [ring] } } } queue o-> job : "buffers" [1 -> 0..*] rt ==> job : "runs" route=bezier tag=hot Nodes: "" [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: [: "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 open a .dit / .dit.txt (or scan a folder) :save [file] save (.dit binary, otherwise text) :export export an svg :scan build a diagram from C / C++ headers :tpl arch ecs microservices compiler uml ... :clear empty diagram :add add a node :connect 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 open or focus a view :vs / :sp split right / below with a view :set = 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= start from a template (arch ecs microservices compiler uml stress) --scan= start from scanned C / C++ headers --export-svg= write an svg and exit (no window needed) --set="name=value" change a setting for this run (repeatable) --open= open or focus a view at startup --layer overlay window (no frame, always on top) --anchor= overlay position: top, bottom, left, right, top-right, ... (implies --layer) --screenshot= 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).