hexagon-editor 0.1.4 → 0.1.6

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 (118) hide show
  1. package/README.md +24 -11
  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/markup-editor.d.ts.map +1 -1
  21. package/dist/core.js +28 -31
  22. package/dist/extensions.js +1 -1
  23. package/dist/forms/MarkdownEditorImageForm.vue.d.ts +2 -2
  24. package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -1
  25. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +2 -2
  26. package/dist/forms/MarkdownEditorTextInput.vue.d.ts +2 -2
  27. package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -1
  28. package/dist/forms.js +1 -1
  29. package/dist/{full-C-o2lPBX.js → full-Da8esvj2.js} +1 -1
  30. package/dist/{full-specs-Cl-ODShc.js → full-specs-hXKoMF-0.js} +1 -1
  31. package/dist/index-D_CMntQU.js +3173 -0
  32. package/dist/index.css +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +3611 -1284
  36. package/dist/{markup-commands-BckOOKIe.js → markup-commands-BYsx8ADT.js} +1993 -1963
  37. package/dist/presets.js +2 -2
  38. package/dist/public-types.d.ts +22 -0
  39. package/dist/public-types.d.ts.map +1 -1
  40. package/dist/renderer/MarkdownRenderer.vue.d.ts +2 -0
  41. package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -1
  42. package/dist/renderer/markdown.d.ts +2 -1
  43. package/dist/renderer/markdown.d.ts.map +1 -1
  44. package/dist/renderer.css +1 -1
  45. package/dist/renderer.js +142 -146
  46. package/package.json +106 -108
  47. package/dist/MarkdownEditorLinkForm.css +0 -1
  48. package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +0 -87
  49. package/dist/arc-y6UeoJpJ.js +0 -83
  50. package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +0 -4778
  51. package/dist/base.css +0 -1
  52. package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +0 -2419
  53. package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +0 -1577
  54. package/dist/channel-BwXGcavV.js +0 -5
  55. package/dist/chunk-2GRJ4B5K-O75udjPr.js +0 -68
  56. package/dist/chunk-2Q5K7J3B-CySL0lOA.js +0 -15
  57. package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +0 -1408
  58. package/dist/chunk-5VM5RSS4--it1VJIv.js +0 -19
  59. package/dist/chunk-6Q2QTUOP-DNiML-50.js +0 -664
  60. package/dist/chunk-GF5L2VYU-z7A-k0-V.js +0 -1533
  61. package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +0 -8
  62. package/dist/chunk-KBJHAD2P-D4R1VW0r.js +0 -19
  63. package/dist/chunk-RYQCIY6F-DmJAYxq8.js +0 -313
  64. package/dist/chunk-XXDRQBXY-CK913N-t.js +0 -8
  65. package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +0 -16
  66. package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +0 -16
  67. package/dist/core/optional-renderers.d.ts +0 -9
  68. package/dist/core/optional-renderers.d.ts.map +0 -1
  69. package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +0 -2608
  70. package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +0 -23766
  71. package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +0 -299
  72. package/dist/cytoscape.esm-3W4EOjxC.js +0 -18756
  73. package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +0 -340
  74. package/dist/defaultLocale-BgPVtth8.js +0 -171
  75. package/dist/diagram-7IWD3JNH-BrApu1hz.js +0 -350
  76. package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +0 -461
  77. package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +0 -142
  78. package/dist/diagram-Q27KOJAE-DWIltqIH.js +0 -528
  79. package/dist/diagram-UB23O5K3-B7z2Lj3K.js +0 -219
  80. package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +0 -109
  81. package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +0 -910
  82. package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +0 -1638
  83. package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +0 -2711
  84. package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +0 -815
  85. package/dist/graph-DAHC4kPm.js +0 -1545
  86. package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +0 -24
  87. package/dist/init-DjUOC4st.js +0 -16
  88. package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +0 -621
  89. package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +0 -834
  90. package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +0 -724
  91. package/dist/katex-ByXcxnHy.js +0 -14436
  92. package/dist/katex-DoRnZ_sp.js +0 -11682
  93. package/dist/layout-DBbo_M5I.js +0 -1519
  94. package/dist/linear-BEdRfKba.js +0 -259
  95. package/dist/map-DRdzG8Ho.js +0 -224
  96. package/dist/markup-commands.css +0 -1
  97. package/dist/mermaid.core-CR0bA2Wa.js +0 -16496
  98. package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +0 -827
  99. package/dist/optional-renderers-BalvqqvY.js +0 -11
  100. package/dist/ordinal-B6-f3MAq.js +0 -61
  101. package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +0 -95
  102. package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +0 -207
  103. package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +0 -1023
  104. package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +0 -77
  105. package/dist/renderer/mermaid-runtime.d.ts +0 -4
  106. package/dist/renderer/mermaid-runtime.d.ts.map +0 -1
  107. package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +0 -882
  108. package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +0 -847
  109. package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +0 -2888
  110. package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +0 -46
  111. package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +0 -263
  112. package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +0 -16
  113. package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +0 -5332
  114. package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +0 -13
  115. package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +0 -1055
  116. package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +0 -1578
  117. package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +0 -675
  118. package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +0 -1388
@@ -1,11 +0,0 @@
1
- let e = {};
2
- function r(n) {
3
- e = { ...e, ...n };
4
- }
5
- function d() {
6
- return e;
7
- }
8
- export {
9
- r as c,
10
- d as g
11
- };
@@ -1,61 +0,0 @@
1
- import { i as a } from "./init-DjUOC4st.js";
2
- class o extends Map {
3
- constructor(n, t = g) {
4
- if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
5
- }
6
- get(n) {
7
- return super.get(c(this, n));
8
- }
9
- has(n) {
10
- return super.has(c(this, n));
11
- }
12
- set(n, t) {
13
- return super.set(l(this, n), t);
14
- }
15
- delete(n) {
16
- return super.delete(p(this, n));
17
- }
18
- }
19
- function c({ _intern: e, _key: n }, t) {
20
- const r = n(t);
21
- return e.has(r) ? e.get(r) : t;
22
- }
23
- function l({ _intern: e, _key: n }, t) {
24
- const r = n(t);
25
- return e.has(r) ? e.get(r) : (e.set(r, t), t);
26
- }
27
- function p({ _intern: e, _key: n }, t) {
28
- const r = n(t);
29
- return e.has(r) && (t = e.get(r), e.delete(r)), t;
30
- }
31
- function g(e) {
32
- return e !== null && typeof e == "object" ? e.valueOf() : e;
33
- }
34
- const f = /* @__PURE__ */ Symbol("implicit");
35
- function h() {
36
- var e = new o(), n = [], t = [], r = f;
37
- function s(u) {
38
- let i = e.get(u);
39
- if (i === void 0) {
40
- if (r !== f) return r;
41
- e.set(u, i = n.push(u) - 1);
42
- }
43
- return t[i % t.length];
44
- }
45
- return s.domain = function(u) {
46
- if (!arguments.length) return n.slice();
47
- n = [], e = new o();
48
- for (const i of u)
49
- e.has(i) || e.set(i, n.push(i) - 1);
50
- return s;
51
- }, s.range = function(u) {
52
- return arguments.length ? (t = Array.from(u), s) : t.slice();
53
- }, s.unknown = function(u) {
54
- return arguments.length ? (r = u, s) : r;
55
- }, s.copy = function() {
56
- return h(n, t).unknown(r);
57
- }, a.apply(s, arguments), s;
58
- }
59
- export {
60
- h as o
61
- };
@@ -1,95 +0,0 @@
1
- import { g as l, r as m, d as a } from "./chunk-6Q2QTUOP-DNiML-50.js";
2
- import { p } from "./chunk-JWPE2WC7-DAjx3Kjr.js";
3
- import { _ as t, l as o } from "./mermaid.core-CR0bA2Wa.js";
4
- import { M as u, d as c } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
- var f = c().RailroadPeg.parser.LangiumParser, i = /* @__PURE__ */ t((e) => {
6
- const r = e.alternatives.map(d);
7
- return r.length === 1 ? r[0] : {
8
- type: "choice",
9
- alternatives: r
10
- };
11
- }, "transformOrderedChoice"), d = /* @__PURE__ */ t((e) => {
12
- const r = e.elements.map(P);
13
- return r.length === 1 ? r[0] : {
14
- type: "sequence",
15
- elements: r
16
- };
17
- }, "transformSequence"), P = /* @__PURE__ */ t((e) => {
18
- const r = g(e.suffix);
19
- return e.operator ? {
20
- type: "special",
21
- text: e.operator === "&" ? `&${s(r)}` : `!${s(r)}`
22
- } : r;
23
- }, "transformPrefix"), s = /* @__PURE__ */ t((e) => {
24
- switch (e.type) {
25
- case "terminal":
26
- return `"${e.value}"`;
27
- case "nonterminal":
28
- return e.name;
29
- case "special":
30
- return e.text;
31
- default:
32
- return "(...)";
33
- }
34
- }, "nodeToLabel"), g = /* @__PURE__ */ t((e) => {
35
- const r = v(e.primary);
36
- if (!e.operator)
37
- return r;
38
- switch (e.operator) {
39
- case "?":
40
- return { type: "optional", element: r };
41
- case "*":
42
- return { type: "repetition", element: r, min: 0, max: 1 / 0 };
43
- case "+":
44
- return { type: "repetition", element: r, min: 1, max: 1 / 0 };
45
- default:
46
- throw new Error(`Unsupported PEG suffix operator: ${e.operator}`);
47
- }
48
- }, "transformSuffix"), v = /* @__PURE__ */ t((e) => {
49
- switch (e.$type) {
50
- case "PegLiteral":
51
- return {
52
- type: "terminal",
53
- value: e.value
54
- };
55
- case "PegIdentifier":
56
- return {
57
- type: "nonterminal",
58
- name: e.name
59
- };
60
- case "PegGroup":
61
- return i(e.element);
62
- case "PegAny":
63
- return {
64
- type: "special",
65
- text: e.dot
66
- };
67
- default:
68
- throw new Error(`Unsupported PEG primary node: ${e.$type}`);
69
- }
70
- }, "transformPrimary"), y = /* @__PURE__ */ t((e) => ({
71
- name: e.name,
72
- definition: i(e.definition)
73
- }), "transformRule"), h = /* @__PURE__ */ t((e) => {
74
- p(e, a), e.title && a.setTitle(e.title), e.rules.map((r) => a.addRule(y(r)));
75
- }, "populateDb"), b = {
76
- parse: /* @__PURE__ */ t((e) => {
77
- a.clear(), o.debug("[PEG Parser] Starting Langium parse");
78
- const r = f.parse(e);
79
- if (r.lexerErrors.length > 0 || r.parserErrors.length > 0)
80
- throw new u(r);
81
- const n = r.value;
82
- o.debug("[PEG Parser] Parsed rules:", n.rules.length), h(n), o.debug("[PEG Parser] Parse complete");
83
- }, "parse"),
84
- parser: {
85
- yy: a
86
- }
87
- }, $ = {
88
- parser: b,
89
- db: a,
90
- renderer: m,
91
- styles: l
92
- };
93
- export {
94
- $ as diagram
95
- };
@@ -1,207 +0,0 @@
1
- import { p as at } from "./chunk-JWPE2WC7-DAjx3Kjr.js";
2
- import { a2 as T, a5 as B, b5 as nt, g as rt, s as it, a as ot, b as st, o as lt, n as ct, _ as g, l as G, c as ut, A as dt, D as gt, K as pt, e as ht, p as ft, B as mt } from "./mermaid.core-CR0bA2Wa.js";
3
- import { p as vt } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
4
- import { d as Z } from "./arc-y6UeoJpJ.js";
5
- import { o as xt } from "./ordinal-B6-f3MAq.js";
6
- function St(t, r) {
7
- return r < t ? -1 : r > t ? 1 : r >= t ? 0 : NaN;
8
- }
9
- function yt(t) {
10
- return t;
11
- }
12
- function wt() {
13
- var t = yt, r = St, y = null, b = T(0), l = T(B), p = T(0);
14
- function i(e) {
15
- var n, s = (e = nt(e)).length, h, w, $ = 0, f = new Array(s), o = new Array(s), D = +b.apply(this, arguments), E = Math.min(B, Math.max(-B, l.apply(this, arguments) - D)), k, L = Math.min(Math.abs(E) / s, p.apply(this, arguments)), u = L * (E < 0 ? -1 : 1), A;
16
- for (n = 0; n < s; ++n)
17
- (A = o[f[n] = n] = +t(e[n], n, e)) > 0 && ($ += A);
18
- for (r != null ? f.sort(function(M, m) {
19
- return r(o[M], o[m]);
20
- }) : y != null && f.sort(function(M, m) {
21
- return y(e[M], e[m]);
22
- }), n = 0, w = $ ? (E - s * u) / $ : 0; n < s; ++n, D = k)
23
- h = f[n], A = o[h], k = D + (A > 0 ? A * w : 0) + u, o[h] = {
24
- data: e[h],
25
- index: n,
26
- value: A,
27
- startAngle: D,
28
- endAngle: k,
29
- padAngle: L
30
- };
31
- return o;
32
- }
33
- return i.value = function(e) {
34
- return arguments.length ? (t = typeof e == "function" ? e : T(+e), i) : t;
35
- }, i.sortValues = function(e) {
36
- return arguments.length ? (r = e, y = null, i) : r;
37
- }, i.sort = function(e) {
38
- return arguments.length ? (y = e, r = null, i) : y;
39
- }, i.startAngle = function(e) {
40
- return arguments.length ? (b = typeof e == "function" ? e : T(+e), i) : b;
41
- }, i.endAngle = function(e) {
42
- return arguments.length ? (l = typeof e == "function" ? e : T(+e), i) : l;
43
- }, i.padAngle = function(e) {
44
- return arguments.length ? (p = typeof e == "function" ? e : T(+e), i) : p;
45
- }, i;
46
- }
47
- var At = mt.pie, I = {
48
- sections: /* @__PURE__ */ new Map(),
49
- showData: !1
50
- }, F = I.sections, V = I.showData, Ct = structuredClone(At), $t = /* @__PURE__ */ g(() => structuredClone(Ct), "getConfig"), Dt = /* @__PURE__ */ g(() => {
51
- F = /* @__PURE__ */ new Map(), V = I.showData, ft();
52
- }, "clear"), Tt = /* @__PURE__ */ g(({ label: t, value: r }) => {
53
- if (r < 0)
54
- throw new Error(
55
- `"${t}" has invalid value: ${r}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
56
- );
57
- F.has(t) || (F.set(t, r), G.debug(`added new section: ${t}, with value: ${r}`));
58
- }, "addSection"), bt = /* @__PURE__ */ g(() => F, "getSections"), kt = /* @__PURE__ */ g((t) => {
59
- V = t;
60
- }, "setShowData"), zt = /* @__PURE__ */ g(() => V, "getShowData"), q = {
61
- getConfig: $t,
62
- clear: Dt,
63
- setDiagramTitle: ct,
64
- getDiagramTitle: lt,
65
- setAccTitle: st,
66
- getAccTitle: ot,
67
- setAccDescription: it,
68
- getAccDescription: rt,
69
- addSection: Tt,
70
- getSections: bt,
71
- setShowData: kt,
72
- getShowData: zt
73
- }, Et = /* @__PURE__ */ g((t, r) => {
74
- at(t, r), r.setShowData(t.showData), t.sections.map(r.addSection);
75
- }, "populateDb"), Mt = {
76
- parse: /* @__PURE__ */ g(async (t) => {
77
- const r = await vt("pie", t);
78
- G.debug(r), Et(r, q);
79
- }, "parse")
80
- }, Rt = /* @__PURE__ */ g((t) => `
81
- .pieCircle{
82
- stroke: ${t.pieStrokeColor};
83
- stroke-width : ${t.pieStrokeWidth};
84
- opacity : ${t.pieOpacity};
85
- }
86
- .pieCircle.highlighted{
87
- scale: 1.05;
88
- opacity: 1;
89
- }
90
- .pieCircle.highlightedOnHover:hover{
91
- transition-duration: 250ms;
92
- scale: 1.05;
93
- opacity: 1;
94
- }
95
- .pieOuterCircle{
96
- stroke: ${t.pieOuterStrokeColor};
97
- stroke-width: ${t.pieOuterStrokeWidth};
98
- fill: none;
99
- }
100
- .pieTitleText {
101
- text-anchor: middle;
102
- font-size: ${t.pieTitleTextSize};
103
- fill: ${t.pieTitleTextColor};
104
- font-family: ${t.fontFamily};
105
- }
106
- .slice {
107
- font-family: ${t.fontFamily};
108
- fill: ${t.pieSectionTextColor};
109
- font-size:${t.pieSectionTextSize};
110
- // fill: white;
111
- }
112
- .legend text {
113
- fill: ${t.pieLegendTextColor};
114
- font-family: ${t.fontFamily};
115
- font-size: ${t.pieLegendTextSize};
116
- }
117
- `, "getStyles"), Lt = Rt, Wt = /* @__PURE__ */ g((t) => {
118
- const r = [...t.values()].reduce((l, p) => l + p, 0), y = [...t.entries()].map(([l, p]) => ({ label: l, value: p })).filter((l) => l.value / r * 100 >= 1);
119
- return wt().value((l) => l.value).sort(null)(y);
120
- }, "createPieArcs"), _t = /* @__PURE__ */ g((t, r, y, b) => {
121
- G.debug(`rendering pie chart
122
- ` + t);
123
- const l = b.db, p = ut(), i = dt(l.getConfig(), p.pie), e = 40, n = 18, s = 4, h = 450, w = h, $ = gt(r), f = $.append("g");
124
- f.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")");
125
- const { themeVariables: o } = p;
126
- let [D] = pt(o.pieOuterStrokeWidth);
127
- D ??= 2;
128
- const E = i.legendPosition, k = i.textPosition, L = i.donutHole > 0 && i.donutHole <= 0.9 ? i.donutHole : 0, u = Math.min(w, h) / 2 - e, A = Z().innerRadius(L * u).outerRadius(u), M = Z().innerRadius(u * k).outerRadius(u * k), m = f.append("g");
129
- m.append("circle").attr("cx", 0).attr("cy", 0).attr("r", u + D / 2).attr("class", "pieOuterCircle");
130
- const W = l.getSections(), J = Wt(W), Q = [
131
- o.pie1,
132
- o.pie2,
133
- o.pie3,
134
- o.pie4,
135
- o.pie5,
136
- o.pie6,
137
- o.pie7,
138
- o.pie8,
139
- o.pie9,
140
- o.pie10,
141
- o.pie11,
142
- o.pie12
143
- ];
144
- let H = 0;
145
- W.forEach((a) => {
146
- H += a;
147
- });
148
- const U = J.filter((a) => (a.data.value / H * 100).toFixed(0) !== "0"), N = xt(Q).domain([
149
- ...W.keys()
150
- ]);
151
- m.selectAll("mySlices").data(U).enter().append("path").attr("d", A).attr("fill", (a) => N(a.data.label)).attr("class", (a) => {
152
- let c = "pieCircle";
153
- return i.highlightSlice === "hover" ? c += " highlightedOnHover" : i.highlightSlice === a.data.label && (c += " highlighted"), c;
154
- }), m.selectAll("mySlices").data(U).enter().append("text").text((a) => (a.data.value / H * 100).toFixed(0) + "%").attr("transform", (a) => "translate(" + M.centroid(a) + ")").style("text-anchor", "middle").attr("class", "slice");
155
- const Y = f.append("text").text(l.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText"), R = [...W.entries()].map(([a, c]) => ({
156
- label: a,
157
- value: c
158
- })), C = f.selectAll(".legend").data(R).enter().append("g").attr("class", "legend");
159
- C.append("rect").attr("width", n).attr("height", n).style("fill", (a) => N(a.label)).style("stroke", (a) => N(a.label)), C.append("text").attr("x", n + s).attr("y", n - s).text((a) => l.getShowData() ? `${a.label} [${a.value}]` : a.label);
160
- const z = Math.max(
161
- ...C.selectAll("text").nodes().map((a) => a?.getBoundingClientRect().width ?? 0)
162
- );
163
- let _ = h, O = w + e;
164
- const d = n + s, P = R.length * d;
165
- switch (E) {
166
- case "center":
167
- C.attr("transform", (a, c) => {
168
- const v = d * R.length / 2, x = -z / 2 - (n + s), S = c * d - v;
169
- return "translate(" + x + "," + S + ")";
170
- });
171
- break;
172
- case "top":
173
- _ += P, C.attr("transform", (a, c) => {
174
- const v = u, x = -z / 2 - (n + s), S = c * d - v;
175
- return `translate(${x}, ${S})`;
176
- }), m.attr("transform", () => `translate(0, ${P + d})`);
177
- break;
178
- case "bottom":
179
- _ += P, C.attr("transform", (a, c) => {
180
- const v = -u - d, x = -z / 2 - (n + s), S = c * d - v;
181
- return "translate(" + x + "," + S + ")";
182
- });
183
- break;
184
- case "left":
185
- O += n + s + z, C.attr("transform", (a, c) => {
186
- const v = d * R.length / 2, x = -u - (n + s), S = c * d - v;
187
- return "translate(" + x + "," + S + ")";
188
- }), m.attr("transform", () => `translate(${z + n + s}, 0)`);
189
- break;
190
- default:
191
- O += n + s + z, C.attr("transform", (a, c) => {
192
- const v = d * R.length / 2, x = 12 * n, S = c * d - v;
193
- return "translate(" + x + "," + S + ")";
194
- });
195
- break;
196
- }
197
- const j = Y.node()?.getBoundingClientRect().width ?? 0, tt = w / 2 - j / 2, et = w / 2 + j / 2, K = Math.min(0, tt), X = Math.max(O, et) - K;
198
- $.attr("viewBox", `${K} 0 ${X} ${_}`), ht($, _, X, i.useMaxWidth);
199
- }, "draw"), Ft = { draw: _t }, It = {
200
- parser: Mt,
201
- db: q,
202
- renderer: Ft,
203
- styles: Lt
204
- };
205
- export {
206
- It as diagram
207
- };