@diagrammo/dgmo 0.70.0 → 0.72.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 (188) hide show
  1. package/README.md +2 -0
  2. package/dist/advanced.d.ts +37 -30
  3. package/dist/advanced.js +91 -91
  4. package/dist/block.js +47 -47
  5. package/dist/{calculator-GU4NVYE2.js → calculator-4CNL2GKU.js} +3 -3
  6. package/dist/{chart-meta-DNsYpNbh.d.ts → chart-meta-6JaOudSs.d.ts} +8 -1
  7. package/dist/chart-meta.d.ts +2 -2
  8. package/dist/chart-meta.js +42 -42
  9. package/dist/{charts-d3-HWKV46CS.js → charts-d3-6IHGTXBR.js} +5 -5
  10. package/dist/{chunk-YYVTBZZC.js → chunk-24YPR5EH.js} +1 -1
  11. package/dist/{chunk-USOLDMYO.js → chunk-2OTYNNHS.js} +6 -6
  12. package/dist/{chunk-SHS3O7ZZ.js → chunk-2VBJCTSG.js} +4 -4
  13. package/dist/{chunk-6WI76LHG.js → chunk-376ATV2Q.js} +19 -5
  14. package/dist/{chunk-PMDE3I53.js → chunk-3HN32MEK.js} +2 -2
  15. package/dist/{chunk-EHRME74D.js → chunk-3SNE4CLI.js} +3 -3
  16. package/dist/{chunk-V5VCGTS4.js → chunk-4VUFJ7UA.js} +3 -3
  17. package/dist/{chunk-7YCHRBD3.js → chunk-5DYDPP7K.js} +2 -2
  18. package/dist/{chunk-LK35AH5V.js → chunk-66VHK7PP.js} +5 -5
  19. package/dist/{chunk-R2VVBC52.js → chunk-6DGMS2WJ.js} +4 -4
  20. package/dist/{chunk-Z6G367CM.js → chunk-6OAKQTXQ.js} +3 -3
  21. package/dist/{chunk-IODPKTRZ.js → chunk-6PA32CUB.js} +2 -2
  22. package/dist/{chunk-VSZRPDIZ.js → chunk-6S53NO3M.js} +5 -2
  23. package/dist/{chunk-PP75ABA4.js → chunk-7BHM774H.js} +6 -6
  24. package/dist/{chunk-QRLNO6C7.js → chunk-7RAWNJI5.js} +192 -122
  25. package/dist/{chunk-YXW2ZYS3.js → chunk-7SEQPFBX.js} +38 -7
  26. package/dist/{chunk-VALNMR2Y.js → chunk-7TSBM4BV.js} +3 -3
  27. package/dist/{chunk-EDFUVEO6.js → chunk-7U3NDE7T.js} +7 -7
  28. package/dist/{chunk-3QLXP6QZ.js → chunk-AEYRSPVV.js} +2 -2
  29. package/dist/{chunk-BNJC5KVG.js → chunk-BYSRXYRW.js} +4 -4
  30. package/dist/{chunk-EC5USK74.js → chunk-DEVZWCD5.js} +17 -5
  31. package/dist/{chunk-FH3S7FDS.js → chunk-DHKVHP3Y.js} +5 -5
  32. package/dist/{chunk-PBXMUXBW.js → chunk-DPGI742S.js} +20 -2
  33. package/dist/{chunk-UFKFABSP.js → chunk-DZ34UUXC.js} +7 -7
  34. package/dist/{chunk-ASUFSCVV.js → chunk-E36Q5ABQ.js} +4 -4
  35. package/dist/{chunk-TJ5PDNGU.js → chunk-EETUTZ5C.js} +2 -2
  36. package/dist/{chunk-KVM4POFR.js → chunk-ELIGVSLE.js} +10 -3
  37. package/dist/{chunk-KSK6B35D.js → chunk-FFD6A3B2.js} +22 -5
  38. package/dist/{chunk-K3MUWASA.js → chunk-FLXDMH7B.js} +3 -3
  39. package/dist/{chunk-J3XFVPEU.js → chunk-FTPNAYL2.js} +18 -6
  40. package/dist/{chunk-UJ4FJLBF.js → chunk-FX2USYOU.js} +13 -1
  41. package/dist/{chunk-IOVJT4PE.js → chunk-GCTKJDLY.js} +5 -5
  42. package/dist/{chunk-WBPWR2CX.js → chunk-GK4AU57A.js} +4 -4
  43. package/dist/{chunk-5ECGBM5S.js → chunk-HKL66CKW.js} +25 -21
  44. package/dist/{chunk-Z4KRDDZC.js → chunk-HWNF22ZZ.js} +20 -15
  45. package/dist/{chunk-2QLYLYLN.js → chunk-HZQCKXPB.js} +70 -385
  46. package/dist/{chunk-ZCWEJ3VB.js → chunk-IXVK7XCN.js} +3 -3
  47. package/dist/{chunk-BQVCENFX.js → chunk-JIWDWOYA.js} +3 -3
  48. package/dist/{chunk-HAGHVHR7.js → chunk-K6MQJ5IV.js} +2 -2
  49. package/dist/{chunk-MOMPLSQI.js → chunk-KJWIU5AM.js} +2 -2
  50. package/dist/{chunk-65KNPZCC.js → chunk-KOVRFBGR.js} +25 -4
  51. package/dist/{chunk-B6MHT3A7.js → chunk-L3XB446I.js} +2 -2
  52. package/dist/{chunk-NZ2Z4ZEN.js → chunk-LSHROB27.js} +3 -3
  53. package/dist/{chunk-Q7UM3R3Y.js → chunk-LTGOPJUV.js} +2 -2
  54. package/dist/{chunk-MMYRNZRQ.js → chunk-MC2H32SM.js} +3 -3
  55. package/dist/{chunk-CE2Z3OXR.js → chunk-MFSTE3YG.js} +18 -4
  56. package/dist/{chunk-4FEPSBUH.js → chunk-MKNWMFZU.js} +15 -5
  57. package/dist/{chunk-FQ7OYKOS.js → chunk-MUVASOBD.js} +7 -7
  58. package/dist/{chunk-6NWCQCJV.js → chunk-MWWRIOEN.js} +2 -2
  59. package/dist/{chunk-HK3JTWG3.js → chunk-MX3BYU7V.js} +2 -2
  60. package/dist/{chunk-4CTCOHDS.js → chunk-N34OTOGH.js} +12 -3
  61. package/dist/{chunk-H4VRTBMS.js → chunk-N5247W2W.js} +59 -16
  62. package/dist/{chunk-76XAJN7L.js → chunk-NEC7R2CB.js} +2 -2
  63. package/dist/{chunk-56TCBKXP.js → chunk-NJKUTY4M.js} +3 -3
  64. package/dist/{chunk-D62K46CW.js → chunk-NNMNHE3J.js} +2 -2
  65. package/dist/{chunk-XDEVAAY4.js → chunk-NTBHGUXY.js} +13 -3
  66. package/dist/{chunk-YYFIZ3AO.js → chunk-NUF7YTHA.js} +2 -2
  67. package/dist/{chunk-TSY25V7W.js → chunk-O4OVVK6J.js} +4 -4
  68. package/dist/{chunk-R2UUKZ6R.js → chunk-P6RPHRX7.js} +4 -4
  69. package/dist/{chunk-AA6LBVBN.js → chunk-PBV2C3BW.js} +27 -6
  70. package/dist/{chunk-Y37EDBPR.js → chunk-PKTRDOBI.js} +3 -3
  71. package/dist/{chunk-CVMD5UWI.js → chunk-QAJFIXJE.js} +19 -5
  72. package/dist/{chunk-7LIDBQDO.js → chunk-QITH5XOX.js} +6 -6
  73. package/dist/{chunk-YA464EGR.js → chunk-QPG55HGH.js} +3 -3
  74. package/dist/{chunk-MUXI4Y6U.js → chunk-REBTZP3W.js} +2 -2
  75. package/dist/{chunk-H7LQGRM3.js → chunk-RJI6MHHK.js} +3 -3
  76. package/dist/{chunk-G5UTJZFR.js → chunk-T7W5LM4N.js} +11 -3
  77. package/dist/{chunk-GAK5UOKL.js → chunk-TF7CFAZ5.js} +3 -3
  78. package/dist/{chunk-XAPHRRQ4.js → chunk-U4NFAWQW.js} +5 -5
  79. package/dist/{chunk-HQBY3N3S.js → chunk-UCGEBFUC.js} +3 -3
  80. package/dist/{chunk-6KJMPC6H.js → chunk-UF3EALKC.js} +9 -9
  81. package/dist/{chunk-JCAINYVG.js → chunk-UKOOGXRF.js} +288 -26
  82. package/dist/{chunk-ZLPNK7U2.js → chunk-UNM2PX5D.js} +3 -3
  83. package/dist/{chunk-JR6H5MEF.js → chunk-UNTFANSM.js} +3 -3
  84. package/dist/{chunk-UG3MRJL6.js → chunk-UTVKOGFF.js} +2 -2
  85. package/dist/{chunk-MGAWLZQE.js → chunk-UY77QQWU.js} +2 -2
  86. package/dist/{chunk-7LMDJ3U7.js → chunk-VE7PPEU3.js} +105 -18
  87. package/dist/{chunk-MZBEPHFY.js → chunk-VGLSKDDI.js} +2 -2
  88. package/dist/{chunk-WN6V4ILM.js → chunk-VLXYWPPE.js} +5 -5
  89. package/dist/{chunk-5FBSYKPQ.js → chunk-VMXV2CL5.js} +4 -4
  90. package/dist/{chunk-FFI25S5O.js → chunk-W27BULCB.js} +4 -4
  91. package/dist/{chunk-NTXNVS47.js → chunk-W7SZKJR6.js} +3 -3
  92. package/dist/{chunk-MACY4WJ4.js → chunk-WEC3JPTN.js} +4 -4
  93. package/dist/{chunk-LQB3NKEA.js → chunk-WPXHTYET.js} +16 -11
  94. package/dist/{chunk-QQI4JTJB.js → chunk-WRWUZ2C4.js} +3 -3
  95. package/dist/{chunk-QQFO63AA.js → chunk-XIZCHGP7.js} +3 -3
  96. package/dist/{chunk-PYL2K5CE.js → chunk-YG35ZCNW.js} +20 -5
  97. package/dist/{chunk-6NEFSIL3.js → chunk-YH5KJIO5.js} +4 -4
  98. package/dist/{chunk-N5XT3OWL.js → chunk-YTFA4VTW.js} +2 -2
  99. package/dist/{chunk-SW36YNNE.js → chunk-YYBQ55V2.js} +35 -74
  100. package/dist/{chunk-M2QQQWM3.js → chunk-ZJJWON5O.js} +15 -5
  101. package/dist/collapse-JRGPUE67.js +13 -0
  102. package/dist/completion-registry.js +14 -9
  103. package/dist/{dgmo-router-EAW7XiBE.d.ts → dgmo-router-Lya7cs3R.d.ts} +28 -0
  104. package/dist/dgmo-router-O55I5UXN.js +89 -0
  105. package/dist/{dimensions-RIZPH26J.js → dimensions-EFEBIRS6.js} +5 -5
  106. package/dist/editor.js +6 -3
  107. package/dist/{flowchart-parser-A64T3OEL.js → flowchart-parser-LZF2GW2P.js} +4 -4
  108. package/dist/{flowchart-renderer-F6PDPKK7.js → flowchart-renderer-JMGOCLTQ.js} +6 -6
  109. package/dist/highlight.js +6 -3
  110. package/dist/index.d.ts +1 -1
  111. package/dist/index.js +60 -47
  112. package/dist/{layout-2D6VKW6G.js → layout-2DVT24YY.js} +3 -3
  113. package/dist/{layout-COGPMCW5.js → layout-4D5JRUHX.js} +4 -4
  114. package/dist/{layout-FFCYSTW7.js → layout-AWPST2S3.js} +3 -3
  115. package/dist/{layout-CYNBG5EP.js → layout-BGXLVSXL.js} +4 -4
  116. package/dist/{layout-36Z4NU4W.js → layout-VMDNULKS.js} +5 -5
  117. package/dist/{layout-2DUQIJOI.js → layout-VVTXA3W2.js} +4 -4
  118. package/dist/{parser-LGDW543A.js → parser-2CXA7K5C.js} +4 -4
  119. package/dist/{parser-6OWUGHKY.js → parser-4E2TVMOK.js} +4 -4
  120. package/dist/{parser-2PN2WRYX.js → parser-52AZJ3BA.js} +4 -4
  121. package/dist/{parser-A3B5KVPK.js → parser-52BOCAVQ.js} +4 -4
  122. package/dist/{parser-FNOWLKC4.js → parser-5IPCYVXY.js} +4 -4
  123. package/dist/{parser-U3T76HY2.js → parser-6BF5TJQH.js} +4 -4
  124. package/dist/{parser-SEFSLUXW.js → parser-6VZISXFY.js} +3 -3
  125. package/dist/{parser-VDD3N5SC.js → parser-6Y5BMNNJ.js} +5 -5
  126. package/dist/{parser-LJZIQJRA.js → parser-7HUZBXKW.js} +3 -3
  127. package/dist/{parser-PXI5UCVR.js → parser-AEJ73QJS.js} +3 -3
  128. package/dist/{parser-M7HBD7V2.js → parser-AWNEAGMJ.js} +4 -4
  129. package/dist/{parser-53ALMRAE.js → parser-C2QRTZPJ.js} +4 -4
  130. package/dist/{parser-DLIBNGNQ.js → parser-CBSYFN6U.js} +3 -3
  131. package/dist/{parser-IL4T3HCM.js → parser-CDMP3UVH.js} +4 -4
  132. package/dist/{parser-CDA5DGXA.js → parser-CNKHKQKZ.js} +4 -4
  133. package/dist/{parser-VQKLDBS7.js → parser-EX3AGFT5.js} +4 -4
  134. package/dist/{parser-SOOR27MC.js → parser-GK3JWVHY.js} +5 -5
  135. package/dist/{parser-4VIMOING.js → parser-GZKR6BFA.js} +4 -4
  136. package/dist/{parser-YCRATNR6.js → parser-K26KDCZN.js} +3 -3
  137. package/dist/{parser-SZXKUTVE.js → parser-LTJ5AKY4.js} +4 -4
  138. package/dist/{parser-Q2K7TDEA.js → parser-NIGB4EYX.js} +3 -3
  139. package/dist/{parser-DAMYSBVY.js → parser-O7GTECFP.js} +3 -3
  140. package/dist/{parser-3QXKYLDG.js → parser-OHWDJGCP.js} +3 -3
  141. package/dist/{parser-RZIIZ3EW.js → parser-QCVEWLCO.js} +3 -3
  142. package/dist/{parser-E33LTBYE.js → parser-SUAOF72Y.js} +4 -4
  143. package/dist/{parser-CLDLYMDI.js → parser-TJ3SP2MJ.js} +4 -4
  144. package/dist/{parser-GEELVJ4X.js → parser-W2HXBHNC.js} +3 -3
  145. package/dist/{parser-2QQJFTMD.js → parser-WF4R7225.js} +4 -4
  146. package/dist/{parser-5ETIIQIM.js → parser-XM6JC3UK.js} +4 -4
  147. package/dist/{parser-D5EZ6Y5I.js → parser-XRZQ7SC7.js} +4 -4
  148. package/dist/{parser-ZXI4IQ5Y.js → parser-YRJAGBV7.js} +4 -4
  149. package/dist/{parser-4CEHZFZG.js → parser-Z3LN7P6G.js} +5 -5
  150. package/dist/{parser-52SRJNP4.js → parser-ZIEEBJMU.js} +4 -4
  151. package/dist/{renderer-PR3AGJ37.js → renderer-2MEPYGAP.js} +7 -7
  152. package/dist/{renderer-P2MICJH5.js → renderer-2T2RAFWX.js} +8 -8
  153. package/dist/{renderer-SDCMF5AF.js → renderer-4DFEFP4X.js} +6 -6
  154. package/dist/{renderer-WPGW6FTW.js → renderer-ACGZ5KJG.js} +8 -8
  155. package/dist/{renderer-F75AZ6HF.js → renderer-B4Q6LUW2.js} +6 -6
  156. package/dist/{renderer-WA5K5VWA.js → renderer-CB44E262.js} +8 -8
  157. package/dist/{renderer-3VPTEQBU.js → renderer-CL4X5S3T.js} +6 -6
  158. package/dist/{renderer-PUYQ5CDE.js → renderer-E3UQ24DE.js} +5 -5
  159. package/dist/{renderer-3EN7ZSXI.js → renderer-E42I44WZ.js} +7 -7
  160. package/dist/{renderer-VK6KVXFB.js → renderer-H5QR3LC3.js} +4 -4
  161. package/dist/{renderer-RY7RQQ37.js → renderer-IH5C7NQT.js} +4 -4
  162. package/dist/{renderer-AF6DVUZH.js → renderer-IZFO3G22.js} +8 -8
  163. package/dist/{renderer-EVHFS3PP.js → renderer-JHWGW4Q7.js} +5 -5
  164. package/dist/{renderer-U7INHN4J.js → renderer-K73COK5L.js} +5 -5
  165. package/dist/{renderer-MGYWZFFR.js → renderer-KQIJV5WD.js} +5 -5
  166. package/dist/{renderer-52YQ3EYR.js → renderer-MZ4N2SVV.js} +5 -5
  167. package/dist/{renderer-KLRBL45Z.js → renderer-QMSFXMAL.js} +5 -5
  168. package/dist/{renderer-YZMFPZGC.js → renderer-UPTO25OX.js} +8 -8
  169. package/dist/{renderer-REULT7UI.js → renderer-VEN6AIWW.js} +8 -8
  170. package/dist/{renderer-QOI2SEEA.js → renderer-VOXE7V6L.js} +7 -7
  171. package/dist/{renderer-BT6TOWBE.js → renderer-VP4DPLDY.js} +4 -4
  172. package/dist/{renderer-KVRTLE2D.js → renderer-W7JC2CTQ.js} +4 -4
  173. package/dist/{renderer-XOPHJWNZ.js → renderer-WBG576LB.js} +5 -5
  174. package/dist/{renderer-4LLJHGIQ.js → renderer-WLA3NQCC.js} +7 -7
  175. package/dist/{renderer-UC2ZZISO.js → renderer-XR4SVKNE.js} +6 -6
  176. package/dist/{renderer-Q24E7LBF.js → renderer-Y3D36RIT.js} +6 -6
  177. package/dist/{renderer-SFYFVKVN.js → renderer-Y4VC3VH4.js} +9 -7
  178. package/dist/renderer-YROML2KW.js +76 -0
  179. package/dist/{renderer-RJLAM6G5.js → renderer-YXYEP46H.js} +6 -6
  180. package/dist/{renderer-VTP3QCCP.js → renderer-ZRHTC24Q.js} +7 -7
  181. package/dist/{renderer-radial-AVHNPO2N.js → renderer-radial-KZ3W4WXI.js} +6 -6
  182. package/dist/{state-parser-GSU2ZDVR.js → state-parser-HJNCGIFT.js} +5 -5
  183. package/dist/{state-renderer-Q6XQDK3W.js → state-renderer-FJ2GT4MU.js} +8 -8
  184. package/docs/language-reference.md +22 -1
  185. package/package.json +2 -1
  186. package/dist/collapse-CLPJD2RL.js +0 -11
  187. package/dist/dgmo-router-YFNEFJST.js +0 -89
  188. package/dist/renderer-BQORZPWF.js +0 -76
@@ -42,7 +42,7 @@ import {
42
42
  getSimpleChartLegendGroups,
43
43
  parseChart,
44
44
  parseExtendedChart
45
- } from "./chunk-MGAWLZQE.js";
45
+ } from "./chunk-UY77QQWU.js";
46
46
  import {
47
47
  EMPHASIS_DIM_OPACITY,
48
48
  EMPHASIS_DIM_TEXT_OPACITY,
@@ -50,7 +50,7 @@ import {
50
50
  } from "./chunk-2CW5ZTNH.js";
51
51
  import {
52
52
  tagAttrKey
53
- } from "./chunk-PBXMUXBW.js";
53
+ } from "./chunk-DPGI742S.js";
54
54
  import {
55
55
  contrastText,
56
56
  getSegmentColors,
@@ -282,6 +282,70 @@ function tagDatum(sel, o) {
282
282
  function drawValueLabel(svg, text, x, y, color, anchor = "middle") {
283
283
  svg.append("text").attr("x", x).attr("y", y).attr("text-anchor", anchor).attr("fill", color).attr("font-size", VALUE_FONT).attr("font-family", FONT_FAMILY).text(text);
284
284
  }
285
+ var LABEL_ROTATE_DEG = 40;
286
+ var LABEL_GAP = 8;
287
+ var LABEL_LINE_HEIGHT = 1.25;
288
+ function spreadIndices(total, count) {
289
+ if (total <= 0) return /* @__PURE__ */ new Set();
290
+ if (total === 1 || count <= 1) return /* @__PURE__ */ new Set([0]);
291
+ const n = Math.min(count, total);
292
+ const keep = /* @__PURE__ */ new Set();
293
+ for (let k = 0; k < n; k++) {
294
+ keep.add(Math.round(k * (total - 1) / (n - 1)));
295
+ }
296
+ return keep;
297
+ }
298
+ function planCategoryLabels(labels, slot, font = TICK_FONT) {
299
+ const n = labels.length;
300
+ if (n === 0) {
301
+ return { rotate: false, stride: 1, height: 18, keep: /* @__PURE__ */ new Set() };
302
+ }
303
+ const widest = Math.max(...labels.map((t) => measureText(t, font)));
304
+ const flatNeeds = widest + LABEL_GAP;
305
+ const flatHeight = Math.round(font * LABEL_LINE_HEIGHT) + 6;
306
+ const all = (stride2) => (
307
+ // How many labels fit at this spacing, both ends included.
308
+ spreadIndices(n, Math.floor((n - 1) / stride2) + 1)
309
+ );
310
+ if (slot <= 0 || flatNeeds <= slot) {
311
+ return {
312
+ rotate: false,
313
+ stride: 1,
314
+ height: flatHeight,
315
+ keep: spreadIndices(n, n)
316
+ };
317
+ }
318
+ const flatStride = Math.ceil(flatNeeds / slot);
319
+ if (flatStride <= 2) {
320
+ return { rotate: false, stride: 2, height: flatHeight, keep: all(2) };
321
+ }
322
+ const rad = LABEL_ROTATE_DEG * Math.PI / 180;
323
+ const rotNeeds = font * LABEL_LINE_HEIGHT / Math.sin(rad);
324
+ const stride = Math.max(1, Math.ceil(rotNeeds / slot));
325
+ return {
326
+ rotate: true,
327
+ stride,
328
+ height: Math.round(widest * Math.sin(rad)) + 12,
329
+ keep: all(stride)
330
+ };
331
+ }
332
+ function labelSurvives(plan, i) {
333
+ return plan.keep.has(i);
334
+ }
335
+ function drawCategoryLabels(svg, labels, plan, xFor, baseline, textColor, font = TICK_FONT) {
336
+ labels.forEach((label, i) => {
337
+ if (!labelSurvives(plan, i)) return;
338
+ const t = svg.append("text").attr("class", "dgmo-tick").attr("fill", textColor).attr("font-size", font).attr("font-family", FONT_FAMILY).text(label);
339
+ if (plan.rotate) {
340
+ t.attr(
341
+ "transform",
342
+ `translate(${xFor(i)},${baseline + font}) rotate(-${LABEL_ROTATE_DEG})`
343
+ ).attr("text-anchor", "end");
344
+ } else {
345
+ t.attr("x", xFor(i)).attr("y", baseline + font + 6).attr("text-anchor", "middle");
346
+ }
347
+ });
348
+ }
285
349
 
286
350
  // src/charts-d3/bar.ts
287
351
  import { scaleBand, scaleLinear } from "d3-scale";
@@ -332,13 +396,18 @@ function renderBar(svg, chart, width, height, colors, palette, isDark, textColor
332
396
  const loVal = Math.min(0, minVal);
333
397
  const niceMax = hiVal === 0 && loVal === 0 ? 1 : hiVal;
334
398
  const leftLabels = horizontal ? data.map((d) => d.label) : [fmtNum(niceMax), fmtNum(niceMax / 2), fmtNum(loVal), fmtNum(loVal / 2)];
399
+ const mLeft = computeLeftMargin(chart.ylabel, leftLabels);
400
+ const plotW = width - mLeft - 32;
401
+ const labelPlan = planCategoryLabels(
402
+ data.map((d) => d.label),
403
+ horizontal || data.length === 0 ? Infinity : plotW / data.length
404
+ );
335
405
  const m = {
336
406
  top: top + 8,
337
407
  right: 32,
338
- bottom: 64,
339
- left: computeLeftMargin(chart.ylabel, leftLabels)
408
+ bottom: horizontal ? 64 : Math.max(64, labelPlan.height + (chart.xlabel ? 40 : 18)),
409
+ left: mLeft
340
410
  };
341
- const plotW = width - m.left - m.right;
342
411
  const plotH = height - m.top - m.bottom;
343
412
  const horiz = horizontal;
344
413
  const catRange = horiz ? [m.top, m.top + plotH] : [m.left, m.left + plotW];
@@ -356,13 +425,20 @@ function renderBar(svg, chart, width, height, colors, palette, isDark, textColor
356
425
  svg.append("text").attr("x", m.left - 10).attr("y", y + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(fmtNum(t));
357
426
  }
358
427
  }
359
- for (const d of data) {
360
- const c = (cat(d.label) ?? 0) + cat.bandwidth() / 2;
361
- if (horiz) {
428
+ if (horiz) {
429
+ for (const d of data) {
430
+ const c = (cat(d.label) ?? 0) + cat.bandwidth() / 2;
362
431
  svg.append("text").attr("x", m.left - 10).attr("y", c + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(d.label);
363
- } else {
364
- svg.append("text").attr("x", c).attr("y", m.top + plotH + 18).attr("text-anchor", "middle").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(d.label);
365
432
  }
433
+ } else {
434
+ drawCategoryLabels(
435
+ svg,
436
+ data.map((d) => d.label),
437
+ labelPlan,
438
+ (i) => (cat(data[i].label) ?? 0) + cat.bandwidth() / 2,
439
+ m.top + plotH,
440
+ textColor
441
+ );
366
442
  }
367
443
  const zero = val(0);
368
444
  const inner = stacked ? null : scaleBand().domain(seriesNames.map((_, i) => i)).range([0, cat.bandwidth()]).padding(0.12);
@@ -554,13 +630,19 @@ function renderLine(svg, chart, width, height, colors, palette, isDark, textColo
554
630
  };
555
631
  const [loL, hiL] = extentFor("left");
556
632
  const [loR, hiR] = dual ? extentFor("right") : [0, 1];
633
+ const mLeft = computeLeftMargin(chart.ylabel, [fmtNum(hiL), fmtNum(loL)]);
634
+ const mRight = dual ? computeLeftMargin(chart.yrlabel, [fmtNum(hiR), fmtNum(loR)]) : 32;
635
+ const plotW = width - mLeft - mRight;
636
+ const labelPlan = planCategoryLabels(
637
+ data.map((d) => d.label),
638
+ data.length > 0 ? plotW / data.length : plotW
639
+ );
557
640
  const m = {
558
641
  top: top + 8,
559
- right: dual ? computeLeftMargin(chart.yrlabel, [fmtNum(hiR), fmtNum(loR)]) : 32,
560
- bottom: 64,
561
- left: computeLeftMargin(chart.ylabel, [fmtNum(hiL), fmtNum(loL)])
642
+ right: mRight,
643
+ bottom: Math.max(64, labelPlan.height + (chart.xlabel ? 40 : 18)),
644
+ left: mLeft
562
645
  };
563
- const plotW = width - m.left - m.right;
564
646
  const plotH = height - m.top - m.bottom;
565
647
  const x = scalePoint().domain(data.map((d) => d.label)).range([m.left, m.left + plotW]).padding(0.5);
566
648
  const yL = scaleLinear2().domain([loL, hiL]).nice().range([m.top + plotH, m.top]);
@@ -588,9 +670,14 @@ function renderLine(svg, chart, width, height, colors, palette, isDark, textColo
588
670
  svg.append("text").attr("class", "dgmo-tick").attr("x", m.left + plotW + 10).attr("y", yR(t) + 4).attr("text-anchor", "start").attr("fill", rightTint ?? textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(fmtNum(t));
589
671
  }
590
672
  }
591
- for (const d of data) {
592
- svg.append("text").attr("class", "dgmo-tick").attr("x", x(d.label) ?? 0).attr("y", m.top + plotH + 18).attr("text-anchor", "middle").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(d.label);
593
- }
673
+ drawCategoryLabels(
674
+ svg,
675
+ data.map((d) => d.label),
676
+ labelPlan,
677
+ (i) => x(data[i].label) ?? 0,
678
+ m.top + plotH,
679
+ textColor
680
+ );
594
681
  svg.append("rect").attr("class", "dgmo-plot-rect").attr("x", m.left).attr("y", m.top).attr("width", plotW).attr("height", plotH).attr("fill", "transparent");
595
682
  for (let s = 0; s < seriesCount; s++) {
596
683
  const color = seriesColor(s);
@@ -2064,4 +2151,4 @@ export {
2064
2151
  supportsD3DataChart,
2065
2152
  renderDataChartD3
2066
2153
  };
2067
- //# sourceMappingURL=chunk-7LMDJ3U7.js.map
2154
+ //# sourceMappingURL=chunk-VE7PPEU3.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-NOTA6TEI.js";
9
9
  import {
10
10
  peelQuotedName
11
- } from "./chunk-M2QQQWM3.js";
11
+ } from "./chunk-ZJJWON5O.js";
12
12
  import {
13
13
  makeDgmoError
14
14
  } from "./chunk-OLMWTJVU.js";
@@ -787,4 +787,4 @@ export {
787
787
  resolveTaskName,
788
788
  calculateSchedule
789
789
  };
790
- //# sourceMappingURL=chunk-MZBEPHFY.js.map
790
+ //# sourceMappingURL=chunk-VGLSKDDI.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-YRYKTYMQ.js";
5
5
  import {
6
6
  ScaleContext
7
- } from "./chunk-YYVTBZZC.js";
7
+ } from "./chunk-24YPR5EH.js";
8
8
  import {
9
9
  createTooltip,
10
10
  hideTooltip,
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-SPA7DCB3.js";
14
14
  import {
15
15
  renderIntegratedLegend
16
- } from "./chunk-VSZRPDIZ.js";
16
+ } from "./chunk-6S53NO3M.js";
17
17
  import {
18
18
  FONT_FAMILY
19
19
  } from "./chunk-UTCPNJND.js";
@@ -32,11 +32,11 @@ import {
32
32
  } from "./chunk-QX53GOI7.js";
33
33
  import {
34
34
  parseTimelineDate
35
- } from "./chunk-D62K46CW.js";
35
+ } from "./chunk-NNMNHE3J.js";
36
36
  import {
37
37
  resolveTagColor,
38
38
  tagAttrKey
39
- } from "./chunk-PBXMUXBW.js";
39
+ } from "./chunk-DPGI742S.js";
40
40
  import {
41
41
  getSeriesColors,
42
42
  mix,
@@ -1672,4 +1672,4 @@ export {
1672
1672
  formatDateLabel,
1673
1673
  renderTimeline
1674
1674
  };
1675
- //# sourceMappingURL=chunk-WN6V4ILM.js.map
1675
+ //# sourceMappingURL=chunk-VLXYWPPE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractDatePrefix,
3
3
  parseTimelineDate
4
- } from "./chunk-D62K46CW.js";
4
+ } from "./chunk-NNMNHE3J.js";
5
5
  import {
6
6
  makeYearContext,
7
7
  parseDateToken,
@@ -16,7 +16,7 @@ import {
16
16
  tagAttrKey,
17
17
  validateTagGroupNames,
18
18
  validateTagValues
19
- } from "./chunk-PBXMUXBW.js";
19
+ } from "./chunk-DPGI742S.js";
20
20
  import {
21
21
  EVENT_LINE_REGISTRY,
22
22
  extractColor,
@@ -27,7 +27,7 @@ import {
27
27
  tryParseSharedOption,
28
28
  warnUnknownMetaKeys,
29
29
  withTagAliases
30
- } from "./chunk-M2QQQWM3.js";
30
+ } from "./chunk-ZJJWON5O.js";
31
31
  import {
32
32
  emit,
33
33
  formatDgmoError,
@@ -686,4 +686,4 @@ export {
686
686
  EVENT_LINE_DIAGNOSTICS,
687
687
  parseEventLine
688
688
  };
689
- //# sourceMappingURL=chunk-5FBSYKPQ.js.map
689
+ //# sourceMappingURL=chunk-VMXV2CL5.js.map
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-A4GOY3PE.js";
23
23
  import {
24
24
  renderIntegratedLegend
25
- } from "./chunk-VSZRPDIZ.js";
25
+ } from "./chunk-6S53NO3M.js";
26
26
  import {
27
27
  getLegendExtent,
28
28
  getMaxLegendReservedHeight
@@ -42,12 +42,12 @@ import {
42
42
  import {
43
43
  resolveTagColor,
44
44
  tagAttrKey
45
- } from "./chunk-PBXMUXBW.js";
45
+ } from "./chunk-DPGI742S.js";
46
46
  import {
47
47
  fillModeFromOptions,
48
48
  legendInlineRequested,
49
49
  legendSuppressed
50
- } from "./chunk-M2QQQWM3.js";
50
+ } from "./chunk-ZJJWON5O.js";
51
51
  import {
52
52
  contrastText,
53
53
  mix,
@@ -317,4 +317,4 @@ export {
317
317
  renderFamilyForExport,
318
318
  renderFamily
319
319
  };
320
- //# sourceMappingURL=chunk-FFI25S5O.js.map
320
+ //# sourceMappingURL=chunk-W27BULCB.js.map
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-MTGGOCND.js";
16
16
  import {
17
17
  tagAttrKey
18
- } from "./chunk-PBXMUXBW.js";
18
+ } from "./chunk-DPGI742S.js";
19
19
  import {
20
20
  legendSuppressed
21
- } from "./chunk-M2QQQWM3.js";
21
+ } from "./chunk-ZJJWON5O.js";
22
22
 
23
23
  // src/c4/layout.ts
24
24
  import dagre from "@dagrejs/dagre";
@@ -1718,4 +1718,4 @@ export {
1718
1718
  layoutC4Components,
1719
1719
  layoutC4Deployment
1720
1720
  };
1721
- //# sourceMappingURL=chunk-NTXNVS47.js.map
1721
+ //# sourceMappingURL=chunk-W7SZKJR6.js.map
@@ -6,7 +6,7 @@ import {
6
6
  formatPct,
7
7
  resolveCellColor,
8
8
  resolveColorMode
9
- } from "./chunk-PMDE3I53.js";
9
+ } from "./chunk-3HN32MEK.js";
10
10
  import {
11
11
  layoutInlineHeader
12
12
  } from "./chunk-6CLC26GU.js";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-A4GOY3PE.js";
18
18
  import {
19
19
  renderIntegratedLegend
20
- } from "./chunk-VSZRPDIZ.js";
20
+ } from "./chunk-6S53NO3M.js";
21
21
  import {
22
22
  getLegendExtent,
23
23
  getMaxLegendReservedHeight
@@ -33,7 +33,7 @@ import {
33
33
  } from "./chunk-MTGGOCND.js";
34
34
  import {
35
35
  tagAttrKey
36
- } from "./chunk-PBXMUXBW.js";
36
+ } from "./chunk-DPGI742S.js";
37
37
  import {
38
38
  contrastText,
39
39
  getSeriesColors,
@@ -439,4 +439,4 @@ export {
439
439
  renderTreemapForExport,
440
440
  renderTreemap
441
441
  };
442
- //# sourceMappingURL=chunk-MACY4WJ4.js.map
442
+ //# sourceMappingURL=chunk-WEC3JPTN.js.map
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  AUTO_TAG_COLOR_SENTINEL,
3
+ activeTagNoMatchMessage,
3
4
  cascadeTagMetadata,
4
5
  finalizeAutoTagColors,
5
6
  matchTagBlockHeading,
@@ -7,7 +8,7 @@ import {
7
8
  tagAttrKey,
8
9
  validateTagGroupNames,
9
10
  validateTagValues
10
- } from "./chunk-PBXMUXBW.js";
11
+ } from "./chunk-DPGI742S.js";
11
12
  import {
12
13
  TREEMAP_REGISTRY,
13
14
  extractColor,
@@ -20,7 +21,7 @@ import {
20
21
  stripQuotes,
21
22
  warnUnknownMetaKeys,
22
23
  withTagAliases
23
- } from "./chunk-M2QQQWM3.js";
24
+ } from "./chunk-ZJJWON5O.js";
24
25
  import {
25
26
  emit,
26
27
  formatDgmoError,
@@ -343,15 +344,19 @@ function resolveDefaultColorMode(result, pushWarning) {
343
344
  const heatHit = heatName !== void 0 ? lv === heatName.toLowerCase() : lv === "value" || lv === "heat";
344
345
  if (result.hasHeat && heatHit) return "heat";
345
346
  if (result.tagGroups.some((g) => g.name.toLowerCase() === lv)) return "tag";
346
- const dims = [
347
- ...result.tagGroups.map((g) => g.name),
348
- ...result.hasHeat ? [heatName ?? "Value"] : []
349
- ];
350
- const hint = dims.length ? ` Available: ${dims.join(", ")}, none.` : " No tag groups or heat are declared.";
351
- pushWarning(
352
- result.activeTagLineNumber ?? 0,
353
- `active-tag "${at}" does not match a declared tag group or the heat label.${hint}`
347
+ const warning = activeTagNoMatchMessage(
348
+ at,
349
+ result.tagGroups,
350
+ result.hasHeat ? [heatName ?? "Value"] : [],
351
+ "the heat label"
354
352
  );
353
+ if (warning) {
354
+ pushWarning(
355
+ result.activeTagLineNumber ?? 1,
356
+ warning,
357
+ "W_ACTIVE_TAG_NO_MATCH"
358
+ );
359
+ }
355
360
  }
356
361
  if (result.hasHeat) return "heat";
357
362
  if (result.tagGroups.length > 0) return "tag";
@@ -440,4 +445,4 @@ export {
440
445
  TREEMAP_DIAGNOSTICS,
441
446
  parseTreemap
442
447
  };
443
- //# sourceMappingURL=chunk-LQB3NKEA.js.map
448
+ //# sourceMappingURL=chunk-WPXHTYET.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-WGC42WJU.js";
7
7
  import {
8
8
  ScaleContext
9
- } from "./chunk-YYVTBZZC.js";
9
+ } from "./chunk-24YPR5EH.js";
10
10
  import {
11
11
  TITLE_FONT_SIZE,
12
12
  TITLE_FONT_WEIGHT,
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-MTGGOCND.js";
22
22
  import {
23
23
  fillModeFromOptions
24
- } from "./chunk-M2QQQWM3.js";
24
+ } from "./chunk-ZJJWON5O.js";
25
25
  import {
26
26
  contrastText,
27
27
  getSeriesColors,
@@ -428,4 +428,4 @@ export {
428
428
  renderPyramid,
429
429
  renderPyramidForExport
430
430
  };
431
- //# sourceMappingURL=chunk-QQI4JTJB.js.map
431
+ //# sourceMappingURL=chunk-WRWUZ2C4.js.map
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-A4GOY3PE.js";
12
12
  import {
13
13
  renderIntegratedLegend
14
- } from "./chunk-VSZRPDIZ.js";
14
+ } from "./chunk-6S53NO3M.js";
15
15
  import {
16
16
  getLegendExtent,
17
17
  getMaxLegendReservedHeight
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  resolveTagColor,
30
30
  tagAttrKey
31
- } from "./chunk-PBXMUXBW.js";
31
+ } from "./chunk-DPGI742S.js";
32
32
  import {
33
33
  contrastText,
34
34
  getSeriesColors,
@@ -1001,4 +1001,4 @@ export {
1001
1001
  renderBracket,
1002
1002
  renderBracketForExport
1003
1003
  };
1004
- //# sourceMappingURL=chunk-QQFO63AA.js.map
1004
+ //# sourceMappingURL=chunk-XIZCHGP7.js.map
@@ -12,12 +12,13 @@ import {
12
12
  } from "./chunk-NOTA6TEI.js";
13
13
  import {
14
14
  AUTO_TAG_COLOR_SENTINEL,
15
+ activeTagNoMatchMessage,
15
16
  finalizeAutoTagColors,
16
17
  matchTagBlockHeading,
17
18
  stripDefaultModifier,
18
19
  tagAttrKey,
19
20
  validateTagGroupNames
20
- } from "./chunk-PBXMUXBW.js";
21
+ } from "./chunk-DPGI742S.js";
21
22
  import {
22
23
  C4_REGISTRY,
23
24
  OPTION_NOCOLON_RE,
@@ -28,7 +29,7 @@ import {
28
29
  splitNameAndMeta,
29
30
  warnUnknownMetaKeys,
30
31
  withTagAliases
31
- } from "./chunk-M2QQQWM3.js";
32
+ } from "./chunk-ZJJWON5O.js";
32
33
  import {
33
34
  formatDgmoError,
34
35
  makeDgmoError,
@@ -164,8 +165,8 @@ function parseC4(content, palette) {
164
165
  diagnostics: [],
165
166
  error: null
166
167
  };
167
- const pushError = (line, message, severity = "error") => {
168
- const diag = makeDgmoError(line, message, severity);
168
+ const pushError = (line, message, severity = "error", code) => {
169
+ const diag = makeDgmoError(line, message, severity, code);
169
170
  result.diagnostics.push(diag);
170
171
  if (!result.error && severity === "error")
171
172
  result.error = formatDgmoError(diag);
@@ -176,6 +177,7 @@ function parseC4(content, palette) {
176
177
  }
177
178
  const lines = content.split("\n");
178
179
  let contentStarted = false;
180
+ let activeTagOptionLine = 0;
179
181
  let sawChartType = false;
180
182
  let inDeployment = false;
181
183
  let currentTagGroup = null;
@@ -265,6 +267,7 @@ function parseC4(content, palette) {
265
267
  }
266
268
  if (KNOWN_C4_OPTIONS.has(key)) {
267
269
  options[key] = optMatch[2].trim();
270
+ if (key === "active-tag") activeTagOptionLine = lineNumber;
268
271
  continue;
269
272
  }
270
273
  }
@@ -735,6 +738,18 @@ function parseC4(content, palette) {
735
738
  (line, msg) => pushError(line, msg, "warning")
736
739
  );
737
740
  result.direction = options["direction-lr"] ? "LR" : "TB";
741
+ const activeTagWarning = activeTagNoMatchMessage(
742
+ options["active-tag"],
743
+ result.tagGroups
744
+ );
745
+ if (activeTagWarning) {
746
+ pushError(
747
+ activeTagOptionLine || 1,
748
+ activeTagWarning,
749
+ "warning",
750
+ "W_ACTIVE_TAG_NO_MATCH"
751
+ );
752
+ }
738
753
  return result;
739
754
  }
740
755
  function findParentElement(indent, stack) {
@@ -830,4 +845,4 @@ function validateDeploymentRefs(result, knownNames, pushWarning) {
830
845
  export {
831
846
  parseC4
832
847
  };
833
- //# sourceMappingURL=chunk-PYL2K5CE.js.map
848
+ //# sourceMappingURL=chunk-YG35ZCNW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryCollectNote
3
- } from "./chunk-HK3JTWG3.js";
3
+ } from "./chunk-MX3BYU7V.js";
4
4
  import {
5
5
  resolveNotes
6
6
  } from "./chunk-7NK42OIB.js";
@@ -19,7 +19,7 @@ import {
19
19
  tagAttrKey,
20
20
  validateTagGroupNames,
21
21
  validateTagValues
22
- } from "./chunk-PBXMUXBW.js";
22
+ } from "./chunk-DPGI742S.js";
23
23
  import {
24
24
  ALL_CHART_TYPES,
25
25
  FILL_FAMILY_TOKENS,
@@ -32,7 +32,7 @@ import {
32
32
  parseMetadataRegion,
33
33
  tryParseSharedOption,
34
34
  withTagAliases
35
- } from "./chunk-M2QQQWM3.js";
35
+ } from "./chunk-ZJJWON5O.js";
36
36
  import {
37
37
  resolveColorWithDiagnostic
38
38
  } from "./chunk-EXNKNJ65.js";
@@ -543,4 +543,4 @@ export {
543
543
  parseState,
544
544
  looksLikeState
545
545
  };
546
- //# sourceMappingURL=chunk-6NEFSIL3.js.map
546
+ //# sourceMappingURL=chunk-YH5KJIO5.js.map
@@ -5,7 +5,7 @@ import {
5
5
  parseFirstLine,
6
6
  splitNameAndMeta,
7
7
  warnUnknownMetaKeys
8
- } from "./chunk-M2QQQWM3.js";
8
+ } from "./chunk-ZJJWON5O.js";
9
9
  import {
10
10
  makeDgmoError,
11
11
  makeFail,
@@ -338,4 +338,4 @@ function assignGlobalNumbers(result) {
338
338
  export {
339
339
  parseTechRadar
340
340
  };
341
- //# sourceMappingURL=chunk-N5XT3OWL.js.map
341
+ //# sourceMappingURL=chunk-YTFA4VTW.js.map