@diagrammo/dgmo 0.8.22 → 0.8.23

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 (53) hide show
  1. package/dist/cli.cjs +111 -109
  2. package/dist/editor.cjs +3 -0
  3. package/dist/editor.cjs.map +1 -1
  4. package/dist/editor.js +3 -0
  5. package/dist/editor.js.map +1 -1
  6. package/dist/highlight.cjs +3 -0
  7. package/dist/highlight.cjs.map +1 -1
  8. package/dist/highlight.js +3 -0
  9. package/dist/highlight.js.map +1 -1
  10. package/dist/index.cjs +1010 -215
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +97 -11
  13. package/dist/index.d.ts +97 -11
  14. package/dist/index.js +1001 -213
  15. package/dist/index.js.map +1 -1
  16. package/dist/internal.cjs +380 -0
  17. package/dist/internal.cjs.map +1 -0
  18. package/dist/internal.d.cts +179 -0
  19. package/dist/internal.d.ts +179 -0
  20. package/dist/internal.js +337 -0
  21. package/dist/internal.js.map +1 -0
  22. package/docs/guide/chart-cycle.md +156 -0
  23. package/docs/guide/chart-journey-map.md +179 -0
  24. package/docs/guide/chart-pyramid.md +111 -0
  25. package/docs/guide/registry.json +5 -0
  26. package/docs/language-reference.md +62 -1
  27. package/gallery/fixtures/pyramid/dikw.dgmo +17 -0
  28. package/gallery/fixtures/pyramid/inverted-funnel.dgmo +16 -0
  29. package/gallery/fixtures/pyramid/minimal.dgmo +5 -0
  30. package/package.json +11 -1
  31. package/src/cli.ts +5 -35
  32. package/src/completion.ts +9 -44
  33. package/src/cycle/layout.ts +19 -28
  34. package/src/cycle/renderer.ts +59 -32
  35. package/src/cycle/types.ts +21 -0
  36. package/src/d3.ts +21 -1
  37. package/src/dgmo-router.ts +73 -3
  38. package/src/echarts.ts +1 -1
  39. package/src/editor/keywords.ts +3 -0
  40. package/src/index.ts +13 -2
  41. package/src/infra/parser.ts +2 -2
  42. package/src/internal.ts +16 -0
  43. package/src/journey-map/renderer.ts +112 -47
  44. package/src/org/collapse.ts +81 -0
  45. package/src/org/renderer.ts +212 -4
  46. package/src/pyramid/parser.ts +172 -0
  47. package/src/pyramid/renderer.ts +684 -0
  48. package/src/pyramid/types.ts +28 -0
  49. package/src/render.ts +2 -8
  50. package/src/sequence/parser.ts +62 -20
  51. package/src/sequence/renderer.ts +2 -2
  52. package/src/tech-radar/interactive.ts +54 -0
  53. package/src/utils/parsing.ts +1 -0
@@ -0,0 +1,156 @@
1
+ # Cycle Diagram
2
+
3
+ ```dgmo
4
+ cycle OODA Loop
5
+
6
+ Observe | color: blue
7
+ Gather raw information from the environment
8
+ Monitor unfolding circumstances
9
+ -Unfold circumstances-> | color: blue
10
+
11
+ Orient | color: green
12
+ Analyze and synthesize observations
13
+ Form a mental model of the situation
14
+ -Form hypothesis-> | color: green
15
+
16
+ Decide | color: orange
17
+ Select a course of action
18
+ -Commit to action-> | color: orange
19
+
20
+ Act | color: red
21
+ Execute the chosen course of action
22
+ Generate results that feed back
23
+ -Generate feedback-> | color: red
24
+ ```
25
+
26
+ ## Overview
27
+
28
+ Cycle diagrams show a circular process flow where nodes are arranged on a circle and directed edges connect each to the next, with the last wrapping back to the first. They are ideal for OODA loops, PDCA cycles, product lifecycles, continuous improvement processes, and any workflow that repeats.
29
+
30
+ ## Syntax
31
+
32
+ ```
33
+ cycle Title
34
+
35
+ NodeLabel
36
+ NodeLabel | color: blue, span: 2
37
+ ```
38
+
39
+ The first line declares the chart type and title. Each top-level line declares a node. Nodes are positioned around a circle in declaration order.
40
+
41
+ ## Nodes
42
+
43
+ Every non-indented, non-directive line is a node:
44
+
45
+ ```
46
+ cycle Seasons
47
+
48
+ Spring | color: green
49
+ Summer | color: yellow
50
+ Autumn | color: orange
51
+ Winter | color: blue
52
+ ```
53
+
54
+ ### Node Pipe Metadata
55
+
56
+ | Key | Type | Default | Description |
57
+ |-----|------|---------|-------------|
58
+ | `color` | palette name | auto | Node fill color |
59
+ | `span` | positive number | `1` | Relative arc distance to next node |
60
+ | `description` | string | — | One-liner shown below the label |
61
+
62
+ ### Descriptions
63
+
64
+ Indented lines under a node add description text. Markdown inline formatting is supported (`**bold**`, `*italic*`, `` `code` ``, `[links](url)`). Bullet points with `- item` render as `• item`.
65
+
66
+ ```
67
+ Observe | color: blue
68
+ Gather raw information from the environment
69
+ Monitor unfolding circumstances
70
+ ```
71
+
72
+ If both `| description: text` and indented lines exist, they concatenate (pipe first, then indented).
73
+
74
+ ## Edges
75
+
76
+ Edges are **implicit** — every node connects to the next, with the last wrapping to the first. The `->` syntax annotates edges with labels, descriptions, and styling:
77
+
78
+ ```
79
+ Observe | color: blue
80
+ -Unfold circumstances-> | color: blue
81
+ Synthesize raw data into context
82
+
83
+ Orient | color: green
84
+ -> | width: 4
85
+ ```
86
+
87
+ Edge lines are indented under their source node. A label goes between `-` and `->`. Pipe metadata supports `color` and `width`.
88
+
89
+ ### Edge Descriptions
90
+
91
+ Indented lines under an edge line add description text:
92
+
93
+ ```
94
+ Observe
95
+ -Analyze->
96
+ Break down observations into components
97
+ Identify **key patterns**
98
+ ```
99
+
100
+ ## Span
101
+
102
+ The `span` metadata controls relative arc distance between nodes. A node with `span: 2` gets twice the arc space to the next node:
103
+
104
+ ```
105
+ cycle Weighted Process
106
+
107
+ Important Step | span: 2
108
+ Quick Step
109
+ Another Step | span: 1.5
110
+ ```
111
+
112
+ ## Directives
113
+
114
+ | Directive | Effect |
115
+ |-----------|--------|
116
+ | `direction-counterclockwise` | Reverse cycle direction (default: clockwise) |
117
+ | `hide-descriptions` | Hide description text on all nodes and edges |
118
+ | `circle-nodes` | Render nodes as circles instead of rounded rectangles |
119
+
120
+ ```
121
+ cycle Simple Loop
122
+
123
+ direction-counterclockwise
124
+
125
+ Plan
126
+ Do
127
+ Check
128
+ Act
129
+ ```
130
+
131
+ ## Complete Example
132
+
133
+ ```dgmo
134
+ cycle PDCA Continuous Improvement
135
+
136
+ Plan | color: blue, span: 1.5
137
+ Define objectives and processes
138
+ Establish expected outcomes
139
+ -Start implementation->
140
+
141
+ Do | color: green
142
+ Execute the plan on a small scale
143
+ Collect data for analysis
144
+ -Gather results->
145
+
146
+ Check | color: orange
147
+ Compare results against expectations
148
+ Identify deviations and root causes
149
+ -Propose changes-> | color: orange
150
+
151
+ Act | color: red
152
+ Standardize successful changes
153
+ Address remaining gaps
154
+ -Feed back into planning-> | color: red
155
+ Begin the next improvement cycle
156
+ ```
@@ -0,0 +1,179 @@
1
+ # Journey Map
2
+
3
+ ```dgmo
4
+ journey-map Coffee Shop Visit
5
+
6
+ [Order]
7
+ Walk in | 4
8
+ Wait in line | 2
9
+ Order drink | 4
10
+
11
+ [Wait]
12
+ Find a seat | 3
13
+ Wait for drink | 2
14
+
15
+ [Enjoy]
16
+ Get drink | 5
17
+ ```
18
+
19
+ ## Overview
20
+
21
+ Journey maps visualize a user's experience across a process or service, plotting emotional highs and lows as a continuous curve. Each step has a score (1–5, high is good) that drives the emotion landscape. Phases group related steps, annotations capture pain points, opportunities, and thoughts, and tags add cross-cutting dimensions like channel or touchpoint.
22
+
23
+ Journey maps are ideal for UX research, customer experience mapping, service design, and identifying friction points.
24
+
25
+ ## Syntax
26
+
27
+ ```
28
+ journey-map Title
29
+
30
+ persona Name
31
+
32
+ [Phase Name]
33
+ Step Name | score
34
+ Step Name | score Emotion
35
+ ```
36
+
37
+ The first line must be `journey-map` followed by a title. Phases use bracket syntax at indent 0. Steps are indented within phases.
38
+
39
+ ## Persona
40
+
41
+ Declares the journey's protagonist:
42
+
43
+ ```
44
+ persona Tech-Savvy Shopper
45
+ 28yo developer, price-sensitive, does extensive research
46
+ ```
47
+
48
+ Name is everything after `persona `. Indented lines add description text. Only one persona per diagram.
49
+
50
+ ## Phases
51
+
52
+ Phases group steps into logical stages:
53
+
54
+ ```
55
+ [Research]
56
+ Compare specs | 4
57
+ Watch reviews | 5
58
+
59
+ [Purchase]
60
+ Add to cart | 3
61
+ Complete payment | 3
62
+ ```
63
+
64
+ Phases are optional — steps can appear at root level for a flat continuous flow.
65
+
66
+ ## Steps
67
+
68
+ Steps appear indented within phases (or at indent 0 in flat mode).
69
+
70
+ ### Score Syntax
71
+
72
+ The score goes in the pipe, separating step name from data:
73
+
74
+ ```
75
+ Step Name | 4 // bare score
76
+ Step Name | 4 Delighted // score + emotion label
77
+ Step Name | 4, ch: Web // score + tag metadata
78
+ Step Name | 4 Delighted, ch: Web // score + label + metadata
79
+ Step Name | score: 4, ch: Web // explicit score key
80
+ Step Name // no pipe = scoreless step
81
+ ```
82
+
83
+ - **Score scale**: 1–5 integer (high = good)
84
+ - **Emotion label**: optional single word after the score (e.g., `Frustrated`, `Delighted`, `Neutral`)
85
+ - **Scoreless steps**: render as cards but produce no emotion curve point
86
+
87
+ ## Annotations
88
+
89
+ Deeper-indented lines under a step add context:
90
+
91
+ ```
92
+ Forced account creation | 1 Frustrated
93
+ pain: Wants guest checkout
94
+ opportunity: Add guest checkout option
95
+ thought: Why do I need an account?
96
+ description: User abandoned cart twice
97
+ ```
98
+
99
+ | Prefix | Rendering |
100
+ |--------|-----------|
101
+ | `pain:` | Pain point (red accent) |
102
+ | `opportunity:` | Improvement opportunity (green accent) |
103
+ | `thought:` | User thought (italic) |
104
+ | `description:` | General context text |
105
+
106
+ Multiple annotations per step are allowed.
107
+
108
+ ## Tag Groups
109
+
110
+ Tags add color-coded dimensions like channel or touchpoint:
111
+
112
+ ```
113
+ tag Channel ch
114
+ Web(blue)
115
+ Mobile(purple)
116
+ In-Person(green)
117
+
118
+ [Research]
119
+ Compare specs | 4, ch: Web
120
+ Ask friends | 4, ch: In-Person
121
+ ```
122
+
123
+ Reference tag values in step pipes via the alias.
124
+
125
+ ## Flat Mode
126
+
127
+ Steps at root level (no `[Phase]` brackets) render as a continuous horizontal strip:
128
+
129
+ ```dgmo
130
+ journey-map Quick Feedback
131
+
132
+ Opened app | 4
133
+ Searched for feature | 3
134
+ Hit error | 1 Frustrated
135
+ pain: No helpful error message
136
+ Contacted support | 2
137
+ Got resolution | 5 Relieved
138
+ ```
139
+
140
+ ## Directives
141
+
142
+ | Directive | Effect |
143
+ |-----------|--------|
144
+ | `no-legend` | Hide the score legend |
145
+ | `active-tag GroupName` | Set the active tag group for coloring |
146
+
147
+ ## Complete Example
148
+
149
+ ```dgmo
150
+ journey-map Buying a Laptop
151
+
152
+ persona Tech-Savvy Shopper
153
+ 28yo developer, price-sensitive, does extensive research
154
+
155
+ tag Channel ch
156
+ Web(blue)
157
+ Mobile(purple)
158
+ Email(teal)
159
+ In-Person(green)
160
+
161
+ [Research]
162
+ Compare specs | 4, ch: Web
163
+ description: Checked 12 laptops across 4 review sites
164
+ Watch reviews | 5 Engaged, ch: Mobile
165
+ Ask friends | 4, ch: In-Person
166
+
167
+ [Purchase]
168
+ Add to cart | 3, ch: Web
169
+ Forced account creation | 1 Frustrated, ch: Web
170
+ pain: Wants guest checkout
171
+ pain: Password requirements too strict
172
+ Complete payment | 3, ch: Web
173
+
174
+ [Delivery]
175
+ Track package | 4, ch: Mobile
176
+ Unboxing | 5 Delighted, ch: In-Person
177
+ opportunity: Include setup guide
178
+ thought: Excited to try it out
179
+ ```
@@ -0,0 +1,111 @@
1
+ # Pyramid Diagram
2
+
3
+ ```dgmo
4
+ pyramid Maslow's Hierarchy of Needs
5
+
6
+ Self-Actualization | color: purple
7
+ Morality, creativity, acceptance of facts.
8
+
9
+ Esteem | color: blue
10
+ Respect, recognition, confidence.
11
+
12
+ Love & Belonging | color: green
13
+ Friendship, intimacy, family.
14
+
15
+ Safety | color: yellow
16
+ Security, employment, health.
17
+
18
+ Physiological | color: orange
19
+ Food, water, warmth, rest.
20
+ ```
21
+
22
+ ## Overview
23
+
24
+ Pyramid diagrams show a hierarchy of stacked layers. Each layer gets a colored band with a label and an optional description. Source order reads apex-first — the first layer in the file is the narrowest (visual top), the last is the widest (visual bottom). Use `inverted` to flip into a funnel orientation.
25
+
26
+ ## Syntax
27
+
28
+ ```
29
+ pyramid Title
30
+
31
+ LayerLabel
32
+ LayerLabel | color: blue
33
+ LayerLabel | color: green
34
+ Indented description
35
+ ```
36
+
37
+ The first line declares the chart type and an optional title. Each non-indented, non-directive line declares one layer. At least two layers are required.
38
+
39
+ ## Layers
40
+
41
+ ```
42
+ pyramid Roles
43
+
44
+ Executives | color: purple
45
+ Managers | color: blue
46
+ Individual Contributors | color: green
47
+ ```
48
+
49
+ ### Layer Pipe Metadata
50
+
51
+ | Key | Type | Default | Description |
52
+ |-----|------|---------|-------------|
53
+ | `color` | palette name | auto-assigned | Layer color |
54
+ | `description` | string | — | One-liner shown beside the layer |
55
+
56
+ ### Descriptions
57
+
58
+ Indented lines under a layer add description text. Markdown inline formatting is supported (`**bold**`, `*italic*`, `` `code` ``, `[links](url)`). Bullet points with `- item` render as `• item`.
59
+
60
+ ```
61
+ Wisdom | color: purple
62
+ Ethical judgment, acting with insight.
63
+ - Knowing *why* something matters
64
+ - Acting with long-term perspective
65
+ ```
66
+
67
+ If both `| description: text` and indented lines exist, they concatenate (pipe first, then indented).
68
+
69
+ ## Directives
70
+
71
+ | Directive | Effect |
72
+ |-----------|--------|
73
+ | `inverted` | Flip apex to the bottom (funnel orientation). Source order is preserved — the first layer is always the visual top. |
74
+
75
+ ```
76
+ pyramid Acquisition Funnel
77
+
78
+ inverted
79
+
80
+ Visitors | color: blue
81
+ Signups | color: cyan
82
+ Activated | color: green
83
+ Paid | color: orange
84
+ ```
85
+
86
+ ## Overflow Handling
87
+
88
+ When descriptions don't fit a layer's band, the renderer automatically:
89
+
90
+ - **Wraps** text at the column edge so nothing leaves the canvas
91
+ - **Truncates** with "…" when content exceeds the available lines
92
+ - **Alternates** descriptions left ↔ right when a single column can't hold them
93
+ - **Reveals** the full description when a layer is highlighted (in-app), hiding siblings so it has room
94
+
95
+ ## Complete Example
96
+
97
+ ```dgmo
98
+ pyramid The DIKW Pyramid
99
+
100
+ Wisdom | color: purple
101
+ Ethical judgment, acting with insight — knowing *why*.
102
+
103
+ Knowledge | color: blue
104
+ Synthesized information — knowing *how*.
105
+
106
+ Information | color: green
107
+ Processed data with context — knowing *what*.
108
+
109
+ Data | color: yellow
110
+ Raw facts and measurements — unprocessed signals.
111
+ ```
@@ -19,12 +19,15 @@
19
19
  { "slug": "chart-er", "title": "Entity Relationship", "group": "software", "file": "chart-er.md" },
20
20
  { "slug": "chart-flowchart", "title": "Flowchart", "group": "software", "file": "chart-flowchart.md" },
21
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" },
22
23
  { "slug": "chart-sequence", "title": "Sequence Diagram", "group": "software", "file": "chart-sequence.md" },
23
24
  { "slug": "chart-sitemap", "title": "Sitemap", "group": "software", "file": "chart-sitemap.md" },
24
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" },
25
27
 
26
28
  { "slug": "chart-area", "title": "Area Chart", "group": "data", "file": "chart-area.md" },
27
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" },
28
31
  { "slug": "chart-chord", "title": "Chord Diagram", "group": "data", "file": "chart-chord.md" },
29
32
  { "slug": "chart-doughnut", "title": "Doughnut Chart", "group": "data", "file": "chart-doughnut.md" },
30
33
  { "slug": "chart-function", "title": "Function Plot", "group": "data", "file": "chart-function.md" },
@@ -38,8 +41,10 @@
38
41
  { "slug": "chart-slope", "title": "Slope Chart", "group": "data", "file": "chart-slope.md" },
39
42
  { "slug": "chart-bar-stacked", "title": "Stacked Bar Chart", "group": "data", "file": "chart-bar-stacked.md" },
40
43
 
44
+ { "slug": "chart-journey-map", "title": "Journey Map", "group": "business", "file": "chart-journey-map.md" },
41
45
  { "slug": "chart-funnel", "title": "Funnel Chart", "group": "business", "file": "chart-funnel.md" },
42
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" },
43
48
  { "slug": "chart-quadrant", "title": "Quadrant Chart", "group": "business", "file": "chart-quadrant.md" },
44
49
  { "slug": "chart-sankey", "title": "Sankey Diagram", "group": "business", "file": "chart-sankey.md" },
45
50
  { "slug": "chart-tech-radar", "title": "Technology Radar", "group": "business", "file": "chart-tech-radar.md" },
@@ -1570,7 +1570,68 @@ wireframe Login Page
1570
1570
 
1571
1571
  ---
1572
1572
 
1573
- ## 19. Colon Usage Summary
1573
+ ## 19. Pyramid Diagrams
1574
+
1575
+ Hierarchical pyramid visualization with stacked layers, descriptions, and optional per-layer color. Source order reads apex-first (top of file = top of pyramid).
1576
+
1577
+ ### Declaration
1578
+
1579
+ ```
1580
+ pyramid [Title]
1581
+
1582
+ LayerLabel
1583
+ LayerLabel | color: blue
1584
+ LayerLabel | color: green
1585
+ Indented description
1586
+ ```
1587
+
1588
+ The first line declares the chart type and an optional title. Each non-indented, non-directive line declares one layer. At least two layers are required.
1589
+
1590
+ ### Example
1591
+
1592
+ ```
1593
+ pyramid Maslow's Hierarchy
1594
+
1595
+ Self-Actualization | color: purple
1596
+ Morality, creativity, acceptance of facts.
1597
+
1598
+ Esteem | color: blue
1599
+ Respect, recognition, confidence.
1600
+
1601
+ Love & Belonging | color: green
1602
+ Friendship, intimacy, family.
1603
+
1604
+ Safety | color: yellow
1605
+ Security, employment, health.
1606
+
1607
+ Physiological | color: orange
1608
+ Food, water, warmth, rest.
1609
+ ```
1610
+
1611
+ ### Layer Pipe Metadata
1612
+
1613
+ | Key | Type | Default | Description |
1614
+ |-----|------|---------|-------------|
1615
+ | `color` | palette name | auto | Layer color |
1616
+ | `description` | string | — | One-liner description |
1617
+
1618
+ ### Descriptions
1619
+
1620
+ Indented lines under a layer are description text. Markdown inline formatting (`**bold**`, `*italic*`, `` `code` ``, `[links](url)`) is supported. Bullets written as `- item` render as `• item`.
1621
+
1622
+ ### Directives
1623
+
1624
+ | Directive | Effect |
1625
+ |-----------|--------|
1626
+ | `inverted` | Flip apex to the bottom (funnel orientation). Source order is preserved — the first layer is always the visual top. |
1627
+
1628
+ ### Overflow Handling
1629
+
1630
+ When descriptions don't fit a layer's band the renderer wraps at the column edge, truncates with `…`, auto-alternates descriptions left ↔ right when one column can't hold them, and (in-app) reveals the full description on highlight while hiding siblings.
1631
+
1632
+ ---
1633
+
1634
+ ## 20. Colon Usage Summary
1574
1635
 
1575
1636
  ### Constructs Where Colons Are REQUIRED
1576
1637
 
@@ -0,0 +1,17 @@
1
+ pyramid The DIKW Pyramid
2
+
3
+ Wisdom | color: purple
4
+ Ethical judgment, acting with
5
+ insight — knowing *why*.
6
+
7
+ Knowledge | color: blue
8
+ Synthesized information —
9
+ knowing *how*.
10
+
11
+ Information | color: green
12
+ Processed data with context —
13
+ knowing *what*.
14
+
15
+ Data | color: yellow
16
+ Raw facts and measurements —
17
+ unprocessed signals.
@@ -0,0 +1,16 @@
1
+ pyramid Acquisition Funnel
2
+
3
+ inverted
4
+
5
+ Visitors | color: blue
6
+ Landed on the site from any channel
7
+ this month.
8
+
9
+ Signups | color: cyan
10
+ Provided an email and confirmed.
11
+
12
+ Activated | color: green
13
+ Completed the first meaningful action.
14
+
15
+ Paid | color: orange
16
+ Converted to a paid plan.
@@ -0,0 +1,5 @@
1
+ pyramid
2
+
3
+ Top
4
+ Middle
5
+ Bottom
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagrammo/dgmo",
3
- "version": "0.8.22",
3
+ "version": "0.8.23",
4
4
  "description": "DGMO diagram markup language — parser, renderer, and color system",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,6 +40,16 @@
40
40
  "types": "./dist/highlight.d.cts",
41
41
  "default": "./dist/highlight.cjs"
42
42
  }
43
+ },
44
+ "./internal": {
45
+ "import": {
46
+ "types": "./dist/internal.d.ts",
47
+ "default": "./dist/internal.js"
48
+ },
49
+ "require": {
50
+ "types": "./dist/internal.d.cts",
51
+ "default": "./dist/internal.cjs"
52
+ }
43
53
  }
44
54
  },
45
55
  "files": [
package/src/cli.ts CHANGED
@@ -6,7 +6,11 @@ import { resolve, join, basename, extname } from 'node:path';
6
6
  import { createInterface } from 'node:readline';
7
7
  import { Resvg } from '@resvg/resvg-js';
8
8
  import { render } from './render';
9
- import { parseDgmo, getAllChartTypes } from './dgmo-router';
9
+ import {
10
+ parseDgmo,
11
+ getAllChartTypes,
12
+ CHART_TYPE_DESCRIPTIONS,
13
+ } from './dgmo-router';
10
14
  import { parseDgmoChartType } from './dgmo-router';
11
15
  import { formatDgmoError } from './diagnostics';
12
16
  import { getPalette, getAvailablePalettes } from './palettes';
@@ -19,40 +23,6 @@ const PALETTES = getAvailablePalettes().map((p) => p.id);
19
23
 
20
24
  const THEMES = ['light', 'dark', 'transparent'] as const;
21
25
 
22
- const CHART_TYPE_DESCRIPTIONS: Record<string, string> = {
23
- bar: 'Bar chart — categorical comparisons',
24
- line: 'Line chart — trends over time',
25
- 'multi-line': 'Multi-line chart — multiple series trends',
26
- area: 'Area chart — filled line chart',
27
- pie: 'Pie chart — part-to-whole proportions',
28
- doughnut: 'Doughnut chart — ring-style pie chart',
29
- radar: 'Radar chart — multi-dimensional metrics',
30
- 'polar-area': 'Polar area chart — radial bar chart',
31
- 'bar-stacked': 'Stacked bar chart — multi-series categorical',
32
- scatter: 'Scatter plot — 2D data points or bubble chart',
33
- sankey: 'Sankey diagram — flow/allocation visualization',
34
- chord: 'Chord diagram — circular flow relationships',
35
- function: 'Function plot — mathematical expressions',
36
- heatmap: 'Heatmap — matrix intensity visualization',
37
- funnel: 'Funnel chart — conversion pipeline',
38
- slope: 'Slope chart — change between two periods',
39
- wordcloud: 'Word cloud — term frequency visualization',
40
- arc: 'Arc diagram — network relationships',
41
- timeline: 'Timeline — events, eras, and date ranges',
42
- venn: 'Venn diagram — set overlaps',
43
- quadrant: 'Quadrant chart — 2x2 positioning matrix',
44
- sequence: 'Sequence diagram — message/interaction flows',
45
- flowchart: 'Flowchart — decision trees and process flows',
46
- class: 'Class diagram — UML class hierarchies',
47
- er: 'ER diagram — database schemas and relationships',
48
- org: 'Org chart — hierarchical tree structures',
49
- kanban: 'Kanban board — task/workflow columns',
50
- c4: 'C4 diagram — system architecture (context, container, component, deployment)',
51
- infra: 'Infra chart — infrastructure traffic flow with rps computation',
52
- 'boxes-and-lines':
53
- 'Boxes and lines — general-purpose node-edge diagrams with groups and tags',
54
- };
55
-
56
26
  const CLAUDE_SKILL_CONTENT = `# dgmo — Diagrammo Diagram Assistant
57
27
 
58
28
  You are helping the user author, render, and share diagrams using the \`dgmo\` CLI and \`.dgmo\` file format.