@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.
Files changed (99) hide show
  1. package/README.md +2 -2
  2. package/dist/advanced.js +48 -45
  3. package/dist/block.js +7 -7
  4. package/dist/{charts-d3-M76E4TZU.js → charts-d3-ZTXJWEHI.js} +4 -4
  5. package/dist/{chunk-BIWMOFSE.js → chunk-2KOBOIB2.js} +2 -2
  6. package/dist/{chunk-KHTKMVKT.js → chunk-67D4MN2H.js} +2 -2
  7. package/dist/{chunk-TJCHULP5.js → chunk-7GUYGQR4.js} +2 -2
  8. package/dist/{chunk-2LN5C6FH.js → chunk-7T3A2UK3.js} +10 -6
  9. package/dist/{chunk-W32HMBPW.js → chunk-B6AONGTI.js} +3 -3
  10. package/dist/{chunk-DY4VJYG7.js → chunk-C6DMG2V6.js} +3 -3
  11. package/dist/{chunk-MD2KWAXJ.js → chunk-CDMF7P5A.js} +2 -2
  12. package/dist/{chunk-HBSKE3ML.js → chunk-CZUSH6NI.js} +3 -3
  13. package/dist/{chunk-USHDV2AF.js → chunk-DB2KQ5DN.js} +3 -3
  14. package/dist/{chunk-34HQALZ5.js → chunk-DN5HEDE4.js} +3 -3
  15. package/dist/{chunk-PUFWYDWP.js → chunk-FRC4LDTQ.js} +3 -3
  16. package/dist/{chunk-MRD4QWFK.js → chunk-I24O2RWT.js} +2 -2
  17. package/dist/{chunk-VWCGN2ST.js → chunk-I2ATN25N.js} +3 -3
  18. package/dist/{chunk-SSR6JAR3.js → chunk-IGIJZHB6.js} +2 -2
  19. package/dist/{chunk-3HYRJAXO.js → chunk-IX6N5MCY.js} +3 -3
  20. package/dist/{chunk-AKD3YZ54.js → chunk-KPX2OWZR.js} +3 -3
  21. package/dist/{chunk-L26ZAPNJ.js → chunk-KZ3PCDUJ.js} +2 -2
  22. package/dist/{chunk-UZ3JPYD3.js → chunk-L4IN4OBB.js} +3 -3
  23. package/dist/{chunk-RZRMSNO7.js → chunk-LMXAB4YM.js} +3 -3
  24. package/dist/{chunk-X4FCKGK2.js → chunk-LYTEVE2N.js} +3 -3
  25. package/dist/{chunk-NQH2Q2RR.js → chunk-M4HYPDER.js} +3 -3
  26. package/dist/{chunk-L57TSE53.js → chunk-MHI6W6XS.js} +3 -3
  27. package/dist/{chunk-ZXLXAOCM.js → chunk-MQHOKBJ6.js} +3 -3
  28. package/dist/{chunk-U22TKD3L.js → chunk-NIZM3LAG.js} +4 -4
  29. package/dist/{chunk-A34FVVVI.js → chunk-NKRCPBTJ.js} +2 -2
  30. package/dist/{chunk-XXDEQSW4.js → chunk-OBKM6GIJ.js} +3 -3
  31. package/dist/{chunk-BPINSP65.js → chunk-OMTBYLKN.js} +4 -4
  32. package/dist/{chunk-UKZ7K5GS.js → chunk-RBAW7VUG.js} +4 -3
  33. package/dist/{chunk-KK5LQIN7.js → chunk-RBBJIHNL.js} +4 -4
  34. package/dist/{chunk-DUHKYKI7.js → chunk-RQL25P3U.js} +4 -4
  35. package/dist/{chunk-MR2XKW35.js → chunk-S5RWWISJ.js} +2 -2
  36. package/dist/{chunk-BGITRLTR.js → chunk-SMCUX42K.js} +2 -2
  37. package/dist/{chunk-PTKCX5ZE.js → chunk-SPHC4RYF.js} +3 -3
  38. package/dist/{chunk-TRP7PC5Z.js → chunk-SVR3YFM3.js} +3 -3
  39. package/dist/{chunk-YVI3JL3S.js → chunk-T4QXHE34.js} +4 -4
  40. package/dist/{chunk-SV7F363F.js → chunk-TAJ2XFTT.js} +3 -3
  41. package/dist/{chunk-SBOG6R6A.js → chunk-V3UQSKWJ.js} +3 -3
  42. package/dist/{chunk-QRHA7WIU.js → chunk-VOJOARA6.js} +42 -42
  43. package/dist/{chunk-2PTK46E2.js → chunk-WDJ4HAGO.js} +2 -2
  44. package/dist/{chunk-QFNRHY62.js → chunk-XUN3MIO3.js} +2 -2
  45. package/dist/{chunk-L4B4GRVS.js → chunk-YHTKDIF2.js} +3 -3
  46. package/dist/{chunk-IMXG673Y.js → chunk-YLK3JNWP.js} +2 -2
  47. package/dist/{chunk-GCVTU64J.js → chunk-Z2ADWRSW.js} +3 -3
  48. package/dist/{chunk-6KFWC4CO.js → chunk-Z5ID35YP.js} +4 -2
  49. package/dist/{flowchart-renderer-BCVCIZHF.js → flowchart-renderer-EXMRHFTQ.js} +3 -3
  50. package/dist/index.js +7 -7
  51. package/dist/{renderer-XIJO7DYS.js → renderer-2ARNFXSC.js} +4 -4
  52. package/dist/{renderer-NKVIQA3C.js → renderer-2E7LQC32.js} +3 -3
  53. package/dist/{renderer-CU6BEHHV.js → renderer-7OOC2ZO2.js} +3 -3
  54. package/dist/{renderer-UTXVIAS7.js → renderer-BYWLJDT4.js} +4 -4
  55. package/dist/{renderer-AVR3LBTS.js → renderer-C6KOE774.js} +4 -4
  56. package/dist/{renderer-M7YOXAGC.js → renderer-DMVUBKP7.js} +3 -3
  57. package/dist/{renderer-5HYDLCMX.js → renderer-FCO42JLK.js} +4 -4
  58. package/dist/{renderer-HPQJRSON.js → renderer-H6AQ4UIR.js} +4 -4
  59. package/dist/{renderer-BBBN7QNX.js → renderer-HLWEJQJW.js} +3 -3
  60. package/dist/{renderer-HGWKAXS6.js → renderer-IN3UPTZS.js} +3 -3
  61. package/dist/{renderer-TDFRMG3O.js → renderer-KK2534AF.js} +3 -3
  62. package/dist/{renderer-TTMBG2N6.js → renderer-KOWVTTYR.js} +4 -4
  63. package/dist/{renderer-PKST5W6U.js → renderer-KPEQ72FY.js} +5 -5
  64. package/dist/{renderer-DRLZELXM.js → renderer-LO4FXQHP.js} +4 -4
  65. package/dist/{renderer-KHVAM4IY.js → renderer-LSBXYOID.js} +4 -4
  66. package/dist/{renderer-K3TH5PP7.js → renderer-M3PQKXK2.js} +5 -5
  67. package/dist/{renderer-AMCTCBV3.js → renderer-M43ROWET.js} +4 -4
  68. package/dist/{renderer-Q2YHQQSN.js → renderer-NHFRVCDC.js} +4 -4
  69. package/dist/{renderer-JL7L5Y5M.js → renderer-OA7FSZ4A.js} +3 -3
  70. package/dist/{renderer-CHHYNEK7.js → renderer-OB77AT7V.js} +4 -4
  71. package/dist/{renderer-35F3XMZH.js → renderer-OYTERGAO.js} +4 -4
  72. package/dist/{renderer-4VDSMPYU.js → renderer-PM7JPC3J.js} +5 -5
  73. package/dist/{renderer-XDL6PRLN.js → renderer-QEHUJHRK.js} +4 -4
  74. package/dist/{renderer-2DKA5QXA.js → renderer-QR5343AR.js} +3 -3
  75. package/dist/{renderer-JBF2PAVP.js → renderer-T5CUGSXP.js} +4 -4
  76. package/dist/{renderer-CXAL2FYB.js → renderer-WN47AMUM.js} +4 -4
  77. package/dist/{renderer-ZHBFOSK5.js → renderer-WR3FA3FF.js} +4 -4
  78. package/dist/{renderer-RN5ZFIEK.js → renderer-XLEYPLVL.js} +4 -4
  79. package/dist/{renderer-DJ5DP3RH.js → renderer-XLPNUOYA.js} +4 -4
  80. package/dist/{renderer-RJT3MOUU.js → renderer-YBEZ5V2H.js} +3 -3
  81. package/dist/{renderer-KKNXTTFE.js → renderer-YELZR4QT.js} +6 -6
  82. package/dist/{renderer-5SN6N5VN.js → renderer-YLM4CGBG.js} +4 -4
  83. package/dist/{renderer-726UVOKE.js → renderer-ZNTLBQ45.js} +4 -4
  84. package/dist/{renderer-radial-4J2KO4GZ.js → renderer-radial-XWAKJACV.js} +4 -4
  85. package/dist/{state-renderer-MCWCZ76U.js → state-renderer-LIESKSBO.js} +4 -4
  86. package/package.json +1 -1
  87. package/dist/advanced.d.ts +0 -6771
  88. package/dist/auto.css +0 -557
  89. package/dist/auto.js +0 -886
  90. package/dist/block.d.ts +0 -142
  91. package/dist/chart-meta-D98NbYDp.d.ts +0 -238
  92. package/dist/chart-meta.d.ts +0 -2
  93. package/dist/cloud-reference.d.ts +0 -96
  94. package/dist/completion-registry.d.ts +0 -129
  95. package/dist/dgmo-router-Dd5PTjxl.d.ts +0 -540
  96. package/dist/element.js +0 -889
  97. package/dist/index.d.ts +0 -207
  98. package/dist/live-link-resolve.d.ts +0 -73
  99. package/dist/themes-DiUAG4Bf.d.ts +0 -631
@@ -1,631 +0,0 @@
1
- import { T as TagGroup, a as DgmoError, P as PaletteConfig, f as PaletteColors, C as CompactViewState } from './dgmo-router-Dd5PTjxl.js';
2
-
3
- /** A POI / route-stop position: gazetteer name (+ optional ISO scope) or coords. */
4
- type PoiPos = {
5
- readonly kind: 'coords';
6
- readonly lat: number;
7
- readonly lon: number;
8
- } | {
9
- readonly kind: 'name';
10
- readonly name: string;
11
- readonly scope?: string;
12
- };
13
- /** One-shot directives (§24B.2/.7). Values are raw strings unless typed.
14
- *
15
- * COSMETIC DEFAULTS ARE ON. Every basemap feature renders by default; the only
16
- * control is a bare `no-*` opt-out flag that sets the matching `noXxx` boolean.
17
- * Absent (undefined) = feature ON — so render gates test `!== true`, never
18
- * `=== true`. There are NO positive opt-in cosmetic flags (§24B.2). */
19
- interface MapDirectives {
20
- /** Legend label for the region value ramp (`region-heat <label>`). */
21
- regionMetric?: string;
22
- /** Recognized color NAME for the choropleth ramp HIGH endpoint, peeled off the
23
- * `region-heat` trailing token (§24B.3). Defaults to red when absent. */
24
- regionMetricColor?: string;
25
- /** Recognized color NAME for the choropleth ramp LOW endpoint (the second,
26
- * left-of-two trailing colors on `region-heat`, §24B.3). Absent ⇒ the low
27
- * end is the implied floored neutral (today's single-colour behaviour). */
28
- regionMetricLowColor?: string;
29
- /** Legend label for the POI value (marker size) channel (`poi-size`). */
30
- poiMetric?: string;
31
- /** Legend label for the edge/leg value (thickness) channel (`flow-width`). */
32
- flowMetric?: string;
33
- /** Default ISO scope for bare-name resolution (§24B.8): a 3166-1 country
34
- * (`locale US`) or 3166-2 subdivision (`locale US-GA`). The country part
35
- * biases ambiguous bare cities to that nation; the subdivision part further
36
- * prefers that state. Inferred from content; explicit only to steer a guess. */
37
- locale?: string;
38
- activeTag?: string;
39
- caption?: string;
40
- /** `no-title` — suppress the title banner (the subtitle/caption, if any, still
41
- * render). Mirrors the `no-title` directive across the other chart types. */
42
- noTitle?: boolean;
43
- /** `no-legend` — suppress the legend (default-on). */
44
- noLegend?: boolean;
45
- /** `no-coastline` — suppress the faint nautical-chart water-lines along
46
- * coasts/shorelines (default-on; geometry derived from drawn region paths). */
47
- noCoastline?: boolean;
48
- /** `no-relief` — suppress mountain-range relief hachures. Relief is default-on
49
- * but auto-gated to dataless reference maps at continent/world zoom (§24B.2). */
50
- noRelief?: boolean;
51
- /** `no-context-labels` — suppress the orientation backdrop (water-body names +
52
- * unreferenced notable country names), distinct from `region-labels`. */
53
- noContextLabels?: boolean;
54
- /** `no-region-labels` — suppress region labels (default-on, full→abbrev→hide). */
55
- noRegionLabels?: boolean;
56
- /** `no-region-heat-value` — suppress the metric VALUE shown under each data region's
57
- * name on a `region-heat` choropleth (default-on). The region NAME still
58
- * renders (governed by `no-region-labels`); only the numeric value line goes. */
59
- noRegionValue?: boolean;
60
- /** `no-poi-labels` — suppress POI labels (default-on, collision-managed auto). */
61
- noPoiLabels?: boolean;
62
- /** `no-colorize` — force the plain green-land reference dress even when regions
63
- * are referenced (regions are auto-coloured by default; §24B colorize). A
64
- * no-op under data — the basemap is already gray there. */
65
- noColorize?: boolean;
66
- /** `no-cities` — suppress the subtle gazetteer city dots scattered across the
67
- * basemap for geographic orientation (default-on; population-ranked, spacing-
68
- * thinned so density adapts to zoom). Explicit POIs always draw regardless. */
69
- noCities?: boolean;
70
- /** `no-cluster-pois` — never collapse coincident POI markers into a count badge
71
- * (clustering/spiderfy is default-on in the interactive preview). With this set
72
- * the markers always render fanned out with their legs — the same as a static
73
- * export — so a dense map reads the same on screen as on paper. No-op for
74
- * export (already always expanded). */
75
- noClusterPois?: boolean;
76
- /** `hours 9-17` — availability window for the clock channel (open/closed status
77
- * dot), evaluated per pin in its own zone. Raw string; parsed at resolve.
78
- * Activation is the per-POI `clock` flag (BL-122), not a header directive. */
79
- clockHours?: string;
80
- /** `days mon-fri` — working days for the clock channel window (default mon-fri
81
- * when `hours` is set). Raw string; parsed at resolve. */
82
- clockDays?: string;
83
- }
84
- /** A region-fill: a subdivision name with an optional score and/or tag values
85
- * (§24B.3/.4 — BOTH may be present; bivariate seam). */
86
- interface MapRegion {
87
- readonly name: string;
88
- /** Optional trailing ISO scope qualifier (§24B.8) — a 3166-1 country code
89
- * (`Georgia US` → US context) or 3166-2 subdivision (`Georgia US-GA`).
90
- * Forces the country-vs-state interpretation and silences the ambiguity warning. */
91
- readonly scope?: string;
92
- /** Numeric value → choropleth shade (§24B.3). Lifted out of `meta`. */
93
- readonly value?: number;
94
- /** §1.5 trailing-token color NAME → flat categorical override fill (§24B.4);
95
- * painted regardless of the active colouring dimension, no legend entry. */
96
- readonly color?: string;
97
- /** Tag values keyed by lowercased tag GROUP name (alias is resolved away). */
98
- readonly tags: Readonly<Record<string, string>>;
99
- /** Any remaining reserved keys captured verbatim (`label`/`style`/…). */
100
- readonly meta: Readonly<Record<string, string>>;
101
- readonly lineNumber: number;
102
- }
103
- /** A point of interest (§24B.5). `meta` holds the numeric `value` (→ marker
104
- * size) and `style` verbatim; `label` is lifted out. */
105
- interface MapPoi {
106
- readonly pos: PoiPos;
107
- readonly alias?: string;
108
- readonly label?: string;
109
- /** §1.5 trailing-token color NAME → flat marker fill (§24B.5); wins over a
110
- * tag color and the default orange. */
111
- readonly color?: string;
112
- /** BL-122 — a `clock` control on this POI line: render a live local-time card
113
- * above the marker. Bare (`poi Denver clock`) derives the zone from the place;
114
- * valued (`clock: Europe/Oslo`, held in `meta.clock`) names the zone, for
115
- * bare-coord pins or to override a city. */
116
- readonly clock?: boolean;
117
- readonly tags: Readonly<Record<string, string>>;
118
- readonly meta: Readonly<Record<string, string>>;
119
- readonly lineNumber: number;
120
- }
121
- /** One leg of a route (§24B.6): an edge from the previous stop to `dest`. Reuses
122
- * the indented edge arrow idiom (same as sitemap) — in-arrow text = leg label,
123
- * `width:` = leg thickness, the arrow glyph = shape (`-…->` straight, `~…~>`
124
- * arc). A tag on the leg line colours the LINE (§24B.6); `label:`/`as` still
125
- * name the DESTINATION stop. The arrow is required — a bare destination errors. */
126
- interface MapRouteLeg {
127
- readonly label?: string;
128
- readonly style: 'straight' | 'arc';
129
- readonly value?: string;
130
- readonly dest: PoiPos;
131
- readonly destAlias?: string;
132
- readonly destLabel?: string;
133
- /** Tag(s) on the leg line → colour the LINE itself. To categorise a STOP,
134
- * tag its own `poi` line. */
135
- readonly tags: Readonly<Record<string, string>>;
136
- readonly lineNumber: number;
137
- }
138
- /** An ordered, auto-numbered route (§24B.6): `route <origin>` + a sequence of
139
- * indented arrow legs, each continuing from the previous stop. Leg shape is
140
- * per-leg (the arrow glyph) — there is no header-level shape option. Repeat the
141
- * origin as a leg's destination to close a loop. */
142
- interface MapRoute {
143
- readonly origin: PoiPos;
144
- readonly originAlias?: string;
145
- readonly originLabel?: string;
146
- readonly originValue?: string;
147
- readonly originTags: Readonly<Record<string, string>>;
148
- readonly legs: readonly MapRouteLeg[];
149
- readonly lineNumber: number;
150
- }
151
- /** A connector (§24B.6). Endpoints are RAW identifier strings (name or alias);
152
- * binding to POIs/regions is the resolver's job. Token = arrowhead iff it ends
153
- * in `>`, arc iff it starts with `~`: `->` straight, `~>` arc, `--`/`-label-`
154
- * undirected straight, `~~`/`~label~` undirected arc. */
155
- interface MapEdge {
156
- readonly from: string;
157
- readonly to: string;
158
- readonly label?: string;
159
- readonly directed: boolean;
160
- readonly style: 'straight' | 'arc';
161
- readonly meta: Readonly<Record<string, string>>;
162
- /** Tag(s) on the edge line → colour the LINE itself (§24B.6). */
163
- readonly tags: Readonly<Record<string, string>>;
164
- readonly lineNumber: number;
165
- }
166
- interface ParsedMap {
167
- readonly title: string | null;
168
- readonly titleLineNumber: number | null;
169
- readonly directives: MapDirectives;
170
- readonly tagGroups: readonly TagGroup[];
171
- readonly regions: readonly MapRegion[];
172
- readonly pois: readonly MapPoi[];
173
- readonly routes: readonly MapRoute[];
174
- readonly edges: readonly MapEdge[];
175
- readonly options: Readonly<Record<string, string>>;
176
- readonly diagnostics: readonly DgmoError[];
177
- readonly error: string | null;
178
- }
179
- /** Legend descriptor for a rendered map (a layout-stage output, re-exported from
180
- * `layout.ts`). It lives here so the `legend-band` helper can consume it without
181
- * importing `layout` — `layout` already value-imports `mapLegendBand`, so the
182
- * reverse type import would form a layout↔legend-band cycle. */
183
- interface MapLayoutLegend {
184
- readonly tagGroups: ReadonlyArray<{
185
- name: string;
186
- entries: ReadonlyArray<{
187
- value: string;
188
- color: string;
189
- }>;
190
- }>;
191
- readonly activeGroup: string | null;
192
- readonly ramp?: {
193
- metric?: string;
194
- min: number;
195
- max: number;
196
- /** Resolved hex of the LOW (t=0) endpoint — the explicit low colour, or the
197
- * floored neutral the single-colour fills blend up from. */
198
- low: string;
199
- /** Resolved hex of the HIGH (t=1) endpoint (the named ramp hue). */
200
- high: string;
201
- };
202
- }
203
-
204
- /** A TopoJSON topology (world-coarse/world-detail keyed by ISO 3166-1 alpha-2;
205
- * us-states keyed by ISO 3166-2). Geometry feature `id` is the ISO code;
206
- * `properties.name` is the display string. Kept loose to avoid a topojson dep. */
207
- interface BoundaryTopology {
208
- type: 'Topology';
209
- objects: Record<string, {
210
- type: string;
211
- geometries: BoundaryGeometry[];
212
- }>;
213
- arcs: number[][][];
214
- transform?: {
215
- scale: [number, number];
216
- translate: [number, number];
217
- };
218
- bbox?: number[];
219
- }
220
- interface BoundaryGeometry {
221
- type: string;
222
- /** ISO code: alpha-2 (countries) or 3166-2 `US-XX` (states). */
223
- id: string;
224
- properties: {
225
- name: string;
226
- };
227
- arcs?: unknown;
228
- }
229
- /**
230
- * A gazetteer city entry: `[lat, lon, iso, pop, name, sub?]`.
231
- * - `lat`/`lon` — rounded to 3 decimals.
232
- * - `iso` — ISO 3166-1 alpha-2 country code.
233
- * - `pop` — population.
234
- * - `name` — canonical display name (case/accents preserved).
235
- * - `sub` — ISO 3166-2 subdivision (US cities only in v1, e.g. `US-OR`); absent otherwise.
236
- */
237
- type GazetteerEntry = [
238
- lat: number,
239
- lon: number,
240
- iso: string,
241
- pop: number,
242
- name: string,
243
- sub?: string
244
- ];
245
- interface Gazetteer {
246
- /** Every city, stored once. `byName`/`alt` reference cities by array index
247
- * (normalized — no tuple duplication; geonameid is a build-time-only linker). */
248
- cities: GazetteerEntry[];
249
- /** Folded (NFD, diacritic-stripped, lowercased) name → indices into `cities`.
250
- * Always an array; length > 1 for same-named cities (Portland US-OR / US-ME). */
251
- byName: Record<string, number[]>;
252
- /** Folded alias → index into `cities`. Never collides with a `byName` key. */
253
- alt: Record<string, number>;
254
- /** BL-122 clock-on-map: distinct IANA zone ids (sorted), referenced by `tz`. */
255
- zones?: string[];
256
- /** BL-122: IANA zone per city, parallel to `cities` — `tz[i]` indexes `zones`
257
- * (−1 when a city had no GeoNames match). Lets `poi Denver clock` derive its
258
- * local time without the author restating the zone. */
259
- tz?: number[];
260
- }
261
- /**
262
- * IATA-coded airport index (a SEPARATE optional asset — `airports.json`; ADR-1).
263
- * Lets memorized airport codes resolve to coordinates through the resolver's
264
- * existing fold→lookup path (`poi JFK`, `route JFK -> LAX`) — no parser change.
265
- *
266
- * - `airports` — `GazetteerEntry` tuples `[lat, lon, iso, 0, name]`. `pop` is
267
- * always 0 (OurAirports has no enplanement column); `name` is the full airport
268
- * name, used for COMPLETION DISPLAY only — airports resolve by IATA code, never
269
- * by name. Coords are rounded to 2 decimals (~1km; sub-pixel at map scale).
270
- * - `airportIata` — folded 3-letter IATA code → index into `airports`. Consulted
271
- * LAST in resolution (after city `byName` + `alt`), so a real city always wins
272
- * a shared token (ADR-2). Airports never enter `cities[]`, so the city-scatter
273
- * and reverse-geocode layers never see them.
274
- */
275
- interface AirportData {
276
- readonly airports: GazetteerEntry[];
277
- readonly airportIata: Record<string, number>;
278
- }
279
- /** Water-feature class (Natural Earth `featurecla`, rivers/reefs excluded). */
280
- type WaterKind = 'ocean' | 'sea' | 'gulf' | 'bay' | 'strait' | 'channel' | 'sound';
281
- /**
282
- * A water-body label entry: `[lat, lon, name, tier, kind, alt?]`.
283
- * - `lat`/`lon` — label anchor (Natural Earth inner point), rounded to 3 decimals.
284
- * - `name` — full display name (no abbreviation exists for water bodies).
285
- * - `tier` — Natural Earth `scalerank` (0 = most prominent → orientation priority).
286
- * - `kind` — feature class (drives styling/priority bucketing).
287
- * - `alt` — optional extra anchor points `[lat, lon][]`; the layout picks the
288
- * one nearest the viewport center (Decision 5 multi-anchor seam). Absent today.
289
- */
290
- type WaterBodyEntry = [
291
- lat: number,
292
- lon: number,
293
- name: string,
294
- tier: number,
295
- kind: WaterKind,
296
- alt?: ReadonlyArray<readonly [number, number]>
297
- ];
298
- interface WaterBodies {
299
- /** Deterministically ordered (tier, then name). Generated from Natural Earth
300
- * marine polys by scripts/build-map-data.mjs into `water-bodies.json`. */
301
- readonly entries: readonly WaterBodyEntry[];
302
- }
303
- /** A fill-able region (country or US state) — the display name + its ISO id +
304
- * layer. Powers region-name autocomplete (completion-only; the renderer derives
305
- * names from the topology directly). Extracted from the topologies by
306
- * scripts/build-map-data.mjs into `region-names.json`. */
307
- interface RegionName {
308
- /** Display name (original casing), e.g. `California` / `Germany`. */
309
- readonly name: string;
310
- /** ISO 3166-1 alpha-2 (country) or 3166-2 `US-XX` (state). */
311
- readonly iso: string;
312
- readonly layer: 'country' | 'us-state';
313
- }
314
- interface RegionNames {
315
- /** Deterministically ordered (layer, then name). */
316
- readonly regions: readonly RegionName[];
317
- }
318
-
319
- /** The four static assets, injected into the pure resolver (DI). */
320
- interface MapData {
321
- worldCoarse: BoundaryTopology;
322
- worldDetail: BoundaryTopology;
323
- usStates: BoundaryTopology;
324
- /** Major lakes (Natural Earth 110m) drawn as water over land — e.g. the Great
325
- * Lakes. Optional so hand-built test fixtures need not supply it. */
326
- lakes?: BoundaryTopology;
327
- /** Major river centerlines (Natural Earth 110m) drawn as thin water lines over
328
- * land — e.g. the Amazon, Nile, Mississippi. Optional, like `lakes`. */
329
- rivers?: BoundaryTopology;
330
- /** Notable mountain-range polygons (Natural Earth 50m geography regions) drawn
331
- * as a subtle gradient relief cue over base land when the `relief` directive
332
- * is on — e.g. the Rockies, Andes, Himalayas. Optional, like `lakes`. */
333
- mountainRanges?: BoundaryTopology;
334
- /** North-America-clipped 10m country land, used as crisp neighbour context
335
- * under the albers-usa US view so Canada/Mexico match the 10m states instead
336
- * of the coarser world tiers. Optional, like `lakes`. */
337
- naLand?: BoundaryTopology;
338
- /** North-America-clipped 10m major lakes (Great Lakes etc.), used in place of
339
- * the coarse `lakes` under the albers-usa US view. Optional. */
340
- naLakes?: BoundaryTopology;
341
- /** Water-body orientation labels (Natural Earth marine polys) drawn when the
342
- * `context-labels` directive is on — oceans/seas/gulfs/bays/etc. Optional, so
343
- * hand-built test fixtures and older bundles need not supply it. */
344
- waterBodies?: WaterBodies;
345
- /** IATA-coded airports (`airports.json`) — lets `poi JFK` / `route JFK -> LAX`
346
- * resolve. Optional so hand-built fixtures and older DI bundles need not supply
347
- * it; the resolver guards `data.airports?.…` everywhere. */
348
- airports?: AirportData;
349
- gazetteer: Gazetteer;
350
- }
351
- type ProjectionFamily = 'equal-earth' | 'natural-earth' | 'equirectangular' | 'albers-usa' | 'conic-equal-area' | 'mercator';
352
- /** Which geometry layers the renderer draws. */
353
- interface Basemaps {
354
- /** World country tier: coarse (world-scale) | detail (regional/zoom). */
355
- world: 'coarse' | 'detail';
356
- /** Loaded subdivision layers (v1: only 'us-states'). */
357
- subdivisions: Array<'us-states'>;
358
- }
359
- interface ResolvedRegion {
360
- /** ISO code: alpha-2 (country) or 3166-2 `US-XX` (state) — the geometry id. */
361
- readonly iso: string;
362
- readonly name: string;
363
- readonly layer: 'country' | 'us-state';
364
- readonly value?: number;
365
- /** §1.5 trailing-token color NAME → flat override fill (§24B.4). */
366
- readonly color?: string;
367
- readonly tags: Readonly<Record<string, string>>;
368
- readonly meta: Readonly<Record<string, string>>;
369
- readonly lineNumber: number;
370
- }
371
- interface ResolvedPoi {
372
- /** Folded registry id (alias|name folded, or `@lat,lon` for coord POIs). */
373
- readonly id: string;
374
- /** Display name (original casing): the city/place name, alias, or endpoint
375
- * string. The on-map label falls back to this when `label` is absent (the
376
- * folded `id` is for binding, not display). */
377
- readonly name?: string;
378
- readonly lat: number;
379
- readonly lon: number;
380
- readonly label?: string;
381
- /** §1.5 trailing-token color NAME → flat marker fill (§24B.5). */
382
- readonly color?: string;
383
- readonly tags: Readonly<Record<string, string>>;
384
- readonly meta: Readonly<Record<string, string>>;
385
- readonly lineNumber: number;
386
- /** True when created from an undeclared edge/route endpoint (§24B.10). */
387
- readonly implicit?: boolean;
388
- /** BL-122 clock channel: the resolved IANA zone id (`Asia/Tokyo`) or a canonical
389
- * fixed-offset label (`UTC+9`) for this pin, from an explicit `tz:` meta (or a
390
- * gazetteer `tz` once built). Absent ⇒ no time card. Set only when the map's
391
- * `clock` directive is on and `tz:` validated; a malformed `tz:` warns + omits. */
392
- readonly tz?: string;
393
- /** BL-122: minutes-east-of-UTC when `tz` is a FIXED offset (from `tz: UTC+9`),
394
- * so the renderer bakes `data-dgmo-clock-fixed-offset` and the ticker skips DST.
395
- * Absent for real IANA zones. */
396
- readonly tzFixedOffsetMin?: number;
397
- }
398
- interface ResolvedEdge {
399
- readonly fromId: string;
400
- readonly toId: string;
401
- readonly label?: string;
402
- readonly directed: boolean;
403
- readonly style: 'straight' | 'arc';
404
- readonly meta: Readonly<Record<string, string>>;
405
- /** Tag(s) on the edge line → colour the LINE (§24B.6). */
406
- readonly tags: Readonly<Record<string, string>>;
407
- readonly lineNumber: number;
408
- }
409
- interface ResolvedRouteLeg {
410
- readonly fromId: string;
411
- readonly toId: string;
412
- readonly label?: string;
413
- readonly style: 'straight' | 'arc';
414
- readonly value?: string;
415
- /** Tag(s) on the leg line → colour the LINE (§24B.6). */
416
- readonly tags: Readonly<Record<string, string>>;
417
- readonly lineNumber: number;
418
- }
419
- interface ResolvedRoute {
420
- /** Ordered UNIQUE stop ids (for numbering + the origin marker). A loop-closing
421
- * leg whose destination is an earlier stop adds a leg but no duplicate stop. */
422
- readonly stopIds: readonly string[];
423
- readonly legs: readonly ResolvedRouteLeg[];
424
- readonly lineNumber: number;
425
- }
426
- /** Geographic bounding box `[[west, south], [east, north]]` in degrees.
427
- *
428
- * WRAP CONVENTION (#12): for an antimeridian-crossing extent the resolver keeps
429
- * `west` in [−180, 180] and returns `east` UNWRAPPED in (180, 540] (i.e.
430
- * `east = west + span`, span ≤ 360). So `east > 180` signals a dateline-crossing
431
- * extent; the renderer (step 4) must mod `east` back into [−180, 180] (or shift
432
- * the projection's center) rather than assume `east ≤ 180`. `south`/`north` are
433
- * always plain degrees in [−90, 90]. */
434
- type GeoExtent = [[number, number], [number, number]];
435
- interface ResolvedMap {
436
- readonly title: string | null;
437
- /** DEAD — the `subtitle` directive was removed (2026-06-02 defaults-on review).
438
- * Never populated; the renderer's subtitle branch is now unreachable. Left for
439
- * a later cleanup pass. */
440
- readonly subtitle?: string;
441
- readonly caption?: string;
442
- readonly tagGroups: readonly TagGroup[];
443
- readonly directives: MapDirectives;
444
- readonly basemaps: Basemaps;
445
- readonly regions: readonly ResolvedRegion[];
446
- readonly pois: readonly ResolvedPoi[];
447
- readonly edges: readonly ResolvedEdge[];
448
- readonly routes: readonly ResolvedRoute[];
449
- readonly extent: GeoExtent;
450
- readonly projection: ProjectionFamily;
451
- /** POI-only region framing: the region(s) that CONTAIN the POIs — us-state ids
452
- * (`US-CA`) or country isos (`FR`). The frame is snapped to the union of their
453
- * bboxes, and the layout labels them prominently (vs. muted neighbours). Empty
454
- * for non-POI-only maps or when POIs fall outside every polygon. Optional so
455
- * older/foreign ResolvedMap literals need not supply it. */
456
- readonly poiFrameContainers?: readonly string[];
457
- readonly diagnostics: readonly DgmoError[];
458
- readonly error: string | null;
459
- }
460
-
461
- /**
462
- * All built-in palettes, keyed by camelCase id. Use directly with render():
463
- *
464
- * await render(text, { palette: palettes.catppuccin });
465
- *
466
- * For preference/settings storage, the `.id` field of each entry is the
467
- * canonical string (e.g. `'tokyo-night'`, `'nord'`) — that's the wire format
468
- * used by share URLs and the CLI `--palette` flag.
469
- */
470
- declare const palettes: {
471
- readonly atlas: PaletteConfig;
472
- readonly blueprint: PaletteConfig;
473
- readonly slate: PaletteConfig;
474
- readonly tidewater: PaletteConfig;
475
- readonly nord: PaletteConfig;
476
- readonly catppuccin: PaletteConfig;
477
- readonly tokyoNight: PaletteConfig;
478
- };
479
-
480
- /**
481
- * How a host supplies map basemap assets: the data itself, or a loader that
482
- * returns it. Declared here (rather than accepting only `MapData`) so a Node
483
- * host can hand over `loadMapData` without paying to read eleven JSON files on
484
- * a render that turns out not to be a map — the loader is called only inside
485
- * the map branch.
486
- */
487
- type MapDataSource = MapData | (() => Promise<MapData>);
488
- /**
489
- * Renders a D3 chart to an SVG string for export.
490
- * Creates a detached DOM element, renders into it, extracts the SVG, then cleans up.
491
- */
492
- type RenderForExportOptions = {
493
- c4Level?: 'context' | 'containers' | 'components' | 'deployment';
494
- c4System?: string;
495
- c4Container?: string;
496
- tagGroup?: string;
497
- exportMode?: boolean;
498
- mapData?: MapDataSource;
499
- mapAspect?: number;
500
- onMapResolverDiagnostics?: (diagnostics: readonly DgmoError[]) => void;
501
- /**
502
- * Canvas to draw onto, in px. Defaults to EXPORT_WIDTH x EXPORT_HEIGHT.
503
- *
504
- * Every chart used to render onto a fixed 1200x800 sheet, so a caller who
505
- * fitted the result to a narrow column got its ASPECT too — a one-line goal
506
- * meter arrived 800px tall with the bar as a sliver in the middle. Callers
507
- * that know the shape they need can now say so; omitting these keeps the
508
- * previous canvas exactly.
509
- */
510
- width?: number;
511
- height?: number;
512
- };
513
- declare function renderForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette?: PaletteColors, viewState?: CompactViewState, options?: RenderForExportOptions): Promise<string>;
514
-
515
- interface MapPlaceCompletion {
516
- /** Canonical display name (original casing), e.g. `Portland`. */
517
- readonly name: string;
518
- /** Text to insert. ISO-qualified (`Portland US-OR`) iff the name is
519
- * ambiguous in the gazetteer; bare otherwise (disambiguate-once, §24B.8). */
520
- readonly insert: string;
521
- /** Menu label (`Portland — US-OR` when ambiguous, else `Portland`). */
522
- readonly label: string;
523
- /** Secondary detail, e.g. `US-OR · 652,503`. */
524
- readonly detail: string;
525
- readonly iso: string;
526
- readonly sub?: string;
527
- readonly pop: number;
528
- /** `'airport'` for IATA-code entries (icon/grouping affordance); absent or
529
- * `'city'` for gazetteer cities. Cities rank above airports for a shared
530
- * prefix so ~1500 codes never bury city names (ADR-5). */
531
- readonly kind?: 'city' | 'airport';
532
- }
533
- interface MapCompletionOptions {
534
- /** Max results (default 12). */
535
- readonly limit?: number;
536
- /** IATA-coded airports (`airports.json`). When supplied, airport codes
537
- * matching the prefix are offered as a second (post-city) group. Optional —
538
- * absent (old DI bundles / no asset) just yields city-only completions. */
539
- readonly airports?: AirportData;
540
- /** Resolver-inferred map scope (country `US` or subdivision `US-CA`). Biases
541
- * airport ranking so in-region airports sort above out-of-region same-prefix
542
- * ones (ADR-6). Pure rank, never a filter — cross-region airports still
543
- * appear. App passes the document's inferred scope in (Slice 2). */
544
- readonly scopeISO?: string;
545
- }
546
- /**
547
- * Prefix-match city names + alternate-name aliases against the gazetteer,
548
- * rank by population (desc; stable tie-break by gazetteer index), and emit
549
- * ISO-qualified insert text only for ambiguous (same-named) places.
550
- *
551
- * Pure + deterministic. Empty/blank query → `[]` (the caller gates min length).
552
- */
553
- declare function completeMapPlaces(query: string, gazetteer: Gazetteer, opts?: MapCompletionOptions): MapPlaceCompletion[];
554
- /** A POI search hit — a city or airport the resolver can resolve, with the
555
- * exact `token` to paste into DGMO (a `poi`/route endpoint). Powers the CLI
556
- * `dgmo map search` command and the MCP `lookup_map_location` tool, so authors
557
- * (and AI agents) can DISCOVER valid place tokens instead of guessing — e.g.
558
- * learn that "New York" must be `New York City` and that `JFK` is bundled. */
559
- interface MapLocationMatch {
560
- /** Canonical display name (cities) or full airport name. */
561
- readonly name: string;
562
- /** Exact text to use in DGMO. Cities: the name, ISO-qualified when ambiguous
563
- * (`Portland US-OR`). Airports: the upper-case IATA code (`JFK`). */
564
- readonly token: string;
565
- readonly kind: 'city' | 'airport';
566
- readonly iso: string;
567
- readonly sub?: string;
568
- /** City population (0 for airports). */
569
- readonly pop: number;
570
- /** Human detail, e.g. `US-OR · 652,503` or `Airport · John F Kennedy Intl`. */
571
- readonly detail: string;
572
- }
573
- /**
574
- * Substring-search cities + airports for a discovery surface (CLI / MCP), so an
575
- * author can find the exact token the resolver expects. Unlike
576
- * {@link completeMapPlaces} (prefix-only, editor type-ahead), this matches
577
- * anywhere in a city name OR an airport code/name, so "york" finds
578
- * `New York City` and "kennedy" finds `JFK`.
579
- *
580
- * Ranking: exact-name (or exact-IATA) → prefix → substring; within a tier,
581
- * cities by population desc (deterministic index tie-break), cities before
582
- * airports. Pure + deterministic. Empty query → `[]`.
583
- */
584
- declare function searchMapLocations(query: string, gazetteer: Gazetteer, opts?: {
585
- readonly limit?: number;
586
- readonly airports?: AirportData;
587
- }): MapLocationMatch[];
588
- interface MapRegionCompletion {
589
- /** Display name = insert text (the resolver disambiguates cross-layer
590
- * collisions like Georgia by map scope, §24B.8). */
591
- readonly name: string;
592
- /** ISO 3166-1/3166-2 id. */
593
- readonly iso: string;
594
- readonly layer: 'country' | 'us-state';
595
- /** Secondary detail, e.g. `US state · US-CA` or `Country · DE`. */
596
- readonly detail: string;
597
- }
598
- /**
599
- * Prefix-match fill-able region names (countries + US states) for region-fill
600
- * lines. Matches the folded display name OR the ISO code; deterministic
601
- * (alphabetical by name, then layer). Pure. Empty query → `[]`.
602
- *
603
- * `regions` is injected (the `region-names.json` asset, shipped in dist/map-data
604
- * alongside the gazetteer). Cross-layer same-name (Georgia: country GE + state
605
- * US-GA) yields both entries, distinguished by `detail`.
606
- */
607
- declare function completeMapRegions(query: string, regions: readonly RegionName[], opts?: MapCompletionOptions): MapRegionCompletion[];
608
-
609
- /**
610
- * Theme — render mode flag. Selects which palette variant the renderer uses
611
- * for background and text:
612
- * - 'light' → palette.light colors
613
- * - 'dark' → palette.dark colors
614
- * - 'transparent' → no background fill (for embedding in colored containers)
615
- */
616
- type Theme = 'light' | 'dark' | 'transparent';
617
- /**
618
- * `themes` namespace — use with render() options for a typed handle:
619
- *
620
- * await render(text, { theme: themes.dark });
621
- *
622
- * Passing the raw string `'dark'` also works (the underlying type is the
623
- * string-literal union); the namespace is the conventional path.
624
- */
625
- declare const themes: {
626
- readonly light: "light";
627
- readonly dark: "dark";
628
- readonly transparent: "transparent";
629
- };
630
-
631
- export { type AirportData as A, type BoundaryTopology as B, renderForExport as C, type Gazetteer as G, type MapDataSource as M, type ParsedMap as P, type RegionName as R, type Theme as T, type GazetteerEntry as a, type MapCompletionOptions as b, type MapData as c, type MapLocationMatch as d, type MapPlaceCompletion as e, type MapRegionCompletion as f, type RegionNames as g, completeMapPlaces as h, completeMapRegions as i, type ResolvedMap as j, type MapLayoutLegend as k, type GeoExtent as l, type MapDirectives as m, type MapEdge as n, type MapPoi as o, palettes as p, type MapRegion as q, type MapRoute as r, searchMapLocations as s, themes as t, type PoiPos as u, type ProjectionFamily as v, type ResolvedEdge as w, type ResolvedPoi as x, type ResolvedRegion as y, type ResolvedRoute as z };