@diagrammo/dgmo 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/auto.cjs +1 -1
  2. package/dist/auto.js +1 -1
  3. package/dist/auto.mjs +1 -1
  4. package/package.json +2 -2
  5. package/docs/guide/chart-arc.md +0 -71
  6. package/docs/guide/chart-area.md +0 -73
  7. package/docs/guide/chart-bar-stacked.md +0 -61
  8. package/docs/guide/chart-bar.md +0 -62
  9. package/docs/guide/chart-boxes-and-lines.md +0 -243
  10. package/docs/guide/chart-c4.md +0 -298
  11. package/docs/guide/chart-chord.md +0 -43
  12. package/docs/guide/chart-class.md +0 -204
  13. package/docs/guide/chart-cycle.md +0 -156
  14. package/docs/guide/chart-doughnut.md +0 -38
  15. package/docs/guide/chart-er.md +0 -218
  16. package/docs/guide/chart-flowchart.md +0 -102
  17. package/docs/guide/chart-function.md +0 -56
  18. package/docs/guide/chart-funnel.md +0 -38
  19. package/docs/guide/chart-gantt.md +0 -368
  20. package/docs/guide/chart-heatmap.md +0 -41
  21. package/docs/guide/chart-infra.md +0 -694
  22. package/docs/guide/chart-journey-map.md +0 -179
  23. package/docs/guide/chart-kanban.md +0 -158
  24. package/docs/guide/chart-line.md +0 -79
  25. package/docs/guide/chart-mindmap.md +0 -198
  26. package/docs/guide/chart-multi-line.md +0 -84
  27. package/docs/guide/chart-org.md +0 -209
  28. package/docs/guide/chart-pie.md +0 -39
  29. package/docs/guide/chart-polar-area.md +0 -38
  30. package/docs/guide/chart-pyramid.md +0 -111
  31. package/docs/guide/chart-quadrant.md +0 -69
  32. package/docs/guide/chart-radar.md +0 -38
  33. package/docs/guide/chart-sankey.md +0 -103
  34. package/docs/guide/chart-scatter.md +0 -91
  35. package/docs/guide/chart-sequence.md +0 -354
  36. package/docs/guide/chart-sitemap.md +0 -265
  37. package/docs/guide/chart-slope.md +0 -56
  38. package/docs/guide/chart-state.md +0 -171
  39. package/docs/guide/chart-tech-radar.md +0 -219
  40. package/docs/guide/chart-timeline.md +0 -229
  41. package/docs/guide/chart-venn.md +0 -81
  42. package/docs/guide/chart-wireframe.md +0 -100
  43. package/docs/guide/chart-wordcloud.md +0 -66
  44. package/docs/guide/colors.md +0 -287
  45. package/docs/guide/how-dgmo-thinks.md +0 -277
  46. package/docs/guide/index.md +0 -63
  47. package/docs/guide/keyboard-shortcuts.md +0 -49
  48. package/docs/guide/registry.json +0 -58
@@ -1,277 +0,0 @@
1
- # How DGMO Thinks
2
-
3
- A guide to the design principles behind the DGMO language. Understanding these themes will help you write diagrams faster and make better use of the language's features.
4
-
5
- ---
6
-
7
- ## Indent, Don't Repeat
8
-
9
- The most important pattern in DGMO: write the thing once, then indent what belongs to it beneath.
10
-
11
- Instead of repeating the source on every line:
12
-
13
- ```dgmo-source
14
- // Verbose — repeats "API" three times
15
- API -routes-> UserService
16
- API -routes-> ProductService
17
- API -auth-> AuthService
18
- ```
19
-
20
- Indent edges under their source:
21
-
22
- ```dgmo-source
23
- // Concise — declare once, indent connections
24
- API
25
- -routes-> UserService
26
- -routes-> ProductService
27
- -auth-> AuthService
28
- ```
29
-
30
- This isn't just a shorthand — it's how DGMO thinks about ownership and hierarchy. The pattern shows up everywhere:
31
-
32
- - **Org charts and sitemaps** — indentation *is* the hierarchy
33
- - **Kanban** — cards indented under columns
34
- - **Gantt** — dependencies indented under tasks
35
- - **ER** — columns and relationships indented under tables
36
- - **Sequence** — participants indented under groups
37
-
38
- When you see indentation in DGMO, read it as "belongs to."
39
-
40
- ---
41
-
42
- ## Meaning First, Color Second
43
-
44
- When you want to make something red, your instinct might be to reach for a color suffix: `AuthService(red)`. That works for one-offs. But DGMO encourages a different approach for anything that carries meaning.
45
-
46
- **Tags** let you separate *what something means* from *how it looks*:
47
-
48
- ```dgmo-source
49
- tag Priority alias p
50
- Critical(red)
51
- Normal(green)
52
- Low(gray)
53
-
54
- API | p: Critical
55
- Cache | p: Low
56
- ```
57
-
58
- Why go through this indirection?
59
-
60
- - **Colors become meaningful.** Red means "Critical," not just red. The legend self-documents.
61
- - **Palettes stay intact.** Switching from Nord to Dracula adjusts all your colors harmoniously. Direct hex codes would break this.
62
- - **Filtering works.** Tags are structured metadata — you can sort, hide, and group by them.
63
- - **One change updates everything.** Rename "Critical" to "Urgent" in one place, not fifty nodes.
64
-
65
- Use color suffixes `(red)` for quick visual accents. Use tags when color carries meaning you'd want in a legend.
66
-
67
- ---
68
-
69
- ## Name Things, Skip the Boilerplate
70
-
71
- DGMO infers as much as it can from names you're already writing.
72
-
73
- In sequence diagrams, the parser recognizes common names and gives them the right shape automatically:
74
-
75
- ```dgmo-source
76
- Redis // cache (cylinder, dashed)
77
- UserService // service (rounded rectangle)
78
- Kafka // queue (horizontal cylinder)
79
- User // actor (stick figure)
80
- WebApp // frontend (monitor)
81
- ```
82
-
83
- You only need `is a` when the name doesn't match a pattern:
84
-
85
- ```dgmo-source
86
- Payments is a service // "Payments" alone wouldn't infer
87
- Vault is a database // "Vault" would infer as service
88
- ```
89
-
90
- In flowcharts, arrow labels infer color:
91
-
92
- ```dgmo-source
93
- <Valid?>
94
- -yes-> [Process] // automatically green
95
- -no-> [Show Error] // automatically red
96
- ```
97
-
98
- The first declared tag group auto-activates. Chart types are detected from the first line. Org hierarchy comes from indentation alone.
99
-
100
- The principle: **name things sensibly and DGMO figures out the rest.** Override only when inference gets it wrong.
101
-
102
- ---
103
-
104
- ## Palette-Aware Colors
105
-
106
- When you write `(red)`, DGMO doesn't render `#ff0000`. It renders *the red from your active palette* — a shade that harmonizes with the other nine named colors in that palette.
107
-
108
- The allowed color names are: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`, `black`, `white`.
109
-
110
- That's the complete list. No hex codes, no CSS keywords, no custom colors. This is a deliberate constraint:
111
-
112
- - Every palette (Nord, Dracula, Catppuccin, Gruvbox, etc.) defines its own version of these eleven names
113
- - Switching palettes recolors your entire diagram coherently
114
- - Diagrams always look good regardless of which palette or theme is active
115
- - No one accidentally picks colors that clash or become invisible on certain backgrounds
116
-
117
- DGMO prioritizes *beautiful by default* over *total control.*
118
-
119
- ---
120
-
121
- ## Brackets Mean "Container"
122
-
123
- Wherever you see `[Name]`, something is being grouped:
124
-
125
- ```dgmo-source
126
- [Backend] // group in infra, boxes-and-lines, C4
127
- [To Do] // column in kanban
128
- [Sprint 1] // swimlane in gantt
129
- [Marketing] // container in sitemap
130
- [Caribbean] // category in scatter charts
131
- [Royal Navy] // group in timeline
132
- ```
133
-
134
- Content indented below the bracket line belongs to that group. Bracket grouping works in sequence, infra, flowchart, state, org, kanban, sitemap, gantt, boxes-and-lines, timeline, and scatter/bubble diagrams. When you see brackets, read them as "these things go together."
135
-
136
- Groups can have color suffixes and pipe metadata:
137
-
138
- ```dgmo-source
139
- [Backend](blue) | team: Platform
140
- API
141
- Database
142
- Cache
143
- ```
144
-
145
- ---
146
-
147
- ## One Arrow Vocabulary
148
-
149
- DGMO uses the same small set of arrow patterns everywhere:
150
-
151
- | Pattern | Meaning | Example |
152
- |---------|---------|---------|
153
- | `->` | Synchronous / directed | `API -> Database` |
154
- | `~>` | Asynchronous | `API ~> Queue` |
155
- | `-label->` | Labeled edge | `-routes-> UserService` |
156
- | `~label~>` | Labeled async edge | `~notify~> Email` |
157
- | `-(color)->` | Colored edge | `-(red)-> Fallback` |
158
- | `<->` | Bidirectional | `A <-> B` |
159
-
160
- The label goes between the dashes (or tildes). Color goes in parens on the label. This works identically in sequence, infra, flowchart, C4, ER, class, sitemap, and boxes-and-lines diagrams.
161
-
162
- Learn it once, use it everywhere.
163
-
164
- ---
165
-
166
- ## Pipe Metadata: The Universal "And Also..."
167
-
168
- When you need to attach extra information to something, the pipe `|` syntax works on almost anything:
169
-
170
- ```dgmo-source
171
- API | description: Main gateway, team: Platform
172
- API -routes-> UserService | frequency: High
173
- [Backend] | owner: Platform Team
174
- 10bd Database Schema | p: Foundation, 80%
175
- 1718-05 Blockade | p: Blackbeard
176
- Card Title | priority: High, assignee: Alice
177
- ```
178
-
179
- Nodes, edges, groups, tasks, events, cards — if it exists in DGMO, you can probably pipe metadata onto it. The format is always `| key: value, key2: value2`.
180
-
181
- ---
182
-
183
- ## Describe Relationships, Not Layouts
184
-
185
- DGMO diagrams have no x/y coordinates, no manual positioning, no pixel-level control. You describe *what things are* and *how they connect*, and the layout engine handles placement.
186
-
187
- ```dgmo-source
188
- // You write this
189
- CEO
190
- CTO
191
- Engineering
192
- DevOps
193
- CFO
194
- Finance
195
-
196
- // DGMO handles the layout
197
- ```
198
-
199
- This is a trade-off:
200
-
201
- - Diagrams reflow cleanly when content changes — add a node and everything adjusts
202
- - Version control diffs are meaningful (text changes, not coordinate noise)
203
- - You spend time on content, not dragging boxes around
204
- - But you don't get pixel-perfect placement
205
-
206
- If you find yourself wanting to control exact positions, you're probably fighting the tool. Instead, use groups, ordering, and direction options (`direction-tb`, `direction-lr`) to guide the layout.
207
-
208
- ---
209
-
210
- ## Options Are Simple Toggles
211
-
212
- Configuration goes at the top of the diagram as plain keywords:
213
-
214
- ```dgmo-source
215
- gantt Product Launch
216
- start 2026-03-15
217
- today-marker
218
- critical-path
219
- no-dependencies
220
- active-tag Team
221
- ```
222
-
223
- - **Boolean options**: bare keyword turns it on, `no-` prefix turns it off (`activations` / `no-activations`)
224
- - **Value options**: keyword followed by the value, space-separated (`start 2026-03-15`)
225
- - No YAML, no JSON, no nested config blocks
226
- - Options must appear before diagram content
227
-
228
- ---
229
-
230
- ## The Colon Rule
231
-
232
- Colons show up in exactly two situations:
233
-
234
- **1. Open-ended metadata** — when you're defining freeform key-value pairs:
235
- ```dgmo-source
236
- API | description: Main gateway // pipe metadata
237
- role: Senior Engineer // org/C4 indented metadata
238
- ```
239
-
240
- **2. Type separators** — where both sides can contain spaces and a delimiter is needed:
241
- ```dgmo-source
242
- + name: string // class field type
243
- + sail(): void // class method return
244
- Trajectory(blue): -0.001*x^2 + 0.27*x // function expression
245
- ```
246
-
247
- **No colons anywhere else** — declarations, options, tags, data rows, arrows, groups, and comments are all colon-free:
248
- ```dgmo-source
249
- bar Revenue by Quarter // declaration: no colon
250
- tag Team alias t // tag: no colon
251
- start 2026-03-15 // option: no colon
252
- Gold 3500 4200 5100 // data row: no colon
253
- id int pk // ER column: no colon
254
- latency-ms 50 // infra property: no colon
255
- ```
256
-
257
- The intuition: **if DGMO already knows what the fields are, spaces are enough. Colons appear only when you're defining something freeform or need an unambiguous separator.**
258
-
259
- ---
260
-
261
- ## One Diagram Per File
262
-
263
- The first line declares the chart type. There's no way to embed multiple diagrams in a single file. One file, one diagram, one clear purpose.
264
-
265
- ```dgmo-source
266
- sequence Auth Flow
267
- // everything below is this one diagram
268
- ```
269
-
270
- ## Comments Are Full-Line Only
271
-
272
- ```dgmo-source
273
- // This is a comment
274
- API -> Database // This is NOT a comment — it's part of the line
275
- ```
276
-
277
- Use `//` at the start of a line. There are no inline comments. `#` is not a comment character.
@@ -1,63 +0,0 @@
1
- # Welcome to Diagrammo
2
-
3
- Diagrammo is a diagram editor for creating charts and diagrams with a simple plain-text syntax. Write a few lines of text — get a polished, theme-aware diagram. Available as a [desktop app](https://diagrammo.app/app) and [online editor](https://online.diagrammo.app).
4
-
5
- Learn more at **[diagrammo.app](https://diagrammo.app)**.
6
-
7
- ## DGMO and Diagrammo
8
-
9
- **DGMO** is the plain-text markup language you write. **Diagrammo** is the app you write it in.
10
-
11
- Think of it like Markdown and your editor — Markdown is the syntax, and you can write it anywhere. DGMO works the same way: it's a `.dgmo` text file that describes a diagram. You can create and edit `.dgmo` files in the Diagrammo desktop app, the online editor, Obsidian (via plugin), or any text editor. The `dgmo` CLI renders them from the terminal, and the `@diagrammo/dgmo` npm package lets you render them programmatically.
12
-
13
- The name "DGMO" is shorthand for "Diagrammo" — shorter to type, easier to use as a file extension and command name.
14
-
15
- ## Getting Started
16
-
17
- - **Create a new file** using the file tree on the left, or press **Cmd + N**
18
- - **Write diagram code** in the editor — the preview updates in real time
19
- - **Export** your diagrams as PNG or SVG
20
- - **Browse the sidebar** to explore all chart types and features
21
-
22
- Every diagram starts with the chart type on the first line, followed by your data and options. For example:
23
-
24
- ```
25
- bar Q1 Sales
26
-
27
- Jan 42
28
- Feb 58
29
- Mar 71
30
- ```
31
-
32
- ## The Diagrammo Ecosystem
33
-
34
- ### Desktop App
35
-
36
- A native Mac app for authoring `.dgmo` files with a live preview editor, file tree, and export. Download at [diagrammo.app/app](https://diagrammo.app/app).
37
-
38
- ### Online Editor
39
-
40
- The full Diagrammo experience in your browser at [online.diagrammo.app](https://online.diagrammo.app). Your diagrams are stored in your browser's [Origin Private File System (OPFS)](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system) — they persist across sessions, but clearing browser data will remove them.
41
-
42
- ### CLI Tool
43
-
44
- The `dgmo` command-line tool renders `.dgmo` files to PNG or SVG from your terminal. Install it via Homebrew:
45
-
46
- ```bash
47
- brew tap diagrammo/dgmo
48
- brew install dgmo
49
- ```
50
-
51
- Or run directly with npx:
52
-
53
- ```bash
54
- npx @diagrammo/dgmo diagram.dgmo
55
- ```
56
-
57
- ### JavaScript / TypeScript Library
58
-
59
- The `@diagrammo/dgmo` npm package lets you parse and render diagrams programmatically — useful for generating diagrams in build pipelines, servers, or web apps.
60
-
61
- ```bash
62
- npm install @diagrammo/dgmo
63
- ```
@@ -1,49 +0,0 @@
1
- # Keyboard Shortcuts
2
-
3
- ## Global
4
-
5
- | Shortcut | Action |
6
- | ------------------- | ------------------------- |
7
- | **⌘ + ,** | Open Settings |
8
- | **⌘ + 1** | Toggle file tree |
9
- | **⌘ + 2** | Toggle code editor |
10
- | **⌘ + Arrow Left** | Focus previous panel |
11
- | **⌘ + Arrow Right** | Focus next panel |
12
- | **⌘ + =** | Increase font size |
13
- | **⌘ + -** | Decrease font size |
14
- | **⌘ + 0** | Reset font size |
15
- | **⌘ + S** | Save file |
16
- | **⌘ + E** | Export diagram |
17
- | **⌘ + N** | New file |
18
- | **⌘ + ?** | Keyboard shortcuts |
19
- | **⌘ + Shift + F** | Focus mode (preview only) |
20
- | **⌘ + Q** | Quit |
21
-
22
- ## File Tree
23
-
24
- | Shortcut | Action |
25
- | ----------------------- | -------------------------- |
26
- | **j** / **Arrow Down** | Move down |
27
- | **k** / **Arrow Up** | Move up |
28
- | **l** / **Arrow Right** | Expand folder |
29
- | **h** / **Arrow Left** | Collapse folder |
30
- | **Enter** / **Space** | Open file or toggle folder |
31
- | **F2** | Rename |
32
- | **Delete** | Delete |
33
- | **⌘ + D** | Duplicate |
34
-
35
- ## Editor
36
-
37
- | Shortcut | Action |
38
- | ----------------- | -------- |
39
- | **Tab** | Indent |
40
- | **Shift + Tab** | Unindent |
41
- | **⌘ + Z** | Undo |
42
- | **⌘ + Shift + Z** | Redo |
43
-
44
- ## Dialogs
45
-
46
- | Shortcut | Action |
47
- | ---------- | ------- |
48
- | **Enter** | Confirm |
49
- | **Escape** | Cancel |
@@ -1,58 +0,0 @@
1
- {
2
- "groups": [
3
- { "id": "getting-started", "label": "Getting Started" },
4
- { "id": "software", "label": "Software" },
5
- { "id": "data", "label": "Data" },
6
- { "id": "business", "label": "Business" },
7
- { "id": "project", "label": "Project" }
8
- ],
9
- "pages": [
10
- { "slug": "index", "title": "Welcome", "group": "getting-started", "file": "index.md" },
11
- { "slug": "keyboard-shortcuts", "title": "Keyboard Shortcuts", "group": "getting-started", "file": "keyboard-shortcuts.md" },
12
- { "slug": "colors", "title": "Colors", "group": "getting-started", "file": "colors.md" },
13
- { "slug": "how-dgmo-thinks", "title": "How DGMO Thinks", "group": "getting-started", "file": "how-dgmo-thinks.md" },
14
-
15
- { "slug": "chart-arc", "title": "Arc Diagram", "group": "software", "file": "chart-arc.md" },
16
- { "slug": "chart-boxes-and-lines", "title": "Boxes and Lines", "group": "software", "file": "chart-boxes-and-lines.md" },
17
- { "slug": "chart-c4", "title": "C4 Diagram", "group": "software", "file": "chart-c4.md" },
18
- { "slug": "chart-class", "title": "Class Diagram", "group": "software", "file": "chart-class.md" },
19
- { "slug": "chart-er", "title": "Entity Relationship", "group": "software", "file": "chart-er.md" },
20
- { "slug": "chart-flowchart", "title": "Flowchart", "group": "software", "file": "chart-flowchart.md" },
21
- { "slug": "chart-infra", "title": "Infrastructure", "group": "software", "file": "chart-infra.md" },
22
- { "slug": "chart-mindmap", "title": "Mind Map", "group": "software", "file": "chart-mindmap.md" },
23
- { "slug": "chart-sequence", "title": "Sequence Diagram", "group": "software", "file": "chart-sequence.md" },
24
- { "slug": "chart-sitemap", "title": "Sitemap", "group": "software", "file": "chart-sitemap.md" },
25
- { "slug": "chart-state", "title": "State Diagram", "group": "software", "file": "chart-state.md" },
26
- { "slug": "chart-wireframe", "title": "Wireframe", "group": "software", "file": "chart-wireframe.md" },
27
-
28
- { "slug": "chart-area", "title": "Area Chart", "group": "data", "file": "chart-area.md" },
29
- { "slug": "chart-bar", "title": "Bar Chart", "group": "data", "file": "chart-bar.md" },
30
- { "slug": "chart-cycle", "title": "Cycle Diagram", "group": "data", "file": "chart-cycle.md" },
31
- { "slug": "chart-chord", "title": "Chord Diagram", "group": "data", "file": "chart-chord.md" },
32
- { "slug": "chart-doughnut", "title": "Doughnut Chart", "group": "data", "file": "chart-doughnut.md" },
33
- { "slug": "chart-function", "title": "Function Plot", "group": "data", "file": "chart-function.md" },
34
- { "slug": "chart-heatmap", "title": "Heatmap", "group": "data", "file": "chart-heatmap.md" },
35
- { "slug": "chart-line", "title": "Line Chart", "group": "data", "file": "chart-line.md" },
36
- { "slug": "chart-multi-line", "title": "Multi-Line Chart", "group": "data", "file": "chart-multi-line.md" },
37
- { "slug": "chart-pie", "title": "Pie Chart", "group": "data", "file": "chart-pie.md" },
38
- { "slug": "chart-polar-area", "title": "Polar Area Chart", "group": "data", "file": "chart-polar-area.md" },
39
- { "slug": "chart-radar", "title": "Radar Chart", "group": "data", "file": "chart-radar.md" },
40
- { "slug": "chart-scatter", "title": "Scatter Plot", "group": "data", "file": "chart-scatter.md" },
41
- { "slug": "chart-slope", "title": "Slope Chart", "group": "data", "file": "chart-slope.md" },
42
- { "slug": "chart-bar-stacked", "title": "Stacked Bar Chart", "group": "data", "file": "chart-bar-stacked.md" },
43
-
44
- { "slug": "chart-journey-map", "title": "Journey Map", "group": "business", "file": "chart-journey-map.md" },
45
- { "slug": "chart-funnel", "title": "Funnel Chart", "group": "business", "file": "chart-funnel.md" },
46
- { "slug": "chart-org", "title": "Org Chart", "group": "business", "file": "chart-org.md" },
47
- { "slug": "chart-pyramid", "title": "Pyramid Diagram", "group": "business", "file": "chart-pyramid.md" },
48
- { "slug": "chart-quadrant", "title": "Quadrant Chart", "group": "business", "file": "chart-quadrant.md" },
49
- { "slug": "chart-sankey", "title": "Sankey Diagram", "group": "business", "file": "chart-sankey.md" },
50
- { "slug": "chart-tech-radar", "title": "Technology Radar", "group": "business", "file": "chart-tech-radar.md" },
51
- { "slug": "chart-venn", "title": "Venn Diagram", "group": "business", "file": "chart-venn.md" },
52
- { "slug": "chart-wordcloud", "title": "Word Cloud", "group": "business", "file": "chart-wordcloud.md" },
53
-
54
- { "slug": "chart-gantt", "title": "Gantt Chart", "group": "project", "file": "chart-gantt.md" },
55
- { "slug": "chart-kanban", "title": "Kanban Board", "group": "project", "file": "chart-kanban.md" },
56
- { "slug": "chart-timeline", "title": "Timeline", "group": "project", "file": "chart-timeline.md" }
57
- ]
58
- }