hexagon-editor 0.1.5 → 0.1.7

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 (117) hide show
  1. package/README.md +44 -24
  2. package/dist/MarkdownEditor.vue.d.ts +28 -26
  3. package/dist/MarkdownEditor.vue.d.ts.map +1 -1
  4. package/dist/{MarkdownEditorLinkForm-C7CGgA83.js → MarkdownEditorLinkForm-B9dEX3WT.js} +1 -1
  5. package/dist/{base-Bnv2-Te4.js → base-BPdMUtQo.js} +141 -137
  6. package/dist/components/MarkdownEditorToolbar.vue.d.ts +4 -3
  7. package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -1
  8. package/dist/configure.d.ts +0 -2
  9. package/dist/configure.d.ts.map +1 -1
  10. package/dist/configure.js +11 -12
  11. package/dist/core/basic-editor-markdown.d.ts.map +1 -1
  12. package/dist/core/basic-editor-renderers.d.ts +6 -4
  13. package/dist/core/basic-editor-renderers.d.ts.map +1 -1
  14. package/dist/core/basic-editor-types.d.ts +2 -0
  15. package/dist/core/basic-editor-types.d.ts.map +1 -1
  16. package/dist/core/basic-editor.d.ts +1 -1
  17. package/dist/core/basic-editor.d.ts.map +1 -1
  18. package/dist/core/index.d.ts +0 -2
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core.js +28 -31
  21. package/dist/extensions.js +1 -1
  22. package/dist/forms/MarkdownEditorImageForm.vue.d.ts +2 -2
  23. package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -1
  24. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +2 -2
  25. package/dist/forms/MarkdownEditorTextInput.vue.d.ts +2 -2
  26. package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -1
  27. package/dist/forms.js +1 -1
  28. package/dist/{full-C-o2lPBX.js → full-Da8esvj2.js} +1 -1
  29. package/dist/{full-specs-Cl-ODShc.js → full-specs-hXKoMF-0.js} +1 -1
  30. package/dist/index-D_CMntQU.js +3173 -0
  31. package/dist/index.css +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +240 -236
  35. package/dist/{markup-commands-B2NMfYHE.js → markup-commands-BYsx8ADT.js} +1989 -1963
  36. package/dist/presets.js +2 -2
  37. package/dist/public-types.d.ts +22 -0
  38. package/dist/public-types.d.ts.map +1 -1
  39. package/dist/renderer/MarkdownRenderer.vue.d.ts +2 -0
  40. package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -1
  41. package/dist/renderer/markdown.d.ts +2 -1
  42. package/dist/renderer/markdown.d.ts.map +1 -1
  43. package/dist/renderer.css +1 -1
  44. package/dist/renderer.js +3590 -200
  45. package/package.json +106 -108
  46. package/dist/MarkdownEditorLinkForm.css +0 -1
  47. package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +0 -87
  48. package/dist/arc-y6UeoJpJ.js +0 -83
  49. package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +0 -4778
  50. package/dist/base.css +0 -1
  51. package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +0 -2419
  52. package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +0 -1577
  53. package/dist/channel-BwXGcavV.js +0 -5
  54. package/dist/chunk-2GRJ4B5K-O75udjPr.js +0 -68
  55. package/dist/chunk-2Q5K7J3B-CySL0lOA.js +0 -15
  56. package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +0 -1408
  57. package/dist/chunk-5VM5RSS4--it1VJIv.js +0 -19
  58. package/dist/chunk-6Q2QTUOP-DNiML-50.js +0 -664
  59. package/dist/chunk-GF5L2VYU-z7A-k0-V.js +0 -1533
  60. package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +0 -8
  61. package/dist/chunk-KBJHAD2P-D4R1VW0r.js +0 -19
  62. package/dist/chunk-RYQCIY6F-DmJAYxq8.js +0 -313
  63. package/dist/chunk-XXDRQBXY-CK913N-t.js +0 -8
  64. package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +0 -16
  65. package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +0 -16
  66. package/dist/core/optional-renderers.d.ts +0 -9
  67. package/dist/core/optional-renderers.d.ts.map +0 -1
  68. package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +0 -2608
  69. package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +0 -23766
  70. package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +0 -299
  71. package/dist/cytoscape.esm-3W4EOjxC.js +0 -18756
  72. package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +0 -340
  73. package/dist/defaultLocale-BgPVtth8.js +0 -171
  74. package/dist/diagram-7IWD3JNH-BrApu1hz.js +0 -350
  75. package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +0 -461
  76. package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +0 -142
  77. package/dist/diagram-Q27KOJAE-DWIltqIH.js +0 -528
  78. package/dist/diagram-UB23O5K3-B7z2Lj3K.js +0 -219
  79. package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +0 -109
  80. package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +0 -910
  81. package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +0 -1638
  82. package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +0 -2711
  83. package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +0 -815
  84. package/dist/graph-DAHC4kPm.js +0 -1545
  85. package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +0 -24
  86. package/dist/init-DjUOC4st.js +0 -16
  87. package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +0 -621
  88. package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +0 -834
  89. package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +0 -724
  90. package/dist/katex-ByXcxnHy.js +0 -14436
  91. package/dist/katex-DoRnZ_sp.js +0 -11682
  92. package/dist/layout-DBbo_M5I.js +0 -1519
  93. package/dist/linear-BEdRfKba.js +0 -259
  94. package/dist/map-DRdzG8Ho.js +0 -224
  95. package/dist/markup-commands.css +0 -1
  96. package/dist/mermaid.core-CR0bA2Wa.js +0 -16496
  97. package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +0 -827
  98. package/dist/optional-renderers-BalvqqvY.js +0 -11
  99. package/dist/ordinal-B6-f3MAq.js +0 -61
  100. package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +0 -95
  101. package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +0 -207
  102. package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +0 -1023
  103. package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +0 -77
  104. package/dist/renderer/mermaid-runtime.d.ts +0 -4
  105. package/dist/renderer/mermaid-runtime.d.ts.map +0 -1
  106. package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +0 -882
  107. package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +0 -847
  108. package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +0 -2888
  109. package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +0 -46
  110. package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +0 -263
  111. package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +0 -16
  112. package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +0 -5332
  113. package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +0 -13
  114. package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +0 -1055
  115. package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +0 -1578
  116. package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +0 -675
  117. package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +0 -1388
@@ -1,847 +0,0 @@
1
- import { n as xt, o as _t, s as vt, g as bt, b as St, a as wt, _ as y, c as lt, b9 as Lt, d as X, W as Et, p as At, k as Tt } from "./mermaid.core-CR0bA2Wa.js";
2
- import { o as Mt } from "./ordinal-B6-f3MAq.js";
3
- function Nt(t) {
4
- for (var n = t.length / 6 | 0, s = new Array(n), a = 0; a < n; ) s[a] = "#" + t.slice(a * 6, ++a * 6);
5
- return s;
6
- }
7
- const Ct = Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
8
- function ct(t, n) {
9
- let s;
10
- if (n === void 0)
11
- for (const a of t)
12
- a != null && (s < a || s === void 0 && a >= a) && (s = a);
13
- else {
14
- let a = -1;
15
- for (let u of t)
16
- (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
17
- }
18
- return s;
19
- }
20
- function pt(t, n) {
21
- let s;
22
- if (n === void 0)
23
- for (const a of t)
24
- a != null && (s > a || s === void 0 && a >= a) && (s = a);
25
- else {
26
- let a = -1;
27
- for (let u of t)
28
- (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
29
- }
30
- return s;
31
- }
32
- function nt(t, n) {
33
- let s = 0;
34
- if (n === void 0)
35
- for (let a of t)
36
- (a = +a) && (s += a);
37
- else {
38
- let a = -1;
39
- for (let u of t)
40
- (u = +n(u, ++a, t)) && (s += u);
41
- }
42
- return s;
43
- }
44
- function Pt(t) {
45
- return t.target.depth;
46
- }
47
- function It(t) {
48
- return t.depth;
49
- }
50
- function Ot(t, n) {
51
- return n - 1 - t.height;
52
- }
53
- function kt(t, n) {
54
- return t.sourceLinks.length ? t.depth : n - 1;
55
- }
56
- function $t(t) {
57
- return t.targetLinks.length ? t.depth : t.sourceLinks.length ? pt(t.sourceLinks, Pt) - 1 : 0;
58
- }
59
- function q(t) {
60
- return function() {
61
- return t;
62
- };
63
- }
64
- function ut(t, n) {
65
- return Q(t.source, n.source) || t.index - n.index;
66
- }
67
- function ht(t, n) {
68
- return Q(t.target, n.target) || t.index - n.index;
69
- }
70
- function Q(t, n) {
71
- return t.y0 - n.y0;
72
- }
73
- function it(t) {
74
- return t.value;
75
- }
76
- function Dt(t) {
77
- return t.index;
78
- }
79
- function jt(t) {
80
- return t.nodes;
81
- }
82
- function zt(t) {
83
- return t.links;
84
- }
85
- function ft(t, n) {
86
- const s = t.get(n);
87
- if (!s) throw new Error("missing: " + n);
88
- return s;
89
- }
90
- function yt({ nodes: t }) {
91
- for (const n of t) {
92
- let s = n.y0, a = s;
93
- for (const u of n.sourceLinks)
94
- u.y0 = s + u.width / 2, s += u.width;
95
- for (const u of n.targetLinks)
96
- u.y1 = a + u.width / 2, a += u.width;
97
- }
98
- }
99
- function Bt() {
100
- let t = 0, n = 0, s = 1, a = 1, u = 24, x = 8, g, k = Dt, o = kt, l, h, m = jt, _ = zt, d = 6;
101
- function v() {
102
- const i = { nodes: m.apply(null, arguments), links: _.apply(null, arguments) };
103
- return T(i), A(i), M(i), I(i), S(i), yt(i), i;
104
- }
105
- v.update = function(i) {
106
- return yt(i), i;
107
- }, v.nodeId = function(i) {
108
- return arguments.length ? (k = typeof i == "function" ? i : q(i), v) : k;
109
- }, v.nodeAlign = function(i) {
110
- return arguments.length ? (o = typeof i == "function" ? i : q(i), v) : o;
111
- }, v.nodeSort = function(i) {
112
- return arguments.length ? (l = i, v) : l;
113
- }, v.nodeWidth = function(i) {
114
- return arguments.length ? (u = +i, v) : u;
115
- }, v.nodePadding = function(i) {
116
- return arguments.length ? (x = g = +i, v) : x;
117
- }, v.nodes = function(i) {
118
- return arguments.length ? (m = typeof i == "function" ? i : q(i), v) : m;
119
- }, v.links = function(i) {
120
- return arguments.length ? (_ = typeof i == "function" ? i : q(i), v) : _;
121
- }, v.linkSort = function(i) {
122
- return arguments.length ? (h = i, v) : h;
123
- }, v.size = function(i) {
124
- return arguments.length ? (t = n = 0, s = +i[0], a = +i[1], v) : [s - t, a - n];
125
- }, v.extent = function(i) {
126
- return arguments.length ? (t = +i[0][0], s = +i[1][0], n = +i[0][1], a = +i[1][1], v) : [[t, n], [s, a]];
127
- }, v.iterations = function(i) {
128
- return arguments.length ? (d = +i, v) : d;
129
- };
130
- function T({ nodes: i, links: f }) {
131
- for (const [e, r] of i.entries())
132
- r.index = e, r.sourceLinks = [], r.targetLinks = [];
133
- const c = new Map(i.map((e, r) => [k(e, r, i), e]));
134
- for (const [e, r] of f.entries()) {
135
- r.index = e;
136
- let { source: p, target: b } = r;
137
- typeof p != "object" && (p = r.source = ft(c, p)), typeof b != "object" && (b = r.target = ft(c, b)), p.sourceLinks.push(r), b.targetLinks.push(r);
138
- }
139
- if (h != null)
140
- for (const { sourceLinks: e, targetLinks: r } of i)
141
- e.sort(h), r.sort(h);
142
- }
143
- function A({ nodes: i }) {
144
- for (const f of i)
145
- f.value = f.fixedValue === void 0 ? Math.max(nt(f.sourceLinks, it), nt(f.targetLinks, it)) : f.fixedValue;
146
- }
147
- function M({ nodes: i }) {
148
- const f = i.length;
149
- let c = new Set(i), e = /* @__PURE__ */ new Set(), r = 0;
150
- for (; c.size; ) {
151
- for (const p of c) {
152
- p.depth = r;
153
- for (const { target: b } of p.sourceLinks)
154
- e.add(b);
155
- }
156
- if (++r > f) throw new Error("circular link");
157
- c = e, e = /* @__PURE__ */ new Set();
158
- }
159
- }
160
- function I({ nodes: i }) {
161
- const f = i.length;
162
- let c = new Set(i), e = /* @__PURE__ */ new Set(), r = 0;
163
- for (; c.size; ) {
164
- for (const p of c) {
165
- p.height = r;
166
- for (const { source: b } of p.targetLinks)
167
- e.add(b);
168
- }
169
- if (++r > f) throw new Error("circular link");
170
- c = e, e = /* @__PURE__ */ new Set();
171
- }
172
- }
173
- function N({ nodes: i }) {
174
- const f = ct(i, (r) => r.depth) + 1, c = (s - t - u) / (f - 1), e = new Array(f);
175
- for (const r of i) {
176
- const p = Math.max(0, Math.min(f - 1, Math.floor(o.call(null, r, f))));
177
- r.layer = p, r.x0 = t + p * c, r.x1 = r.x0 + u, e[p] ? e[p].push(r) : e[p] = [r];
178
- }
179
- if (l) for (const r of e)
180
- r.sort(l);
181
- return e;
182
- }
183
- function D(i) {
184
- const f = pt(i, (c) => (a - n - (c.length - 1) * g) / nt(c, it));
185
- for (const c of i) {
186
- let e = n;
187
- for (const r of c) {
188
- r.y0 = e, r.y1 = e + r.value * f, e = r.y1 + g;
189
- for (const p of r.sourceLinks)
190
- p.width = p.value * f;
191
- }
192
- e = (a - e + g) / (c.length + 1);
193
- for (let r = 0; r < c.length; ++r) {
194
- const p = c[r];
195
- p.y0 += e * (r + 1), p.y1 += e * (r + 1);
196
- }
197
- w(c);
198
- }
199
- }
200
- function S(i) {
201
- const f = N(i);
202
- g = Math.min(x, (a - n) / (ct(f, (c) => c.length) - 1)), D(f);
203
- for (let c = 0; c < d; ++c) {
204
- const e = Math.pow(0.99, c), r = Math.max(1 - e, (c + 1) / d);
205
- R(f, e, r), C(f, e, r);
206
- }
207
- }
208
- function C(i, f, c) {
209
- for (let e = 1, r = i.length; e < r; ++e) {
210
- const p = i[e];
211
- for (const b of p) {
212
- let L = 0, B = 0;
213
- for (const { source: Y, value: et } of b.targetLinks) {
214
- let H = et * (b.layer - Y.layer);
215
- L += P(Y, b) * H, B += H;
216
- }
217
- if (!(B > 0)) continue;
218
- let U = (L / B - b.y0) * f;
219
- b.y0 += U, b.y1 += U, z(b);
220
- }
221
- l === void 0 && p.sort(Q), j(p, c);
222
- }
223
- }
224
- function R(i, f, c) {
225
- for (let e = i.length, r = e - 2; r >= 0; --r) {
226
- const p = i[r];
227
- for (const b of p) {
228
- let L = 0, B = 0;
229
- for (const { target: Y, value: et } of b.sourceLinks) {
230
- let H = et * (Y.layer - b.layer);
231
- L += E(b, Y) * H, B += H;
232
- }
233
- if (!(B > 0)) continue;
234
- let U = (L / B - b.y0) * f;
235
- b.y0 += U, b.y1 += U, z(b);
236
- }
237
- l === void 0 && p.sort(Q), j(p, c);
238
- }
239
- }
240
- function j(i, f) {
241
- const c = i.length >> 1, e = i[c];
242
- O(i, e.y0 - g, c - 1, f), V(i, e.y1 + g, c + 1, f), O(i, a, i.length - 1, f), V(i, n, 0, f);
243
- }
244
- function V(i, f, c, e) {
245
- for (; c < i.length; ++c) {
246
- const r = i[c], p = (f - r.y0) * e;
247
- p > 1e-6 && (r.y0 += p, r.y1 += p), f = r.y1 + g;
248
- }
249
- }
250
- function O(i, f, c, e) {
251
- for (; c >= 0; --c) {
252
- const r = i[c], p = (r.y1 - f) * e;
253
- p > 1e-6 && (r.y0 -= p, r.y1 -= p), f = r.y0 - g;
254
- }
255
- }
256
- function z({ sourceLinks: i, targetLinks: f }) {
257
- if (h === void 0) {
258
- for (const { source: { sourceLinks: c } } of f)
259
- c.sort(ht);
260
- for (const { target: { targetLinks: c } } of i)
261
- c.sort(ut);
262
- }
263
- }
264
- function w(i) {
265
- if (h === void 0)
266
- for (const { sourceLinks: f, targetLinks: c } of i)
267
- f.sort(ht), c.sort(ut);
268
- }
269
- function P(i, f) {
270
- let c = i.y0 - (i.sourceLinks.length - 1) * g / 2;
271
- for (const { target: e, width: r } of i.sourceLinks) {
272
- if (e === f) break;
273
- c += r + g;
274
- }
275
- for (const { source: e, width: r } of f.targetLinks) {
276
- if (e === i) break;
277
- c -= r;
278
- }
279
- return c;
280
- }
281
- function E(i, f) {
282
- let c = f.y0 - (f.targetLinks.length - 1) * g / 2;
283
- for (const { source: e, width: r } of f.targetLinks) {
284
- if (e === i) break;
285
- c += r + g;
286
- }
287
- for (const { target: e, width: r } of i.sourceLinks) {
288
- if (e === f) break;
289
- c -= r;
290
- }
291
- return c;
292
- }
293
- return v;
294
- }
295
- var rt = Math.PI, st = 2 * rt, F = 1e-6, Ft = st - F;
296
- function ot() {
297
- this._x0 = this._y0 = // start of current subpath
298
- this._x1 = this._y1 = null, this._ = "";
299
- }
300
- function mt() {
301
- return new ot();
302
- }
303
- ot.prototype = mt.prototype = {
304
- constructor: ot,
305
- moveTo: function(t, n) {
306
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
307
- },
308
- closePath: function() {
309
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
310
- },
311
- lineTo: function(t, n) {
312
- this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
313
- },
314
- quadraticCurveTo: function(t, n, s, a) {
315
- this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
316
- },
317
- bezierCurveTo: function(t, n, s, a, u, x) {
318
- this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +x);
319
- },
320
- arcTo: function(t, n, s, a, u) {
321
- t = +t, n = +n, s = +s, a = +a, u = +u;
322
- var x = this._x1, g = this._y1, k = s - t, o = a - n, l = x - t, h = g - n, m = l * l + h * h;
323
- if (u < 0) throw new Error("negative radius: " + u);
324
- if (this._x1 === null)
325
- this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
326
- else if (m > F) if (!(Math.abs(h * k - o * l) > F) || !u)
327
- this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
328
- else {
329
- var _ = s - x, d = a - g, v = k * k + o * o, T = _ * _ + d * d, A = Math.sqrt(v), M = Math.sqrt(m), I = u * Math.tan((rt - Math.acos((v + m - T) / (2 * A * M))) / 2), N = I / M, D = I / A;
330
- Math.abs(N - 1) > F && (this._ += "L" + (t + N * l) + "," + (n + N * h)), this._ += "A" + u + "," + u + ",0,0," + +(h * _ > l * d) + "," + (this._x1 = t + D * k) + "," + (this._y1 = n + D * o);
331
- }
332
- },
333
- arc: function(t, n, s, a, u, x) {
334
- t = +t, n = +n, s = +s, x = !!x;
335
- var g = s * Math.cos(a), k = s * Math.sin(a), o = t + g, l = n + k, h = 1 ^ x, m = x ? a - u : u - a;
336
- if (s < 0) throw new Error("negative radius: " + s);
337
- this._x1 === null ? this._ += "M" + o + "," + l : (Math.abs(this._x1 - o) > F || Math.abs(this._y1 - l) > F) && (this._ += "L" + o + "," + l), s && (m < 0 && (m = m % st + st), m > Ft ? this._ += "A" + s + "," + s + ",0,1," + h + "," + (t - g) + "," + (n - k) + "A" + s + "," + s + ",0,1," + h + "," + (this._x1 = o) + "," + (this._y1 = l) : m > F && (this._ += "A" + s + "," + s + ",0," + +(m >= rt) + "," + h + "," + (this._x1 = t + s * Math.cos(u)) + "," + (this._y1 = n + s * Math.sin(u))));
338
- },
339
- rect: function(t, n, s, a) {
340
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
341
- },
342
- toString: function() {
343
- return this._;
344
- }
345
- };
346
- function dt(t) {
347
- return function() {
348
- return t;
349
- };
350
- }
351
- function Rt(t) {
352
- return t[0];
353
- }
354
- function Vt(t) {
355
- return t[1];
356
- }
357
- var Wt = Array.prototype.slice;
358
- function Gt(t) {
359
- return t.source;
360
- }
361
- function Ut(t) {
362
- return t.target;
363
- }
364
- function Yt(t) {
365
- var n = Gt, s = Ut, a = Rt, u = Vt, x = null;
366
- function g() {
367
- var k, o = Wt.call(arguments), l = n.apply(this, o), h = s.apply(this, o);
368
- if (x || (x = k = mt()), t(x, +a.apply(this, (o[0] = l, o)), +u.apply(this, o), +a.apply(this, (o[0] = h, o)), +u.apply(this, o)), k) return x = null, k + "" || null;
369
- }
370
- return g.source = function(k) {
371
- return arguments.length ? (n = k, g) : n;
372
- }, g.target = function(k) {
373
- return arguments.length ? (s = k, g) : s;
374
- }, g.x = function(k) {
375
- return arguments.length ? (a = typeof k == "function" ? k : dt(+k), g) : a;
376
- }, g.y = function(k) {
377
- return arguments.length ? (u = typeof k == "function" ? k : dt(+k), g) : u;
378
- }, g.context = function(k) {
379
- return arguments.length ? (x = k ?? null, g) : x;
380
- }, g;
381
- }
382
- function Ht(t, n, s, a, u) {
383
- t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
384
- }
385
- function Xt() {
386
- return Yt(Ht);
387
- }
388
- function qt(t) {
389
- return [t.source.x1, t.y0];
390
- }
391
- function Qt(t) {
392
- return [t.target.x0, t.y1];
393
- }
394
- function Kt() {
395
- return Xt().source(qt).target(Qt);
396
- }
397
- var at = (function() {
398
- var t = /* @__PURE__ */ y(function(k, o, l, h) {
399
- for (l = l || {}, h = k.length; h--; l[k[h]] = o) ;
400
- return l;
401
- }, "o"), n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
402
- trace: /* @__PURE__ */ y(function() {
403
- }, "trace"),
404
- yy: {},
405
- symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 },
406
- terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" },
407
- productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
408
- performAction: /* @__PURE__ */ y(function(o, l, h, m, _, d, v) {
409
- var T = d.length - 1;
410
- switch (_) {
411
- case 7:
412
- const A = m.findOrCreateNode(d[T - 4].trim().replaceAll('""', '"')), M = m.findOrCreateNode(d[T - 2].trim().replaceAll('""', '"')), I = parseFloat(d[T].trim());
413
- m.addLink(A, M, I);
414
- break;
415
- case 8:
416
- case 9:
417
- case 11:
418
- this.$ = d[T];
419
- break;
420
- case 10:
421
- this.$ = d[T - 1];
422
- break;
423
- }
424
- }, "anonymous"),
425
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(s, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(s, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 15: 18, 16: 7, 17: 8, 18: n, 20: s }, { 18: [1, 19] }, t(s, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: n, 20: s }, t([1, 5, 10], [2, 7])],
426
- defaultActions: { 11: [2, 1], 12: [2, 5] },
427
- parseError: /* @__PURE__ */ y(function(o, l) {
428
- if (l.recoverable)
429
- this.trace(o);
430
- else {
431
- var h = new Error(o);
432
- throw h.hash = l, h;
433
- }
434
- }, "parseError"),
435
- parse: /* @__PURE__ */ y(function(o) {
436
- var l = this, h = [0], m = [], _ = [null], d = [], v = this.table, T = "", A = 0, M = 0, I = 2, N = 1, D = d.slice.call(arguments, 1), S = Object.create(this.lexer), C = { yy: {} };
437
- for (var R in this.yy)
438
- Object.prototype.hasOwnProperty.call(this.yy, R) && (C.yy[R] = this.yy[R]);
439
- S.setInput(o, C.yy), C.yy.lexer = S, C.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
440
- var j = S.yylloc;
441
- d.push(j);
442
- var V = S.options && S.options.ranges;
443
- typeof C.yy.parseError == "function" ? this.parseError = C.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
444
- function O(L) {
445
- h.length = h.length - 2 * L, _.length = _.length - L, d.length = d.length - L;
446
- }
447
- y(O, "popStack");
448
- function z() {
449
- var L;
450
- return L = m.pop() || S.lex() || N, typeof L != "number" && (L instanceof Array && (m = L, L = m.pop()), L = l.symbols_[L] || L), L;
451
- }
452
- y(z, "lex");
453
- for (var w, P, E, i, f = {}, c, e, r, p; ; ) {
454
- if (P = h[h.length - 1], this.defaultActions[P] ? E = this.defaultActions[P] : ((w === null || typeof w > "u") && (w = z()), E = v[P] && v[P][w]), typeof E > "u" || !E.length || !E[0]) {
455
- var b = "";
456
- p = [];
457
- for (c in v[P])
458
- this.terminals_[c] && c > I && p.push("'" + this.terminals_[c] + "'");
459
- S.showPosition ? b = "Parse error on line " + (A + 1) + `:
460
- ` + S.showPosition() + `
461
- Expecting ` + p.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : b = "Parse error on line " + (A + 1) + ": Unexpected " + (w == N ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(b, {
462
- text: S.match,
463
- token: this.terminals_[w] || w,
464
- line: S.yylineno,
465
- loc: j,
466
- expected: p
467
- });
468
- }
469
- if (E[0] instanceof Array && E.length > 1)
470
- throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + w);
471
- switch (E[0]) {
472
- case 1:
473
- h.push(w), _.push(S.yytext), d.push(S.yylloc), h.push(E[1]), w = null, M = S.yyleng, T = S.yytext, A = S.yylineno, j = S.yylloc;
474
- break;
475
- case 2:
476
- if (e = this.productions_[E[1]][1], f.$ = _[_.length - e], f._$ = {
477
- first_line: d[d.length - (e || 1)].first_line,
478
- last_line: d[d.length - 1].last_line,
479
- first_column: d[d.length - (e || 1)].first_column,
480
- last_column: d[d.length - 1].last_column
481
- }, V && (f._$.range = [
482
- d[d.length - (e || 1)].range[0],
483
- d[d.length - 1].range[1]
484
- ]), i = this.performAction.apply(f, [
485
- T,
486
- M,
487
- A,
488
- C.yy,
489
- E[1],
490
- _,
491
- d
492
- ].concat(D)), typeof i < "u")
493
- return i;
494
- e && (h = h.slice(0, -1 * e * 2), _ = _.slice(0, -1 * e), d = d.slice(0, -1 * e)), h.push(this.productions_[E[1]][0]), _.push(f.$), d.push(f._$), r = v[h[h.length - 2]][h[h.length - 1]], h.push(r);
495
- break;
496
- case 3:
497
- return !0;
498
- }
499
- }
500
- return !0;
501
- }, "parse")
502
- }, x = /* @__PURE__ */ (function() {
503
- var k = {
504
- EOF: 1,
505
- parseError: /* @__PURE__ */ y(function(l, h) {
506
- if (this.yy.parser)
507
- this.yy.parser.parseError(l, h);
508
- else
509
- throw new Error(l);
510
- }, "parseError"),
511
- // resets the lexer, sets new input
512
- setInput: /* @__PURE__ */ y(function(o, l) {
513
- return this.yy = l || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
514
- first_line: 1,
515
- first_column: 0,
516
- last_line: 1,
517
- last_column: 0
518
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
519
- }, "setInput"),
520
- // consumes and returns one char from the input
521
- input: /* @__PURE__ */ y(function() {
522
- var o = this._input[0];
523
- this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
524
- var l = o.match(/(?:\r\n?|\n).*/g);
525
- return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
526
- }, "input"),
527
- // unshifts one char (or a string) into the input
528
- unput: /* @__PURE__ */ y(function(o) {
529
- var l = o.length, h = o.split(/(?:\r\n?|\n)/g);
530
- this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
531
- var m = this.match.split(/(?:\r\n?|\n)/g);
532
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1);
533
- var _ = this.yylloc.range;
534
- return this.yylloc = {
535
- first_line: this.yylloc.first_line,
536
- last_line: this.yylineno + 1,
537
- first_column: this.yylloc.first_column,
538
- last_column: h ? (h.length === m.length ? this.yylloc.first_column : 0) + m[m.length - h.length].length - h[0].length : this.yylloc.first_column - l
539
- }, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
540
- }, "unput"),
541
- // When called from action, caches matched text and appends it on next action
542
- more: /* @__PURE__ */ y(function() {
543
- return this._more = !0, this;
544
- }, "more"),
545
- // 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.
546
- reject: /* @__PURE__ */ y(function() {
547
- if (this.options.backtrack_lexer)
548
- this._backtrack = !0;
549
- else
550
- 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).
551
- ` + this.showPosition(), {
552
- text: "",
553
- token: null,
554
- line: this.yylineno
555
- });
556
- return this;
557
- }, "reject"),
558
- // retain first n characters of the match
559
- less: /* @__PURE__ */ y(function(o) {
560
- this.unput(this.match.slice(o));
561
- }, "less"),
562
- // displays already matched input, i.e. for error messages
563
- pastInput: /* @__PURE__ */ y(function() {
564
- var o = this.matched.substr(0, this.matched.length - this.match.length);
565
- return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
566
- }, "pastInput"),
567
- // displays upcoming input, i.e. for error messages
568
- upcomingInput: /* @__PURE__ */ y(function() {
569
- var o = this.match;
570
- return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
571
- }, "upcomingInput"),
572
- // displays the character position where the lexing error occurred, i.e. for error messages
573
- showPosition: /* @__PURE__ */ y(function() {
574
- var o = this.pastInput(), l = new Array(o.length + 1).join("-");
575
- return o + this.upcomingInput() + `
576
- ` + l + "^";
577
- }, "showPosition"),
578
- // test the lexed token: return FALSE when not a match, otherwise return token
579
- test_match: /* @__PURE__ */ y(function(o, l) {
580
- var h, m, _;
581
- if (this.options.backtrack_lexer && (_ = {
582
- yylineno: this.yylineno,
583
- yylloc: {
584
- first_line: this.yylloc.first_line,
585
- last_line: this.last_line,
586
- first_column: this.yylloc.first_column,
587
- last_column: this.yylloc.last_column
588
- },
589
- yytext: this.yytext,
590
- match: this.match,
591
- matches: this.matches,
592
- matched: this.matched,
593
- yyleng: this.yyleng,
594
- offset: this.offset,
595
- _more: this._more,
596
- _input: this._input,
597
- yy: this.yy,
598
- conditionStack: this.conditionStack.slice(0),
599
- done: this.done
600
- }, this.options.ranges && (_.yylloc.range = this.yylloc.range.slice(0))), m = o[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
601
- first_line: this.yylloc.last_line,
602
- last_line: this.yylineno + 1,
603
- first_column: this.yylloc.last_column,
604
- last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
605
- }, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], h = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h)
606
- return h;
607
- if (this._backtrack) {
608
- for (var d in _)
609
- this[d] = _[d];
610
- return !1;
611
- }
612
- return !1;
613
- }, "test_match"),
614
- // return next match in input
615
- next: /* @__PURE__ */ y(function() {
616
- if (this.done)
617
- return this.EOF;
618
- this._input || (this.done = !0);
619
- var o, l, h, m;
620
- this._more || (this.yytext = "", this.match = "");
621
- for (var _ = this._currentRules(), d = 0; d < _.length; d++)
622
- if (h = this._input.match(this.rules[_[d]]), h && (!l || h[0].length > l[0].length)) {
623
- if (l = h, m = d, this.options.backtrack_lexer) {
624
- if (o = this.test_match(h, _[d]), o !== !1)
625
- return o;
626
- if (this._backtrack) {
627
- l = !1;
628
- continue;
629
- } else
630
- return !1;
631
- } else if (!this.options.flex)
632
- break;
633
- }
634
- return l ? (o = this.test_match(l, _[m]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
635
- ` + this.showPosition(), {
636
- text: "",
637
- token: null,
638
- line: this.yylineno
639
- });
640
- }, "next"),
641
- // return next match that has a token
642
- lex: /* @__PURE__ */ y(function() {
643
- var l = this.next();
644
- return l || this.lex();
645
- }, "lex"),
646
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
647
- begin: /* @__PURE__ */ y(function(l) {
648
- this.conditionStack.push(l);
649
- }, "begin"),
650
- // pop the previously active lexer condition state off the condition stack
651
- popState: /* @__PURE__ */ y(function() {
652
- var l = this.conditionStack.length - 1;
653
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
654
- }, "popState"),
655
- // produce the lexer rule set which is active for the currently active lexer condition state
656
- _currentRules: /* @__PURE__ */ y(function() {
657
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
658
- }, "_currentRules"),
659
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
660
- topState: /* @__PURE__ */ y(function(l) {
661
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
662
- }, "topState"),
663
- // alias for begin(condition)
664
- pushState: /* @__PURE__ */ y(function(l) {
665
- this.begin(l);
666
- }, "pushState"),
667
- // return the number of states currently on the stack
668
- stateStackSize: /* @__PURE__ */ y(function() {
669
- return this.conditionStack.length;
670
- }, "stateStackSize"),
671
- options: { "case-insensitive": !0 },
672
- performAction: /* @__PURE__ */ y(function(l, h, m, _) {
673
- switch (m) {
674
- case 0:
675
- return this.pushState("csv"), 4;
676
- case 1:
677
- return this.pushState("csv"), 4;
678
- case 2:
679
- return 10;
680
- case 3:
681
- return 5;
682
- case 4:
683
- return 12;
684
- case 5:
685
- return this.pushState("escaped_text"), 18;
686
- case 6:
687
- return 20;
688
- case 7:
689
- return this.popState("escaped_text"), 18;
690
- case 8:
691
- return 19;
692
- }
693
- }, "anonymous"),
694
- rules: [/^(?:sankey-beta\b)/i, /^(?:sankey\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],
695
- conditions: { csv: { rules: [2, 3, 4, 5, 6, 7, 8], inclusive: !1 }, escaped_text: { rules: [7, 8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8], inclusive: !0 } }
696
- };
697
- return k;
698
- })();
699
- u.lexer = x;
700
- function g() {
701
- this.yy = {};
702
- }
703
- return y(g, "Parser"), g.prototype = u, u.Parser = g, new g();
704
- })();
705
- at.parser = at;
706
- var K = at, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ y(() => {
707
- J = [], tt = [], Z = /* @__PURE__ */ new Map(), At();
708
- }, "clear"), W, Jt = (W = class {
709
- constructor(n, s, a = 0) {
710
- this.source = n, this.target = s, this.value = a;
711
- }
712
- }, y(W, "SankeyLink"), W), te = /* @__PURE__ */ y((t, n, s) => {
713
- J.push(new Jt(t, n, s));
714
- }, "addLink"), G, ee = (G = class {
715
- constructor(n) {
716
- this.ID = n;
717
- }
718
- }, y(G, "SankeyNode"), G), ne = /* @__PURE__ */ y((t) => {
719
- t = Tt.sanitizeText(t, lt());
720
- let n = Z.get(t);
721
- return n === void 0 && (n = new ee(t), Z.set(t, n), tt.push(n)), n;
722
- }, "findOrCreateNode"), ie = /* @__PURE__ */ y(() => tt, "getNodes"), re = /* @__PURE__ */ y(() => J, "getLinks"), se = /* @__PURE__ */ y(() => ({
723
- nodes: tt.map((t) => ({ id: t.ID })),
724
- links: J.map((t) => ({
725
- source: t.source.ID,
726
- target: t.target.ID,
727
- value: t.value
728
- }))
729
- }), "getGraph"), oe = {
730
- nodesMap: Z,
731
- getConfig: /* @__PURE__ */ y(() => lt().sankey, "getConfig"),
732
- getNodes: ie,
733
- getLinks: re,
734
- getGraph: se,
735
- addLink: te,
736
- findOrCreateNode: ne,
737
- getAccTitle: wt,
738
- setAccTitle: St,
739
- getAccDescription: bt,
740
- setAccDescription: vt,
741
- getDiagramTitle: _t,
742
- setDiagramTitle: xt,
743
- clear: Zt
744
- }, $, gt = ($ = class {
745
- static next(n) {
746
- return new $(n + ++$.count);
747
- }
748
- constructor(n) {
749
- this.id = n, this.href = `#${n}`;
750
- }
751
- toString() {
752
- return "url(" + this.href + ")";
753
- }
754
- }, y($, "Uid"), $.count = 0, $), ae = {
755
- left: It,
756
- right: Ot,
757
- center: $t,
758
- justify: kt
759
- }, le = /* @__PURE__ */ y((t) => {
760
- let n = 0, s = 0;
761
- for (const a of t) {
762
- const u = a.value ?? 0;
763
- u > n && (n = u, s = a.layer ?? 0);
764
- }
765
- return s;
766
- }, "findCentralNodeLayer"), ce = /* @__PURE__ */ y(function(t, n, s, a) {
767
- const { securityLevel: u, sankey: x } = lt(), g = Lt.sankey;
768
- let k;
769
- u === "sandbox" && (k = X("#i" + n));
770
- const o = u === "sandbox" ? X(k.nodes()[0].contentDocument.body) : X("body"), l = u === "sandbox" ? o.select(`[id="${n}"]`) : X(`[id="${n}"]`), h = x?.width ?? g.width, m = x?.height ?? g.width, _ = x?.useMaxWidth ?? g.useMaxWidth, d = x?.nodeAlignment ?? g.nodeAlignment, v = x?.prefix ?? g.prefix, T = x?.suffix ?? g.suffix, A = x?.showValues ?? g.showValues, M = x?.nodeWidth ?? g.nodeWidth ?? 10, I = x?.nodePadding ?? g.nodePadding ?? 12, N = x?.labelStyle ?? g.labelStyle ?? "legacy", D = x?.nodeColors ?? {}, S = a.db.getGraph(), C = ae[d];
771
- Bt().nodeId((e) => e.id).nodeWidth(M).nodePadding(I + (A ? 15 : 0)).nodeAlign(C).extent([
772
- [0, 0],
773
- [h, m]
774
- ])(S);
775
- const j = le(S.nodes), V = Mt(Ct), O = /* @__PURE__ */ y((e) => D[e] ?? V(e), "getNodeColor");
776
- l.append("g").attr("class", "nodes").selectAll(".node").data(S.nodes).join("g").attr("class", "node").attr("id", (e) => (e.uid = gt.next("node-")).id).attr("transform", function(e) {
777
- return "translate(" + e.x0 + "," + e.y0 + ")";
778
- }).attr("x", (e) => e.x0).attr("y", (e) => e.y0).append("rect").attr("height", (e) => e.y1 - e.y0).attr("width", (e) => e.x1 - e.x0).attr("fill", (e) => O(e.id));
779
- const z = /* @__PURE__ */ y(({ id: e, value: r }) => A ? `${e}
780
- ${v}${Math.round(r * 100) / 100}${T}` : e, "getText"), w = /* @__PURE__ */ y((e) => N === "outlined" ? (e.layer ?? 0) < j ? { x: e.x0 - 6, anchor: "end" } : { x: e.x1 + 6, anchor: "start" } : e.x0 < h / 2 ? { x: e.x1 + 6, anchor: "start" } : { x: e.x0 - 6, anchor: "end" }, "getLabelPosition"), P = l.append("g").attr("class", "node-labels").attr("font-size", 14), E = /* @__PURE__ */ y((e) => P.selectAll(e ? `.${e}` : "text").data(S.nodes).join("text").attr("class", e ?? null).attr("x", (r) => w(r).x).attr("y", (r) => (r.y1 + r.y0) / 2).attr("dy", `${A ? "0" : "0.35"}em`).attr("text-anchor", (r) => w(r).anchor).text(z), "appendLabel");
781
- N === "outlined" ? (E("sankey-label-bg"), E("sankey-label-fg")) : E();
782
- const i = l.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(S.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), f = x?.linkColor ?? "gradient";
783
- if (f === "gradient") {
784
- const e = i.append("linearGradient").attr("id", (r) => (r.uid = gt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (r) => r.source.x1).attr("x2", (r) => r.target.x0);
785
- e.append("stop").attr("offset", "0%").attr("stop-color", (r) => O(r.source.id)), e.append("stop").attr("offset", "100%").attr("stop-color", (r) => O(r.target.id));
786
- }
787
- let c;
788
- switch (f) {
789
- case "gradient":
790
- c = /* @__PURE__ */ y((e) => e.uid, "coloring");
791
- break;
792
- case "source":
793
- c = /* @__PURE__ */ y((e) => O(e.source.id), "coloring");
794
- break;
795
- case "target":
796
- c = /* @__PURE__ */ y((e) => O(e.target.id), "coloring");
797
- break;
798
- default:
799
- c = f;
800
- }
801
- i.append("path").attr("d", Kt()).attr("stroke", c).attr("stroke-width", (e) => Math.max(1, e.width)), Et(void 0, l, 0, _);
802
- }, "draw"), ue = {
803
- draw: ce
804
- }, he = /* @__PURE__ */ y((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
805
- `).trim(), "prepareTextForParsing"), fe = /* @__PURE__ */ y((t) => `.label {
806
- font-family: ${t.fontFamily};
807
- }
808
-
809
- .node-labels {
810
- font-family: ${t.fontFamily};
811
- }
812
-
813
- /* Outlined label style - background stroke for better readability */
814
- .sankey-label-bg {
815
- stroke: ${t.mainBkg || t.background || "#fff"};
816
- stroke-width: 4px;
817
- stroke-linejoin: round;
818
- paint-order: stroke;
819
- }
820
-
821
- /* Foreground label text */
822
- .sankey-label-fg {
823
- fill: ${t.textColor};
824
- }
825
-
826
- /* Node styling */
827
- .node rect {
828
- shape-rendering: crispEdges;
829
- }
830
-
831
- /* Link styling */
832
- .link {
833
- fill: none;
834
- stroke-opacity: 0.5;
835
- mix-blend-mode: multiply;
836
- }
837
- `, "getStyles"), ye = fe, de = K.parse.bind(K);
838
- K.parse = (t) => de(he(t));
839
- var ke = {
840
- styles: ye,
841
- parser: K,
842
- db: oe,
843
- renderer: ue
844
- };
845
- export {
846
- ke as diagram
847
- };