@diagrammo/dgmo 0.63.0 → 0.64.1
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.
- package/README.md +2 -2
- package/dist/advanced.js +48 -45
- package/dist/block.js +7 -7
- package/dist/{charts-d3-M76E4TZU.js → charts-d3-ZTXJWEHI.js} +4 -4
- package/dist/{chunk-BIWMOFSE.js → chunk-2KOBOIB2.js} +2 -2
- package/dist/{chunk-KHTKMVKT.js → chunk-67D4MN2H.js} +2 -2
- package/dist/{chunk-TJCHULP5.js → chunk-7GUYGQR4.js} +2 -2
- package/dist/{chunk-2LN5C6FH.js → chunk-7T3A2UK3.js} +10 -6
- package/dist/{chunk-W32HMBPW.js → chunk-B6AONGTI.js} +3 -3
- package/dist/{chunk-DY4VJYG7.js → chunk-C6DMG2V6.js} +3 -3
- package/dist/{chunk-MD2KWAXJ.js → chunk-CDMF7P5A.js} +2 -2
- package/dist/{chunk-HBSKE3ML.js → chunk-CZUSH6NI.js} +3 -3
- package/dist/{chunk-USHDV2AF.js → chunk-DB2KQ5DN.js} +3 -3
- package/dist/{chunk-34HQALZ5.js → chunk-DN5HEDE4.js} +3 -3
- package/dist/{chunk-PUFWYDWP.js → chunk-FRC4LDTQ.js} +3 -3
- package/dist/{chunk-MRD4QWFK.js → chunk-I24O2RWT.js} +2 -2
- package/dist/{chunk-VWCGN2ST.js → chunk-I2ATN25N.js} +3 -3
- package/dist/{chunk-SSR6JAR3.js → chunk-IGIJZHB6.js} +2 -2
- package/dist/{chunk-3HYRJAXO.js → chunk-IX6N5MCY.js} +3 -3
- package/dist/{chunk-AKD3YZ54.js → chunk-KPX2OWZR.js} +3 -3
- package/dist/{chunk-L26ZAPNJ.js → chunk-KZ3PCDUJ.js} +2 -2
- package/dist/{chunk-UZ3JPYD3.js → chunk-L4IN4OBB.js} +3 -3
- package/dist/{chunk-RZRMSNO7.js → chunk-LMXAB4YM.js} +3 -3
- package/dist/{chunk-X4FCKGK2.js → chunk-LYTEVE2N.js} +3 -3
- package/dist/{chunk-NQH2Q2RR.js → chunk-M4HYPDER.js} +3 -3
- package/dist/{chunk-L57TSE53.js → chunk-MHI6W6XS.js} +3 -3
- package/dist/{chunk-ZXLXAOCM.js → chunk-MQHOKBJ6.js} +3 -3
- package/dist/{chunk-U22TKD3L.js → chunk-NIZM3LAG.js} +4 -4
- package/dist/{chunk-A34FVVVI.js → chunk-NKRCPBTJ.js} +2 -2
- package/dist/{chunk-XXDEQSW4.js → chunk-OBKM6GIJ.js} +3 -3
- package/dist/{chunk-BPINSP65.js → chunk-OMTBYLKN.js} +4 -4
- package/dist/{chunk-UKZ7K5GS.js → chunk-RBAW7VUG.js} +4 -3
- package/dist/{chunk-KK5LQIN7.js → chunk-RBBJIHNL.js} +4 -4
- package/dist/{chunk-DUHKYKI7.js → chunk-RQL25P3U.js} +4 -4
- package/dist/{chunk-MR2XKW35.js → chunk-S5RWWISJ.js} +2 -2
- package/dist/{chunk-BGITRLTR.js → chunk-SMCUX42K.js} +2 -2
- package/dist/{chunk-PTKCX5ZE.js → chunk-SPHC4RYF.js} +3 -3
- package/dist/{chunk-TRP7PC5Z.js → chunk-SVR3YFM3.js} +3 -3
- package/dist/{chunk-YVI3JL3S.js → chunk-T4QXHE34.js} +4 -4
- package/dist/{chunk-SV7F363F.js → chunk-TAJ2XFTT.js} +3 -3
- package/dist/{chunk-SBOG6R6A.js → chunk-V3UQSKWJ.js} +3 -3
- package/dist/{chunk-QRHA7WIU.js → chunk-VOJOARA6.js} +42 -42
- package/dist/{chunk-2PTK46E2.js → chunk-WDJ4HAGO.js} +2 -2
- package/dist/{chunk-QFNRHY62.js → chunk-XUN3MIO3.js} +2 -2
- package/dist/{chunk-L4B4GRVS.js → chunk-YHTKDIF2.js} +3 -3
- package/dist/{chunk-IMXG673Y.js → chunk-YLK3JNWP.js} +2 -2
- package/dist/{chunk-GCVTU64J.js → chunk-Z2ADWRSW.js} +3 -3
- package/dist/{chunk-6KFWC4CO.js → chunk-Z5ID35YP.js} +4 -2
- package/dist/{flowchart-renderer-BCVCIZHF.js → flowchart-renderer-EXMRHFTQ.js} +3 -3
- package/dist/index.js +7 -7
- package/dist/{renderer-XIJO7DYS.js → renderer-2ARNFXSC.js} +4 -4
- package/dist/{renderer-NKVIQA3C.js → renderer-2E7LQC32.js} +3 -3
- package/dist/{renderer-CU6BEHHV.js → renderer-7OOC2ZO2.js} +3 -3
- package/dist/{renderer-UTXVIAS7.js → renderer-BYWLJDT4.js} +4 -4
- package/dist/{renderer-AVR3LBTS.js → renderer-C6KOE774.js} +4 -4
- package/dist/{renderer-M7YOXAGC.js → renderer-DMVUBKP7.js} +3 -3
- package/dist/{renderer-5HYDLCMX.js → renderer-FCO42JLK.js} +4 -4
- package/dist/{renderer-HPQJRSON.js → renderer-H6AQ4UIR.js} +4 -4
- package/dist/{renderer-BBBN7QNX.js → renderer-HLWEJQJW.js} +3 -3
- package/dist/{renderer-HGWKAXS6.js → renderer-IN3UPTZS.js} +3 -3
- package/dist/{renderer-TDFRMG3O.js → renderer-KK2534AF.js} +3 -3
- package/dist/{renderer-TTMBG2N6.js → renderer-KOWVTTYR.js} +4 -4
- package/dist/{renderer-PKST5W6U.js → renderer-KPEQ72FY.js} +5 -5
- package/dist/{renderer-DRLZELXM.js → renderer-LO4FXQHP.js} +4 -4
- package/dist/{renderer-KHVAM4IY.js → renderer-LSBXYOID.js} +4 -4
- package/dist/{renderer-K3TH5PP7.js → renderer-M3PQKXK2.js} +5 -5
- package/dist/{renderer-AMCTCBV3.js → renderer-M43ROWET.js} +4 -4
- package/dist/{renderer-Q2YHQQSN.js → renderer-NHFRVCDC.js} +4 -4
- package/dist/{renderer-JL7L5Y5M.js → renderer-OA7FSZ4A.js} +3 -3
- package/dist/{renderer-CHHYNEK7.js → renderer-OB77AT7V.js} +4 -4
- package/dist/{renderer-35F3XMZH.js → renderer-OYTERGAO.js} +4 -4
- package/dist/{renderer-4VDSMPYU.js → renderer-PM7JPC3J.js} +5 -5
- package/dist/{renderer-XDL6PRLN.js → renderer-QEHUJHRK.js} +4 -4
- package/dist/{renderer-2DKA5QXA.js → renderer-QR5343AR.js} +3 -3
- package/dist/{renderer-JBF2PAVP.js → renderer-T5CUGSXP.js} +4 -4
- package/dist/{renderer-CXAL2FYB.js → renderer-WN47AMUM.js} +4 -4
- package/dist/{renderer-ZHBFOSK5.js → renderer-WR3FA3FF.js} +4 -4
- package/dist/{renderer-RN5ZFIEK.js → renderer-XLEYPLVL.js} +4 -4
- package/dist/{renderer-DJ5DP3RH.js → renderer-XLPNUOYA.js} +4 -4
- package/dist/{renderer-RJT3MOUU.js → renderer-YBEZ5V2H.js} +3 -3
- package/dist/{renderer-KKNXTTFE.js → renderer-YELZR4QT.js} +6 -6
- package/dist/{renderer-5SN6N5VN.js → renderer-YLM4CGBG.js} +4 -4
- package/dist/{renderer-726UVOKE.js → renderer-ZNTLBQ45.js} +4 -4
- package/dist/{renderer-radial-4J2KO4GZ.js → renderer-radial-XWAKJACV.js} +4 -4
- package/dist/{state-renderer-MCWCZ76U.js → state-renderer-LIESKSBO.js} +4 -4
- package/package.json +1 -1
- package/dist/advanced.d.ts +0 -6771
- package/dist/auto.css +0 -557
- package/dist/auto.js +0 -886
- package/dist/block.d.ts +0 -142
- package/dist/chart-meta-D98NbYDp.d.ts +0 -238
- package/dist/chart-meta.d.ts +0 -2
- package/dist/cloud-reference.d.ts +0 -96
- package/dist/completion-registry.d.ts +0 -129
- package/dist/dgmo-router-Dd5PTjxl.d.ts +0 -540
- package/dist/element.js +0 -889
- package/dist/index.d.ts +0 -207
- package/dist/live-link-resolve.d.ts +0 -73
- package/dist/themes-DiUAG4Bf.d.ts +0 -631
|
@@ -1,540 +0,0 @@
|
|
|
1
|
-
type DgmoSeverity = 'error' | 'warning';
|
|
2
|
-
interface DgmoError {
|
|
3
|
-
line: number;
|
|
4
|
-
column?: number;
|
|
5
|
-
message: string;
|
|
6
|
-
severity: DgmoSeverity;
|
|
7
|
-
/**
|
|
8
|
-
* Optional stable diagnostic code (e.g. 'E_ARROW_SUBSTRING_IN_LABEL').
|
|
9
|
-
* Additive; pre-existing diagnostics omit this field and existing
|
|
10
|
-
* substring-on-`.message` assertions keep working unchanged.
|
|
11
|
-
*/
|
|
12
|
-
code?: string;
|
|
13
|
-
}
|
|
14
|
-
declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity, code?: string): DgmoError;
|
|
15
|
-
/** Runtime params passed to `emit()` and forwarded to a message builder. */
|
|
16
|
-
type DiagnosticParams = Record<string, unknown>;
|
|
17
|
-
/**
|
|
18
|
-
* Parameter type for a `DiagnosticSpec.message` builder body. Typed loosely
|
|
19
|
-
* (`any`) on purpose: builders are hand-authored interpolation bags keyed by
|
|
20
|
-
* ad-hoc names, and dgmo's tsconfig enables `noPropertyAccessFromIndexSignature`
|
|
21
|
-
* (which forbids `p.name` dot-access on a `Record<string, unknown>`). Using
|
|
22
|
-
* `any` here keeps builder bodies readable (`p.name`) instead of forcing
|
|
23
|
-
* `p['name']` bracket access at every interpolation site.
|
|
24
|
-
*/
|
|
25
|
-
type DiagnosticMessageParams = any;
|
|
26
|
-
interface DiagnosticSpec {
|
|
27
|
-
/** Stable diagnostic code, e.g. `'E_MAP_UNKNOWN_PLACE'`. */
|
|
28
|
-
code: string;
|
|
29
|
-
/** Severity — must agree with the `E_`/`W_`/`I_` code prefix. */
|
|
30
|
-
severity: DgmoSeverity;
|
|
31
|
-
/** Owning chart type (`'map'`, `'swimlane'`, …) or `null` for universal/global codes. */
|
|
32
|
-
chartType: string | null;
|
|
33
|
-
/** Short human label for the catalog UI. */
|
|
34
|
-
title: string;
|
|
35
|
-
/**
|
|
36
|
-
* Canonical message wording. A plain string for static messages, or a
|
|
37
|
-
* builder `(params) => string` when the message interpolates runtime
|
|
38
|
-
* values. The builder must tolerate being called with `{}` so the
|
|
39
|
-
* catalog can show a representative message without live params.
|
|
40
|
-
*/
|
|
41
|
-
message: string | ((params: DiagnosticMessageParams) => string);
|
|
42
|
-
/** Optional fix guidance shown alongside the message. */
|
|
43
|
-
hint?: string;
|
|
44
|
-
/** Minimal `.dgmo` source that triggers this diagnostic (for docs/console). */
|
|
45
|
-
example?: string;
|
|
46
|
-
}
|
|
47
|
-
/** Optional extras when emitting (currently just an explicit column). */
|
|
48
|
-
interface EmitOptions {
|
|
49
|
-
column?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Emit a diagnostic from its `DiagnosticSpec`. The code, severity, and
|
|
53
|
-
* canonical wording all come from the spec — call sites supply only the
|
|
54
|
-
* line and the interpolation params, so the code/severity can never drift
|
|
55
|
-
* out of sync with the declared spec. Replaces the per-parser
|
|
56
|
-
* `push`/`err`/`fail` wrappers that each re-declared this shape.
|
|
57
|
-
*/
|
|
58
|
-
declare function emit(spec: DiagnosticSpec, line: number, params?: DiagnosticParams, opts?: EmitOptions): DgmoError;
|
|
59
|
-
declare function formatDgmoError(err: DgmoError): string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Compact view state schema (ADR-6).
|
|
63
|
-
* All fields optional. Only non-default values are encoded.
|
|
64
|
-
* `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
|
|
65
|
-
*/
|
|
66
|
-
interface CompactViewState {
|
|
67
|
-
tag?: string | null;
|
|
68
|
-
cs?: number[];
|
|
69
|
-
cg?: string[];
|
|
70
|
-
swim?: string | null;
|
|
71
|
-
cl?: string[];
|
|
72
|
-
cc?: string[];
|
|
73
|
-
rm?: string;
|
|
74
|
-
htv?: Record<string, string[]>;
|
|
75
|
-
ha?: string[];
|
|
76
|
-
sem?: boolean;
|
|
77
|
-
cm?: boolean;
|
|
78
|
-
c4l?: string;
|
|
79
|
-
c4s?: string;
|
|
80
|
-
c4c?: string;
|
|
81
|
-
rps?: number;
|
|
82
|
-
spd?: number;
|
|
83
|
-
io?: Record<string, number>;
|
|
84
|
-
hd?: boolean;
|
|
85
|
-
cbd?: boolean;
|
|
86
|
-
rq?: string;
|
|
87
|
-
an?: boolean;
|
|
88
|
-
fl?: boolean;
|
|
89
|
-
}
|
|
90
|
-
interface DecodedDiagramUrl {
|
|
91
|
-
dsl: string;
|
|
92
|
-
viewState: CompactViewState;
|
|
93
|
-
palette?: string;
|
|
94
|
-
theme?: 'light' | 'dark';
|
|
95
|
-
filename?: string;
|
|
96
|
-
}
|
|
97
|
-
interface EncodeDiagramUrlOptions {
|
|
98
|
-
baseUrl?: string;
|
|
99
|
-
viewState?: CompactViewState;
|
|
100
|
-
palette?: string;
|
|
101
|
-
theme?: 'light' | 'dark';
|
|
102
|
-
filename?: string;
|
|
103
|
-
}
|
|
104
|
-
type EncodeDiagramUrlResult = {
|
|
105
|
-
url: string;
|
|
106
|
-
error?: undefined;
|
|
107
|
-
} | {
|
|
108
|
-
url?: undefined;
|
|
109
|
-
error: 'too-large';
|
|
110
|
-
compressedSize: number;
|
|
111
|
-
limit: number;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Encode a CompactViewState to a compressed string for URL embedding.
|
|
115
|
-
* Returns empty string if state has no keys (ADR-4).
|
|
116
|
-
*/
|
|
117
|
-
declare function encodeViewState(state: CompactViewState): string;
|
|
118
|
-
/**
|
|
119
|
-
* Decode a compressed view state string back to CompactViewState.
|
|
120
|
-
* Returns empty object on failure (no crash).
|
|
121
|
-
*/
|
|
122
|
-
declare function decodeViewState(encoded: string): CompactViewState;
|
|
123
|
-
/**
|
|
124
|
-
* Compress a DGMO DSL string into a shareable URL.
|
|
125
|
-
* Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
|
|
126
|
-
* compressed payload exceeds the 8 KB limit.
|
|
127
|
-
*/
|
|
128
|
-
declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
|
|
129
|
-
/**
|
|
130
|
-
* Decode a DGMO DSL string and view state from a URL query string or hash.
|
|
131
|
-
* Accepts any of:
|
|
132
|
-
* - `?dgmo=<payload>&vs=<state>`
|
|
133
|
-
* - `#dgmo=<payload>&vs=<state>` (backwards compat)
|
|
134
|
-
* - `dgmo=<payload>`
|
|
135
|
-
* - `<bare payload>`
|
|
136
|
-
*
|
|
137
|
-
* Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
|
|
138
|
-
*/
|
|
139
|
-
declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Color definitions for a single mode (light or dark).
|
|
143
|
-
* 10 semantic UI colors + 9 named accent colors = 19 total.
|
|
144
|
-
*
|
|
145
|
-
* `readonly` on every field (and the nested `colors` map) by design —
|
|
146
|
-
* palettes flow from the registry into every renderer; nothing in the
|
|
147
|
-
* pipeline should ever mutate a palette in place.
|
|
148
|
-
*/
|
|
149
|
-
interface PaletteColors {
|
|
150
|
-
/** Main background (#eceff4 light / #2e3440 dark for Nord) */
|
|
151
|
-
readonly bg: string;
|
|
152
|
-
/** Cards, panels (#e5e9f0 / #3b4252) */
|
|
153
|
-
readonly surface: string;
|
|
154
|
-
/** Popovers, dropdowns (#e5e9f0 / #434c5e) */
|
|
155
|
-
readonly overlay: string;
|
|
156
|
-
/** Borders, dividers, muted (#d8dee9 / #4c566a) */
|
|
157
|
-
readonly border: string;
|
|
158
|
-
/** Primary text (#2e3440 / #eceff4) */
|
|
159
|
-
readonly text: string;
|
|
160
|
-
/** Secondary/diminished text (#4c566a / #d8dee9) */
|
|
161
|
-
readonly textMuted: string;
|
|
162
|
-
/**
|
|
163
|
-
* Light-mode arg for `contrastText()` when text is rendered on a
|
|
164
|
-
* tinted shape fill (e.g. `shapeFill()` output). Must guarantee
|
|
165
|
-
* ≥ 4.5:1 WCAG AA against any `shapeFill()` the palette can produce.
|
|
166
|
-
* Distinct from `colors.white` because palette-aesthetic anchors don't
|
|
167
|
-
* always meet contrast requirements (TD-5).
|
|
168
|
-
*/
|
|
169
|
-
readonly textOnFillLight: string;
|
|
170
|
-
/** Dark-mode counterpart to `textOnFillLight`. */
|
|
171
|
-
readonly textOnFillDark: string;
|
|
172
|
-
/** Primary accent — buttons, links */
|
|
173
|
-
readonly primary: string;
|
|
174
|
-
/** Secondary accent */
|
|
175
|
-
readonly secondary: string;
|
|
176
|
-
/** Tertiary accent */
|
|
177
|
-
readonly accent: string;
|
|
178
|
-
/** Error/danger */
|
|
179
|
-
readonly destructive: string;
|
|
180
|
-
/**
|
|
181
|
-
* Used for: inline annotations (red), pie charts, cScale,
|
|
182
|
-
* series rotation, journey actors, Gantt tasks.
|
|
183
|
-
*/
|
|
184
|
-
readonly colors: {
|
|
185
|
-
readonly red: string;
|
|
186
|
-
readonly orange: string;
|
|
187
|
-
readonly yellow: string;
|
|
188
|
-
readonly green: string;
|
|
189
|
-
readonly blue: string;
|
|
190
|
-
readonly purple: string;
|
|
191
|
-
readonly teal: string;
|
|
192
|
-
readonly cyan: string;
|
|
193
|
-
readonly gray: string;
|
|
194
|
-
readonly black: string;
|
|
195
|
-
readonly white: string;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Complete palette definition. One object per color scheme.
|
|
200
|
-
* This is what palette authors create — the single artifact for NFR1.
|
|
201
|
-
*
|
|
202
|
-
* Palettes are immutable from the consumer's perspective; the registry
|
|
203
|
-
* hands out the same frozen-shape object on every `getPalette(id)`.
|
|
204
|
-
*/
|
|
205
|
-
interface PaletteConfig {
|
|
206
|
-
/** Registry key: 'nord', 'slate', 'catppuccin' */
|
|
207
|
-
readonly id: string;
|
|
208
|
-
/** Display name: 'Nord', 'Slate', 'Catppuccin' */
|
|
209
|
-
readonly name: string;
|
|
210
|
-
/** Light mode color definitions */
|
|
211
|
-
readonly light: PaletteColors;
|
|
212
|
-
/** Dark mode color definitions */
|
|
213
|
-
readonly dark: PaletteColors;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/** A single entry inside a tag group: `Value color` */
|
|
217
|
-
interface TagEntry {
|
|
218
|
-
readonly value: string;
|
|
219
|
-
readonly color: string;
|
|
220
|
-
/**
|
|
221
|
-
* The color NAME the author wrote (one of the recognized palette names),
|
|
222
|
-
* when the entry declared an explicit color. Absent for bare/auto-colored
|
|
223
|
-
* entries. `color` above is always the RESOLVED hex (auto and explicit are
|
|
224
|
-
* indistinguishable there); this preserves the authored-vs-auto distinction
|
|
225
|
-
* so a GUI editor can round-trip an explicit color through a reparse.
|
|
226
|
-
*/
|
|
227
|
-
readonly authoredColor?: string;
|
|
228
|
-
readonly lineNumber: number;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* A tag group block: heading + entries.
|
|
232
|
-
*
|
|
233
|
-
* Parser internals build via `Writable<TagGroup>` from `utils/brand.ts`;
|
|
234
|
-
* once returned to a chart-type parser, consumers see the readonly view.
|
|
235
|
-
*/
|
|
236
|
-
interface TagGroup {
|
|
237
|
-
readonly name: string;
|
|
238
|
-
readonly alias?: string;
|
|
239
|
-
readonly entries: readonly TagEntry[];
|
|
240
|
-
/** Default value for nodes without explicit metadata. First entry unless another is marked `default`. */
|
|
241
|
-
readonly defaultValue?: string;
|
|
242
|
-
readonly lineNumber: number;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* DOM-safe key for a tag group — used wherever the group name becomes a
|
|
246
|
-
* `data-tag-*` attribute suffix, an entity metadata key, or an `active-tag`
|
|
247
|
-
* match target. For a single-identifier name (the only form the parser used to
|
|
248
|
-
* accept) this is exactly `name.toLowerCase()`, so swapping it in for existing
|
|
249
|
-
* diagrams is byte-identical. A quoted multi-word name (`tag "Trust Zone" as tz`)
|
|
250
|
-
* slugs to a hyphenated identifier (`trust-zone`) so it never produces an
|
|
251
|
-
* invalid DOM attribute name; the original `name` is kept for the legend label.
|
|
252
|
-
*/
|
|
253
|
-
declare function tagAttrKey(name: string): string;
|
|
254
|
-
/**
|
|
255
|
-
* The categorical name cycle used to auto-assign colors to bare tag values,
|
|
256
|
-
* in deterministic order. Aliased to the shared {@link CATEGORICAL_COLOR_ORDER}
|
|
257
|
-
* (RGB-seeded, max-contrast, neutrals excluded) so tag swatches and data-chart
|
|
258
|
-
* series colors share one canonical rotation. If a group has more colorless
|
|
259
|
-
* entries than free categorical names, the cycle wraps.
|
|
260
|
-
*/
|
|
261
|
-
declare const autoTagColorCycle: readonly string[];
|
|
262
|
-
|
|
263
|
-
/** Validate that a hex string is well-formed (#RGB or #RRGGBB). */
|
|
264
|
-
declare function isValidHex(value: string): boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Register a palette. Called at module initialization.
|
|
267
|
-
* Validates that all 19 color fields per mode are present and valid hex.
|
|
268
|
-
* Throws on malformed palettes to catch errors at startup, not at render time.
|
|
269
|
-
*/
|
|
270
|
-
declare function registerPalette(palette: PaletteConfig): void;
|
|
271
|
-
/** Get palette by id. Silently returns the default palette if id is unrecognized. */
|
|
272
|
-
declare function getPalette(id: string): PaletteConfig;
|
|
273
|
-
/**
|
|
274
|
-
* Resolve a palette by id, falling back to the default palette when the id is
|
|
275
|
-
* unregistered. If a `warn` callback is supplied, it is invoked once with a
|
|
276
|
-
* human-readable fallback message on a miss — the single place the "resolve,
|
|
277
|
-
* fall back, warn" policy lives, so each host can surface it its own way
|
|
278
|
-
* (console.warn, Obsidian Notice, MCP response). Silent when the id resolves or
|
|
279
|
-
* when no callback is passed.
|
|
280
|
-
*/
|
|
281
|
-
declare function resolvePaletteOrFallback(id: string, warn?: (message: string) => void): PaletteConfig;
|
|
282
|
-
/** List all registered palettes alphabetically (for the selector UI). */
|
|
283
|
-
declare function getAvailablePalettes(): PaletteConfig[];
|
|
284
|
-
|
|
285
|
-
interface ChartTypeMeta {
|
|
286
|
-
readonly id: string;
|
|
287
|
-
readonly description: string;
|
|
288
|
-
readonly fallback?: true;
|
|
289
|
-
/**
|
|
290
|
-
* Routable but never OFFERED. The type parses, routes and renders like any
|
|
291
|
-
* other, but no surface that enumerates types for a human or a model may list
|
|
292
|
-
* it — nobody hand-authors one, so a picker entry would produce a file the
|
|
293
|
-
* user cannot complete.
|
|
294
|
-
*
|
|
295
|
-
* Honoured at five edges, and deliberately NOT inside `getAllChartTypes()`,
|
|
296
|
-
* which keeps meaning "everything routable":
|
|
297
|
-
* 1. `cli.ts` — `dgmo types` (plain and `--json`)
|
|
298
|
-
* 2. `completion-registry.ts` — the chart-type completion popup
|
|
299
|
-
* 3. `dgmo-mcp/src/index.ts` — the `list_chart_types` tool
|
|
300
|
-
* 4. `dgmo-mcp/src/suggest/scoring.ts` — the suggester's candidate pool
|
|
301
|
-
* 5. `scripts/gen-ai-core.mjs` — the generated AI core every model reads
|
|
302
|
-
* `tests/internal-chart-types.test.ts` is this flag's specification; without
|
|
303
|
-
* it the flag is a convention and the next refactor drops an edge silently.
|
|
304
|
-
*/
|
|
305
|
-
readonly internal?: true;
|
|
306
|
-
}
|
|
307
|
-
declare const chartTypesData: readonly [{
|
|
308
|
-
readonly id: "journey-map";
|
|
309
|
-
readonly description: "User experience flow with emotion scores, phases, and annotations";
|
|
310
|
-
}, {
|
|
311
|
-
readonly id: "c4";
|
|
312
|
-
readonly description: "System architecture (context, container, component, deployment)";
|
|
313
|
-
}, {
|
|
314
|
-
readonly id: "er";
|
|
315
|
-
readonly description: "Database schemas and relationships";
|
|
316
|
-
}, {
|
|
317
|
-
readonly id: "class";
|
|
318
|
-
readonly description: "UML class hierarchies";
|
|
319
|
-
}, {
|
|
320
|
-
readonly id: "sequence";
|
|
321
|
-
readonly description: "Message request and response interaction flows";
|
|
322
|
-
readonly fallback: true;
|
|
323
|
-
}, {
|
|
324
|
-
readonly id: "state";
|
|
325
|
-
readonly description: "State machine / lifecycle transitions";
|
|
326
|
-
}, {
|
|
327
|
-
readonly id: "infra";
|
|
328
|
-
readonly description: "Infrastructure traffic flow with RPS computation";
|
|
329
|
-
}, {
|
|
330
|
-
readonly id: "gantt";
|
|
331
|
-
readonly description: "Project scheduling with task dependencies and milestones";
|
|
332
|
-
}, {
|
|
333
|
-
readonly id: "pert";
|
|
334
|
-
readonly description: "Project network with three-point estimates, critical path, and uncertainty (Beta-PERT, Monte Carlo)";
|
|
335
|
-
}, {
|
|
336
|
-
readonly id: "swimlane";
|
|
337
|
-
readonly description: "Cross-functional process flow with lanes, phases and gateways (BPMN-style)";
|
|
338
|
-
}, {
|
|
339
|
-
readonly id: "version-control";
|
|
340
|
-
readonly description: "Git / version-control branch-and-merge graph: commits, branches, merges, rebase, HEAD and remote-tracking (gitGraph-style)";
|
|
341
|
-
}, {
|
|
342
|
-
readonly id: "timeline";
|
|
343
|
-
readonly description: "Events, eras, and date ranges";
|
|
344
|
-
}, {
|
|
345
|
-
readonly id: "event-line";
|
|
346
|
-
readonly description: "Annotated narrative timeline — events on a horizontal line with descriptions (not the date-scaled timeline)";
|
|
347
|
-
}, {
|
|
348
|
-
readonly id: "body";
|
|
349
|
-
readonly description: "Human anatomy figure annotated by muscle/bone/joint name — for medical, exercise, and educational diagrams";
|
|
350
|
-
}, {
|
|
351
|
-
readonly id: "org";
|
|
352
|
-
readonly description: "Reporting hierarchy";
|
|
353
|
-
}, {
|
|
354
|
-
readonly id: "family";
|
|
355
|
-
readonly description: "Family tree / genealogy: unions (couples), children, remarriage, adoption, and GEDCOM-style metadata";
|
|
356
|
-
}, {
|
|
357
|
-
readonly id: "sitemap";
|
|
358
|
-
readonly description: "Site / app navigation structure";
|
|
359
|
-
}, {
|
|
360
|
-
readonly id: "bracket";
|
|
361
|
-
readonly description: "Single-elimination tournament bracket: winners auto-advance up a tree; seed the field for a day-0 skeleton or list results for a casual bracket, with two sides mirroring inward to a championship";
|
|
362
|
-
}, {
|
|
363
|
-
readonly id: "kanban";
|
|
364
|
-
readonly description: "Task board columns";
|
|
365
|
-
}, {
|
|
366
|
-
readonly id: "raci";
|
|
367
|
-
readonly description: "Tasks × roles responsibility matrix with constraint linting";
|
|
368
|
-
}, {
|
|
369
|
-
readonly id: "tech-radar";
|
|
370
|
-
readonly description: "Technology adoption quadrants (adopt/trial/assess/hold)";
|
|
371
|
-
}, {
|
|
372
|
-
readonly id: "mindmap";
|
|
373
|
-
readonly description: "Radial hierarchy of ideas branching from a central topic";
|
|
374
|
-
}, {
|
|
375
|
-
readonly id: "wireframe";
|
|
376
|
-
readonly description: "Low-fidelity UI layout with panels, controls, and annotations";
|
|
377
|
-
}, {
|
|
378
|
-
readonly id: "cycle";
|
|
379
|
-
readonly description: "Cyclical process visualization (PDCA, OODA, DevOps loops)";
|
|
380
|
-
}, {
|
|
381
|
-
readonly id: "pyramid";
|
|
382
|
-
readonly description: "Stacked hierarchy of layers with descriptions (Maslow, DIKW)";
|
|
383
|
-
}, {
|
|
384
|
-
readonly id: "ring";
|
|
385
|
-
readonly description: "Concentric rings showing nested or hierarchical categories (read core-out)";
|
|
386
|
-
}, {
|
|
387
|
-
readonly id: "treemap";
|
|
388
|
-
readonly description: "Nested rectangles sized by value — show a hierarchy’s proportions (budgets, disk usage, portfolios) with color by category, value heatmap, or branch";
|
|
389
|
-
}, {
|
|
390
|
-
readonly id: "block";
|
|
391
|
-
readonly description: "Block diagram: an author-controlled grid of rectangular blocks with nested, collapsible containers — system/hardware/architecture layouts where the 2-D arrangement is the meaning";
|
|
392
|
-
}, {
|
|
393
|
-
readonly id: "sketch";
|
|
394
|
-
readonly description: "GUI-first constrained canvas: uniformly-sized shapes placed freely on a snap grid, arrows between them, meaning through tags — the markup is generated by the canvas editor";
|
|
395
|
-
}, {
|
|
396
|
-
readonly id: "goal";
|
|
397
|
-
readonly description: "Single progress-toward-a-target value (now vs target) as a progress bar, thermometer, or gauge — KPIs, fundraising, quotas, completion";
|
|
398
|
-
}, {
|
|
399
|
-
readonly id: "countdown";
|
|
400
|
-
readonly description: "Live \"N days until X\" that ticks every second and is accurate on every load — trip dates, launches, deadlines; the only dynamic chart type";
|
|
401
|
-
}, {
|
|
402
|
-
readonly id: "clock";
|
|
403
|
-
readonly description: "Live world-clock board: current time for people/places across time zones, ticking every second, with optional working-hours status and sundown line";
|
|
404
|
-
}, {
|
|
405
|
-
readonly id: "map";
|
|
406
|
-
readonly description: "Geographic concept map: highlight/score regions, drop points of interest, connect with routes or edges";
|
|
407
|
-
}, {
|
|
408
|
-
readonly id: "quadrant";
|
|
409
|
-
readonly description: "2x2 positioning matrix";
|
|
410
|
-
}, {
|
|
411
|
-
readonly id: "venn";
|
|
412
|
-
readonly description: "Set overlaps";
|
|
413
|
-
}, {
|
|
414
|
-
readonly id: "funnel";
|
|
415
|
-
readonly description: "Conversion pipeline";
|
|
416
|
-
}, {
|
|
417
|
-
readonly id: "slope";
|
|
418
|
-
readonly description: "Change between 2 time periods";
|
|
419
|
-
}, {
|
|
420
|
-
readonly id: "sankey";
|
|
421
|
-
readonly description: "Flow / allocation visualization";
|
|
422
|
-
}, {
|
|
423
|
-
readonly id: "arc";
|
|
424
|
-
readonly description: "Network relationships (linear or circular via `layout`)";
|
|
425
|
-
}, {
|
|
426
|
-
readonly id: "wordcloud";
|
|
427
|
-
readonly description: "Term frequency visualization";
|
|
428
|
-
}, {
|
|
429
|
-
readonly id: "heatmap";
|
|
430
|
-
readonly description: "Matrix intensity visualization";
|
|
431
|
-
}, {
|
|
432
|
-
readonly id: "function";
|
|
433
|
-
readonly description: "Mathematical expressions";
|
|
434
|
-
}, {
|
|
435
|
-
readonly id: "bar";
|
|
436
|
-
readonly description: "Categorical comparisons for 3 - 5 figures";
|
|
437
|
-
readonly fallback: true;
|
|
438
|
-
}, {
|
|
439
|
-
readonly id: "line";
|
|
440
|
-
readonly description: "Trends over time";
|
|
441
|
-
readonly fallback: true;
|
|
442
|
-
}, {
|
|
443
|
-
readonly id: "pie";
|
|
444
|
-
readonly description: "Part-to-whole proportions";
|
|
445
|
-
}, {
|
|
446
|
-
readonly id: "radar";
|
|
447
|
-
readonly description: "Multi-dimensional metrics";
|
|
448
|
-
}, {
|
|
449
|
-
readonly id: "polar-area";
|
|
450
|
-
readonly description: "Radial bar chart";
|
|
451
|
-
}, {
|
|
452
|
-
readonly id: "scatter";
|
|
453
|
-
readonly description: "2D data points or bubble chart";
|
|
454
|
-
}, {
|
|
455
|
-
readonly id: "flowchart";
|
|
456
|
-
readonly description: "Decision trees and process flows";
|
|
457
|
-
readonly fallback: true;
|
|
458
|
-
}, {
|
|
459
|
-
readonly id: "boxes-and-lines";
|
|
460
|
-
readonly description: "General-purpose node-edge diagrams with groups and tags";
|
|
461
|
-
readonly fallback: true;
|
|
462
|
-
}, {
|
|
463
|
-
readonly id: "live-link";
|
|
464
|
-
readonly description: "A pointer to a diagram published at Diagrammo Cloud";
|
|
465
|
-
readonly internal: true;
|
|
466
|
-
}];
|
|
467
|
-
/**
|
|
468
|
-
* Every chart type the router can dispatch — the "routable" set.
|
|
469
|
-
*
|
|
470
|
-
* Distinct from the "offered" set (`utils/offered-types.ts`), which drops the
|
|
471
|
-
* `internal` types nobody hand-authors. A live link is routable but never
|
|
472
|
-
* offered.
|
|
473
|
-
*
|
|
474
|
-
* This union is the reason the id list lives here: `chart-type-registry.ts`
|
|
475
|
-
* keys its `Record` by it, so a chart type missing from the registry is a
|
|
476
|
-
* compile error, and `ALL_CHART_TYPES` / the editor's `CHART_TYPES` derive from
|
|
477
|
-
* the same array rather than restating it.
|
|
478
|
-
*/
|
|
479
|
-
type ChartTypeId = (typeof chartTypesData)[number]['id'];
|
|
480
|
-
declare const chartTypes: readonly ChartTypeMeta[];
|
|
481
|
-
|
|
482
|
-
/** User-visible rendering category for dispatch and routing. */
|
|
483
|
-
type RenderCategory = 'data-chart' | 'visualization' | 'diagram';
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Extracts the chart type from raw file content.
|
|
487
|
-
* First tries the first non-empty, non-comment line as a bare chart type name
|
|
488
|
-
* (e.g., `gantt Product Launch`).
|
|
489
|
-
* Falls back to inference when no explicit chart type is found.
|
|
490
|
-
*/
|
|
491
|
-
declare function parseDgmoChartType(content: string): string | null;
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Returns the render category for a given chart type, or `null` if unknown.
|
|
495
|
-
* Use this instead of the internal framework map for dispatch in consumers.
|
|
496
|
-
*/
|
|
497
|
-
declare function getRenderCategory(chartType: string): RenderCategory | null;
|
|
498
|
-
/**
|
|
499
|
-
* Returns true if the chart type is an extended chart type
|
|
500
|
-
* handled by parseExtendedChart (scatter, sankey, function, heatmap, funnel).
|
|
501
|
-
* Returns false for standard chart types and all other types.
|
|
502
|
-
*/
|
|
503
|
-
declare function isExtendedChartType(chartType: string): boolean;
|
|
504
|
-
/**
|
|
505
|
-
* Returns all supported chart type identifiers in canonical (tier) order,
|
|
506
|
-
* derived from `chartTypes`. Consumers that need alphabetical order should
|
|
507
|
-
* call `.sort()` explicitly.
|
|
508
|
-
*/
|
|
509
|
-
declare function getAllChartTypes(): string[];
|
|
510
|
-
/**
|
|
511
|
-
* Canonical descriptions for every supported chart type. Derived from
|
|
512
|
-
* `chartTypes` so there is exactly one place to update when adding a new
|
|
513
|
-
* type. Consumed by the CLI `dgmo types` command, the editor autocomplete
|
|
514
|
-
* popup, and the MCP `list_chart_types` tool.
|
|
515
|
-
*/
|
|
516
|
-
declare const CHART_TYPE_DESCRIPTIONS: Record<string, string>;
|
|
517
|
-
type ParseResult = {
|
|
518
|
-
diagnostics: readonly DgmoError[];
|
|
519
|
-
};
|
|
520
|
-
type ParseFn = (content: string) => ParseResult;
|
|
521
|
-
/**
|
|
522
|
-
* Maps every chart-type id to the parser that handles it, DERIVED from
|
|
523
|
-
* `CHART_TYPE_REGISTRY` (src/chart-type-registry.ts). Adding a new chart type
|
|
524
|
-
* means adding ONE descriptor there plus its `chartTypes` metadata entry; the
|
|
525
|
-
* `chart-type-registry.test.ts` cross-check asserts the registry, `chartTypes`,
|
|
526
|
-
* the render-category sites, and the export handlers all stay in sync.
|
|
527
|
-
*/
|
|
528
|
-
declare const chartTypeParsers: ReadonlyArray<readonly [string, ParseFn]>;
|
|
529
|
-
/** Ids in the same order as `chartTypeParsers`; used for cross-checks. */
|
|
530
|
-
declare const knownChartTypeIds: readonly string[];
|
|
531
|
-
/**
|
|
532
|
-
* Parse DGMO content and return diagnostics without rendering.
|
|
533
|
-
* Useful for the CLI and editor to surface all errors before attempting render.
|
|
534
|
-
*/
|
|
535
|
-
declare function parseDgmo(content: string): {
|
|
536
|
-
diagnostics: DgmoError[];
|
|
537
|
-
chartType: string | null;
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
export { isExtendedChartType as A, isValidHex as B, type CompactViewState as C, type DiagnosticSpec as D, type EmitOptions as E, knownChartTypeIds as F, makeDgmoError as G, parseDgmoChartType as H, registerPalette as I, tagAttrKey as J, type PaletteConfig as P, type RenderCategory as R, type TagGroup as T, type DgmoError as a, type ChartTypeId as b, type ChartTypeMeta as c, type DgmoSeverity as d, type DiagnosticParams as e, type PaletteColors as f, chartTypes as g, emit as h, formatDgmoError as i, getPalette as j, type TagEntry as k, CHART_TYPE_DESCRIPTIONS as l, type DecodedDiagramUrl as m, type EncodeDiagramUrlOptions as n, type EncodeDiagramUrlResult as o, parseDgmo as p, autoTagColorCycle as q, resolvePaletteOrFallback as r, chartTypeParsers as s, decodeDiagramUrl as t, decodeViewState as u, encodeDiagramUrl as v, encodeViewState as w, getAllChartTypes as x, getAvailablePalettes as y, getRenderCategory as z };
|