@yorz/cli 0.1.4 → 0.1.5

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 (138) hide show
  1. package/dist/cli/index.js +133 -53
  2. package/dist/gui/assets/{abnfDiagram-VRR7QNED-BlILeZZA.js → abnfDiagram-VRR7QNED-BjiKWU_r.js} +1 -1
  3. package/dist/gui/assets/{arc-C-xJpbjF.js → arc--ZszoeC5.js} +1 -1
  4. package/dist/gui/assets/{architectureDiagram-ZJ3FMSHR-QdzNii0b.js → architectureDiagram-ZJ3FMSHR-D8beCiJM.js} +1 -1
  5. package/dist/gui/assets/{blockDiagram-677ZJIJ3-BQTAKTET.js → blockDiagram-677ZJIJ3-XTjBv4Yl.js} +1 -1
  6. package/dist/gui/assets/{c4Diagram-LMCZKHZV-YRh3fqeb.js → c4Diagram-LMCZKHZV-B8mRAP6M.js} +1 -1
  7. package/dist/gui/assets/channel-DSEvjkHE.js +1 -0
  8. package/dist/gui/assets/{chunk-2Q5K7J3B-Bgu-eeCS.js → chunk-2Q5K7J3B-yiwKrUMh.js} +1 -1
  9. package/dist/gui/assets/{chunk-32BRIVSS-DTLd8wsP.js → chunk-32BRIVSS-BKUpEqmm.js} +1 -1
  10. package/dist/gui/assets/{chunk-5VM5RSS4-Cct8HJoz.js → chunk-5VM5RSS4-DbsGyMz5.js} +1 -1
  11. package/dist/gui/assets/{chunk-EX3LRPZG-DBgaA_1N.js → chunk-EX3LRPZG-DTBuQkne.js} +1 -1
  12. package/dist/gui/assets/{chunk-JWPE2WC7-DELoF8bV.js → chunk-JWPE2WC7-Durur7_4.js} +1 -1
  13. package/dist/gui/assets/{chunk-MOJQB5TN-Du6uREYs.js → chunk-MOJQB5TN-DXNE2VJB.js} +1 -1
  14. package/dist/gui/assets/{chunk-RYQCIY6F-CxO6cQdM.js → chunk-RYQCIY6F-HY8qhnee.js} +1 -1
  15. package/dist/gui/assets/{chunk-V7JOEXUC-BiILBcGA.js → chunk-V7JOEXUC-BXRxPy5M.js} +1 -1
  16. package/dist/gui/assets/{chunk-VR4S4FIN-BfY2RvG4.js → chunk-VR4S4FIN-Ws4fVn18.js} +1 -1
  17. package/dist/gui/assets/{chunk-XXDRQBXY-DmsZw6tB.js → chunk-XXDRQBXY-CwHBGyO1.js} +1 -1
  18. package/dist/gui/assets/classDiagram-OUVF2IWQ-BN1qwPdD.js +1 -0
  19. package/dist/gui/assets/classDiagram-v2-EOCWNBFH-BN1qwPdD.js +1 -0
  20. package/dist/gui/assets/{cose-bilkent-JH36ORCC-gX-8DSxS.js → cose-bilkent-JH36ORCC-C3oDctXM.js} +1 -1
  21. package/dist/gui/assets/{cynefin-VYW2F7L2-vOfRo7cL.js → cynefin-VYW2F7L2-BjremdIM.js} +1 -1
  22. package/dist/gui/assets/{cynefinDiagram-TSTJHNR4-Dv66a7Rh.js → cynefinDiagram-TSTJHNR4-Cwe2fD65.js} +1 -1
  23. package/dist/gui/assets/{dagre-VKFMJZFB-Rk64dDvT.js → dagre-VKFMJZFB-Bx2kzeqs.js} +1 -1
  24. package/dist/gui/assets/{diagram-FQU43EPY-CyW3IjmQ.js → diagram-FQU43EPY-BVyLKNdq.js} +1 -1
  25. package/dist/gui/assets/{diagram-G47NLZAW-Caav47lW.js → diagram-G47NLZAW-DicBAwcf.js} +1 -1
  26. package/dist/gui/assets/{diagram-NH7WQ7WH-_X3ihqNf.js → diagram-NH7WQ7WH-BbRrvaYb.js} +1 -1
  27. package/dist/gui/assets/{diagram-OA4YK3LP-CjbverOE.js → diagram-OA4YK3LP-C2YIUXV5.js} +1 -1
  28. package/dist/gui/assets/{diagram-WEI45ONY-B93ZeTtT.js → diagram-WEI45ONY-DJHPHFaZ.js} +1 -1
  29. package/dist/gui/assets/{ebnfDiagram-CCIWWBDH-CdDt4bWx.js → ebnfDiagram-CCIWWBDH-DtDW0rR6.js} +1 -1
  30. package/dist/gui/assets/{erDiagram-Q63AITRT-Bypq-rvj.js → erDiagram-Q63AITRT-C5CAH1UZ.js} +1 -1
  31. package/dist/gui/assets/{flowDiagram-23GEKE2U-b-l8_7KP.js → flowDiagram-23GEKE2U-DA2WblHa.js} +1 -1
  32. package/dist/gui/assets/{ganttDiagram-NO4QXBWP-BeZFHLhX.js → ganttDiagram-NO4QXBWP-TMRYyAbG.js} +1 -1
  33. package/dist/gui/assets/{gitGraphDiagram-IHSO6WYX-C0siPGLA.js → gitGraphDiagram-IHSO6WYX-Ci-GVNac.js} +1 -1
  34. package/dist/gui/assets/index-Bq3A8DU2.js +21 -0
  35. package/dist/gui/assets/{infoDiagram-FWYZ7A6U-Bk8DNKgG.js → infoDiagram-FWYZ7A6U-BV4Ye9h-.js} +1 -1
  36. package/dist/gui/assets/{ishikawaDiagram-FXEZZL3T-DyS4wmJu.js → ishikawaDiagram-FXEZZL3T-CLBTOnXf.js} +1 -1
  37. package/dist/gui/assets/{journeyDiagram-5HDEW3XC-4jUY7Bzi.js → journeyDiagram-5HDEW3XC-BINYoOlq.js} +1 -1
  38. package/dist/gui/assets/{kanban-definition-HUTT4EX6-BRiI4KbM.js → kanban-definition-HUTT4EX6-Bvoywhuo.js} +1 -1
  39. package/dist/gui/assets/{linear-C5JkbjyJ.js → linear-CldLHplp.js} +1 -1
  40. package/dist/gui/assets/{mermaid.core-ImB_5gdE.js → mermaid.core-1Uynhu-S.js} +4 -4
  41. package/dist/gui/assets/{mindmap-definition-LN4V7U3C-9_Awmd2W.js → mindmap-definition-LN4V7U3C-Sv5B_zGg.js} +1 -1
  42. package/dist/gui/assets/{pegDiagram-2B236MQR-DF_vIYzp.js → pegDiagram-2B236MQR-CyYAur_9.js} +1 -1
  43. package/dist/gui/assets/{pieDiagram-ENE6RG2P-3TPwXSjQ.js → pieDiagram-ENE6RG2P-D3P7lu31.js} +1 -1
  44. package/dist/gui/assets/{quadrantDiagram-ABIIQ3AL-jzJ30mNi.js → quadrantDiagram-ABIIQ3AL-zmQrhKVf.js} +1 -1
  45. package/dist/gui/assets/{railroadDiagram-RFXS5EU6-B-29q3CI.js → railroadDiagram-RFXS5EU6-D5HlXQ4M.js} +1 -1
  46. package/dist/gui/assets/{requirementDiagram-TGXJPOKE-BanWpS6g.js → requirementDiagram-TGXJPOKE-BJcv5tpR.js} +1 -1
  47. package/dist/gui/assets/{sankeyDiagram-HTMAVEWB-B_sxc9IV.js → sankeyDiagram-HTMAVEWB-9R97Q-65.js} +1 -1
  48. package/dist/gui/assets/{sequenceDiagram-DBY2YBRQ-BNVav9DA.js → sequenceDiagram-DBY2YBRQ-D6v2e_UA.js} +1 -1
  49. package/dist/gui/assets/{sizeCapture-X5ZJPWSS-DbaiKjno.js → sizeCapture-X5ZJPWSS-5Ee75AoR.js} +1 -1
  50. package/dist/gui/assets/{stateDiagram-2N3HPSRC-jU5WBm6c.js → stateDiagram-2N3HPSRC-CiFKPVFd.js} +1 -1
  51. package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-XeM3QPuf.js +1 -0
  52. package/dist/gui/assets/{swimlanes-5IMT3BWC-Dcmb64x2.js → swimlanes-5IMT3BWC-DejeKz32.js} +2 -2
  53. package/dist/gui/assets/swimlanesDiagram-G3AALYLV-BaUP5W6u.js +8 -0
  54. package/dist/gui/assets/{timeline-definition-FHXFAJF6-COm9ow7j.js → timeline-definition-FHXFAJF6-CpW-bina.js} +1 -1
  55. package/dist/gui/assets/{vennDiagram-L72KCM5P-DliDuTVY.js → vennDiagram-L72KCM5P-DFEDh4dV.js} +1 -1
  56. package/dist/gui/assets/{wardleyDiagram-EHGQE667-C2O_2cpw.js → wardleyDiagram-EHGQE667-B4Blcc-a.js} +1 -1
  57. package/dist/gui/assets/{xychartDiagram-FW5EYKEG-Ldmt9hoc.js → xychartDiagram-FW5EYKEG-D9idxadT.js} +1 -1
  58. package/dist/gui/index.html +1 -1
  59. package/package.json +1 -1
  60. package/dist/_commonjsHelpers-DyI1JsEH.js +0 -34
  61. package/dist/abnfDiagram-VRR7QNED-UQS77aUi.js +0 -119
  62. package/dist/api-DrYc_Ds_.js +0 -129852
  63. package/dist/arc-B1cAL3U1.js +0 -132
  64. package/dist/architectureDiagram-ZJ3FMSHR-CfWOhs-q.js +0 -8816
  65. package/dist/blockDiagram-677ZJIJ3-CLOAAFZa.js +0 -3796
  66. package/dist/c4Diagram-LMCZKHZV-BGdELGkb.js +0 -2483
  67. package/dist/certs-BeimSwB3.js +0 -14071
  68. package/dist/certs-C4t5lAmJ.js +0 -14071
  69. package/dist/certs-CLLngjpY.js +0 -14071
  70. package/dist/certs-D3fTB-0_.js +0 -14071
  71. package/dist/channel-_gQD3mZ8.js +0 -8
  72. package/dist/chunk-2Q5K7J3B-DIJkMPWD.js +0 -20
  73. package/dist/chunk-32BRIVSS-CIQb7-9I.js +0 -117
  74. package/dist/chunk-5VM5RSS4-DmlAsh6o.js +0 -20
  75. package/dist/chunk-EX3LRPZG-BEXyn5R-.js +0 -1989
  76. package/dist/chunk-JWPE2WC7-XiIefccF.js +0 -17
  77. package/dist/chunk-MOJQB5TN-CC5OBDWw.js +0 -861
  78. package/dist/chunk-RYQCIY6F-DQacsGpB.js +0 -475
  79. package/dist/chunk-V7JOEXUC-TLRsIUvf.js +0 -2027
  80. package/dist/chunk-VR4S4FIN-9AfN7RDF.js +0 -25
  81. package/dist/chunk-XXDRQBXY-DhWucSRr.js +0 -14
  82. package/dist/classDiagram-OUVF2IWQ-CN55rRkB.js +0 -20
  83. package/dist/classDiagram-v2-EOCWNBFH-CN55rRkB.js +0 -20
  84. package/dist/cose-bilkent-JH36ORCC-8uGYe6_d.js +0 -4944
  85. package/dist/cynefin-VYW2F7L2-BwTeE-TI.js +0 -32061
  86. package/dist/cynefinDiagram-TSTJHNR4-DM7ixE-v.js +0 -454
  87. package/dist/cytoscape.esm-BTopYfIb.js +0 -30347
  88. package/dist/dagre-VKFMJZFB-blEDoYen.js +0 -522
  89. package/dist/defaultLocale-wHUL1xE2.js +0 -207
  90. package/dist/diagram-FQU43EPY-MEZlmmdi.js +0 -633
  91. package/dist/diagram-G47NLZAW-DZOZvHqp.js +0 -857
  92. package/dist/diagram-NH7WQ7WH-ChpmPbZz.js +0 -213
  93. package/dist/diagram-OA4YK3LP-oy4yvrnL.js +0 -489
  94. package/dist/diagram-WEI45ONY-B3nx1cYt.js +0 -305
  95. package/dist/ebnfDiagram-CCIWWBDH-BASj7BoO.js +0 -139
  96. package/dist/erDiagram-Q63AITRT-lujHq-S9.js +0 -1239
  97. package/dist/flowDiagram-23GEKE2U-BdsAVPgU.js +0 -2349
  98. package/dist/ganttDiagram-NO4QXBWP-DUUP4lsu.js +0 -3733
  99. package/dist/gitGraphDiagram-IHSO6WYX-BdIPAtb0.js +0 -1374
  100. package/dist/graph-CE8jV7cI.js +0 -2043
  101. package/dist/gui/assets/channel-DGoXAS0B.js +0 -1
  102. package/dist/gui/assets/classDiagram-OUVF2IWQ-B4zeZ0PC.js +0 -1
  103. package/dist/gui/assets/classDiagram-v2-EOCWNBFH-B4zeZ0PC.js +0 -1
  104. package/dist/gui/assets/index-DKVgyltQ.js +0 -21
  105. package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-GXq_r-DG.js +0 -1
  106. package/dist/gui/assets/swimlanesDiagram-G3AALYLV-DDE-INgq.js +0 -8
  107. package/dist/index--GoVvfUP.js +0 -5447
  108. package/dist/index-3-WDiDAh.js +0 -5466
  109. package/dist/index-CHBXZAxg.js +0 -5460
  110. package/dist/index-DeCq8xn7.js +0 -5460
  111. package/dist/infoDiagram-FWYZ7A6U-D9wo93kg.js +0 -32
  112. package/dist/init-DDGa2CQM.js +0 -17
  113. package/dist/ishikawaDiagram-FXEZZL3T-DZh3_kt2.js +0 -968
  114. package/dist/journeyDiagram-5HDEW3XC-C8RWHIn0.js +0 -1256
  115. package/dist/kanban-definition-HUTT4EX6-B7qQtB5a.js +0 -1053
  116. package/dist/katex-WjDlQEfU.js +0 -14500
  117. package/dist/layout-DQAYh_L7.js +0 -2360
  118. package/dist/linear-C_kZRZXS.js +0 -341
  119. package/dist/map-BElV7BMC.js +0 -299
  120. package/dist/mermaid.core-Dy_tFRs7.js +0 -26495
  121. package/dist/mindmap-definition-LN4V7U3C-BzHCd5Ab.js +0 -1181
  122. package/dist/ordinal-C2kkg180.js +0 -77
  123. package/dist/pegDiagram-2B236MQR-B046bQWM.js +0 -127
  124. package/dist/pieDiagram-ENE6RG2P-B5_W2CZy.js +0 -316
  125. package/dist/quadrantDiagram-ABIIQ3AL-Bbpt496h.js +0 -1342
  126. package/dist/railroadDiagram-RFXS5EU6-10XIH3X0.js +0 -93
  127. package/dist/requirementDiagram-TGXJPOKE-Dt1QyccY.js +0 -1205
  128. package/dist/sankeyDiagram-HTMAVEWB-CnqRAq7M.js +0 -1274
  129. package/dist/sequenceDiagram-DBY2YBRQ-DtJLSXoz.js +0 -4515
  130. package/dist/sizeCapture-X5ZJPWSS-DUl5ZEo3.js +0 -63
  131. package/dist/stateDiagram-2N3HPSRC-b-qzcVNj.js +0 -449
  132. package/dist/stateDiagram-v2-6OUMAXLB-KjDlRfc7.js +0 -20
  133. package/dist/swimlanes-5IMT3BWC-CAjGnQLa.js +0 -8553
  134. package/dist/swimlanesDiagram-G3AALYLV-DiOi9bzU.js +0 -16
  135. package/dist/timeline-definition-FHXFAJF6-Bme2FWbh.js +0 -1597
  136. package/dist/vennDiagram-L72KCM5P-BUQgnZDB.js +0 -2516
  137. package/dist/wardleyDiagram-EHGQE667-DHR2Avlu.js +0 -976
  138. package/dist/xychartDiagram-FW5EYKEG-V4K5eBMS.js +0 -2000
@@ -1,1597 +0,0 @@
1
- #!/usr/bin/env node
2
- import { _ as __name, y as getConfig, T as isDark, U as lighten, V as darken, c as getConfig2, l as log, D as selectSvgElement, K as parseFontSize, W as setupGraphViewbox, d as select, t as __export, X as commonDb_exports, p as clear } from "./mermaid.core-Dy_tFRs7.js";
3
- import { d as d3arc } from "./arc-B1cAL3U1.js";
4
- var parser = (function() {
5
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
6
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
7
- return o2;
8
- }, "o"), $V0 = [6, 11, 13, 14, 15, 17, 19, 20, 23, 24], $V1 = [1, 12], $V2 = [1, 13], $V3 = [1, 14], $V4 = [1, 15], $V5 = [1, 16], $V6 = [1, 19], $V7 = [1, 20];
9
- var parser2 = {
10
- trace: /* @__PURE__ */ __name(function trace() {
11
- }, "trace"),
12
- yy: {},
13
- symbols_: { "error": 2, "start": 3, "timeline_header": 4, "document": 5, "EOF": 6, "timeline": 7, "timeline_lr": 8, "timeline_td": 9, "line": 10, "SPACE": 11, "statement": 12, "NEWLINE": 13, "title": 14, "acc_title": 15, "acc_title_value": 16, "acc_descr": 17, "acc_descr_value": 18, "acc_descr_multiline_value": 19, "section": 20, "period_statement": 21, "event_statement": 22, "period": 23, "event": 24, "$accept": 0, "$end": 1 },
14
- terminals_: { 2: "error", 6: "EOF", 7: "timeline", 8: "timeline_lr", 9: "timeline_td", 11: "SPACE", 13: "NEWLINE", 14: "title", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 23: "period", 24: "event" },
15
- productions_: [0, [3, 3], [4, 1], [4, 1], [4, 1], [5, 0], [5, 2], [10, 2], [10, 1], [10, 1], [10, 1], [12, 1], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [21, 1], [22, 1]],
16
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
17
- var $0 = $$.length - 1;
18
- switch (yystate) {
19
- case 1:
20
- return $$[$0 - 1];
21
- case 3:
22
- yy.setDirection("LR");
23
- break;
24
- case 4:
25
- yy.setDirection("TD");
26
- break;
27
- case 5:
28
- this.$ = [];
29
- break;
30
- case 6:
31
- $$[$0 - 1].push($$[$0]);
32
- this.$ = $$[$0 - 1];
33
- break;
34
- case 7:
35
- case 8:
36
- this.$ = $$[$0];
37
- break;
38
- case 9:
39
- case 10:
40
- this.$ = [];
41
- break;
42
- case 11:
43
- yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
44
- this.$ = $$[$0].substr(6);
45
- break;
46
- case 12:
47
- this.$ = $$[$0].trim();
48
- yy.getCommonDb().setAccTitle(this.$);
49
- break;
50
- case 13:
51
- case 14:
52
- this.$ = $$[$0].trim();
53
- yy.getCommonDb().setAccDescription(this.$);
54
- break;
55
- case 15:
56
- yy.addSection($$[$0].substr(8));
57
- this.$ = $$[$0].substr(8);
58
- break;
59
- case 18:
60
- yy.addTask($$[$0], 0, "");
61
- this.$ = $$[$0];
62
- break;
63
- case 19:
64
- yy.addEvent($$[$0].substr(2));
65
- this.$ = $$[$0];
66
- break;
67
- }
68
- }, "anonymous"),
69
- table: [{ 3: 1, 4: 2, 7: [1, 3], 8: [1, 4], 9: [1, 5] }, { 1: [3] }, o($V0, [2, 5], { 5: 6 }), o($V0, [2, 2]), o($V0, [2, 3]), o($V0, [2, 4]), { 6: [1, 7], 10: 8, 11: [1, 9], 12: 10, 13: [1, 11], 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 10], { 1: [2, 1] }), o($V0, [2, 6]), { 12: 21, 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 11]), { 16: [1, 22] }, { 18: [1, 23] }, o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), o($V0, [2, 18]), o($V0, [2, 19]), o($V0, [2, 7]), o($V0, [2, 12]), o($V0, [2, 13])],
70
- defaultActions: {},
71
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
72
- if (hash.recoverable) {
73
- this.trace(str);
74
- } else {
75
- var error = new Error(str);
76
- error.hash = hash;
77
- throw error;
78
- }
79
- }, "parseError"),
80
- parse: /* @__PURE__ */ __name(function parse(input) {
81
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
82
- var args = lstack.slice.call(arguments, 1);
83
- var lexer2 = Object.create(this.lexer);
84
- var sharedState = { yy: {} };
85
- for (var k in this.yy) {
86
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
87
- sharedState.yy[k] = this.yy[k];
88
- }
89
- }
90
- lexer2.setInput(input, sharedState.yy);
91
- sharedState.yy.lexer = lexer2;
92
- sharedState.yy.parser = this;
93
- if (typeof lexer2.yylloc == "undefined") {
94
- lexer2.yylloc = {};
95
- }
96
- var yyloc = lexer2.yylloc;
97
- lstack.push(yyloc);
98
- var ranges = lexer2.options && lexer2.options.ranges;
99
- if (typeof sharedState.yy.parseError === "function") {
100
- this.parseError = sharedState.yy.parseError;
101
- } else {
102
- this.parseError = Object.getPrototypeOf(this).parseError;
103
- }
104
- function popStack(n) {
105
- stack.length = stack.length - 2 * n;
106
- vstack.length = vstack.length - n;
107
- lstack.length = lstack.length - n;
108
- }
109
- __name(popStack, "popStack");
110
- function lex() {
111
- var token;
112
- token = tstack.pop() || lexer2.lex() || EOF;
113
- if (typeof token !== "number") {
114
- if (token instanceof Array) {
115
- tstack = token;
116
- token = tstack.pop();
117
- }
118
- token = self.symbols_[token] || token;
119
- }
120
- return token;
121
- }
122
- __name(lex, "lex");
123
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
124
- while (true) {
125
- state = stack[stack.length - 1];
126
- if (this.defaultActions[state]) {
127
- action = this.defaultActions[state];
128
- } else {
129
- if (symbol === null || typeof symbol == "undefined") {
130
- symbol = lex();
131
- }
132
- action = table[state] && table[state][symbol];
133
- }
134
- if (typeof action === "undefined" || !action.length || !action[0]) {
135
- var errStr = "";
136
- expected = [];
137
- for (p in table[state]) {
138
- if (this.terminals_[p] && p > TERROR) {
139
- expected.push("'" + this.terminals_[p] + "'");
140
- }
141
- }
142
- if (lexer2.showPosition) {
143
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
144
- } else {
145
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
146
- }
147
- this.parseError(errStr, {
148
- text: lexer2.match,
149
- token: this.terminals_[symbol] || symbol,
150
- line: lexer2.yylineno,
151
- loc: yyloc,
152
- expected
153
- });
154
- }
155
- if (action[0] instanceof Array && action.length > 1) {
156
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
157
- }
158
- switch (action[0]) {
159
- case 1:
160
- stack.push(symbol);
161
- vstack.push(lexer2.yytext);
162
- lstack.push(lexer2.yylloc);
163
- stack.push(action[1]);
164
- symbol = null;
165
- {
166
- yyleng = lexer2.yyleng;
167
- yytext = lexer2.yytext;
168
- yylineno = lexer2.yylineno;
169
- yyloc = lexer2.yylloc;
170
- }
171
- break;
172
- case 2:
173
- len = this.productions_[action[1]][1];
174
- yyval.$ = vstack[vstack.length - len];
175
- yyval._$ = {
176
- first_line: lstack[lstack.length - (len || 1)].first_line,
177
- last_line: lstack[lstack.length - 1].last_line,
178
- first_column: lstack[lstack.length - (len || 1)].first_column,
179
- last_column: lstack[lstack.length - 1].last_column
180
- };
181
- if (ranges) {
182
- yyval._$.range = [
183
- lstack[lstack.length - (len || 1)].range[0],
184
- lstack[lstack.length - 1].range[1]
185
- ];
186
- }
187
- r = this.performAction.apply(yyval, [
188
- yytext,
189
- yyleng,
190
- yylineno,
191
- sharedState.yy,
192
- action[1],
193
- vstack,
194
- lstack
195
- ].concat(args));
196
- if (typeof r !== "undefined") {
197
- return r;
198
- }
199
- if (len) {
200
- stack = stack.slice(0, -1 * len * 2);
201
- vstack = vstack.slice(0, -1 * len);
202
- lstack = lstack.slice(0, -1 * len);
203
- }
204
- stack.push(this.productions_[action[1]][0]);
205
- vstack.push(yyval.$);
206
- lstack.push(yyval._$);
207
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
208
- stack.push(newState);
209
- break;
210
- case 3:
211
- return true;
212
- }
213
- }
214
- return true;
215
- }, "parse")
216
- };
217
- var lexer = /* @__PURE__ */ (function() {
218
- var lexer2 = {
219
- EOF: 1,
220
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
221
- if (this.yy.parser) {
222
- this.yy.parser.parseError(str, hash);
223
- } else {
224
- throw new Error(str);
225
- }
226
- }, "parseError"),
227
- // resets the lexer, sets new input
228
- setInput: /* @__PURE__ */ __name(function(input, yy) {
229
- this.yy = yy || this.yy || {};
230
- this._input = input;
231
- this._more = this._backtrack = this.done = false;
232
- this.yylineno = this.yyleng = 0;
233
- this.yytext = this.matched = this.match = "";
234
- this.conditionStack = ["INITIAL"];
235
- this.yylloc = {
236
- first_line: 1,
237
- first_column: 0,
238
- last_line: 1,
239
- last_column: 0
240
- };
241
- if (this.options.ranges) {
242
- this.yylloc.range = [0, 0];
243
- }
244
- this.offset = 0;
245
- return this;
246
- }, "setInput"),
247
- // consumes and returns one char from the input
248
- input: /* @__PURE__ */ __name(function() {
249
- var ch = this._input[0];
250
- this.yytext += ch;
251
- this.yyleng++;
252
- this.offset++;
253
- this.match += ch;
254
- this.matched += ch;
255
- var lines = ch.match(/(?:\r\n?|\n).*/g);
256
- if (lines) {
257
- this.yylineno++;
258
- this.yylloc.last_line++;
259
- } else {
260
- this.yylloc.last_column++;
261
- }
262
- if (this.options.ranges) {
263
- this.yylloc.range[1]++;
264
- }
265
- this._input = this._input.slice(1);
266
- return ch;
267
- }, "input"),
268
- // unshifts one char (or a string) into the input
269
- unput: /* @__PURE__ */ __name(function(ch) {
270
- var len = ch.length;
271
- var lines = ch.split(/(?:\r\n?|\n)/g);
272
- this._input = ch + this._input;
273
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
274
- this.offset -= len;
275
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
276
- this.match = this.match.substr(0, this.match.length - 1);
277
- this.matched = this.matched.substr(0, this.matched.length - 1);
278
- if (lines.length - 1) {
279
- this.yylineno -= lines.length - 1;
280
- }
281
- var r = this.yylloc.range;
282
- this.yylloc = {
283
- first_line: this.yylloc.first_line,
284
- last_line: this.yylineno + 1,
285
- first_column: this.yylloc.first_column,
286
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
287
- };
288
- if (this.options.ranges) {
289
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
290
- }
291
- this.yyleng = this.yytext.length;
292
- return this;
293
- }, "unput"),
294
- // When called from action, caches matched text and appends it on next action
295
- more: /* @__PURE__ */ __name(function() {
296
- this._more = true;
297
- return this;
298
- }, "more"),
299
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
300
- reject: /* @__PURE__ */ __name(function() {
301
- if (this.options.backtrack_lexer) {
302
- this._backtrack = true;
303
- } else {
304
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
305
- text: "",
306
- token: null,
307
- line: this.yylineno
308
- });
309
- }
310
- return this;
311
- }, "reject"),
312
- // retain first n characters of the match
313
- less: /* @__PURE__ */ __name(function(n) {
314
- this.unput(this.match.slice(n));
315
- }, "less"),
316
- // displays already matched input, i.e. for error messages
317
- pastInput: /* @__PURE__ */ __name(function() {
318
- var past = this.matched.substr(0, this.matched.length - this.match.length);
319
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
320
- }, "pastInput"),
321
- // displays upcoming input, i.e. for error messages
322
- upcomingInput: /* @__PURE__ */ __name(function() {
323
- var next = this.match;
324
- if (next.length < 20) {
325
- next += this._input.substr(0, 20 - next.length);
326
- }
327
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
328
- }, "upcomingInput"),
329
- // displays the character position where the lexing error occurred, i.e. for error messages
330
- showPosition: /* @__PURE__ */ __name(function() {
331
- var pre = this.pastInput();
332
- var c = new Array(pre.length + 1).join("-");
333
- return pre + this.upcomingInput() + "\n" + c + "^";
334
- }, "showPosition"),
335
- // test the lexed token: return FALSE when not a match, otherwise return token
336
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
337
- var token, lines, backup;
338
- if (this.options.backtrack_lexer) {
339
- backup = {
340
- yylineno: this.yylineno,
341
- yylloc: {
342
- first_line: this.yylloc.first_line,
343
- last_line: this.last_line,
344
- first_column: this.yylloc.first_column,
345
- last_column: this.yylloc.last_column
346
- },
347
- yytext: this.yytext,
348
- match: this.match,
349
- matches: this.matches,
350
- matched: this.matched,
351
- yyleng: this.yyleng,
352
- offset: this.offset,
353
- _more: this._more,
354
- _input: this._input,
355
- yy: this.yy,
356
- conditionStack: this.conditionStack.slice(0),
357
- done: this.done
358
- };
359
- if (this.options.ranges) {
360
- backup.yylloc.range = this.yylloc.range.slice(0);
361
- }
362
- }
363
- lines = match[0].match(/(?:\r\n?|\n).*/g);
364
- if (lines) {
365
- this.yylineno += lines.length;
366
- }
367
- this.yylloc = {
368
- first_line: this.yylloc.last_line,
369
- last_line: this.yylineno + 1,
370
- first_column: this.yylloc.last_column,
371
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
372
- };
373
- this.yytext += match[0];
374
- this.match += match[0];
375
- this.matches = match;
376
- this.yyleng = this.yytext.length;
377
- if (this.options.ranges) {
378
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
379
- }
380
- this._more = false;
381
- this._backtrack = false;
382
- this._input = this._input.slice(match[0].length);
383
- this.matched += match[0];
384
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
385
- if (this.done && this._input) {
386
- this.done = false;
387
- }
388
- if (token) {
389
- return token;
390
- } else if (this._backtrack) {
391
- for (var k in backup) {
392
- this[k] = backup[k];
393
- }
394
- return false;
395
- }
396
- return false;
397
- }, "test_match"),
398
- // return next match in input
399
- next: /* @__PURE__ */ __name(function() {
400
- if (this.done) {
401
- return this.EOF;
402
- }
403
- if (!this._input) {
404
- this.done = true;
405
- }
406
- var token, match, tempMatch, index;
407
- if (!this._more) {
408
- this.yytext = "";
409
- this.match = "";
410
- }
411
- var rules = this._currentRules();
412
- for (var i = 0; i < rules.length; i++) {
413
- tempMatch = this._input.match(this.rules[rules[i]]);
414
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
415
- match = tempMatch;
416
- index = i;
417
- if (this.options.backtrack_lexer) {
418
- token = this.test_match(tempMatch, rules[i]);
419
- if (token !== false) {
420
- return token;
421
- } else if (this._backtrack) {
422
- match = false;
423
- continue;
424
- } else {
425
- return false;
426
- }
427
- } else if (!this.options.flex) {
428
- break;
429
- }
430
- }
431
- }
432
- if (match) {
433
- token = this.test_match(match, rules[index]);
434
- if (token !== false) {
435
- return token;
436
- }
437
- return false;
438
- }
439
- if (this._input === "") {
440
- return this.EOF;
441
- } else {
442
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
443
- text: "",
444
- token: null,
445
- line: this.yylineno
446
- });
447
- }
448
- }, "next"),
449
- // return next match that has a token
450
- lex: /* @__PURE__ */ __name(function lex() {
451
- var r = this.next();
452
- if (r) {
453
- return r;
454
- } else {
455
- return this.lex();
456
- }
457
- }, "lex"),
458
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
459
- begin: /* @__PURE__ */ __name(function begin(condition) {
460
- this.conditionStack.push(condition);
461
- }, "begin"),
462
- // pop the previously active lexer condition state off the condition stack
463
- popState: /* @__PURE__ */ __name(function popState() {
464
- var n = this.conditionStack.length - 1;
465
- if (n > 0) {
466
- return this.conditionStack.pop();
467
- } else {
468
- return this.conditionStack[0];
469
- }
470
- }, "popState"),
471
- // produce the lexer rule set which is active for the currently active lexer condition state
472
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
473
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
474
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
475
- } else {
476
- return this.conditions["INITIAL"].rules;
477
- }
478
- }, "_currentRules"),
479
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
480
- topState: /* @__PURE__ */ __name(function topState(n) {
481
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
482
- if (n >= 0) {
483
- return this.conditionStack[n];
484
- } else {
485
- return "INITIAL";
486
- }
487
- }, "topState"),
488
- // alias for begin(condition)
489
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
490
- this.begin(condition);
491
- }, "pushState"),
492
- // return the number of states currently on the stack
493
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
494
- return this.conditionStack.length;
495
- }, "stateStackSize"),
496
- options: { "case-insensitive": true },
497
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
498
- switch ($avoiding_name_collisions) {
499
- case 0:
500
- break;
501
- case 1:
502
- break;
503
- case 2:
504
- return 13;
505
- case 3:
506
- break;
507
- case 4:
508
- break;
509
- case 5:
510
- return 8;
511
- case 6:
512
- return 9;
513
- case 7:
514
- return 7;
515
- case 8:
516
- return 14;
517
- case 9:
518
- this.begin("acc_title");
519
- return 15;
520
- case 10:
521
- this.popState();
522
- return "acc_title_value";
523
- case 11:
524
- this.begin("acc_descr");
525
- return 17;
526
- case 12:
527
- this.popState();
528
- return "acc_descr_value";
529
- case 13:
530
- this.begin("acc_descr_multiline");
531
- break;
532
- case 14:
533
- this.popState();
534
- break;
535
- case 15:
536
- return "acc_descr_multiline_value";
537
- case 16:
538
- return 20;
539
- case 17:
540
- return 24;
541
- case 18:
542
- return 23;
543
- case 19:
544
- return 6;
545
- case 20:
546
- return "INVALID";
547
- }
548
- }, "anonymous"),
549
- rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline[ \t]+LR\b)/i, /^(?:timeline[ \t]+TD\b)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
550
- conditions: { "acc_descr_multiline": { "rules": [14, 15], "inclusive": false }, "acc_descr": { "rules": [12], "inclusive": false }, "acc_title": { "rules": [10], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 19, 20], "inclusive": true } }
551
- };
552
- return lexer2;
553
- })();
554
- parser2.lexer = lexer;
555
- function Parser() {
556
- this.yy = {};
557
- }
558
- __name(Parser, "Parser");
559
- Parser.prototype = parser2;
560
- parser2.Parser = Parser;
561
- return new Parser();
562
- })();
563
- parser.parser = parser;
564
- var timeline_default = parser;
565
- var timelineDb_exports = {};
566
- __export(timelineDb_exports, {
567
- addEvent: () => addEvent,
568
- addSection: () => addSection,
569
- addTask: () => addTask,
570
- addTaskOrg: () => addTaskOrg,
571
- clear: () => clear2,
572
- default: () => timelineDb_default,
573
- getCommonDb: () => getCommonDb,
574
- getDirection: () => getDirection,
575
- getSections: () => getSections,
576
- getTasks: () => getTasks,
577
- setDirection: () => setDirection
578
- });
579
- var currentSection = "";
580
- var currentTaskId = 0;
581
- var direction = "LR";
582
- var sections = [];
583
- var tasks = [];
584
- var rawTasks = [];
585
- var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
586
- var clear2 = /* @__PURE__ */ __name(function() {
587
- sections.length = 0;
588
- tasks.length = 0;
589
- currentSection = "";
590
- rawTasks.length = 0;
591
- direction = "LR";
592
- clear();
593
- }, "clear");
594
- var setDirection = /* @__PURE__ */ __name(function(dir) {
595
- direction = dir;
596
- }, "setDirection");
597
- var getDirection = /* @__PURE__ */ __name(function() {
598
- return direction;
599
- }, "getDirection");
600
- var addSection = /* @__PURE__ */ __name(function(txt) {
601
- currentSection = txt;
602
- sections.push(txt);
603
- }, "addSection");
604
- var getSections = /* @__PURE__ */ __name(function() {
605
- return sections;
606
- }, "getSections");
607
- var getTasks = /* @__PURE__ */ __name(function() {
608
- let allItemsProcessed = compileTasks();
609
- const maxDepth = 100;
610
- let iterationCount = 0;
611
- while (!allItemsProcessed && iterationCount < maxDepth) {
612
- allItemsProcessed = compileTasks();
613
- iterationCount++;
614
- }
615
- tasks.push(...rawTasks);
616
- return tasks;
617
- }, "getTasks");
618
- var addTask = /* @__PURE__ */ __name(function(period, length, event) {
619
- const rawTask = {
620
- id: currentTaskId++,
621
- section: currentSection,
622
- type: currentSection,
623
- task: period,
624
- score: length ? length : 0,
625
- //if event is defined, then add it the events array
626
- events: event ? [event] : []
627
- };
628
- rawTasks.push(rawTask);
629
- }, "addTask");
630
- var addEvent = /* @__PURE__ */ __name(function(event) {
631
- const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);
632
- currentTask.events.push(event);
633
- }, "addEvent");
634
- var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
635
- const newTask = {
636
- section: currentSection,
637
- type: currentSection,
638
- description: descr,
639
- task: descr,
640
- classes: []
641
- };
642
- tasks.push(newTask);
643
- }, "addTaskOrg");
644
- var compileTasks = /* @__PURE__ */ __name(function() {
645
- const compileTask = /* @__PURE__ */ __name(function(pos) {
646
- return rawTasks[pos].processed;
647
- }, "compileTask");
648
- let allProcessed = true;
649
- for (const [i, rawTask] of rawTasks.entries()) {
650
- compileTask(i);
651
- allProcessed = allProcessed && rawTask.processed;
652
- }
653
- return allProcessed;
654
- }, "compileTasks");
655
- var timelineDb_default = {
656
- clear: clear2,
657
- getCommonDb,
658
- getDirection,
659
- setDirection,
660
- addSection,
661
- getSections,
662
- getTasks,
663
- addTask,
664
- addTaskOrg,
665
- addEvent
666
- };
667
- var nodeCount = 0;
668
- var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
669
- const rectElem = elem.append("rect");
670
- rectElem.attr("x", rectData.x);
671
- rectElem.attr("y", rectData.y);
672
- rectElem.attr("fill", rectData.fill);
673
- rectElem.attr("stroke", rectData.stroke);
674
- rectElem.attr("width", rectData.width);
675
- rectElem.attr("height", rectData.height);
676
- rectElem.attr("rx", rectData.rx);
677
- rectElem.attr("ry", rectData.ry);
678
- if (rectData.class !== void 0) {
679
- rectElem.attr("class", rectData.class);
680
- }
681
- return rectElem;
682
- }, "drawRect");
683
- var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
684
- const radius = 15;
685
- const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
686
- const face = element.append("g");
687
- face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
688
- face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
689
- function smile(face2) {
690
- const arc = d3arc().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
691
- face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
692
- }
693
- __name(smile, "smile");
694
- function sad(face2) {
695
- const arc = d3arc().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
696
- face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
697
- }
698
- __name(sad, "sad");
699
- function ambivalent(face2) {
700
- face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
701
- }
702
- __name(ambivalent, "ambivalent");
703
- if (faceData.score > 3) {
704
- smile(face);
705
- } else if (faceData.score < 3) {
706
- sad(face);
707
- } else {
708
- ambivalent(face);
709
- }
710
- return circleElement;
711
- }, "drawFace");
712
- var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
713
- const circleElement = element.append("circle");
714
- circleElement.attr("cx", circleData.cx);
715
- circleElement.attr("cy", circleData.cy);
716
- circleElement.attr("class", "actor-" + circleData.pos);
717
- circleElement.attr("fill", circleData.fill);
718
- circleElement.attr("stroke", circleData.stroke);
719
- circleElement.attr("r", circleData.r);
720
- if (circleElement.class !== void 0) {
721
- circleElement.attr("class", circleElement.class);
722
- }
723
- if (circleData.title !== void 0) {
724
- circleElement.append("title").text(circleData.title);
725
- }
726
- return circleElement;
727
- }, "drawCircle");
728
- var drawText = /* @__PURE__ */ __name(function(elem, textData) {
729
- const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
730
- const textElem = elem.append("text");
731
- textElem.attr("x", textData.x);
732
- textElem.attr("y", textData.y);
733
- textElem.attr("class", "legend");
734
- textElem.style("text-anchor", textData.anchor);
735
- if (textData.class !== void 0) {
736
- textElem.attr("class", textData.class);
737
- }
738
- const span = textElem.append("tspan");
739
- span.attr("x", textData.x + textData.textMargin * 2);
740
- span.text(nText);
741
- return textElem;
742
- }, "drawText");
743
- var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
744
- function genPoints(x, y, width, height, cut) {
745
- return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
746
- }
747
- __name(genPoints, "genPoints");
748
- const polygon = elem.append("polygon");
749
- polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
750
- polygon.attr("class", "labelBox");
751
- txtObject.y = txtObject.y + txtObject.labelMargin;
752
- txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
753
- drawText(elem, txtObject);
754
- }, "drawLabel");
755
- var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
756
- const g = elem.append("g");
757
- const rect = getNoteRect();
758
- rect.x = section.x;
759
- rect.y = section.y;
760
- rect.fill = section.fill;
761
- rect.width = conf.width;
762
- rect.height = conf.height;
763
- rect.class = "journey-section section-type-" + section.num;
764
- rect.rx = 3;
765
- rect.ry = 3;
766
- drawRect(g, rect);
767
- _drawTextCandidateFunc(conf)(
768
- section.text,
769
- g,
770
- rect.x,
771
- rect.y,
772
- rect.width,
773
- rect.height,
774
- { class: "journey-section section-type-" + section.num },
775
- conf,
776
- section.colour
777
- );
778
- }, "drawSection");
779
- var taskCount = -1;
780
- var drawTask = /* @__PURE__ */ __name(function(elem, task, conf, diagramId) {
781
- const center = task.x + conf.width / 2;
782
- const g = elem.append("g");
783
- taskCount++;
784
- const maxHeight = 300 + 5 * 30;
785
- g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
786
- drawFace(g, {
787
- cx: center,
788
- cy: 300 + (5 - task.score) * 30,
789
- score: task.score
790
- });
791
- const rect = getNoteRect();
792
- rect.x = task.x;
793
- rect.y = task.y;
794
- rect.fill = task.fill;
795
- rect.width = conf.width;
796
- rect.height = conf.height;
797
- rect.class = "task task-type-" + task.num;
798
- rect.rx = 3;
799
- rect.ry = 3;
800
- drawRect(g, rect);
801
- _drawTextCandidateFunc(conf)(
802
- task.task,
803
- g,
804
- rect.x,
805
- rect.y,
806
- rect.width,
807
- rect.height,
808
- { class: "task" },
809
- conf,
810
- task.colour
811
- );
812
- }, "drawTask");
813
- var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
814
- const rectElem = drawRect(elem, {
815
- x: bounds.startx,
816
- y: bounds.starty,
817
- width: bounds.stopx - bounds.startx,
818
- height: bounds.stopy - bounds.starty,
819
- fill: bounds.fill,
820
- class: "rect"
821
- });
822
- rectElem.lower();
823
- }, "drawBackgroundRect");
824
- var getTextObj = /* @__PURE__ */ __name(function() {
825
- return {
826
- x: 0,
827
- y: 0,
828
- fill: void 0,
829
- "text-anchor": "start",
830
- width: 100,
831
- height: 100,
832
- textMargin: 0,
833
- rx: 0,
834
- ry: 0
835
- };
836
- }, "getTextObj");
837
- var getNoteRect = /* @__PURE__ */ __name(function() {
838
- return {
839
- x: 0,
840
- y: 0,
841
- width: 100,
842
- anchor: "start",
843
- height: 100,
844
- rx: 0,
845
- ry: 0
846
- };
847
- }, "getNoteRect");
848
- var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
849
- function byText(content, g, x, y, width, height, textAttrs, colour) {
850
- const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
851
- _setTextAttrs(text, textAttrs);
852
- }
853
- __name(byText, "byText");
854
- function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
855
- const { taskFontSize, taskFontFamily } = conf;
856
- const lines = content.split(/<br\s*\/?>/gi);
857
- for (let i = 0; i < lines.length; i++) {
858
- const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
859
- const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
860
- text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
861
- text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
862
- _setTextAttrs(text, textAttrs);
863
- }
864
- }
865
- __name(byTspan, "byTspan");
866
- function byFo(content, g, x, y, width, height, textAttrs, conf) {
867
- const body = g.append("switch");
868
- const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
869
- const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
870
- text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
871
- byTspan(content, body, x, y, width, height, textAttrs, conf);
872
- _setTextAttrs(text, textAttrs);
873
- }
874
- __name(byFo, "byFo");
875
- function _setTextAttrs(toText, fromTextAttrsDict) {
876
- for (const key in fromTextAttrsDict) {
877
- if (key in fromTextAttrsDict) {
878
- toText.attr(key, fromTextAttrsDict[key]);
879
- }
880
- }
881
- }
882
- __name(_setTextAttrs, "_setTextAttrs");
883
- return function(conf) {
884
- return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
885
- };
886
- })();
887
- var initGraphics = /* @__PURE__ */ __name(function(graphics, id) {
888
- nodeCount = 0;
889
- taskCount = -1;
890
- graphics.append("defs").append("marker").attr("id", id + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
891
- }, "initGraphics");
892
- function wrap(text, width) {
893
- text.each(function() {
894
- var text2 = select(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
895
- for (let j = 0; j < words.length; j++) {
896
- word = words[words.length - 1 - j];
897
- line.push(word);
898
- tspan.text(line.join(" ").trim());
899
- if (tspan.node().getComputedTextLength() > width || word === "<br>") {
900
- line.pop();
901
- tspan.text(line.join(" ").trim());
902
- if (word === "<br>") {
903
- line = [""];
904
- } else {
905
- line = [word];
906
- }
907
- tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
908
- }
909
- }
910
- });
911
- }
912
- __name(wrap, "wrap");
913
- var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf, diagramId, isEvent = false) {
914
- const { theme, look } = conf;
915
- const isReduxTheme = theme?.includes("redux");
916
- const maxSections = conf?.themeVariables?.THEME_COLOR_LIMIT ?? 12;
917
- const section = fullSection % maxSections - 1;
918
- const nodeElem = elem.append("g");
919
- node.section = section;
920
- nodeElem.attr(
921
- "class",
922
- (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section)
923
- );
924
- const bkgElem = nodeElem.append("g");
925
- const textElem = nodeElem.append("g");
926
- const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
927
- const bbox = txt.node().getBBox();
928
- const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
929
- node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;
930
- node.height = Math.max(node.height, node.maxHeight);
931
- node.width = node.width + 2 * node.padding;
932
- textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
933
- if (isReduxTheme) {
934
- textElem.attr(
935
- "transform",
936
- `translate(${node.width / 2}, ${isEvent ? node.padding / 2 + 3 : node.padding})`
937
- );
938
- }
939
- defaultBkg(bkgElem, node, section, diagramId, conf);
940
- if (look === "neo") {
941
- nodeElem.attr("data-look", `neo`);
942
- if (isReduxTheme) {
943
- const isDark2 = theme.includes("dark");
944
- const rootSvgNode = elem.node()?.ownerSVGElement ?? elem.node();
945
- const rootSvg = select(rootSvgNode);
946
- const svgId = rootSvg.attr("id") ?? "";
947
- const dropShadowId = svgId ? `${svgId}-drop-shadow` : "drop-shadow";
948
- if (rootSvg.select(`#${dropShadowId}`).empty()) {
949
- const existingDefs = rootSvg.select("defs");
950
- const defsEl = existingDefs.empty() ? rootSvg.append("defs") : existingDefs;
951
- defsEl.append("filter").attr("id", dropShadowId).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", isDark2 ? "0.2" : "0.06").attr("flood-color", isDark2 ? "#FFFFFF" : "#000000");
952
- }
953
- }
954
- }
955
- return node;
956
- }, "drawNode");
957
- var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
958
- const textElem = elem.append("g");
959
- const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
960
- const bbox = txt.node().getBBox();
961
- const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
962
- textElem.remove();
963
- return bbox.height + fontSize * 1.1 * 0.5 + node.padding;
964
- }, "getVirtualNodeHeight");
965
- var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section, diagramId, config) {
966
- const { theme } = config;
967
- const r = theme?.includes("redux") ? 0 : 5;
968
- const rd = 5;
969
- const d = r > 0 ? `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-${r},${r},-${r} h${node.width - 2 * rd} q${r},0,${r},${r} v${node.height - rd} H0 Z` : `M0 ${node.height - rd} v${-(node.height - rd)} h${node.width} v${node.height} H0 Z`;
970
- elem.append("path").attr("id", diagramId + "-node-" + nodeCount++).attr("class", "node-bkg node-" + node.type).attr("d", d);
971
- if (!theme?.includes("redux")) {
972
- elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
973
- }
974
- }, "defaultBkg");
975
- var svgDraw_default = {
976
- drawRect,
977
- drawCircle,
978
- drawSection,
979
- drawText,
980
- drawLabel,
981
- drawTask,
982
- drawBackgroundRect,
983
- getTextObj,
984
- getNoteRect,
985
- initGraphics,
986
- drawNode,
987
- getVirtualNodeHeight
988
- };
989
- var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
990
- const conf = getConfig2();
991
- const { look, theme, themeVariables } = conf;
992
- const { useGradient, gradientStart, gradientStop } = themeVariables;
993
- const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
994
- log.debug("timeline", diagObj.db);
995
- const securityLevel = conf.securityLevel;
996
- let sandboxElement;
997
- if (securityLevel === "sandbox") {
998
- sandboxElement = select("#i" + id);
999
- }
1000
- const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
1001
- const svg = root.select("#" + id);
1002
- svg.append("g");
1003
- const tasks2 = diagObj.db.getTasks();
1004
- const title = diagObj.db.getCommonDb().getDiagramTitle();
1005
- log.debug("task", tasks2);
1006
- svgDraw_default.initGraphics(svg, id);
1007
- const sections2 = diagObj.db.getSections();
1008
- log.debug("sections", sections2);
1009
- let maxSectionHeight = 0;
1010
- let maxTaskHeight = 0;
1011
- let depthY = 0;
1012
- let sectionBeginY = 0;
1013
- let masterX = 50 + LEFT_MARGIN;
1014
- let masterY = 50;
1015
- sectionBeginY = 50;
1016
- let sectionNumber = 0;
1017
- let hasSections = true;
1018
- sections2.forEach(function(section) {
1019
- const sectionNode = {
1020
- number: sectionNumber,
1021
- descr: section,
1022
- section: sectionNumber,
1023
- width: 150,
1024
- padding: 20,
1025
- maxHeight: maxSectionHeight
1026
- };
1027
- const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1028
- log.debug("sectionHeight before draw", sectionHeight);
1029
- maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
1030
- });
1031
- let maxEventCount = 0;
1032
- let maxEventLineLength = 0;
1033
- log.debug("tasks.length", tasks2.length);
1034
- for (const [i, task] of tasks2.entries()) {
1035
- const taskNode = {
1036
- number: i,
1037
- descr: task,
1038
- section: task.section,
1039
- width: 150,
1040
- padding: 20,
1041
- maxHeight: maxTaskHeight
1042
- };
1043
- const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1044
- log.debug("taskHeight before draw", taskHeight);
1045
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
1046
- maxEventCount = Math.max(maxEventCount, task.events.length);
1047
- let maxEventLineLengthTemp = 0;
1048
- for (const event of task.events) {
1049
- const eventNode = {
1050
- descr: event,
1051
- section: task.section,
1052
- number: task.section,
1053
- width: 150,
1054
- padding: 20,
1055
- maxHeight: 50
1056
- };
1057
- maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1058
- }
1059
- if (task.events.length > 0) {
1060
- maxEventLineLengthTemp += (task.events.length - 1) * 10;
1061
- }
1062
- maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1063
- }
1064
- log.debug("maxSectionHeight before draw", maxSectionHeight);
1065
- log.debug("maxTaskHeight before draw", maxTaskHeight);
1066
- if (sections2 && sections2.length > 0) {
1067
- sections2.forEach((section) => {
1068
- const tasksForSection = tasks2.filter((task) => task.section === section);
1069
- const sectionNode = {
1070
- number: sectionNumber,
1071
- descr: section,
1072
- section: sectionNumber,
1073
- width: 200 * Math.max(tasksForSection.length, 1) - 50,
1074
- padding: 20,
1075
- maxHeight: maxSectionHeight
1076
- };
1077
- log.debug("sectionNode", sectionNode);
1078
- const sectionNodeWrapper = svg.append("g");
1079
- const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf, id);
1080
- log.debug("sectionNode output", node);
1081
- sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1082
- masterY += maxSectionHeight + 50;
1083
- if (tasksForSection.length > 0) {
1084
- drawTasks(
1085
- svg,
1086
- tasksForSection,
1087
- sectionNumber,
1088
- masterX,
1089
- masterY,
1090
- maxTaskHeight,
1091
- conf,
1092
- maxEventCount,
1093
- maxEventLineLength,
1094
- maxSectionHeight,
1095
- false,
1096
- id
1097
- );
1098
- }
1099
- masterX += 200 * Math.max(tasksForSection.length, 1);
1100
- masterY = sectionBeginY;
1101
- sectionNumber++;
1102
- });
1103
- } else {
1104
- hasSections = false;
1105
- drawTasks(
1106
- svg,
1107
- tasks2,
1108
- sectionNumber,
1109
- masterX,
1110
- masterY,
1111
- maxTaskHeight,
1112
- conf,
1113
- maxEventCount,
1114
- maxEventLineLength,
1115
- maxSectionHeight,
1116
- true,
1117
- id
1118
- );
1119
- }
1120
- const box = svg.node().getBBox();
1121
- log.debug("bounds", box);
1122
- if (title) {
1123
- svg.append("text").text(title).attr("x", look === "neo" ? box.x * 2 + LEFT_MARGIN : box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1124
- }
1125
- depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1126
- const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1127
- lineWrapper.append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${id}-arrowhead)`);
1128
- if (look === "neo" && useGradient && theme !== "neutral") {
1129
- const existingDefs = svg.select("defs");
1130
- const defsEl = existingDefs.empty() ? svg.append("defs") : existingDefs;
1131
- const gradient = defsEl.append("linearGradient").attr("id", svg.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1132
- gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1133
- gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1134
- }
1135
- setupGraphViewbox(
1136
- void 0,
1137
- svg,
1138
- conf.timeline?.padding ?? 50,
1139
- conf.timeline?.useMaxWidth ?? false
1140
- );
1141
- }, "draw");
1142
- var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections, diagramId) {
1143
- for (const task of tasks2) {
1144
- const taskNode = {
1145
- descr: task.task,
1146
- section: sectionColor,
1147
- number: sectionColor,
1148
- width: 150,
1149
- padding: 20,
1150
- maxHeight: maxTaskHeight
1151
- };
1152
- log.debug("taskNode", taskNode);
1153
- const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1154
- const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf, diagramId);
1155
- const taskHeight = node.height;
1156
- log.debug("taskHeight after draw", taskHeight);
1157
- taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1158
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1159
- if (task.events) {
1160
- const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1161
- let lineLength = maxTaskHeight;
1162
- masterY += 100;
1163
- lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf, diagramId);
1164
- masterY -= 100;
1165
- lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr("y2", masterY + maxTaskHeight + 100 + maxEventLineLength + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${diagramId}-arrowhead)`).attr("stroke-dasharray", "5,5");
1166
- }
1167
- masterX = masterX + 200;
1168
- if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1169
- sectionColor++;
1170
- }
1171
- }
1172
- masterY = masterY - 10;
1173
- }, "drawTasks");
1174
- var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf, diagramId) {
1175
- let maxEventHeight = 0;
1176
- const eventBeginY = masterY;
1177
- masterY = masterY + 100;
1178
- for (const event of events) {
1179
- const eventNode = {
1180
- descr: event,
1181
- section: sectionColor,
1182
- number: sectionColor,
1183
- width: 150,
1184
- padding: 20,
1185
- maxHeight: 50
1186
- };
1187
- log.debug("eventNode", eventNode);
1188
- const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1189
- const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf, diagramId, true);
1190
- const eventHeight = node.height;
1191
- maxEventHeight = maxEventHeight + eventHeight;
1192
- eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1193
- masterY = masterY + 10 + eventHeight;
1194
- }
1195
- masterY = eventBeginY;
1196
- return maxEventHeight;
1197
- }, "drawEvents");
1198
- var timelineRenderer_default = {
1199
- setConf: /* @__PURE__ */ __name(() => {
1200
- }, "setConf"),
1201
- draw
1202
- };
1203
- var NODE_WIDTH = 200;
1204
- var NODE_PADDING = 5;
1205
- var NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2;
1206
- var EVENT_WIDTH = NODE_WIDTH + 100;
1207
- var EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2;
1208
- var EVENT_SPACING = 10;
1209
- var EVENT_VERTICAL_GAP = 0;
1210
- var SECTION_TASK_GAP = 20;
1211
- var TASK_AXIS_GAP = 20;
1212
- var TASK_VERTICAL_GAP = 30;
1213
- var EVENT_AXIS_GAP = 50;
1214
- var draw2 = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1215
- const conf = getConfig2();
1216
- const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1217
- log.debug("timeline", diagObj.db);
1218
- const svg = selectSvgElement(id);
1219
- svg.append("g");
1220
- const tasks2 = diagObj.db.getTasks();
1221
- const title = diagObj.db.getCommonDb().getDiagramTitle();
1222
- log.debug("task", tasks2);
1223
- svgDraw_default.initGraphics(svg);
1224
- const sections2 = diagObj.db.getSections();
1225
- log.debug("sections", sections2);
1226
- let maxSectionHeight = 0;
1227
- let maxTaskHeight = 0;
1228
- const masterX = 50 + LEFT_MARGIN;
1229
- let masterY = 50;
1230
- const contentTopY = masterY;
1231
- const sectionBeginX = masterX;
1232
- const leftWidth = NODE_TOTAL_WIDTH + TASK_AXIS_GAP;
1233
- const rightWidth = EVENT_TOTAL_WIDTH + EVENT_AXIS_GAP;
1234
- const axisX = sectionBeginX + leftWidth;
1235
- let sectionNumber = 0;
1236
- const hasSections = sections2 && sections2.length > 0;
1237
- const timelineX = hasSections ? axisX : masterX + leftWidth;
1238
- const sectionWidth = Math.max(50, leftWidth + rightWidth - NODE_PADDING * 2);
1239
- sections2.forEach(function(section) {
1240
- const sectionNode = {
1241
- number: sectionNumber,
1242
- descr: section,
1243
- section: sectionNumber,
1244
- width: sectionWidth,
1245
- padding: NODE_PADDING,
1246
- maxHeight: maxSectionHeight
1247
- };
1248
- const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1249
- log.debug("sectionHeight before draw", sectionHeight);
1250
- maxSectionHeight = Math.max(maxSectionHeight, sectionHeight);
1251
- });
1252
- let maxEventStackHeight = 0;
1253
- log.debug("tasks.length", tasks2.length);
1254
- for (const [i, task] of tasks2.entries()) {
1255
- const taskNode = {
1256
- number: i,
1257
- descr: task,
1258
- section: task.section,
1259
- width: NODE_WIDTH,
1260
- padding: NODE_PADDING,
1261
- maxHeight: maxTaskHeight
1262
- };
1263
- const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1264
- log.debug("taskHeight before draw", taskHeight);
1265
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1266
- let maxEventStackHeightTemp = 0;
1267
- for (const event of task.events) {
1268
- const eventNode = {
1269
- descr: event,
1270
- section: task.section,
1271
- number: task.section,
1272
- width: EVENT_WIDTH,
1273
- padding: NODE_PADDING,
1274
- maxHeight: 50
1275
- };
1276
- maxEventStackHeightTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1277
- }
1278
- if (task.events.length > 0) {
1279
- maxEventStackHeightTemp += (task.events.length - 1) * EVENT_SPACING;
1280
- }
1281
- maxEventStackHeight = Math.max(maxEventStackHeight, maxEventStackHeightTemp) + EVENT_VERTICAL_GAP;
1282
- }
1283
- log.debug("maxSectionHeight before draw", maxSectionHeight);
1284
- log.debug("maxTaskHeight before draw", maxTaskHeight);
1285
- const taskBlockHeight = Math.max(maxTaskHeight, maxEventStackHeight);
1286
- const taskSpacing = taskBlockHeight + TASK_VERTICAL_GAP;
1287
- if (hasSections) {
1288
- sections2.forEach((section) => {
1289
- const tasksForSection = tasks2.filter((task) => task.section === section);
1290
- const sectionNode = {
1291
- number: sectionNumber,
1292
- descr: section,
1293
- section: sectionNumber,
1294
- width: sectionWidth,
1295
- padding: NODE_PADDING,
1296
- maxHeight: maxSectionHeight
1297
- };
1298
- log.debug("sectionNode", sectionNode);
1299
- const sectionNodeWrapper = svg.append("g");
1300
- const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1301
- log.debug("sectionNode output", node);
1302
- const sectionX = timelineX - leftWidth;
1303
- sectionNodeWrapper.attr("transform", `translate(${sectionX}, ${masterY})`);
1304
- const taskStartY = masterY + node.height + SECTION_TASK_GAP;
1305
- if (tasksForSection.length > 0) {
1306
- drawTasks2(
1307
- svg,
1308
- tasksForSection,
1309
- sectionNumber,
1310
- timelineX,
1311
- taskStartY,
1312
- maxTaskHeight,
1313
- conf,
1314
- taskSpacing,
1315
- false
1316
- );
1317
- }
1318
- const taskCount2 = tasksForSection.length;
1319
- const sectionHeight = node.height + SECTION_TASK_GAP + taskSpacing * Math.max(taskCount2, 1) - (taskCount2 > 0 ? TASK_VERTICAL_GAP * 2 : 0);
1320
- masterY += sectionHeight;
1321
- sectionNumber++;
1322
- });
1323
- } else {
1324
- drawTasks2(
1325
- svg,
1326
- tasks2,
1327
- sectionNumber,
1328
- timelineX,
1329
- masterY,
1330
- maxTaskHeight,
1331
- conf,
1332
- taskSpacing,
1333
- true
1334
- );
1335
- }
1336
- let box = svg.node()?.getBBox();
1337
- if (!box) {
1338
- throw new Error("bbox not found");
1339
- }
1340
- log.debug("bounds", box);
1341
- if (title) {
1342
- svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1343
- box = svg.node()?.getBBox();
1344
- if (!box) {
1345
- throw new Error("bbox not found");
1346
- }
1347
- log.debug("bounds after title", box);
1348
- }
1349
- const [fontSize] = parseFontSize(conf.fontSize);
1350
- const arrowTopOffset = (fontSize ?? 16) * 2;
1351
- const arrowBottomPadding = (fontSize ?? 16) * 0.5 + 20;
1352
- const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1353
- lineWrapper.append("line").attr("x1", timelineX).attr("y1", contentTopY - arrowTopOffset).attr("x2", timelineX).attr("y2", box.y + box.height + arrowBottomPadding).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1354
- lineWrapper.lower();
1355
- setupGraphViewbox(
1356
- void 0,
1357
- svg,
1358
- conf.timeline?.padding ?? 50,
1359
- conf.timeline?.useMaxWidth ?? false
1360
- );
1361
- }, "draw");
1362
- var drawTasks2 = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, timelineX, masterY, maxTaskHeight, conf, taskSpacing, isWithoutSections) {
1363
- for (const task of tasks2) {
1364
- const taskNode = {
1365
- descr: task.task,
1366
- section: sectionColor,
1367
- number: sectionColor,
1368
- width: NODE_WIDTH,
1369
- padding: NODE_PADDING,
1370
- maxHeight: maxTaskHeight
1371
- };
1372
- log.debug("taskNode", taskNode);
1373
- const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1374
- const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1375
- const taskHeight = node.height;
1376
- log.debug("taskHeight after draw", taskHeight);
1377
- const taskX = timelineX - TASK_AXIS_GAP - node.width;
1378
- taskWrapper.attr("transform", `translate(${taskX}, ${masterY})`);
1379
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1380
- if (task.events && task.events.length > 0) {
1381
- const eventsStartY = masterY;
1382
- const eventsX = timelineX + EVENT_AXIS_GAP;
1383
- drawEvents2(diagram2, task.events, sectionColor, timelineX, eventsX, eventsStartY, conf);
1384
- }
1385
- masterY = masterY + taskSpacing;
1386
- if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1387
- sectionColor++;
1388
- }
1389
- }
1390
- }, "drawTasks");
1391
- var drawEvents2 = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, axisX, eventsX, startY, conf) {
1392
- let currentY = startY;
1393
- for (const event of events) {
1394
- const eventNode = {
1395
- descr: event,
1396
- section: sectionColor,
1397
- number: sectionColor,
1398
- width: EVENT_WIDTH,
1399
- padding: NODE_PADDING,
1400
- maxHeight: 0
1401
- };
1402
- log.debug("eventNode", eventNode);
1403
- const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1404
- const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf);
1405
- const eventHeight = node.height;
1406
- eventWrapper.attr("transform", `translate(${eventsX}, ${currentY})`);
1407
- const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1408
- const lineY = currentY + eventHeight / 2;
1409
- lineWrapper.append("line").attr("x1", axisX).attr("y1", lineY).attr("x2", eventsX).attr("y2", lineY).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1410
- currentY = currentY + eventHeight + EVENT_SPACING;
1411
- }
1412
- return currentY - startY;
1413
- }, "drawEvents");
1414
- var timelineRendererVertical_default = {
1415
- setConf: /* @__PURE__ */ __name(() => {
1416
- }, "setConf"),
1417
- draw: draw2
1418
- };
1419
- var genReduxSections = /* @__PURE__ */ __name((options) => {
1420
- const { theme } = getConfig();
1421
- const isDarkTheme = theme?.includes("dark");
1422
- const isColorTheme = theme?.includes("color");
1423
- const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1424
- const scopedDropShadow = rawSvgId ? `url(#${rawSvgId}-drop-shadow)` : options.dropShadow ?? "none";
1425
- let sections2 = "";
1426
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1427
- const sw = `${17 - 3 * i}`;
1428
- const color = isColorTheme ? options.borderColorArray[i] : options.mainBkg;
1429
- const stroke = isColorTheme ? options.borderColorArray[i] : options.nodeBorder;
1430
- sections2 += `
1431
- .section-${i - 1} rect,
1432
- .section-${i - 1} path,
1433
- .section-${i - 1} circle {
1434
- fill: ${isDarkTheme && isColorTheme ? options.mainBkg : color};
1435
- stroke: ${stroke};
1436
- stroke-width: ${options.strokeWidth};
1437
- filter: ${scopedDropShadow};
1438
- }
1439
-
1440
- .section-${i - 1} text {
1441
- fill: ${options.nodeBorder};
1442
- font-weight: ${options.fontWeight}
1443
- }
1444
-
1445
- .node-icon-${i - 1} {
1446
- font-size: 40px;
1447
- color: ${options["cScaleLabel" + i]};
1448
- }
1449
-
1450
- .section-edge-${i - 1} {
1451
- stroke: ${options["cScale" + i]};
1452
- }
1453
-
1454
- .edge-depth-${i - 1} {
1455
- stroke-width: ${sw};
1456
- }
1457
-
1458
- .section-${i - 1} line {
1459
- stroke: ${options["cScaleInv" + i]};
1460
- stroke-width: 3;
1461
- }
1462
-
1463
- .lineWrapper line {
1464
- stroke: ${options.nodeBorder};
1465
- stroke-width:${options.strokeWidth}
1466
- }
1467
-
1468
- .disabled,
1469
- .disabled circle,
1470
- .disabled text {
1471
- fill: ${options.tertiaryColor ?? "lightgray"};
1472
- }
1473
-
1474
- .disabled text {
1475
- fill: ${options.clusterBorder ?? "#efefef"};
1476
- }
1477
- `;
1478
- }
1479
- return sections2;
1480
- }, "genReduxSections");
1481
- var genSections = /* @__PURE__ */ __name((options) => {
1482
- let sections2 = "";
1483
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1484
- options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1485
- if (isDark(options["lineColor" + i])) {
1486
- options["lineColor" + i] = lighten(options["lineColor" + i], 20);
1487
- } else {
1488
- options["lineColor" + i] = darken(options["lineColor" + i], 20);
1489
- }
1490
- }
1491
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1492
- const sw = "" + (17 - 3 * i);
1493
- sections2 += `
1494
- .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1495
- fill: ${options["cScale" + i]};
1496
- }
1497
- .section-${i - 1} text {
1498
- fill: ${options["cScaleLabel" + i]};
1499
- }
1500
- .node-icon-${i - 1} {
1501
- font-size: 40px;
1502
- color: ${options["cScaleLabel" + i]};
1503
- }
1504
- .section-edge-${i - 1}{
1505
- stroke: ${options["cScale" + i]};
1506
- }
1507
- .edge-depth-${i - 1}{
1508
- stroke-width: ${sw};
1509
- }
1510
- .section-${i - 1} line {
1511
- stroke: ${options["cScaleInv" + i]} ;
1512
- stroke-width: 3;
1513
- }
1514
-
1515
- .lineWrapper line{
1516
- stroke: ${options["cScaleLabel" + i]} ;
1517
- }
1518
-
1519
- .disabled, .disabled circle, .disabled text {
1520
- fill: ${options.tertiaryColor ?? "lightgray"};
1521
- }
1522
- .disabled text {
1523
- fill: ${options.clusterBorder ?? "#efefef"};
1524
- }
1525
- `;
1526
- }
1527
- return sections2;
1528
- }, "genSections");
1529
- var getStyles = /* @__PURE__ */ __name((options) => {
1530
- const { theme } = getConfig();
1531
- const isReduxTheme = theme?.includes("redux");
1532
- const isNeutralTheme = theme === "neutral";
1533
- const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1534
- let gradientSections = "";
1535
- if (options.useGradient && rawSvgId && options.THEME_COLOR_LIMIT && !isNeutralTheme) {
1536
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1537
- gradientSections += `
1538
- .section-${i - 1}[data-look="neo"] rect,
1539
- .section-${i - 1}[data-look="neo"] path,
1540
- .section-${i - 1}[data-look="neo"] circle {
1541
- fill: ${options.mainBkg};
1542
- stroke: url(#${rawSvgId}-gradient);
1543
- stroke-width: 2;
1544
- }
1545
- .section-${i - 1}[data-look="neo"] line {
1546
- stroke: url(#${rawSvgId}-gradient);
1547
- stroke-width: 2;
1548
- }`;
1549
- }
1550
- }
1551
- return `
1552
- .edge {
1553
- stroke-width: 3;
1554
- }
1555
- ${isReduxTheme ? genReduxSections(options) : genSections(options)}
1556
- ${gradientSections}
1557
- .section-root rect, .section-root path, .section-root circle {
1558
- fill: ${options.git0};
1559
- }
1560
- .section-root text {
1561
- fill: ${options.gitBranchLabel0};
1562
- }
1563
- .icon-container {
1564
- height:100%;
1565
- display: flex;
1566
- justify-content: center;
1567
- align-items: center;
1568
- }
1569
- .edge {
1570
- fill: none;
1571
- }
1572
- .eventWrapper {
1573
- filter: brightness(120%);
1574
- }
1575
- `;
1576
- }, "getStyles");
1577
- var styles_default = getStyles;
1578
- var rendererSelector = {
1579
- setConf: /* @__PURE__ */ __name(() => {
1580
- }, "setConf"),
1581
- draw: /* @__PURE__ */ __name((text, id, version, diagObj) => {
1582
- const direction2 = diagObj?.db?.getDirection?.() ?? "LR";
1583
- if (direction2 === "TD") {
1584
- return timelineRendererVertical_default.draw(text, id, version, diagObj);
1585
- }
1586
- return timelineRenderer_default.draw(text, id, version, diagObj);
1587
- }, "draw")
1588
- };
1589
- var diagram = {
1590
- db: timelineDb_exports,
1591
- renderer: rendererSelector,
1592
- parser: timeline_default,
1593
- styles: styles_default
1594
- };
1595
- export {
1596
- diagram
1597
- };