@draftably/editor 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +4 -5
  2. package/dist/assets/{engine.worker-DmHew5f6.js → engine.worker-DwN9io_m.js} +2765 -2722
  3. package/dist/element.js +1 -1
  4. package/dist/index.js +19553 -2
  5. package/dist/types/src/components/controls.d.ts +8 -5
  6. package/dist/types/src/state/canvas-commands.d.ts +169 -0
  7. package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
  8. package/dist/types/src/state/links.d.ts +4 -1
  9. package/dist/types/src/state/workspace.d.ts +3 -0
  10. package/package.json +1 -1
  11. package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
  12. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
  13. package/dist/chunks/arc-rJj0TtXf.js +0 -83
  14. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
  15. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
  16. package/dist/chunks/browser-iNhbPsGc.js +0 -40
  17. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
  18. package/dist/chunks/channel-qMvPU6eH.js +0 -5
  19. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
  20. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
  21. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
  22. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
  23. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
  24. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
  25. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
  26. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
  27. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
  28. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
  29. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
  30. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
  31. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
  32. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
  33. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
  34. package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
  35. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
  36. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
  37. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
  38. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
  39. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
  40. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
  41. package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
  42. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
  43. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
  44. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
  45. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
  46. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
  47. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
  48. package/dist/chunks/graph-CKJmgLki.js +0 -1541
  49. package/dist/chunks/import-core-C-I1wGfw.js +0 -145
  50. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
  51. package/dist/chunks/init-DjUOC4st.js +0 -16
  52. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
  53. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
  54. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
  55. package/dist/chunks/katex-BsrBVQKd.js +0 -11314
  56. package/dist/chunks/linear-4t7D_ros.js +0 -259
  57. package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
  58. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
  59. package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
  60. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
  61. package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
  62. package/dist/chunks/ordinal-DfAQgscy.js +0 -61
  63. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
  64. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
  65. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
  66. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
  67. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
  68. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
  69. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
  70. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
  71. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
  72. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
  73. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
  74. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
  75. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
  76. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
  77. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
  78. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
  79. package/dist/types/src/import/browser.d.ts +0 -3
  80. package/dist/types/src/import/detect.d.ts +0 -31
  81. package/dist/types/src/import/dot-importer.d.ts +0 -3
  82. package/dist/types/src/import/import-core.d.ts +0 -105
  83. package/dist/types/src/import/mermaid-facade.d.ts +0 -120
  84. package/dist/types/src/import/mermaid-importer.d.ts +0 -4
  85. package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
  86. package/dist/types/src/import/scratch.d.ts +0 -3
  87. package/dist/types/src/lib/source-hash.d.ts +0 -7
  88. package/dist/types/src/model/candidates.d.ts +0 -53
  89. package/dist/types/src/model/examples.d.ts +0 -15
  90. package/dist/types/src/model/label-hits.d.ts +0 -27
  91. package/dist/types/src/model/static-scene.d.ts +0 -15
  92. package/dist/types/src/state/commands.d.ts +0 -529
  93. package/dist/types/src/state/comparison.d.ts +0 -151
  94. package/dist/types/src/state/files.d.ts +0 -61
  95. package/dist/types/src/state/keyboard.d.ts +0 -6
  96. package/dist/types/src/state/launch.d.ts +0 -61
  97. package/dist/types/src/state/ui.d.ts +0 -39
@@ -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 = 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-2E7WHVMD-BEZwsFS3.js";
2
- import { p } from "./chunk-JWPE2WC7-CnAFS2xF.js";
3
- import { _ as t, l as o } from "./mermaid.core-DXv6D2Sm.js";
4
- import { M as u, d as c } from "./cynefin-EF2NZ3EQ-Bt6b88hY.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,208 +0,0 @@
1
- import { p as at } from "./chunk-JWPE2WC7-CnAFS2xF.js";
2
- import { aa as T, ad as G, bc as rt, g as nt, s as it, a as ot, b as st, t as lt, q as ct, _ as g, l as B, c as dt, N as ut, Q as gt, V as pt, d as ht, A as ft, O as mt } from "./mermaid.core-DXv6D2Sm.js";
3
- import { p as vt } from "./cynefin-EF2NZ3EQ-Bt6b88hY.js";
4
- import { d as X } from "./arc-rJj0TtXf.js";
5
- import { o as xt } from "./ordinal-DfAQgscy.js";
6
- function St(t, n) {
7
- return n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN;
8
- }
9
- function yt(t) {
10
- return t;
11
- }
12
- function wt() {
13
- var t = yt, n = St, y = null, b = T(0), l = T(G), p = T(0);
14
- function i(e) {
15
- var r, s = (e = rt(e)).length, h, w, $ = 0, f = new Array(s), o = new Array(s), D = +b.apply(this, arguments), E = Math.min(G, Math.max(-G, l.apply(this, arguments) - D)), k, L = Math.min(Math.abs(E) / s, p.apply(this, arguments)), d = L * (E < 0 ? -1 : 1), A;
16
- for (r = 0; r < s; ++r)
17
- (A = o[f[r] = r] = +t(e[r], r, e)) > 0 && ($ += A);
18
- for (n != null ? f.sort(function(M, m) {
19
- return n(o[M], o[m]);
20
- }) : y != null && f.sort(function(M, m) {
21
- return y(e[M], e[m]);
22
- }), r = 0, w = $ ? (E - s * d) / $ : 0; r < s; ++r, D = k)
23
- h = f[r], A = o[h], k = D + (A > 0 ? A * w : 0) + d, o[h] = {
24
- data: e[h],
25
- index: r,
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 ? (n = e, y = null, i) : n;
37
- }, i.sort = function(e) {
38
- return arguments.length ? (y = e, n = 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
- }, W = I.sections, V = I.showData, Ct = structuredClone(At), $t = /* @__PURE__ */ g(() => structuredClone(Ct), "getConfig"), Dt = /* @__PURE__ */ g(() => {
51
- W = /* @__PURE__ */ new Map(), V = I.showData, ft();
52
- }, "clear"), Tt = /* @__PURE__ */ g(({ label: t, value: n }) => {
53
- if (n < 0)
54
- throw new Error(
55
- `"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
56
- );
57
- W.has(t) || (W.set(t, n), B.debug(`added new section: ${t}, with value: ${n}`));
58
- }, "addSection"), bt = /* @__PURE__ */ g(() => W, "getSections"), kt = /* @__PURE__ */ g((t) => {
59
- V = t;
60
- }, "setShowData"), zt = /* @__PURE__ */ g(() => V, "getShowData"), Z = {
61
- getConfig: $t,
62
- clear: Dt,
63
- setDiagramTitle: ct,
64
- getDiagramTitle: lt,
65
- setAccTitle: st,
66
- getAccTitle: ot,
67
- setAccDescription: it,
68
- getAccDescription: nt,
69
- addSection: Tt,
70
- getSections: bt,
71
- setShowData: kt,
72
- getShowData: zt
73
- }, Et = /* @__PURE__ */ g((t, n) => {
74
- at(t, n), n.setShowData(t.showData), t.sections.map(n.addSection);
75
- }, "populateDb"), Mt = {
76
- parse: /* @__PURE__ */ g(async (t) => {
77
- const n = await vt("pie", t);
78
- B.debug(n), Et(n, Z);
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, Nt = /* @__PURE__ */ g((t) => {
118
- const n = [...t.values()].reduce((l, p) => l + p, 0), y = [...t.entries()].map(([l, p]) => ({ label: l, value: p })).filter((l) => l.value / n * 100 >= 1);
119
- return wt().value((l) => l.value).sort(null)(y);
120
- }, "createPieArcs"), Ot = /* @__PURE__ */ g((t, n, y, b) => {
121
- B.debug(`rendering pie chart
122
- ` + t);
123
- const l = b.db, p = dt(), i = ut(l.getConfig(), p.pie), e = 40, r = 18, s = 4, h = 450, w = h, $ = gt(n), 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, d = Math.min(w, h) / 2 - e, A = X().innerRadius(L * d).outerRadius(d), M = X().innerRadius(d * k).outerRadius(d * k), m = f.append("g");
129
- m.append("circle").attr("cx", 0).attr("cy", 0).attr("r", d + D / 2).attr("class", "pieOuterCircle");
130
- const N = l.getSections(), J = Nt(N), K = [
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 _ = 0;
145
- N.forEach((a) => {
146
- _ += a;
147
- });
148
- const U = J.filter((a) => (a.data.value / _ * 100).toFixed(0) !== "0"), F = xt(K).domain([
149
- ...N.keys()
150
- ]);
151
- m.selectAll("mySlices").data(U).enter().append("path").attr("d", A).attr("fill", (a) => F(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 / _ * 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 = [...N.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", r).attr("height", r).style("fill", (a) => F(a.label)).style("stroke", (a) => F(a.label)), C.append("text").attr("x", r + s).attr("y", r - 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 O = h, H = w + e;
164
- const u = r + s, P = R.length * u;
165
- switch (E) {
166
- case "center":
167
- C.attr("transform", (a, c) => {
168
- const v = u * R.length / 2, x = -z / 2 - (r + s), S = c * u - v;
169
- return "translate(" + x + "," + S + ")";
170
- });
171
- break;
172
- case "top":
173
- O += P, C.attr("transform", (a, c) => {
174
- const v = d, x = -z / 2 - (r + s), S = c * u - v;
175
- return `translate(${x}, ${S})`;
176
- }), m.attr("transform", () => `translate(0, ${P + u})`);
177
- break;
178
- case "bottom":
179
- O += P, C.attr("transform", (a, c) => {
180
- const v = -d - u, x = -z / 2 - (r + s), S = c * u - v;
181
- return "translate(" + x + "," + S + ")";
182
- });
183
- break;
184
- case "left":
185
- H += r + s + z, C.attr("transform", (a, c) => {
186
- const v = u * R.length / 2, x = -d - (r + s), S = c * u - v;
187
- return "translate(" + x + "," + S + ")";
188
- }), m.attr("transform", () => `translate(${z + r + s}, 0)`);
189
- break;
190
- case "right":
191
- default:
192
- H += r + s + z, C.attr("transform", (a, c) => {
193
- const v = u * R.length / 2, x = 12 * r, S = c * u - v;
194
- return "translate(" + x + "," + S + ")";
195
- });
196
- break;
197
- }
198
- const j = Y.node()?.getBoundingClientRect().width ?? 0, tt = w / 2 - j / 2, et = w / 2 + j / 2, q = Math.min(0, tt), Q = Math.max(H, et) - q;
199
- $.attr("viewBox", `${q} 0 ${Q} ${O}`), ht($, O, Q, i.useMaxWidth);
200
- }, "draw"), Wt = { draw: Ot }, It = {
201
- parser: Mt,
202
- db: Z,
203
- renderer: Wt,
204
- styles: Lt
205
- };
206
- export {
207
- It as diagram
208
- };