@diagrammo/dgmo 0.74.0 → 0.76.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 (100) hide show
  1. package/dist/advanced.d.ts +51 -50
  2. package/dist/advanced.js +211 -49
  3. package/dist/{analyzer-FHRJUIMW.js → analyzer-QTDQEMS5.js} +4 -6
  4. package/dist/block.css +20 -3
  5. package/dist/block.d.ts +10 -2
  6. package/dist/block.js +34 -17
  7. package/dist/chart-meta.js +6 -6
  8. package/dist/{charts-d3-LWHTOVX7.js → charts-d3-SQEVMIAM.js} +5 -5
  9. package/dist/{chunk-TC63QU4M.js → chunk-32MOGTKT.js} +31 -196
  10. package/dist/{chunk-LYLRNAX2.js → chunk-3EGIU5WY.js} +2 -2
  11. package/dist/{chunk-CMQJP5L4.js → chunk-3LJNQ6LR.js} +4 -4
  12. package/dist/{chunk-GJQQCI63.js → chunk-3SQJZMPO.js} +1 -127
  13. package/dist/{chunk-2NRIGEHZ.js → chunk-46KVXDUJ.js} +10 -3
  14. package/dist/{chunk-YXY6V2YN.js → chunk-4CRLM3IT.js} +56 -52
  15. package/dist/{chunk-BBH5IAAR.js → chunk-76IBFEYW.js} +3 -3
  16. package/dist/{chunk-YJ5G2WRU.js → chunk-7EZ5AKBK.js} +3 -3
  17. package/dist/{chunk-5NAOTRLN.js → chunk-7G4XMHDB.js} +3 -3
  18. package/dist/chunk-7IATMZSA.js +72 -0
  19. package/dist/{chunk-LSHMDQZQ.js → chunk-AFR6GWXD.js} +3 -3
  20. package/dist/{chunk-T6BO4VO6.js → chunk-AYM472K3.js} +2 -2
  21. package/dist/{chunk-YSMI6TNZ.js → chunk-BCB24FG7.js} +2 -2
  22. package/dist/{chunk-6DYZ2JM6.js → chunk-BZQCAZZZ.js} +203 -29
  23. package/dist/{chunk-KR432TCU.js → chunk-C576CU77.js} +4 -4
  24. package/dist/{chunk-5KE6KHY6.js → chunk-CAPR5DET.js} +2 -2
  25. package/dist/{chunk-GQJ35I2I.js → chunk-CLQJAGWL.js} +7 -5
  26. package/dist/{chunk-NW3VXCXR.js → chunk-COCMMQXW.js} +2 -2
  27. package/dist/{chunk-A4GOY3PE.js → chunk-DEW62ON3.js} +1 -3
  28. package/dist/{chunk-SXZS56YM.js → chunk-EGXJWRO6.js} +3 -3
  29. package/dist/{chunk-RT7ACF77.js → chunk-EGY3TS62.js} +6 -6
  30. package/dist/{chunk-TDHD3HNO.js → chunk-F4X5NVKY.js} +37 -16
  31. package/dist/{chunk-RQ6SEQOT.js → chunk-FMZEU7MF.js} +65 -24
  32. package/dist/{chunk-R5JPMW2F.js → chunk-FTTB64OJ.js} +5 -5
  33. package/dist/{chunk-PHRBLJ3K.js → chunk-GEURKGZS.js} +2 -2
  34. package/dist/{chunk-ALDU62VN.js → chunk-GFXFRKUG.js} +4 -4
  35. package/dist/{chunk-L2EA5YLO.js → chunk-HGFKDSKZ.js} +3 -3
  36. package/dist/{chunk-JSYAH7KR.js → chunk-HOIAQ3P2.js} +2 -2
  37. package/dist/{chunk-FGXBIOVK.js → chunk-IFC3JXCT.js} +2 -2
  38. package/dist/{chunk-EV6BZMBZ.js → chunk-IHUOYDLN.js} +3 -3
  39. package/dist/{chunk-474D3IUN.js → chunk-JL7BDLC6.js} +4 -4
  40. package/dist/{chunk-WWQ6TUVK.js → chunk-JLJ7SP4X.js} +3 -3
  41. package/dist/{chunk-ULEWCCBN.js → chunk-JQ575OAK.js} +2 -2
  42. package/dist/{chunk-SUA56ZSB.js → chunk-LTTZX6RD.js} +6 -2
  43. package/dist/{chunk-YJMWEZOB.js → chunk-MG3DE3VO.js} +2 -2
  44. package/dist/{chunk-GE5RO4BS.js → chunk-N6MZSBOL.js} +5 -1
  45. package/dist/{chunk-DU3OIBQE.js → chunk-NWNSXHA5.js} +6 -2
  46. package/dist/{chunk-57Z2WXJ2.js → chunk-OBYZU23V.js} +5 -5
  47. package/dist/{chunk-2MJSSDK5.js → chunk-OUJG73YJ.js} +2 -2
  48. package/dist/{chunk-XCAEHWQB.js → chunk-PAW4RMH3.js} +2 -2
  49. package/dist/{chunk-CDFIZHVD.js → chunk-QI4Q5ZZH.js} +3 -3
  50. package/dist/{chunk-ALBVWTU4.js → chunk-TF76LCZS.js} +35 -51
  51. package/dist/{chunk-FL5IKZQA.js → chunk-U5B3TUEW.js} +2 -2
  52. package/dist/{chunk-TTCXHFFB.js → chunk-U7AO6FRL.js} +2 -2
  53. package/dist/{chunk-RN3PAL4E.js → chunk-UBW53CNS.js} +2 -2
  54. package/dist/{chunk-MDEG62W7.js → chunk-UTTRJ6KN.js} +3 -3
  55. package/dist/{chunk-Q6LP67RP.js → chunk-UWYZIGCB.js} +2 -2
  56. package/dist/{chunk-XJLNQEQS.js → chunk-XHROEQ23.js} +3 -3
  57. package/dist/{chunk-EPH4UMUE.js → chunk-YVDBBWEP.js} +2 -2
  58. package/dist/{dgmo-router-KYNLRE7S.js → dgmo-router-A3LIHT6H.js} +7 -7
  59. package/dist/{dimensions-Q5SFPATB.js → dimensions-7NYBSZRJ.js} +4 -4
  60. package/dist/{flowchart-parser-LY5GGQL2.js → flowchart-parser-NVBP3C5D.js} +2 -2
  61. package/dist/{flowchart-renderer-TTUSBBQI.js → flowchart-renderer-QYGQ64BM.js} +6 -6
  62. package/dist/index.js +13 -13
  63. package/dist/{layout-UJ62RQQ3.js → layout-2OJ25STS.js} +2 -2
  64. package/dist/{layout-DAYQ46PS.js → layout-LAS67TK3.js} +3 -3
  65. package/dist/{parser-LUOINP6H.js → parser-QYAIFXLP.js} +3 -3
  66. package/dist/{parser-L7RXUKYN.js → parser-WVE6SKB7.js} +2 -2
  67. package/dist/{parser-JYIZEKAS.js → parser-ZYAFHXKQ.js} +2 -2
  68. package/dist/pert.d.ts +4 -33
  69. package/dist/{renderer-AA5CC4VJ.js → renderer-4EWGZLJ6.js} +3 -3
  70. package/dist/{renderer-6SSIELBC.js → renderer-4PNVGHVA.js} +3 -3
  71. package/dist/{renderer-U6PK5ZKD.js → renderer-5W3HWIUL.js} +3 -3
  72. package/dist/{renderer-TI7QABY7.js → renderer-CGOPX4HW.js} +4 -4
  73. package/dist/{renderer-6IGQEVTE.js → renderer-CO5O5VR5.js} +3 -3
  74. package/dist/{renderer-QLZVE45Z.js → renderer-D7N7PPB7.js} +3 -3
  75. package/dist/{renderer-6HRDO635.js → renderer-DKW273R7.js} +4 -4
  76. package/dist/{renderer-227JWWHX.js → renderer-E6NHTVN6.js} +5 -5
  77. package/dist/{renderer-IPNSOM5J.js → renderer-F24V3RD3.js} +4 -4
  78. package/dist/{renderer-N2X3WYBY.js → renderer-F6WSR7UM.js} +5 -5
  79. package/dist/{renderer-55JP6AO4.js → renderer-FGGDZZFQ.js} +3 -3
  80. package/dist/{renderer-E5BYZTVH.js → renderer-FUJNSC5X.js} +3 -3
  81. package/dist/{renderer-YQI5U6KJ.js → renderer-GF6S5ZX6.js} +3 -3
  82. package/dist/{renderer-UXZEYV2X.js → renderer-GJDVPXI3.js} +4 -4
  83. package/dist/{renderer-UYYBJ7OB.js → renderer-IH45QV6Z.js} +9 -9
  84. package/dist/{renderer-NECP7G4X.js → renderer-JMJ7Q5OC.js} +4 -4
  85. package/dist/{renderer-YM7PLDBF.js → renderer-KMOGGMM7.js} +5 -5
  86. package/dist/{renderer-P55KPBIX.js → renderer-LBNVKVO3.js} +4 -4
  87. package/dist/{renderer-46QQH33X.js → renderer-LE3ZKHNS.js} +4 -4
  88. package/dist/{renderer-4K6KR3U3.js → renderer-MUW4G2N6.js} +6 -6
  89. package/dist/{renderer-2WW35ZIW.js → renderer-PIEPRK6M.js} +4 -4
  90. package/dist/{renderer-EJXFEA5C.js → renderer-PKRKLOYR.js} +4 -4
  91. package/dist/{renderer-W7RKBG6C.js → renderer-PR3KLNST.js} +4 -4
  92. package/dist/{renderer-SCIHPARI.js → renderer-QAMOXOZ2.js} +3 -3
  93. package/dist/{renderer-3LD3ANCP.js → renderer-RUHC6D3B.js} +4 -4
  94. package/dist/{renderer-OWBIWBMK.js → renderer-UUP6OX6F.js} +3 -3
  95. package/dist/{renderer-UUPNOGO5.js → renderer-UYZSP7MF.js} +4 -4
  96. package/dist/{renderer-CF5TYQT4.js → renderer-ZAJ5353N.js} +3 -3
  97. package/dist/{state-renderer-OPP6YOJI.js → state-renderer-UIE3AQM6.js} +6 -6
  98. package/docs/language-reference.md +6 -6
  99. package/package.json +3 -3
  100. package/dist/chunk-PDKUANDZ.js +0 -35
@@ -1,6 +1,6 @@
1
1
  // src/sketch/diagnostics.ts
2
2
  var SKETCH_DIAGNOSTIC_CODES = {
3
- NESTED_BOX: "E_SKETCH_NESTED_BOX",
3
+ BOX_DEPTH: "E_SKETCH_BOX_DEPTH",
4
4
  AMBIGUOUS_TARGET: "E_SKETCH_AMBIGUOUS_TARGET",
5
5
  UNKNOWN_SHAPE: "W_SKETCH_UNKNOWN_SHAPE",
6
6
  OVERLAP_RESOLVED: "W_SKETCH_OVERLAP_RESOLVED",
@@ -8,12 +8,12 @@ var SKETCH_DIAGNOSTIC_CODES = {
8
8
  };
9
9
  var SKETCH_DIAGNOSTICS = [
10
10
  {
11
- code: SKETCH_DIAGNOSTIC_CODES.NESTED_BOX,
11
+ code: SKETCH_DIAGNOSTIC_CODES.BOX_DEPTH,
12
12
  severity: "error",
13
13
  chartType: "sketch",
14
- title: "Nested box",
15
- message: (p) => `Box "${String(p.label ?? "?")}" is nested inside another box \u2014 sketch boxes are one level only; its shapes join the outer box`,
16
- hint: "Move the inner [Box] to the top level.",
14
+ title: "Box nested too deep",
15
+ message: (p) => `Box "${String(p.label ?? "?")}" is nested ${String(p.depth ?? "?")} levels deep \u2014 sketch boxes nest to depth ${String(p.max ?? "?")} (decision #58); its shapes join the box above it`,
16
+ hint: "Move the inner [Box] up a level \u2014 two levels of bracket is the bound.",
17
17
  example: "sketch\n[Outer]\n [Inner]\n Shape"
18
18
  },
19
19
  {
@@ -58,4 +58,4 @@ export {
58
58
  SKETCH_DIAGNOSTIC_CODES,
59
59
  SKETCH_DIAGNOSTICS
60
60
  };
61
- //# sourceMappingURL=chunk-RT7ACF77.js.map
61
+ //# sourceMappingURL=chunk-EGY3TS62.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SKETCH_DIAGNOSTIC_CODES
3
- } from "./chunk-RT7ACF77.js";
3
+ } from "./chunk-EGY3TS62.js";
4
4
  import {
5
5
  parseInArrowLabel
6
6
  } from "./chunk-IHOFUR74.js";
@@ -71,6 +71,7 @@ var BOX_RE = /^\[([^\]]*)\]\s*(.*)$/;
71
71
  var BOX_TAIL_ALIAS_RE = /^as\s+([A-Za-z][A-Za-z0-9_]{0,11})(?=\s|,|$)\s*,?\s*/;
72
72
  var AT_VALUE_RE = /^(-?\d+)\s+(-?\d+)$/;
73
73
  var SKETCH_AT_MAX = 2e3;
74
+ var MAX_BOX_DEPTH = 2;
74
75
  function parseSketch(content, palette) {
75
76
  const options = {
76
77
  noLegend: false,
@@ -262,7 +263,7 @@ function parseSketch(content, palette) {
262
263
  }
263
264
  return { ...alias !== void 0 && { alias }, at, collapsed, meta };
264
265
  };
265
- const openBox = (label, tail, lineNumber) => {
266
+ const openBox = (label, tail, lineNumber, parentBoxId) => {
266
267
  const norm = normalizeName(label);
267
268
  const existing = boxByNorm.get(norm);
268
269
  const { alias, at, collapsed, meta } = parseBoxTail(tail, lineNumber);
@@ -281,9 +282,14 @@ function parseSketch(content, palette) {
281
282
  metadata: meta,
282
283
  collapsed,
283
284
  children: [],
285
+ childBoxes: [],
286
+ parentBoxId,
284
287
  lineNumber
285
288
  };
286
289
  boxes.push(box);
290
+ if (parentBoxId !== null) {
291
+ boxByNorm.get(normalizeName(parentBoxId.slice(1, -1)))?.childBoxes.push(box.id);
292
+ }
287
293
  boxByNorm.set(norm, box);
288
294
  if (alias !== void 0) {
289
295
  if (aliasIndex.has(alias)) {
@@ -353,7 +359,13 @@ function parseSketch(content, palette) {
353
359
  let firstLineConsumed = false;
354
360
  let contentStarted = false;
355
361
  let currentTagGroup = null;
356
- let currentBox = null;
362
+ const boxStack = [];
363
+ const boxAt = (indent) => {
364
+ while (boxStack.length > 0 && indent <= boxStack[boxStack.length - 1].indent) {
365
+ boxStack.pop();
366
+ }
367
+ return boxStack[boxStack.length - 1] ?? null;
368
+ };
357
369
  let currentShape = null;
358
370
  for (let i = 0; i < lines.length; i++) {
359
371
  const raw = lines[i];
@@ -492,8 +504,8 @@ ${descLine}`;
492
504
  if (EDGE_START_RE.test(trimmed)) {
493
505
  if (indent > 0 && currentShape && indent > currentShape.indent) {
494
506
  addEdge(trimmed, lineNumber, currentShape.id);
495
- } else if (indent > 0 && currentBox && indent > currentBox.indent) {
496
- addEdge(trimmed, lineNumber, currentBox.box.id);
507
+ } else if (indent > 0 && boxAt(indent)) {
508
+ addEdge(trimmed, lineNumber, boxAt(indent).box.id);
497
509
  } else {
498
510
  warn(
499
511
  lineNumber,
@@ -509,29 +521,38 @@ ${descLine}`;
509
521
  warn(lineNumber, "Box has no label \u2014 ignored");
510
522
  continue;
511
523
  }
512
- if (indent > 0 && currentBox && indent > currentBox.indent) {
524
+ while (boxStack.length > 0 && indent <= boxStack[boxStack.length - 1].indent) {
525
+ boxStack.pop();
526
+ }
527
+ const depth = boxStack.length + 1;
528
+ if (depth > MAX_BOX_DEPTH) {
513
529
  pushError(
514
530
  lineNumber,
515
- `Box "${label}" is nested inside "${currentBox.box.label}" \u2014 sketch boxes are one level only; its shapes join the outer box`,
516
- SKETCH_DIAGNOSTIC_CODES.NESTED_BOX
531
+ `Box "${label}" is nested ${depth} levels deep \u2014 sketch boxes nest to depth ${MAX_BOX_DEPTH} (decision #58); its shapes join the box above it`,
532
+ SKETCH_DIAGNOSTIC_CODES.BOX_DEPTH
517
533
  );
518
534
  continue;
519
535
  }
520
- currentBox = {
521
- box: openBox(label, boxMatch[2] ?? "", lineNumber),
522
- indent
523
- };
536
+ const parent = boxStack[boxStack.length - 1] ?? null;
537
+ const box = openBox(
538
+ label,
539
+ boxMatch[2] ?? "",
540
+ lineNumber,
541
+ parent ? parent.box.id : null
542
+ );
543
+ boxStack.push({ box, indent });
524
544
  currentShape = null;
525
545
  continue;
526
546
  }
527
547
  if (indent === 0) {
528
- currentBox = null;
548
+ boxStack.length = 0;
529
549
  const node2 = addShape(trimmed, lineNumber, null);
530
550
  currentShape = node2 ? { id: node2.id, indent } : null;
531
551
  continue;
532
552
  }
533
- if (currentBox && indent > currentBox.indent) {
534
- const node2 = addShape(trimmed, lineNumber, currentBox.box);
553
+ const owner = boxAt(indent);
554
+ if (owner) {
555
+ const node2 = addShape(trimmed, lineNumber, owner.box);
535
556
  currentShape = node2 ? { id: node2.id, indent } : currentShape;
536
557
  continue;
537
558
  }
@@ -632,4 +653,4 @@ export {
632
653
  isSketchShapeKind,
633
654
  parseSketch
634
655
  };
635
- //# sourceMappingURL=chunk-TDHD3HNO.js.map
656
+ //# sourceMappingURL=chunk-F4X5NVKY.js.map
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  TITLE_FONT_SIZE,
14
14
  TITLE_Y
15
- } from "./chunk-A4GOY3PE.js";
15
+ } from "./chunk-DEW62ON3.js";
16
16
  import {
17
17
  compactNumber,
18
18
  computeLegendLayout
@@ -624,17 +624,33 @@ function legLabelPoint(a, b, curved, offset, away) {
624
624
  function buildConnectorLegs(args) {
625
625
  const { resolved, poiScreen, palette, width, height, fillAt, labelOnFill } = args;
626
626
  const legs = [];
627
+ const legDefaultGroups = resolved.tagGroups.filter((g) => {
628
+ if (!g.defaultValue) return false;
629
+ const k = tagAttrKey(g.name);
630
+ return resolved.edges.some((e) => e.tags[k]) || resolved.routes.some((rt) => rt.legs.some((l) => l.tags[k]));
631
+ });
632
+ const entryColor = (group, val) => val ? group.entries.find((e) => e.value.toLowerCase() === val.toLowerCase())?.color : void 0;
627
633
  const lineColor = (tags) => {
628
634
  for (const group of resolved.tagGroups) {
629
- const val = tags[tagAttrKey(group.name)];
630
- if (!val) continue;
631
- const entry = group.entries.find(
632
- (e) => e.value.toLowerCase() === val.toLowerCase()
633
- );
634
- if (entry?.color) return entry.color;
635
+ const hex = entryColor(group, tags[tagAttrKey(group.name)]);
636
+ if (hex) return hex;
637
+ }
638
+ for (const group of legDefaultGroups) {
639
+ if (tags[tagAttrKey(group.name)]) continue;
640
+ const hex = entryColor(group, group.defaultValue);
641
+ if (hex) return hex;
635
642
  }
636
643
  return null;
637
644
  };
645
+ const effectiveTags = (tags) => {
646
+ let out = null;
647
+ for (const group of legDefaultGroups) {
648
+ const key = tagAttrKey(group.name);
649
+ if (tags[key]) continue;
650
+ (out ??= { ...tags })[key] = group.defaultValue;
651
+ }
652
+ return out ?? tags;
653
+ };
638
654
  const placedLegSamples = [];
639
655
  const sampleLeg = (a, b, curved, bow) => {
640
656
  const pts = [];
@@ -754,6 +770,7 @@ function buildConnectorLegs(args) {
754
770
  });
755
771
  const routeLabelStyle = leg.label !== void 0 ? labelOnFill(fillAt(bow.labelX, bow.labelY)) : void 0;
756
772
  const routeVal = Number(leg.value);
773
+ const legTags = effectiveTags(leg.tags);
757
774
  legs.push({
758
775
  d: legPath(a, b, bow.curved, bow.offset, bow.center),
759
776
  width: routeWidthFor(routeVal),
@@ -762,7 +779,7 @@ function buildConnectorLegs(args) {
762
779
  fromId: leg.fromId,
763
780
  toId: leg.toId,
764
781
  ...Number.isFinite(routeVal) && routeVal > 0 && { value: routeVal },
765
- ...Object.keys(leg.tags).length > 0 && { tags: leg.tags },
782
+ ...Object.keys(legTags).length > 0 && { tags: legTags },
766
783
  lineNumber: leg.lineNumber,
767
784
  ...leg.label !== void 0 && {
768
785
  label: leg.label,
@@ -815,6 +832,7 @@ function buildConnectorLegs(args) {
815
832
  });
816
833
  const edgeLabelStyle = e.label !== void 0 ? labelOnFill(fillAt(bow.labelX, bow.labelY)) : void 0;
817
834
  const edgeVal = Number(e.meta["width"]);
835
+ const edgeTags = effectiveTags(e.tags);
818
836
  legs.push({
819
837
  d: legPath(a, b, bow.curved, bow.offset),
820
838
  width: widthFor(e),
@@ -823,7 +841,7 @@ function buildConnectorLegs(args) {
823
841
  fromId: e.fromId,
824
842
  toId: e.toId,
825
843
  ...Number.isFinite(edgeVal) && edgeVal > 0 && { value: edgeVal },
826
- ...Object.keys(e.tags).length > 0 && { tags: e.tags },
844
+ ...Object.keys(edgeTags).length > 0 && { tags: edgeTags },
827
845
  lineNumber: e.lineNumber,
828
846
  ...e.label !== void 0 && {
829
847
  label: e.label,
@@ -1897,7 +1915,7 @@ function layoutMap(resolvedIn, data, size, opts) {
1897
1915
  };
1898
1916
  const fillGroupNames = /* @__PURE__ */ new Set();
1899
1917
  for (const g of resolved.tagGroups) {
1900
- const k = g.name.toLowerCase();
1918
+ const k = tagAttrKey(g.name);
1901
1919
  if (resolved.regions.some((r) => r.tags[k]) || resolved.pois.some((p) => p.tags[k]))
1902
1920
  fillGroupNames.add(g.name);
1903
1921
  }
@@ -1983,6 +2001,24 @@ function layoutMap(resolvedIn, data, size, opts) {
1983
2001
  const pct = RAMP_FLOOR + Math.max(0, Math.min(1, t)) * (100 - RAMP_FLOOR);
1984
2002
  return mix(rampHue, rampBase, pct);
1985
2003
  };
2004
+ const defaultGroupsFor = (used) => resolved.tagGroups.filter(
2005
+ (g) => g.defaultValue && used(tagAttrKey(g.name))
2006
+ );
2007
+ const poiDefaultGroups = defaultGroupsFor(
2008
+ (k) => resolved.pois.some((p) => p.tags[k])
2009
+ );
2010
+ const regionDefaultGroups = defaultGroupsFor(
2011
+ (k) => resolved.regions.some((r) => r.tags[k])
2012
+ );
2013
+ const effectiveTags = (tags, groups2) => {
2014
+ let out = null;
2015
+ for (const group of groups2) {
2016
+ const key = tagAttrKey(group.name);
2017
+ if (tags[key]) continue;
2018
+ (out ??= { ...tags })[key] = group.defaultValue;
2019
+ }
2020
+ return out ?? tags;
2021
+ };
1986
2022
  const tagFill = (tags, groupName) => {
1987
2023
  if (!groupName) return null;
1988
2024
  const group = resolved.tagGroups.find(
@@ -2366,8 +2402,10 @@ function layoutMap(resolvedIn, data, size, opts) {
2366
2402
  let label;
2367
2403
  let lineNumber = -1;
2368
2404
  let layer = "base";
2405
+ let tags = {};
2369
2406
  if (isThisLayer) {
2370
2407
  fill = regionFill(r);
2408
+ tags = effectiveTags(r.tags, regionDefaultGroups);
2371
2409
  lineNumber = r.lineNumber;
2372
2410
  layer = layerKind;
2373
2411
  label = r.name;
@@ -2384,7 +2422,7 @@ function layoutMap(resolvedIn, data, size, opts) {
2384
2422
  ...label !== void 0 && { label },
2385
2423
  ...hasCentroid && { labelX: geo.cx, labelY: geo.cy },
2386
2424
  ...isThisLayer && r.value !== void 0 && { value: r.value },
2387
- ...isThisLayer && Object.keys(r.tags).length > 0 && { tags: r.tags }
2425
+ ...Object.keys(tags).length > 0 && { tags }
2388
2426
  });
2389
2427
  }
2390
2428
  };
@@ -2522,19 +2560,21 @@ function layoutMap(resolvedIn, data, size, opts) {
2522
2560
  const directHex = p.color ? resolveColor(p.color, palette) : null;
2523
2561
  if (directHex)
2524
2562
  return { fill: directHex, stroke: mix(directHex, palette.text, 18) };
2563
+ const paint = (hex) => ({
2564
+ fill: hex,
2565
+ stroke: mix(hex, palette.text, 18)
2566
+ });
2567
+ const entryColor = (group, val) => val ? group.entries.find((e) => e.value.toLowerCase() === val.toLowerCase())?.color : void 0;
2525
2568
  for (const group of resolved.tagGroups) {
2526
- const val = p.tags[tagAttrKey(group.name)];
2527
- if (!val) continue;
2528
- const entry = group.entries.find(
2529
- (e) => e.value.toLowerCase() === val.toLowerCase()
2530
- );
2531
- const hex = entry?.color;
2532
- if (hex) return { fill: hex, stroke: mix(hex, palette.text, 18) };
2569
+ const hex = entryColor(group, p.tags[tagAttrKey(group.name)]);
2570
+ if (hex) return paint(hex);
2533
2571
  }
2534
- return {
2535
- fill: palette.colors.orange,
2536
- stroke: mix(palette.colors.orange, palette.text, 18)
2537
- };
2572
+ for (const group of poiDefaultGroups) {
2573
+ if (p.tags[tagAttrKey(group.name)]) continue;
2574
+ const hex = entryColor(group, group.defaultValue);
2575
+ if (hex) return paint(hex);
2576
+ }
2577
+ return paint(palette.colors.orange);
2538
2578
  };
2539
2579
  const routeNumberById = /* @__PURE__ */ new Map();
2540
2580
  const originIds = /* @__PURE__ */ new Set();
@@ -2556,6 +2596,7 @@ function layoutMap(resolvedIn, data, size, opts) {
2556
2596
  }
2557
2597
  const placePoi = (e, cx, cy, clusterId) => {
2558
2598
  const { fill, stroke } = poiFill(e.p);
2599
+ const poiTags = effectiveTags(e.p.tags, poiDefaultGroups);
2559
2600
  const r = radiusFor(e.p);
2560
2601
  poiScreen.set(e.p.id, { cx, cy, r });
2561
2602
  const num = routeNumberById.get(e.p.id);
@@ -2571,7 +2612,7 @@ function layoutMap(resolvedIn, data, size, opts) {
2571
2612
  implicit: !!e.p.implicit,
2572
2613
  isOrigin: originIds.has(e.p.id),
2573
2614
  ...num !== void 0 && { routeNumber: num },
2574
- ...Object.keys(e.p.tags).length > 0 && { tags: e.p.tags },
2615
+ ...Object.keys(poiTags).length > 0 && { tags: poiTags },
2575
2616
  ...clusterId !== void 0 && { clusterId }
2576
2617
  });
2577
2618
  };
@@ -3365,4 +3406,4 @@ export {
3365
3406
  albersSkewFallback,
3366
3407
  layoutMap
3367
3408
  };
3368
- //# sourceMappingURL=chunk-RQ6SEQOT.js.map
3409
+ //# sourceMappingURL=chunk-FMZEU7MF.js.map
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-KRTLS3G6.js";
52
52
  import {
53
53
  parseSketch
54
- } from "./chunk-TDHD3HNO.js";
54
+ } from "./chunk-F4X5NVKY.js";
55
55
  import {
56
56
  parseSwimlane
57
57
  } from "./chunk-W7UBPARG.js";
@@ -89,7 +89,7 @@ import {
89
89
  } from "./chunk-ZM27UI5O.js";
90
90
  import {
91
91
  parseInfra
92
- } from "./chunk-2NRIGEHZ.js";
92
+ } from "./chunk-46KVXDUJ.js";
93
93
  import {
94
94
  parseGantt
95
95
  } from "./chunk-TPN7RJOM.js";
@@ -106,7 +106,7 @@ import {
106
106
  import {
107
107
  looksLikeFlowchart,
108
108
  parseFlowchart
109
- } from "./chunk-DU3OIBQE.js";
109
+ } from "./chunk-NWNSXHA5.js";
110
110
  import {
111
111
  looksLikeState,
112
112
  parseState
@@ -114,7 +114,7 @@ import {
114
114
  import {
115
115
  looksLikeClassDiagram,
116
116
  parseClassDiagram
117
- } from "./chunk-SUA56ZSB.js";
117
+ } from "./chunk-LTTZX6RD.js";
118
118
  import {
119
119
  looksLikeERDiagram,
120
120
  parseERDiagram
@@ -1716,4 +1716,4 @@ export {
1716
1716
  knownChartTypeIds,
1717
1717
  parseDgmo
1718
1718
  };
1719
- //# sourceMappingURL=chunk-R5JPMW2F.js.map
1719
+ //# sourceMappingURL=chunk-FTTB64OJ.js.map
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  TITLE_FONT_SIZE,
15
15
  TITLE_FONT_WEIGHT
16
- } from "./chunk-A4GOY3PE.js";
16
+ } from "./chunk-DEW62ON3.js";
17
17
  import {
18
18
  renderIntegratedLegend
19
19
  } from "./chunk-QT5UMFPE.js";
@@ -1154,4 +1154,4 @@ export {
1154
1154
  renderKanban,
1155
1155
  renderKanbanForExport
1156
1156
  };
1157
- //# sourceMappingURL=chunk-PHRBLJ3K.js.map
1157
+ //# sourceMappingURL=chunk-GEURKGZS.js.map
@@ -19,13 +19,13 @@ import {
19
19
  } from "./chunk-24YPR5EH.js";
20
20
  import {
21
21
  layoutInlineHeader
22
- } from "./chunk-YJMWEZOB.js";
22
+ } from "./chunk-MG3DE3VO.js";
23
23
  import {
24
24
  TITLE_FONT_SIZE,
25
25
  TITLE_FONT_WEIGHT,
26
26
  TITLE_OFFSET,
27
27
  TITLE_Y
28
- } from "./chunk-A4GOY3PE.js";
28
+ } from "./chunk-DEW62ON3.js";
29
29
  import {
30
30
  renderIntegratedLegend
31
31
  } from "./chunk-QT5UMFPE.js";
@@ -54,7 +54,7 @@ import {
54
54
  } from "./chunk-MTGGOCND.js";
55
55
  import {
56
56
  parseInfra
57
- } from "./chunk-2NRIGEHZ.js";
57
+ } from "./chunk-46KVXDUJ.js";
58
58
  import {
59
59
  preprocessDescriptionLine
60
60
  } from "./chunk-IYULMRBE.js";
@@ -1613,4 +1613,4 @@ export {
1613
1613
  renderInfra,
1614
1614
  parseAndLayoutInfra
1615
1615
  };
1616
- //# sourceMappingURL=chunk-ALDU62VN.js.map
1616
+ //# sourceMappingURL=chunk-GFXFRKUG.js.map
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-WGC42WJU.js";
4
4
  import {
5
5
  layoutInlineHeader
6
- } from "./chunk-YJMWEZOB.js";
6
+ } from "./chunk-MG3DE3VO.js";
7
7
  import {
8
8
  TITLE_FONT_SIZE,
9
9
  TITLE_FONT_WEIGHT,
10
10
  TITLE_Y
11
- } from "./chunk-A4GOY3PE.js";
11
+ } from "./chunk-DEW62ON3.js";
12
12
  import {
13
13
  renderIntegratedLegend
14
14
  } from "./chunk-QT5UMFPE.js";
@@ -1001,4 +1001,4 @@ export {
1001
1001
  renderBracket,
1002
1002
  renderBracketForExport
1003
1003
  };
1004
- //# sourceMappingURL=chunk-L2EA5YLO.js.map
1004
+ //# sourceMappingURL=chunk-HGFKDSKZ.js.map
@@ -11,7 +11,7 @@ import {
11
11
  TITLE_FONT_SIZE,
12
12
  TITLE_FONT_WEIGHT,
13
13
  TITLE_Y
14
- } from "./chunk-A4GOY3PE.js";
14
+ } from "./chunk-DEW62ON3.js";
15
15
  import {
16
16
  FONT_FAMILY
17
17
  } from "./chunk-UTCPNJND.js";
@@ -296,4 +296,4 @@ export {
296
296
  renderRing,
297
297
  renderRingForExport
298
298
  };
299
- //# sourceMappingURL=chunk-JSYAH7KR.js.map
299
+ //# sourceMappingURL=chunk-HOIAQ3P2.js.map
@@ -2,7 +2,7 @@ import {
2
2
  TITLE_FONT_SIZE,
3
3
  TITLE_FONT_WEIGHT,
4
4
  TITLE_Y
5
- } from "./chunk-A4GOY3PE.js";
5
+ } from "./chunk-DEW62ON3.js";
6
6
  import {
7
7
  FONT_FAMILY
8
8
  } from "./chunk-UTCPNJND.js";
@@ -443,4 +443,4 @@ export {
443
443
  renderVersionControl,
444
444
  renderVersionControlForExport
445
445
  };
446
- //# sourceMappingURL=chunk-FGXBIOVK.js.map
446
+ //# sourceMappingURL=chunk-IFC3JXCT.js.map
@@ -19,11 +19,11 @@ import {
19
19
  } from "./chunk-24YPR5EH.js";
20
20
  import {
21
21
  layoutInlineHeader
22
- } from "./chunk-YJMWEZOB.js";
22
+ } from "./chunk-MG3DE3VO.js";
23
23
  import {
24
24
  TITLE_FONT_SIZE,
25
25
  TITLE_FONT_WEIGHT
26
- } from "./chunk-A4GOY3PE.js";
26
+ } from "./chunk-DEW62ON3.js";
27
27
  import {
28
28
  renderIntegratedLegend
29
29
  } from "./chunk-QT5UMFPE.js";
@@ -426,4 +426,4 @@ export {
426
426
  renderMindmap,
427
427
  renderMindmapForExport
428
428
  };
429
- //# sourceMappingURL=chunk-EV6BZMBZ.js.map
429
+ //# sourceMappingURL=chunk-IHUOYDLN.js.map
@@ -11,16 +11,16 @@ import {
11
11
  initD3Chart,
12
12
  renderChartTitle,
13
13
  resolveExportPalette
14
- } from "./chunk-RN3PAL4E.js";
14
+ } from "./chunk-UBW53CNS.js";
15
15
  import {
16
16
  layoutInlineHeader
17
- } from "./chunk-YJMWEZOB.js";
17
+ } from "./chunk-MG3DE3VO.js";
18
18
  import {
19
19
  TITLE_FONT_SIZE,
20
20
  TITLE_FONT_WEIGHT,
21
21
  TITLE_OFFSET,
22
22
  TITLE_Y
23
- } from "./chunk-A4GOY3PE.js";
23
+ } from "./chunk-DEW62ON3.js";
24
24
  import {
25
25
  computeLegendLayout
26
26
  } from "./chunk-4SXHMFFP.js";
@@ -2151,4 +2151,4 @@ export {
2151
2151
  supportsD3DataChart,
2152
2152
  renderDataChartD3
2153
2153
  };
2154
- //# sourceMappingURL=chunk-474D3IUN.js.map
2154
+ //# sourceMappingURL=chunk-JL7BDLC6.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  buildMapProjection
3
- } from "./chunk-RQ6SEQOT.js";
3
+ } from "./chunk-FMZEU7MF.js";
4
4
  import {
5
5
  TITLE_FONT_SIZE,
6
6
  TITLE_Y
7
- } from "./chunk-A4GOY3PE.js";
7
+ } from "./chunk-DEW62ON3.js";
8
8
 
9
9
  // src/map/dimensions.ts
10
10
  import { geoPath } from "d3-geo";
@@ -51,4 +51,4 @@ export {
51
51
  mapContentAspect,
52
52
  mapExportDimensions
53
53
  };
54
- //# sourceMappingURL=chunk-WWQ6TUVK.js.map
54
+ //# sourceMappingURL=chunk-JLJ7SP4X.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  TITLE_FONT_SIZE,
6
6
  TITLE_FONT_WEIGHT
7
- } from "./chunk-A4GOY3PE.js";
7
+ } from "./chunk-DEW62ON3.js";
8
8
  import {
9
9
  FONT_FAMILY
10
10
  } from "./chunk-UTCPNJND.js";
@@ -554,4 +554,4 @@ function renderModal(parent, node, ctx) {
554
554
  export {
555
555
  renderWireframe
556
556
  };
557
- //# sourceMappingURL=chunk-ULEWCCBN.js.map
557
+ //# sourceMappingURL=chunk-JQ575OAK.js.map
@@ -421,6 +421,7 @@ function looksLikeClassDiagram(content) {
421
421
  }
422
422
  function extractSymbols(docText) {
423
423
  const entities = [];
424
+ const seen = /* @__PURE__ */ new Set();
424
425
  let inMetadata = true;
425
426
  for (const rawLine of docText.split("\n")) {
426
427
  const line = rawLine.trim();
@@ -436,7 +437,10 @@ function extractSymbols(docText) {
436
437
  const m = CLASS_DECL_RE.exec(line);
437
438
  if (m) {
438
439
  const name = (m[2] ?? m[3] ?? "").trim();
439
- if (name && !entities.includes(name)) entities.push(name);
440
+ if (name && !seen.has(name)) {
441
+ seen.add(name);
442
+ entities.push(name);
443
+ }
440
444
  }
441
445
  }
442
446
  return {
@@ -450,4 +454,4 @@ export {
450
454
  looksLikeClassDiagram,
451
455
  extractSymbols
452
456
  };
453
- //# sourceMappingURL=chunk-SUA56ZSB.js.map
457
+ //# sourceMappingURL=chunk-LTTZX6RD.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TITLE_FONT_SIZE,
3
3
  TITLE_Y
4
- } from "./chunk-A4GOY3PE.js";
4
+ } from "./chunk-DEW62ON3.js";
5
5
  import {
6
6
  LEGEND_HEIGHT
7
7
  } from "./chunk-YT5ICQ4R.js";
@@ -83,4 +83,4 @@ export {
83
83
  INLINE_HEADER_PAD,
84
84
  layoutInlineHeader
85
85
  };
86
- //# sourceMappingURL=chunk-YJMWEZOB.js.map
86
+ //# sourceMappingURL=chunk-MG3DE3VO.js.map
@@ -283,6 +283,10 @@ function layoutGraph(graph, options) {
283
283
  for (const group of layoutGroups) {
284
284
  extend(group.x, group.y, group.x + group.width, group.y + group.height);
285
285
  }
286
+ for (const edge of layoutEdges) {
287
+ if (edge.source !== edge.target) continue;
288
+ for (const pt of edge.points) extend(pt.x, pt.y, pt.x, pt.y);
289
+ }
286
290
  if (!Number.isFinite(bbMinX)) {
287
291
  bbMinX = 0;
288
292
  bbMinY = 0;
@@ -311,4 +315,4 @@ function layoutGraph(graph, options) {
311
315
  export {
312
316
  layoutGraph
313
317
  };
314
- //# sourceMappingURL=chunk-GE5RO4BS.js.map
318
+ //# sourceMappingURL=chunk-N6MZSBOL.js.map
@@ -452,6 +452,7 @@ function looksLikeFlowchart(content) {
452
452
  var NODE_ID_RE = /^([a-zA-Z_][\w-]*)[\s([</{]/;
453
453
  function extractSymbols(docText) {
454
454
  const entities = [];
455
+ const seen = /* @__PURE__ */ new Set();
455
456
  let inMetadata = true;
456
457
  for (const rawLine of docText.split("\n")) {
457
458
  const line = rawLine.trim();
@@ -460,7 +461,10 @@ function extractSymbols(docText) {
460
461
  inMetadata = false;
461
462
  if (line.length === 0 || /^\s/.test(rawLine)) continue;
462
463
  const m = NODE_ID_RE.exec(line);
463
- if (m && !entities.includes(m[1])) entities.push(m[1]);
464
+ if (m && !seen.has(m[1])) {
465
+ seen.add(m[1]);
466
+ entities.push(m[1]);
467
+ }
464
468
  }
465
469
  return { kind: "flowchart", entities };
466
470
  }
@@ -470,4 +474,4 @@ export {
470
474
  looksLikeFlowchart,
471
475
  extractSymbols
472
476
  };
473
- //# sourceMappingURL=chunk-DU3OIBQE.js.map
477
+ //# sourceMappingURL=chunk-NWNSXHA5.js.map