@diagrammo/dgmo 0.85.0 → 0.87.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 (122) hide show
  1. package/dist/advanced.d.ts +45 -9
  2. package/dist/advanced.js +83 -64
  3. package/dist/block.js +11 -23
  4. package/dist/chart-meta.js +3 -3
  5. package/dist/{chunk-FAV4RDVT.js → chunk-2A4DQAXG.js} +1 -1
  6. package/dist/{chunk-LRNIYQ6Y.js → chunk-33FQ6HNV.js} +1 -1
  7. package/dist/{chunk-JIPUBFAM.js → chunk-5KGM44TG.js} +2 -2
  8. package/dist/{chunk-23RWHHI5.js → chunk-5NU7NII2.js} +14 -2
  9. package/dist/{chunk-QJ2JOLFN.js → chunk-6I5UN4FD.js} +2 -2
  10. package/dist/{chunk-HMWZQ53A.js → chunk-7WGCQE2E.js} +1 -1
  11. package/dist/{chunk-NSS2EF5B.js → chunk-AAMCXQPP.js} +1 -1
  12. package/dist/{chunk-XD7XL3SF.js → chunk-AGO3PFGS.js} +1 -1
  13. package/dist/{chunk-JVRDKR5R.js → chunk-AQIBKTPG.js} +1 -1
  14. package/dist/{chunk-RYZNNXUV.js → chunk-AUS7V54P.js} +1 -1
  15. package/dist/{chunk-ITLPDLBH.js → chunk-B7CU2HW5.js} +3 -3
  16. package/dist/{chunk-X2VEJ5NT.js → chunk-BMUWF77V.js} +2 -2
  17. package/dist/{chunk-6HOVLE3H.js → chunk-BT2WH2XT.js} +1 -1
  18. package/dist/{chunk-3MXJMZAN.js → chunk-BV6PKJUS.js} +105 -28
  19. package/dist/{chunk-7256EOAE.js → chunk-CFBY77QJ.js} +129 -10
  20. package/dist/{chunk-BP4BT5TH.js → chunk-CLQIXD2C.js} +1 -1
  21. package/dist/{chunk-OZTDXMRQ.js → chunk-D4M25W6R.js} +1 -1
  22. package/dist/{chunk-A4PHPKNR.js → chunk-DAX42XVH.js} +1 -1
  23. package/dist/{chunk-C5FEPGSJ.js → chunk-DSG6GBUQ.js} +3 -3
  24. package/dist/{chunk-JLGN6S4B.js → chunk-EJS3K44P.js} +148 -80
  25. package/dist/{chunk-YWHGWLY6.js → chunk-FBKPSU3A.js} +5 -5
  26. package/dist/{chunk-5JO443MB.js → chunk-HAH5X345.js} +1 -1
  27. package/dist/{chunk-HBCAY3KR.js → chunk-HTNLLT34.js} +1 -1
  28. package/dist/{chunk-PEFPTQ3Z.js → chunk-HTPZDZKQ.js} +3 -3
  29. package/dist/{chunk-XXAZ5C4K.js → chunk-IJ27L3R4.js} +1 -1
  30. package/dist/{chunk-OGKP2XGJ.js → chunk-J7Q4VPBJ.js} +2 -2
  31. package/dist/{chunk-VDMG3MM4.js → chunk-JD4RHBNX.js} +1 -1
  32. package/dist/{chunk-HATTVAWX.js → chunk-LJFXC3IP.js} +1 -1
  33. package/dist/{chunk-REUEU5PU.js → chunk-LL6D3MES.js} +3 -3
  34. package/dist/{chunk-ULCB4BLF.js → chunk-LPXC4I4R.js} +19 -2
  35. package/dist/{chunk-BIQYWWJ2.js → chunk-LSQGJN5H.js} +2 -2
  36. package/dist/{chunk-T327J6CE.js → chunk-MSXRNVHB.js} +2 -2
  37. package/dist/{chunk-V3LJIPS4.js → chunk-N7XRBWXA.js} +3 -3
  38. package/dist/{chunk-UJRMARNX.js → chunk-NJIGYGZS.js} +19 -1
  39. package/dist/{chunk-WMIKC5XO.js → chunk-NPWVOFB3.js} +1 -1
  40. package/dist/{chunk-2QIGN7KL.js → chunk-O6MMQQLF.js} +9 -5
  41. package/dist/{chunk-MIZ46MOF.js → chunk-P5V63L35.js} +2 -2
  42. package/dist/{chunk-ADAGWVWJ.js → chunk-PJQZWJ5I.js} +70 -48
  43. package/dist/{chunk-RMAJIB6S.js → chunk-PUVTFUNH.js} +4 -4
  44. package/dist/{chunk-ETBXIKK6.js → chunk-Q2U5635V.js} +1 -1
  45. package/dist/chunk-QT3KDDXK.js +436 -0
  46. package/dist/{chunk-UNSN56OJ.js → chunk-R2K5L4UA.js} +1 -1
  47. package/dist/{chunk-SLMAAJPE.js → chunk-RGI64U3A.js} +1 -1
  48. package/dist/{chunk-ZGHV4QLK.js → chunk-RJNZHFNG.js} +1 -1
  49. package/dist/{chunk-FWNJDD4U.js → chunk-S7W75MIM.js} +3 -20
  50. package/dist/{chunk-ZUUNTOMG.js → chunk-UIUXIDBX.js} +1 -1
  51. package/dist/{chunk-XIYVGO24.js → chunk-UMRZPRAN.js} +3 -3
  52. package/dist/{chunk-67USWFFE.js → chunk-UY6TEJJH.js} +1 -1
  53. package/dist/{chunk-UGYZ5Q5Y.js → chunk-VJ2KROJ5.js} +1 -1
  54. package/dist/{chunk-PSH5DT26.js → chunk-WZ23JJ7U.js} +3 -3
  55. package/dist/{chunk-IIEI7VK5.js → chunk-XCKNFFKM.js} +2 -0
  56. package/dist/{chunk-Y7FTHOMD.js → chunk-XIFK423U.js} +129 -225
  57. package/dist/{chunk-LQSNWE3W.js → chunk-XUDGZJTJ.js} +3 -3
  58. package/dist/{chunk-D7D5YK4J.js → chunk-XVSJYAK7.js} +15 -3
  59. package/dist/{chunk-J2ICADUM.js → chunk-XWYR5T52.js} +3 -3
  60. package/dist/{chunk-QNKHJ5CK.js → chunk-YK4N6TBN.js} +4 -2
  61. package/dist/{chunk-NJS62BAG.js → chunk-YMG7JDEY.js} +17 -7
  62. package/dist/chunk-Z6DXWULM.js +23 -0
  63. package/dist/{chunk-PBEH52A2.js → chunk-ZNNVI5SR.js} +1 -1
  64. package/dist/cloud-reference.d.ts +11 -1
  65. package/dist/cloud-reference.js +1 -1
  66. package/dist/{dgmo-router-VILEOWQ2.js → dgmo-router-F2DSURTR.js} +4 -4
  67. package/dist/{dimensions-F3Y5T54V.js → dimensions-6QAWEGIR.js} +2 -2
  68. package/dist/{flowchart-renderer-TGQL4S4L.js → flowchart-renderer-THC6Y7EH.js} +8 -7
  69. package/dist/index.d.ts +68 -1
  70. package/dist/index.js +81 -13
  71. package/dist/{layout-WZCXK7DF.js → layout-5NPBHV5F.js} +2 -2
  72. package/dist/{layout-WXVGMSI3.js → layout-5VSMZPMG.js} +2 -2
  73. package/dist/{layout-CFTB7GKV.js → layout-BOVTLAOT.js} +7 -6
  74. package/dist/{layout-K6NI4VCS.js → layout-CUFA7XJD.js} +2 -2
  75. package/dist/{layout-6JARW64V.js → layout-EHTYSMV4.js} +6 -5
  76. package/dist/{layout-NB7TKAWN.js → layout-LUQKAGGT.js} +2 -2
  77. package/dist/{layout-YELNBVPC.js → layout-P6DTD4RT.js} +6 -5
  78. package/dist/{layout-PT7IKVCV.js → layout-QX5T6ZNE.js} +2 -2
  79. package/dist/layout-RANVNAKI.js +10 -0
  80. package/dist/{layout-FMKSENGL.js → layout-XUW444O5.js} +5 -4
  81. package/dist/{layout-search-GRJEBAUF.js → layout-search-VKSBUCDM.js} +67 -33
  82. package/dist/live-link-resolve.d.ts +21 -3
  83. package/dist/live-link-resolve.js +47 -17
  84. package/dist/{parser-6TXNMXNB.js → parser-XYY5NHP4.js} +2 -2
  85. package/dist/{renderer-YSH5EX54.js → renderer-222OTVQV.js} +3 -2
  86. package/dist/{renderer-DRLLZZ6P.js → renderer-2KVQGGTT.js} +5 -4
  87. package/dist/{renderer-E5EKGIX2.js → renderer-2OOPQ4CH.js} +4 -3
  88. package/dist/{renderer-OV3GUJRR.js → renderer-36JH4OMC.js} +4 -4
  89. package/dist/{renderer-G72GMBKA.js → renderer-3CTUWCO7.js} +7 -6
  90. package/dist/{renderer-XS42HEXW.js → renderer-3FF4QVGW.js} +4 -3
  91. package/dist/{renderer-R6VJDZFO.js → renderer-4BHOELCE.js} +4 -3
  92. package/dist/{renderer-EU27D4S6.js → renderer-4BIMRO4X.js} +5 -4
  93. package/dist/{renderer-HV6ZYJMC.js → renderer-4NZZ5J2F.js} +2 -2
  94. package/dist/{renderer-UGA5DGKR.js → renderer-A4LMOBZL.js} +9 -8
  95. package/dist/{renderer-3AOOLHJU.js → renderer-A6ACVK4X.js} +3 -2
  96. package/dist/{renderer-HWEGM72C.js → renderer-BICLPGAH.js} +2 -2
  97. package/dist/{renderer-ML2CLU25.js → renderer-DCFQDBGJ.js} +4 -3
  98. package/dist/{renderer-ADX4DWRJ.js → renderer-ELYPDPNF.js} +3 -2
  99. package/dist/{renderer-OXSLLQQC.js → renderer-KVAQE7PQ.js} +2 -2
  100. package/dist/{renderer-X4KFEKUK.js → renderer-LODEVN3V.js} +5 -4
  101. package/dist/{renderer-WUDVV363.js → renderer-NHPKNNBD.js} +6 -5
  102. package/dist/{renderer-TF3NTKP3.js → renderer-NX4YKWCJ.js} +2 -2
  103. package/dist/{renderer-P7LQBDU2.js → renderer-QM23SWAM.js} +2 -2
  104. package/dist/{renderer-5YOF2AHJ.js → renderer-R34GJL7U.js} +9 -8
  105. package/dist/{renderer-FBAFYSIQ.js → renderer-RAATRF6W.js} +3 -3
  106. package/dist/{renderer-FXX3XSNW.js → renderer-RENDISO5.js} +2 -2
  107. package/dist/{renderer-3F4K2X57.js → renderer-RMGN3Q7D.js} +2 -2
  108. package/dist/{renderer-FQAZ3KNU.js → renderer-SDUSBCJI.js} +4 -3
  109. package/dist/{renderer-OVDVFPAI.js → renderer-WH2HWE5Z.js} +5 -4
  110. package/dist/{renderer-J3O2KVTL.js → renderer-X5A5VIRD.js} +6 -5
  111. package/dist/{renderer-WRWVFEX7.js → renderer-XRALFCIN.js} +6 -4
  112. package/dist/{renderer-3XRDFNYF.js → renderer-YDAVCRTP.js} +5 -4
  113. package/dist/{renderer-5A6VWIVX.js → renderer-YIZ7G4HU.js} +5 -5
  114. package/dist/{state-renderer-B4ZF6ESS.js → state-renderer-5IQ4OJUI.js} +8 -7
  115. package/docs/language-reference.md +12 -12
  116. package/gallery/fixtures/journey-map.dgmo +28 -0
  117. package/gallery/fixtures/mindmap.dgmo +31 -0
  118. package/gallery/fixtures/pert.dgmo +27 -0
  119. package/gallery/fixtures/wireframe.dgmo +30 -0
  120. package/package.json +3 -3
  121. package/dist/chunk-WTTIODDV.js +0 -9
  122. package/dist/layout-JQ3IPJYR.js +0 -9
@@ -10,13 +10,13 @@ import {
10
10
  } from "./chunk-RE27AX7O.js";
11
11
  import {
12
12
  parseDgmoChartType
13
- } from "./chunk-JVRDKR5R.js";
13
+ } from "./chunk-AQIBKTPG.js";
14
14
  import {
15
15
  parseRaci
16
16
  } from "./chunk-3RYBTEF5.js";
17
17
  import "./chunk-UNNJCSSQ.js";
18
18
  import "./chunk-3TYUXC7D.js";
19
- import "./chunk-HMWZQ53A.js";
19
+ import "./chunk-7WGCQE2E.js";
20
20
  import "./chunk-EQW6HOP4.js";
21
21
  import "./chunk-DAOFNU6J.js";
22
22
  import "./chunk-VPASQOR3.js";
@@ -43,7 +43,7 @@ import {
43
43
  chartTypes,
44
44
  parseFirstLine
45
45
  } from "./chunk-44GP7PD5.js";
46
- import "./chunk-23RWHHI5.js";
46
+ import "./chunk-5NU7NII2.js";
47
47
  import {
48
48
  getAvailablePalettes,
49
49
  getPalette
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildPlacedNotes
3
- } from "./chunk-HBCAY3KR.js";
3
+ } from "./chunk-HTNLLT34.js";
4
4
  import {
5
5
  noteCanvasShift
6
6
  } from "./chunk-6EK55ART.js";
@@ -4,7 +4,7 @@ import {
4
4
  META_FONT_SIZE,
5
5
  META_LINE_HEIGHT,
6
6
  SEPARATOR_GAP
7
- } from "./chunk-IIEI7VK5.js";
7
+ } from "./chunk-XCKNFFKM.js";
8
8
  import {
9
9
  LEGEND_CAPSULE_PAD,
10
10
  LEGEND_DOT_R,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText,
6
6
  stripInlineMarkdown
7
- } from "./chunk-FWNJDD4U.js";
7
+ } from "./chunk-S7W75MIM.js";
8
8
  import {
9
9
  FONT_FAMILY
10
10
  } from "./chunk-ICLB27PZ.js";
@@ -34,12 +34,24 @@ function parseCloudReferenceUrl(text) {
34
34
  if (url.searchParams.has("at")) return null;
35
35
  return reference(match[1] ?? match[2] ?? match[3]);
36
36
  }
37
+ var STRINGIFIED_NOTHING = /* @__PURE__ */ new Set([
38
+ "undefined",
39
+ "null",
40
+ "NaN"
41
+ ]);
37
42
  function reference(id) {
38
- return id ? { id } : null;
43
+ return id && !STRINGIFIED_NOTHING.has(id) ? { id } : null;
39
44
  }
45
+ var ID_ONLY_RE = new RegExp(`^${ID}$`);
40
46
  function referenceSourceUrl(ref, options = {}) {
47
+ const id = ref.id;
48
+ if (typeof id !== "string" || !ID_ONLY_RE.test(id) || STRINGIFIED_NOTHING.has(id)) {
49
+ throw new TypeError(
50
+ `referenceSourceUrl: not a diagram id: ${JSON.stringify(id) ?? String(id)}`
51
+ );
52
+ }
41
53
  const base = (options.base ?? CLOUD_API_BASE).replace(/\/+$/, "");
42
- return `${base}/public/diagrams/${ref.id}/source`;
54
+ return `${base}/public/diagrams/${id}/source`;
43
55
  }
44
56
  function referenceShareUrl(ref, options = {}) {
45
57
  const base = (options.base ?? CLOUD_APP_BASE).replace(/\/+$/, "");
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  parseCloudReferenceFence,
6
6
  parseCloudReferenceUrl
7
- } from "./chunk-23RWHHI5.js";
7
+ } from "./chunk-5NU7NII2.js";
8
8
  import {
9
9
  formatDgmoError,
10
10
  makeDgmoError
@@ -4,7 +4,7 @@ import {
4
4
  META_FONT_SIZE,
5
5
  META_LINE_HEIGHT,
6
6
  SEPARATOR_GAP
7
- } from "./chunk-IIEI7VK5.js";
7
+ } from "./chunk-XCKNFFKM.js";
8
8
  import {
9
9
  LEGEND_CAPSULE_PAD,
10
10
  LEGEND_DOT_R,
@@ -9,7 +9,7 @@ import {
9
9
  EDGE_DASH,
10
10
  GRID_DASH,
11
11
  HAIRLINE_DASH
12
- } from "./chunk-IIEI7VK5.js";
12
+ } from "./chunk-XCKNFFKM.js";
13
13
  import {
14
14
  INLINE_HEADER_PAD,
15
15
  layoutInlineHeader
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UNNJCSSQ.js";
4
4
  import {
5
5
  isLiveLinkLine
6
- } from "./chunk-HMWZQ53A.js";
6
+ } from "./chunk-7WGCQE2E.js";
7
7
  import {
8
8
  looksLikeSequence
9
9
  } from "./chunk-VPASQOR3.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  acyclicOrient
3
- } from "./chunk-JLGN6S4B.js";
3
+ } from "./chunk-EJS3K44P.js";
4
4
 
5
5
  // src/swimlane/layout.ts
6
6
  var MARGIN = 30;
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-26EVL454.js";
5
5
  import {
6
6
  layoutGraph
7
- } from "./chunk-PBEH52A2.js";
7
+ } from "./chunk-ZNNVI5SR.js";
8
8
  import {
9
9
  NOTE_BADGE_RADIUS,
10
10
  noteConnectorPoints,
11
11
  renderNoteBadge,
12
12
  renderNoteBox,
13
13
  renderNoteConnector
14
- } from "./chunk-5JO443MB.js";
14
+ } from "./chunk-HAH5X345.js";
15
15
  import {
16
16
  appendArrowheadMarkers
17
17
  } from "./chunk-XBJJP2HN.js";
@@ -27,7 +27,7 @@ import {
27
27
  EDGE_LABEL_KNOCKOUT_OPACITY,
28
28
  EDGE_STROKE_WIDTH,
29
29
  NODE_STROKE_WIDTH
30
- } from "./chunk-IIEI7VK5.js";
30
+ } from "./chunk-XCKNFFKM.js";
31
31
  import {
32
32
  layoutInlineHeader
33
33
  } from "./chunk-3DOQOXXI.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
@@ -5,7 +5,7 @@ import {
5
5
  ARROWHEAD_HEIGHT,
6
6
  ARROWHEAD_WIDTH,
7
7
  EDGE_DASH
8
- } from "./chunk-IIEI7VK5.js";
8
+ } from "./chunk-XCKNFFKM.js";
9
9
  import {
10
10
  TITLE_FONT_SIZE,
11
11
  TITLE_FONT_WEIGHT,
@@ -90,14 +90,72 @@ function mapLegendBox(legend, opts) {
90
90
  };
91
91
  }
92
92
 
93
- // src/map/layout.ts
93
+ // src/map/projection.ts
94
94
  import {
95
- geoPath as geoPath2,
96
- geoNaturalEarth1,
95
+ geoConicEqualArea,
97
96
  geoEqualEarth,
98
97
  geoEquirectangular,
99
- geoConicEqualArea,
100
98
  geoMercator,
99
+ geoNaturalEarth1
100
+ } from "d3-geo";
101
+ function createMapProjection(spec) {
102
+ let p;
103
+ switch (spec.kind) {
104
+ case "conic-equal-area":
105
+ p = geoConicEqualArea();
106
+ break;
107
+ case "mercator":
108
+ p = geoMercator();
109
+ break;
110
+ case "equal-earth":
111
+ p = geoEqualEarth();
112
+ break;
113
+ case "natural-earth":
114
+ p = geoNaturalEarth1();
115
+ break;
116
+ case "equirectangular":
117
+ default:
118
+ p = geoEquirectangular();
119
+ break;
120
+ }
121
+ if (spec.parallels) {
122
+ p.parallels([
123
+ spec.parallels[0],
124
+ spec.parallels[1]
125
+ ]);
126
+ }
127
+ if (spec.center) p.center([spec.center[0], spec.center[1]]);
128
+ if (spec.rotate) p.rotate([spec.rotate[0], spec.rotate[1]]);
129
+ return p;
130
+ }
131
+ function captureMapProjection(spec, projection) {
132
+ const [tx, ty] = projection.translate();
133
+ const clip = projection.clipExtent();
134
+ return {
135
+ ...spec,
136
+ scale: projection.scale(),
137
+ translate: [tx, ty],
138
+ clipExtent: clip ? [
139
+ [clip[0][0], clip[0][1]],
140
+ [clip[1][0], clip[1][1]]
141
+ ] : null
142
+ };
143
+ }
144
+ function rebuildMapProjection(params) {
145
+ const p = createMapProjection(params).scale(params.scale).translate([params.translate[0], params.translate[1]]);
146
+ if (params.clipExtent) {
147
+ const [[x0, y0], [x1, y1]] = params.clipExtent;
148
+ p.clipExtent([
149
+ [x0, y0],
150
+ [x1, y1]
151
+ ]);
152
+ }
153
+ return p;
154
+ }
155
+
156
+ // src/map/layout.ts
157
+ import {
158
+ geoPath as geoPath2,
101
159
  geoBounds,
102
160
  geoTransform
103
161
  } from "d3-geo";
@@ -880,8 +938,8 @@ function layoutInsets(args) {
880
938
  regionStroke,
881
939
  colorizeStroke,
882
940
  regionFill,
883
- alaskaProjection: alaskaProjection2,
884
- hawaiiProjection: hawaiiProjection2,
941
+ alaskaProjection,
942
+ hawaiiProjection,
885
943
  akRef,
886
944
  hiRef
887
945
  } = args;
@@ -924,7 +982,8 @@ function layoutInsets(args) {
924
982
  }
925
983
  return maxY;
926
984
  };
927
- const placeInset = (iso, proj, boxX, iwReq) => {
985
+ const placeInset = (iso, spec, boxX, iwReq) => {
986
+ const proj = createMapProjection(spec);
928
987
  const f = usLayer.get(iso);
929
988
  if (!f) return boxX;
930
989
  const x0 = boxX;
@@ -978,9 +1037,10 @@ function layoutInsets(args) {
978
1037
  [xr, bottom],
979
1038
  [x0, bottom]
980
1039
  ],
981
- // The FITTED inset projection (just fit to this box) — captured so the
982
- // geo-query can invert pixels inside the frame back to AK/HI coords.
983
- projection: proj,
1040
+ // The FITTED inset projection (just fit to this box), as data — so the
1041
+ // geo-query can rebuild it and invert pixels inside the frame back to
1042
+ // AK/HI coords.
1043
+ projectionParams: captureMapProjection(spec, proj),
984
1044
  ...contextLand && { contextLand }
985
1045
  });
986
1046
  insetRegions.push({
@@ -1002,11 +1062,11 @@ function layoutInsets(args) {
1002
1062
  };
1003
1063
  let akRight = fitPad;
1004
1064
  if (akRef)
1005
- akRight = placeInset("US-AK", alaskaProjection2(), fitPad, width * 0.18);
1065
+ akRight = placeInset("US-AK", alaskaProjection, fitPad, width * 0.18);
1006
1066
  if (hiRef)
1007
1067
  placeInset(
1008
1068
  "US-HI",
1009
- hawaiiProjection2(),
1069
+ hawaiiProjection,
1010
1070
  akRef ? akRight + 24 : fitPad,
1011
1071
  width * 0.12
1012
1072
  );
@@ -1648,28 +1708,41 @@ function mkCurated(curated, project) {
1648
1708
  if (!p || !Number.isFinite(p[0]) || !Number.isFinite(p[1])) return [];
1649
1709
  return [{ lonLat: [curated[0], curated[1]], screen: [p[0], p[1]] }];
1650
1710
  }
1651
- var usConusProjection = () => geoConicEqualArea().parallels([29.5, 45.5]).rotate([96, 0]);
1652
- var alaskaProjection = () => geoConicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]);
1653
- var hawaiiProjection = () => geoMercator();
1654
- function projectionFor(family, extent) {
1711
+ var US_CONUS_PROJECTION = {
1712
+ kind: "conic-equal-area",
1713
+ parallels: [29.5, 45.5],
1714
+ rotate: [96, 0]
1715
+ };
1716
+ var ALASKA_PROJECTION = {
1717
+ kind: "conic-equal-area",
1718
+ rotate: [154, 0],
1719
+ center: [-2, 58.5],
1720
+ parallels: [55, 65]
1721
+ };
1722
+ var HAWAII_PROJECTION = { kind: "mercator" };
1723
+ function projectionSpecFor(family, extent) {
1655
1724
  switch (family) {
1656
1725
  case "albers-usa":
1657
- return usConusProjection();
1726
+ return US_CONUS_PROJECTION;
1658
1727
  case "conic-equal-area": {
1659
1728
  const s = extent[0][1];
1660
1729
  const n = extent[1][1];
1661
- return geoConicEqualArea().parallels([s + (n - s) / 6, s + (n - s) * 5 / 6]).center([0, (s + n) / 2]);
1730
+ return {
1731
+ kind: "conic-equal-area",
1732
+ parallels: [s + (n - s) / 6, s + (n - s) * 5 / 6],
1733
+ center: [0, (s + n) / 2]
1734
+ };
1662
1735
  }
1663
1736
  case "mercator":
1664
- return geoMercator();
1737
+ return { kind: "mercator" };
1665
1738
  case "equal-earth":
1666
- return geoEqualEarth();
1739
+ return { kind: "equal-earth" };
1667
1740
  case "equirectangular":
1668
- return geoEquirectangular();
1741
+ return { kind: "equirectangular" };
1669
1742
  case "natural-earth":
1670
- return geoNaturalEarth1();
1743
+ return { kind: "natural-earth" };
1671
1744
  default:
1672
- return geoEquirectangular();
1745
+ return { kind: "equirectangular" };
1673
1746
  }
1674
1747
  }
1675
1748
  var INSET_STATES = /* @__PURE__ */ new Set(["US-AK", "US-HI"]);
@@ -1768,16 +1841,18 @@ function buildMapProjection(resolved, data) {
1768
1841
  fitFeatures = [extentOutline()];
1769
1842
  }
1770
1843
  const fitTarget = { type: "FeatureCollection", features: fitFeatures };
1771
- const projection = projectionFor(resolved.projection, resolved.extent);
1844
+ let projectionSpec = projectionSpecFor(resolved.projection, resolved.extent);
1772
1845
  if (resolved.projection !== "albers-usa") {
1773
1846
  let centerLon = (resolved.extent[0][0] + resolved.extent[1][0]) / 2;
1774
1847
  if (centerLon > 180) centerLon -= 360;
1775
- projection.rotate([-centerLon, 0]);
1848
+ projectionSpec = { ...projectionSpec, rotate: [-centerLon, 0] };
1776
1849
  }
1850
+ const projection = createMapProjection(projectionSpec);
1777
1851
  const fitGB = geoBounds(fitTarget);
1778
1852
  const fitIsGlobal = fitGB[1][0] - fitGB[0][0] >= 270 || fitGB[1][1] - fitGB[0][1] >= 130;
1779
1853
  return {
1780
1854
  projection,
1855
+ projectionSpec,
1781
1856
  fitTarget,
1782
1857
  fitIsGlobal,
1783
1858
  worldLayer,
@@ -1890,6 +1965,7 @@ function layoutMap(resolvedIn, data, size, opts) {
1890
1965
  }
1891
1966
  const {
1892
1967
  projection,
1968
+ projectionSpec,
1893
1969
  fitTarget,
1894
1970
  fitIsGlobal,
1895
1971
  worldLayer,
@@ -2254,8 +2330,8 @@ function layoutMap(resolvedIn, data, size, opts) {
2254
2330
  regionStroke,
2255
2331
  colorizeStroke,
2256
2332
  regionFill,
2257
- alaskaProjection,
2258
- hawaiiProjection,
2333
+ alaskaProjection: ALASKA_PROJECTION,
2334
+ hawaiiProjection: HAWAII_PROJECTION,
2259
2335
  akRef,
2260
2336
  hiRef
2261
2337
  }) : { insets: [], insetRegions: [], insetLabelSeeds: [] };
@@ -3389,7 +3465,7 @@ function layoutMap(resolvedIn, data, size, opts) {
3389
3465
  legend,
3390
3466
  insets,
3391
3467
  insetRegions,
3392
- projection,
3468
+ projectionParams: captureMapProjection(projectionSpec, projection),
3393
3469
  stretch: stretchParams,
3394
3470
  diagnostics: []
3395
3471
  };
@@ -3398,6 +3474,7 @@ function layoutMap(resolvedIn, data, size, opts) {
3398
3474
  export {
3399
3475
  mapLegendGroups,
3400
3476
  mapLegendConfig,
3477
+ rebuildMapProjection,
3401
3478
  mapBackgroundColor,
3402
3479
  mapNeutralLandColor,
3403
3480
  buildMapProjection,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  renderCollapseBar,
7
7
  renderNodeCard
8
- } from "./chunk-UNSN56OJ.js";
8
+ } from "./chunk-R2K5L4UA.js";
9
9
  import {
10
10
  ScaleContext
11
11
  } from "./chunk-24YPR5EH.js";
@@ -23,7 +23,7 @@ import {
23
23
  LABEL_FONT_SIZE,
24
24
  META_FONT_SIZE,
25
25
  NODE_STROKE_WIDTH
26
- } from "./chunk-IIEI7VK5.js";
26
+ } from "./chunk-XCKNFFKM.js";
27
27
  import {
28
28
  layoutInlineHeader
29
29
  } from "./chunk-3DOQOXXI.js";
@@ -940,7 +940,7 @@ function assignEdgeSides(edges, rectById) {
940
940
  return { s: facing(dx, dy), t: facing(-dx, -dy) };
941
941
  });
942
942
  }
943
- function edgePath(source, target, sSide, tSide, sourcePorts, targetPorts) {
943
+ function edgePath(source, target, sSide, tSide, sourcePorts, targetPorts, ends) {
944
944
  const acx = source.x + source.w / 2;
945
945
  const acy = source.y + source.h / 2;
946
946
  const bcx = target.x + target.w / 2;
@@ -958,8 +958,8 @@ function edgePath(source, target, sSide, tSide, sourcePorts, targetPorts) {
958
958
  return { x, y };
959
959
  };
960
960
  const normal = (side) => side === "L" ? { x: -1, y: 0 } : side === "R" ? { x: 1, y: 0 } : side === "T" ? { x: 0, y: -1 } : { x: 0, y: 1 };
961
- const p0 = attach(sSide, source, sourcePorts, { x: bcx, y: bcy });
962
- const p1 = attach(tSide, target, targetPorts, { x: acx, y: acy });
961
+ const p0 = ends?.p0 ?? attach(sSide, source, sourcePorts, { x: bcx, y: bcy });
962
+ const p1 = ends?.p1 ?? attach(tSide, target, targetPorts, { x: acx, y: acy });
963
963
  const n0 = normal(sSide);
964
964
  const n1 = normal(tSide);
965
965
  const k = Math.max(
@@ -1021,7 +1021,8 @@ function polyCrossings(a, b) {
1021
1021
  if (segmentsCross(a[i], a[i + 1], b[j], b[j + 1])) n++;
1022
1022
  return n;
1023
1023
  }
1024
- function polyIntersection(a, b) {
1024
+ function polyIntersections(a, b) {
1025
+ const out = [];
1025
1026
  for (let i = 0; i + 1 < a.length; i++) {
1026
1027
  const p = a[i];
1027
1028
  const p2 = a[i + 1];
@@ -1036,10 +1037,10 @@ function polyIntersection(a, b) {
1036
1037
  const denom = rx * sy - ry * sx;
1037
1038
  if (denom === 0) continue;
1038
1039
  const t = ((q.x - p.x) * sy - (q.y - p.y) * sx) / denom;
1039
- return { x: p.x + t * rx, y: p.y + t * ry };
1040
+ out.push({ x: p.x + t * rx, y: p.y + t * ry });
1040
1041
  }
1041
1042
  }
1042
- return null;
1043
+ return out;
1043
1044
  }
1044
1045
  var HOP_R = 7;
1045
1046
  function hoppedPath(g, hops) {
@@ -1308,14 +1309,132 @@ function sketchEdgeGeometry(layout, offsets) {
1308
1309
  }
1309
1310
  if (!changed) break;
1310
1311
  }
1312
+ const FAN_GAP_MAX = 32;
1313
+ const fanSides = /* @__PURE__ */ new Map();
1314
+ for (let i = 0; i < layout.edges.length; i++) {
1315
+ const g = geoms[i];
1316
+ if (!g) continue;
1317
+ const e = layout.edges[i];
1318
+ const ch = chosen[i];
1319
+ const ends = [
1320
+ { id: e.sourceId, side: ch.s, end: "p0", at: g.p0, far: g.p1 },
1321
+ { id: e.targetId, side: ch.t, end: "p1", at: g.p1, far: g.p0 }
1322
+ ];
1323
+ for (const en of ends) {
1324
+ if (isBox(en.id)) continue;
1325
+ const n = normalOf(en.side);
1326
+ const along = en.side === "T" || en.side === "B";
1327
+ const dx = en.far.x - en.at.x;
1328
+ const dy = en.far.y - en.at.y;
1329
+ const proj = along ? dx : dy;
1330
+ const key = Math.atan2(proj, dx * n.x + dy * n.y);
1331
+ const k = `${en.side}:${en.id}`;
1332
+ const list = fanSides.get(k) ?? [];
1333
+ list.push({ edge: i, end: en.end, at: en.at, key, proj });
1334
+ fanSides.set(k, list);
1335
+ }
1336
+ }
1337
+ const fanned = layout.edges.map(() => ({}));
1338
+ let anyFanned = false;
1339
+ for (const [k, list] of fanSides) {
1340
+ const count = list.length;
1341
+ if (count < 2) continue;
1342
+ const along = k[0] === "T" || k[0] === "B";
1343
+ const c = ctx[list[0].edge];
1344
+ const rect = list[0].end === "p0" ? c.source : c.target;
1345
+ const len = along ? rect.w : rect.h;
1346
+ const gap = Math.min(len / (count + 1), FAN_GAP_MAX);
1347
+ const span = (count - 1) / 2 * gap;
1348
+ const reach = len / 2 - gap / 2;
1349
+ list.sort(
1350
+ (a, b) => a.key - b.key || a.edge - b.edge || (a.end < b.end ? -1 : 1)
1351
+ );
1352
+ const runs = [];
1353
+ const place = (r) => Math.max(
1354
+ -reach,
1355
+ Math.min(reach - (r.n - 1) * gap, r.an > 0 ? r.as / r.an : r.ls / r.ln)
1356
+ );
1357
+ for (const f of list) {
1358
+ const aligned = Math.abs(f.proj) <= span;
1359
+ const d = Math.max(-span, Math.min(span, f.proj));
1360
+ const run = aligned ? { n: 1, an: 1, as: d, ln: 0, ls: 0, at: 0 } : { n: 1, an: 0, as: 0, ln: 1, ls: d, at: 0 };
1361
+ run.at = place(run);
1362
+ runs.push(run);
1363
+ while (runs.length > 1) {
1364
+ const cur = runs[runs.length - 1];
1365
+ const prev = runs[runs.length - 2];
1366
+ if (prev.at + prev.n * gap <= cur.at) break;
1367
+ runs.pop();
1368
+ prev.as += cur.as - cur.an * prev.n * gap;
1369
+ prev.ls += cur.ls - cur.ln * prev.n * gap;
1370
+ prev.an += cur.an;
1371
+ prev.ln += cur.ln;
1372
+ prev.n += cur.n;
1373
+ prev.at = place(prev);
1374
+ }
1375
+ }
1376
+ let idx = 0;
1377
+ for (const run of runs) {
1378
+ for (let m = 0; m < run.n; m++, idx++) {
1379
+ const f = list[idx];
1380
+ const off2 = run.at + m * gap;
1381
+ fanned[f.edge][f.end] = along ? { x: f.at.x + off2, y: f.at.y } : { x: f.at.x, y: f.at.y + off2 };
1382
+ }
1383
+ }
1384
+ anyFanned = true;
1385
+ }
1386
+ if (anyFanned) {
1387
+ for (let i = 0; i < ctx.length; i++) {
1388
+ const c = ctx[i];
1389
+ const f = fanned[i];
1390
+ if (!c || !f.p0 && !f.p1) continue;
1391
+ const g = edgePath(
1392
+ c.source,
1393
+ c.target,
1394
+ chosen[i].s,
1395
+ chosen[i].t,
1396
+ c.sPorts,
1397
+ c.tPorts,
1398
+ f
1399
+ );
1400
+ geoms[i] = g;
1401
+ polys[i] = polyline(g);
1402
+ }
1403
+ }
1404
+ const SHARED_END_CLEAR = 2 * HOP_R;
1405
+ const endsAt = (i, id) => {
1406
+ const e = layout.edges[i];
1407
+ const g = geoms[i];
1408
+ const out = [];
1409
+ if (e.sourceId === id) out.push(g.p0);
1410
+ if (e.targetId === id) out.push(g.p1);
1411
+ return out;
1412
+ };
1311
1413
  const hopsFor = layout.edges.map(() => []);
1312
1414
  for (let i = 0; i < polys.length; i++) {
1313
1415
  for (let j = i + 1; j < polys.length; j++) {
1314
- if (ctx[i]?.adjacent.has(j)) continue;
1315
1416
  const a = polys[i];
1316
1417
  const b = polys[j];
1317
1418
  if (!a || !b) continue;
1318
- const pt = polyIntersection(a, b);
1419
+ if (!ctx[i]?.adjacent.has(j)) {
1420
+ const pt2 = polyIntersections(a, b)[0];
1421
+ if (pt2) hopsFor[j].push(pt2);
1422
+ continue;
1423
+ }
1424
+ const ei = layout.edges[i];
1425
+ const ej = layout.edges[j];
1426
+ const shared = [ei.sourceId, ei.targetId].filter(
1427
+ (id) => id === ej.sourceId || id === ej.targetId
1428
+ );
1429
+ const nearShared = shared.flatMap((id) => [
1430
+ ...endsAt(i, id),
1431
+ ...endsAt(j, id)
1432
+ ]);
1433
+ const pt = polyIntersections(a, b).find(
1434
+ (p) => nearShared.every(
1435
+ (q) => Math.hypot(p.x - q.x, p.y - q.y) > SHARED_END_CLEAR
1436
+ )
1437
+ );
1319
1438
  if (pt) hopsFor[j].push(pt);
1320
1439
  }
1321
1440
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildPlacedNotes
3
- } from "./chunk-HBCAY3KR.js";
3
+ } from "./chunk-HTNLLT34.js";
4
4
  import {
5
5
  noteCanvasShift
6
6
  } from "./chunk-6EK55ART.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-RE27AX7O.js";
12
12
  import {
13
13
  parseDgmoChartType
14
- } from "./chunk-JVRDKR5R.js";
14
+ } from "./chunk-AQIBKTPG.js";
15
15
  import {
16
16
  chartTypes
17
17
  } from "./chunk-44GP7PD5.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  META_FONT_SIZE,
3
3
  META_LINE_HEIGHT
4
- } from "./chunk-IIEI7VK5.js";
4
+ } from "./chunk-XCKNFFKM.js";
5
5
  import {
6
6
  LEGEND_CAPSULE_PAD,
7
7
  LEGEND_DOT_R,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  wrapDescriptionLines
3
- } from "./chunk-WMIKC5XO.js";
3
+ } from "./chunk-NPWVOFB3.js";
4
4
  import {
5
5
  renderInlineText
6
- } from "./chunk-FWNJDD4U.js";
6
+ } from "./chunk-S7W75MIM.js";
7
7
  import {
8
8
  ScaleContext
9
9
  } from "./chunk-24YPR5EH.js";
10
10
  import {
11
11
  ARROWHEAD_HEIGHT,
12
12
  ARROWHEAD_WIDTH
13
- } from "./chunk-IIEI7VK5.js";
13
+ } from "./chunk-XCKNFFKM.js";
14
14
  import {
15
15
  TITLE_FONT_SIZE,
16
16
  TITLE_FONT_WEIGHT,