@diagrammo/dgmo 0.21.1 → 0.23.0

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 (87) hide show
  1. package/README.md +16 -6
  2. package/dist/advanced.cjs +2230 -503
  3. package/dist/advanced.d.cts +5731 -0
  4. package/dist/advanced.d.ts +5731 -0
  5. package/dist/advanced.js +2226 -503
  6. package/dist/auto.cjs +2272 -479
  7. package/dist/auto.d.cts +39 -0
  8. package/dist/auto.d.ts +39 -0
  9. package/dist/auto.js +124 -124
  10. package/dist/auto.mjs +2274 -480
  11. package/dist/cli.cjs +170 -170
  12. package/dist/editor.cjs +16 -16
  13. package/dist/editor.js +16 -16
  14. package/dist/highlight.cjs +18 -13
  15. package/dist/highlight.js +18 -13
  16. package/dist/index.cjs +2253 -465
  17. package/dist/index.d.cts +339 -0
  18. package/dist/index.d.ts +339 -0
  19. package/dist/index.js +2255 -466
  20. package/dist/internal.cjs +2230 -503
  21. package/dist/internal.d.cts +5731 -0
  22. package/dist/internal.d.ts +5731 -0
  23. package/dist/internal.js +2226 -503
  24. package/dist/map-data/PROVENANCE.json +1 -1
  25. package/dist/map-data/gazetteer.json +1 -1
  26. package/dist/map-data/mountain-ranges.json +1 -1
  27. package/dist/map-data/water-bodies.json +1 -0
  28. package/dist/map-data/world-coarse.json +1 -1
  29. package/dist/map-data/world-detail.json +1 -1
  30. package/docs/language-reference.md +55 -9
  31. package/gallery/fixtures/boxes-and-lines.dgmo +6 -4
  32. package/gallery/fixtures/map-categorical-world.dgmo +16 -0
  33. package/gallery/fixtures/map-categorical.dgmo +0 -1
  34. package/gallery/fixtures/map-choropleth.dgmo +0 -1
  35. package/gallery/fixtures/map-coastline.dgmo +7 -0
  36. package/gallery/fixtures/map-colorize.dgmo +11 -0
  37. package/gallery/fixtures/map-direct-color.dgmo +0 -1
  38. package/gallery/fixtures/map-reference-world.dgmo +11 -0
  39. package/gallery/fixtures/map-region-scope.dgmo +0 -3
  40. package/gallery/fixtures/map-route.dgmo +0 -1
  41. package/package.json +1 -1
  42. package/src/advanced.ts +12 -1
  43. package/src/boxes-and-lines/parser.ts +39 -0
  44. package/src/boxes-and-lines/renderer.ts +205 -20
  45. package/src/boxes-and-lines/types.ts +9 -0
  46. package/src/cli.ts +1 -1
  47. package/src/completion.ts +36 -30
  48. package/src/cycle/renderer.ts +14 -1
  49. package/src/d3.ts +20 -6
  50. package/src/editor/highlight-api.ts +4 -0
  51. package/src/editor/keywords.ts +16 -16
  52. package/src/infra/renderer.ts +35 -7
  53. package/src/map/colorize.ts +54 -0
  54. package/src/map/context-labels.ts +429 -0
  55. package/src/map/data/PROVENANCE.json +1 -1
  56. package/src/map/data/README.md +6 -0
  57. package/src/map/data/gazetteer.json +1 -1
  58. package/src/map/data/mountain-ranges.json +1 -1
  59. package/src/map/data/types.ts +34 -0
  60. package/src/map/data/water-bodies.json +1 -0
  61. package/src/map/data/world-coarse.json +1 -1
  62. package/src/map/data/world-detail.json +1 -1
  63. package/src/map/dimensions.ts +117 -0
  64. package/src/map/geo-query.ts +21 -3
  65. package/src/map/geo.ts +47 -1
  66. package/src/map/layout.ts +1408 -266
  67. package/src/map/load-data.ts +10 -2
  68. package/src/map/parser.ts +42 -116
  69. package/src/map/renderer.ts +604 -14
  70. package/src/map/resolved-types.ts +16 -2
  71. package/src/map/resolver.ts +208 -59
  72. package/src/map/types.ts +30 -32
  73. package/src/mindmap/renderer.ts +10 -1
  74. package/src/palettes/atlas.ts +77 -0
  75. package/src/palettes/blueprint.ts +73 -0
  76. package/src/palettes/color-utils.ts +58 -1
  77. package/src/palettes/index.ts +12 -3
  78. package/src/palettes/slate.ts +73 -0
  79. package/src/palettes/tidewater.ts +73 -0
  80. package/src/render.ts +8 -1
  81. package/src/tech-radar/renderer.ts +3 -0
  82. package/src/tech-radar/types.ts +3 -0
  83. package/src/utils/d3-types.ts +5 -0
  84. package/src/utils/legend-layout.ts +21 -4
  85. package/src/utils/legend-types.ts +7 -0
  86. package/src/utils/reserved-key-registry.ts +8 -3
  87. package/src/palettes/bold.ts +0 -67
package/README.md CHANGED
@@ -60,7 +60,7 @@ dgmo diagram.dgmo --theme dark --palette catppuccin
60
60
  | Flag | Values | Default |
61
61
  |------|--------|---------|
62
62
  | `--theme` | `light`, `dark`, `transparent` | `light` |
63
- | `--palette` | `nord`, `solarized`, `catppuccin`, `rose-pine`, `gruvbox`, `tokyo-night`, `one-dark`, `bold` | `nord` |
63
+ | `--palette` | `nord`, `atlas`, `blueprint`, `slate`, `tidewater`, `solarized`, `catppuccin`, `rose-pine`, `gruvbox`, `tokyo-night`, `one-dark`, `dracula`, `monokai` | `nord` |
64
64
  | `-o` | Output file path (`.svg` extension → SVG, otherwise PNG) | `<input>.png` |
65
65
 
66
66
  ## Supported chart types
@@ -473,16 +473,21 @@ Colors can be specified inline as named colors (`red`, `blue`, `teal`, etc.) or
473
473
 
474
474
  ## Palettes
475
475
 
476
- Eight built-in palettes, each with light and dark variants:
476
+ Thirteen built-in palettes, each with light and dark variants:
477
477
 
478
478
  - `nordPalette` — cool, muted Scandinavian tones (default)
479
+ - `atlasPalette` — vintage classroom-map pastels on warm manila paper
480
+ - `blueprintPalette` — cyanotype engineering drawing (chalk on blueprint blue)
481
+ - `slatePalette` — restrained corporate/BI neutrals with one corporate blue
482
+ - `tidewaterPalette` — nautical maritime-chart (sea-mist, navy ink, brass)
479
483
  - `solarizedPalette` — warm/cool Solarized
480
484
  - `catppuccinPalette` — modern pastels
481
485
  - `rosePinePalette` — soft mauve and rose
482
486
  - `gruvboxPalette` — retro groove
483
487
  - `tokyoNightPalette` — Tokyo night
484
488
  - `oneDarkPalette` — Atom One Dark inspired
485
- - `boldPalette` — high-contrast
489
+ - `draculaPalette` — Dracula
490
+ - `monokaiPalette` — Monokai
486
491
 
487
492
  ```typescript
488
493
  import { getPalette, getAvailablePalettes, registerPalette } from '@diagrammo/dgmo';
@@ -572,7 +577,7 @@ Configure via JSON on the bundle's own `<script>` tag — no inline JS, CSP-frie
572
577
  | Key | Type | Default | Description |
573
578
  |-----|------|---------|-------------|
574
579
  | `theme` | `'auto' \| 'light' \| 'dark' \| 'transparent'` | `'auto'` | `'auto'` reads `prefers-color-scheme`, `<html data-theme>`, and `<html class="dark">`; re-renders live when the system preference flips |
575
- | `palette` | palette id (string) | `'nord'` | Any registered palette: `bold`, `catppuccin`, `dracula`, `gruvbox`, `monokai`, `nord`, `one-dark`, `rose-pine`, `solarized`, `tokyo-night` |
580
+ | `palette` | palette id (string) | `'nord'` | Any registered palette: `atlas`, `blueprint`, `catppuccin`, `dracula`, `gruvbox`, `monokai`, `nord`, `one-dark`, `rose-pine`, `slate`, `solarized`, `tidewater`, `tokyo-night` |
576
581
  | `showSource` | `boolean` | `true` | Show the collapsible "DGMO source" panel under each diagram |
577
582
  | `showEditorLink` | `boolean` | `true` | Include the "Open in editor" button (set `false` for air-gapped intranets) |
578
583
 
@@ -858,14 +863,19 @@ src/
858
863
  ├── registry.ts # getPalette, registerPalette
859
864
  ├── color-utils.ts # HSL conversions, mix(), mute(), tint()
860
865
  ├── mermaid-bridge.ts # Mermaid CSS variable builder
861
- ├── nord.ts # Nord palette
866
+ ├── nord.ts # Nord palette (default)
867
+ ├── atlas.ts # Atlas palette
868
+ ├── blueprint.ts # Blueprint palette
869
+ ├── slate.ts # Slate palette
870
+ ├── tidewater.ts # Tidewater palette
862
871
  ├── solarized.ts # Solarized palette
863
872
  ├── catppuccin.ts # Catppuccin palette
864
873
  ├── rose-pine.ts # Rose Pine palette
865
874
  ├── gruvbox.ts # Gruvbox palette
866
875
  ├── tokyo-night.ts # Tokyo Night palette
867
876
  ├── one-dark.ts # One Dark palette
868
- └── bold.ts # Bold palette
877
+ ├── dracula.ts # Dracula palette
878
+ └── monokai.ts # Monokai palette
869
879
  ```
870
880
 
871
881
  ### Build output