@marimo-team/islands 0.14.11-dev2 → 0.14.11-dev21

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 (71) hide show
  1. package/dist/{ConnectedDataExplorerComponent-Dl7Gx8nj.js → ConnectedDataExplorerComponent-B98UAJGl.js} +4 -4
  2. package/dist/{ImageComparisonComponent-IsA0pccG.js → ImageComparisonComponent-3rx-X1eA.js} +1 -1
  3. package/dist/{VegaLite-C3jfIIJl.js → VegaLite-bssctYsi.js} +6961 -7180
  4. package/dist/{_baseUniq-DXGCzwrs.js → _baseUniq-n5nuGCm-.js} +36 -36
  5. package/dist/{any-language-editor-BbtP_crK.js → any-language-editor-CTuUQiXP.js} +1 -1
  6. package/dist/{architectureDiagram-IEHRJDOE-B5UTatfK.js → architectureDiagram-NQ2NVSRB-Ghs-gTjF.js} +897 -894
  7. package/dist/assets/{worker-BcyuOSTi.js → save-worker-fI5ofStJ.js} +1076 -1649
  8. package/dist/assets/{save-worker-BIDtxCd1.js → worker-Bfk1FrzG.js} +1627 -1747
  9. package/dist/assets/worker-BldghCZh.js +3752 -0
  10. package/dist/{blockDiagram-JOT3LUYC-BsdaPVqe.js → blockDiagram-PHRCVELO-BJrdpvE8.js} +534 -522
  11. package/dist/{c4Diagram-VJAJSXHY-mAt84R4z.js → c4Diagram-6F6E4RAY-C3mvzJPu.js} +4 -4
  12. package/dist/{channel-BQIWHLpc.js → channel-Dv_KwBSx.js} +1 -1
  13. package/dist/{chunk-4BMEZGHF-CKIxJWxP.js → chunk-353BL4L5-DE1uUKLI.js} +1 -1
  14. package/dist/{chunk-D6G4REZN-CgGV16Ao.js → chunk-67H74DCK-BSe-uUSS.js} +1 -1
  15. package/dist/chunk-6OLS64BW-lmSfyWue.js +1383 -0
  16. package/dist/{chunk-XZIHB7SX-Bwue5JjE.js → chunk-AACKK3MU-DAmuROVD.js} +1 -1
  17. package/dist/chunk-BFAMUDN2-D9C6R9UM.js +8 -0
  18. package/dist/chunk-E2GYISFI-BzFDmP6o.js +19 -0
  19. package/dist/{chunk-A2AXSNBT-wMvlVMnZ.js → chunk-QEP2MXWD-BILXx23p.js} +30 -27
  20. package/dist/chunk-SKB7J2MH-CxMkQppY.js +20 -0
  21. package/dist/{classDiagram-GIVACNV2-DOmcKRwM.js → classDiagram-BGRH5UQR-BbYr5aD9.js} +2 -2
  22. package/dist/{classDiagram-v2-COTLJTTW-DOmcKRwM.js → classDiagram-v2-O24JOBDK-BbYr5aD9.js} +2 -2
  23. package/dist/{clone-PHSHUhb-.js → clone-DuBujAk0.js} +1 -1
  24. package/dist/{dagre-OKDRZEBW-D5HNBllU.js → dagre-FFZHY6LT-DO5nLpLx.js} +8 -8
  25. package/dist/{data-editor-Coz_zrsX.js → data-editor-C8yM5wyh.js} +213 -201
  26. package/dist/diagram-3EMPZRKU-B1rYMJMS.js +313 -0
  27. package/dist/diagram-5UYTHUR4-BUu8PsmE.js +137 -0
  28. package/dist/{diagram-SSKATNLV-BsO89QJN.js → diagram-ZTM2IBQH-lz_uZrYh.js} +3 -3
  29. package/dist/{erDiagram-Q7BY3M3F-DWIMKTfS.js → erDiagram-R3QVA2FD-D_A2jrJV.js} +6 -5
  30. package/dist/{flowDiagram-4HSFHLVR-CnO0wmaL.js → flowDiagram-PKI6S5ZS-Bv6D_bIf.js} +283 -278
  31. package/dist/{ganttDiagram-APWFNJXF-otclLFL4.js → ganttDiagram-EK5VF46D-CbkaARm4.js} +453 -439
  32. package/dist/{gitGraphDiagram-7IBYFJ6S-C7F3RAja.js → gitGraphDiagram-GW3U2K7C-B8ZGoOT-.js} +35 -35
  33. package/dist/{graph-Btsdly6D.js → graph-txVVq_De.js} +3 -3
  34. package/dist/{index-BreCkhLm.js → index-BI6tloBb.js} +3 -3
  35. package/dist/{index-CcRF-HlA.js → index-CFJazcU-.js} +4 -4
  36. package/dist/{index-BGmzdYRo.js → index-OiR0LgXX.js} +6 -3
  37. package/dist/{index-z8OyYHEh.js → index-fJDj-gSp.js} +1 -1
  38. package/dist/index-pBmAzQJl.js +235 -0
  39. package/dist/{infoDiagram-PH2N3AL5-BwcXDzwE.js → infoDiagram-RLU2ROGC-DJw6nWp0.js} +5 -3
  40. package/dist/journeyDiagram-EWQZEKCU-1oCDdLcB.js +836 -0
  41. package/dist/{kanban-definition-NDS4AKOZ-3NJYjnpz.js → kanban-definition-ILFWEQ3N-nKJ02Ox0.js} +41 -39
  42. package/dist/{layout-qfivsCI_.js → layout-CbUwX9d6.js} +49 -49
  43. package/dist/{linear-D_Kojy5s.js → linear-sn9_bxtB.js} +22 -22
  44. package/dist/{main-DLuap1gp.js → main-D9-48wlP.js} +45053 -45130
  45. package/dist/main.js +1 -1
  46. package/dist/{mermaid-DCIbF0Rd.js → mermaid-CRRCnedu.js} +4925 -4853
  47. package/dist/min-CYaGuxZ4.js +80 -0
  48. package/dist/{mindmap-definition-ALO5MXBD-BtSBR7-c.js → mindmap-definition-CZNETY7S-CV62GMPJ.js} +3 -3
  49. package/dist/{pieDiagram-IB7DONF6-TiB_3g9z.js → pieDiagram-NIOCPIFQ-Bcs4p6kX.js} +3 -3
  50. package/dist/{quadrantDiagram-7GDLP6J5-B0DPjp7Z.js → quadrantDiagram-2OG54O6I-BlY5yea6.js} +2 -2
  51. package/dist/{react-plotly-BXWB3UQ5.js → react-plotly-B1SKP2B-.js} +1 -1
  52. package/dist/{requirementDiagram-KVF5MWMF-D_IlbRr_.js → requirementDiagram-SO3GGRV7-rmiJc5mh.js} +5 -4
  53. package/dist/{sankeyDiagram-QLVOVGJD-BHm9uvp_.js → sankeyDiagram-4UZDY2LN-TVzOLFCA.js} +11 -11
  54. package/dist/{sequenceDiagram-X6HHIX6F-3wcWWNtl.js → sequenceDiagram-ZIKVLSP4-POBNIgPB.js} +151 -149
  55. package/dist/{slides-component-JEGZbKgL.js → slides-component-5Y9DQzeV.js} +969 -962
  56. package/dist/stateDiagram-XX37X6EN-lR-7TG5f.js +264 -0
  57. package/dist/{stateDiagram-v2-YXO3MK2T-DTdt4vFc.js → stateDiagram-v2-GD6S3NHB-CYV2YCSY.js} +2 -2
  58. package/dist/style.css +1 -1
  59. package/dist/{time-DyZM4tB4.js → time-BytuUgXk.js} +2 -2
  60. package/dist/{timeline-definition-BDJGKUSR-Of4cvbYH.js → timeline-definition-RI47OAVP-DOrNrVHk.js} +99 -102
  61. package/dist/{radar-MK3ICKWK-BMSp8zaN.js → treemap-FKARHQ26-BOli4yXg.js} +2469 -2330
  62. package/dist/{vega-component-Dwc_9OTG.js → vega-component-KZ-3GH6H.js} +21 -21
  63. package/dist/{xychartDiagram-VJFVF3MP-5Jc993Va.js → xychartDiagram-H2YORKM3-CUOFDcIy.js} +409 -375
  64. package/package.json +37 -37
  65. package/dist/assets/worker-Dz6PPEGc.js +0 -4115
  66. package/dist/chunk-AEK57VVT-BAi7QtEw.js +0 -1416
  67. package/dist/chunk-RZ5BOZE2-D7Ag0UF8.js +0 -24
  68. package/dist/diagram-VNBRO52H-CA8VTm7L.js +0 -126
  69. package/dist/journeyDiagram-U35MCT3I-Co4hTdu9.js +0 -809
  70. package/dist/min-CQBZldos.js +0 -80
  71. package/dist/stateDiagram-DGXRK772-DbH3Rdz4.js +0 -271
@@ -0,0 +1,313 @@
1
+ import { s as re } from "./chunk-SKB7J2MH-CxMkQppY.js";
2
+ import { _ as p, s as ne, g as oe, t as ce, q as ie, a as de, b as pe, F as K, G as U, K as he, e as me, l as G, aa as L, d as H, ab as fe, z as ue, H as ge } from "./mermaid-CRRCnedu.js";
3
+ import { p as ye } from "./chunk-353BL4L5-DE1uUKLI.js";
4
+ import { I as Se } from "./chunk-AACKK3MU-DAmuROVD.js";
5
+ import { p as xe } from "./treemap-FKARHQ26-BOli4yXg.js";
6
+ import { f as W } from "./main-D9-48wlP.js";
7
+ import { o as B } from "./ordinal-CYN5qNoq.js";
8
+ import { h as be, t as ve } from "./index-pBmAzQJl.js";
9
+ var Ce = {
10
+ nodes: [],
11
+ levels: /* @__PURE__ */ new Map(),
12
+ outerNodes: [],
13
+ classes: /* @__PURE__ */ new Map()
14
+ }, C = new Se(() => structuredClone(Ce)), we = /* @__PURE__ */ p(() => {
15
+ const r = ge, a = U();
16
+ return K({
17
+ ...r.treemap,
18
+ ...a.treemap ?? {}
19
+ });
20
+ }, "getConfig"), Le = /* @__PURE__ */ p(() => C.records.nodes, "getNodes"), $e = /* @__PURE__ */ p((r, a) => {
21
+ const c = C.records;
22
+ c.nodes.push(r), c.levels.set(r, a), a === 0 && c.outerNodes.push(r), a === 0 && !c.root && (c.root = r);
23
+ }, "addNode"), Te = /* @__PURE__ */ p(() => ({ name: "", children: C.records.outerNodes }), "getRoot"), Fe = /* @__PURE__ */ p((r, a) => {
24
+ const c = C.records.classes, o = c.get(r) ?? { id: r, styles: [], textStyles: [] };
25
+ c.set(r, o);
26
+ const i = a.replace(/\\,/g, "\xA7\xA7\xA7").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
27
+ i && i.forEach((s) => {
28
+ fe(s) && ((o == null ? void 0 : o.textStyles) ? o.textStyles.push(s) : o.textStyles = [s]), (o == null ? void 0 : o.styles) ? o.styles.push(s) : o.styles = [s];
29
+ }), c.set(r, o);
30
+ }, "addClass"), ze = /* @__PURE__ */ p(() => C.records.classes, "getClasses"), Ne = /* @__PURE__ */ p((r) => {
31
+ var _a;
32
+ return ((_a = C.records.classes.get(r)) == null ? void 0 : _a.styles) ?? [];
33
+ }, "getStylesForClass"), ke = /* @__PURE__ */ p(() => {
34
+ ue(), C.reset();
35
+ }, "clear"), D = {
36
+ getNodes: Le,
37
+ addNode: $e,
38
+ getRoot: Te,
39
+ getConfig: we,
40
+ clear: ke,
41
+ setAccTitle: pe,
42
+ getAccTitle: de,
43
+ setDiagramTitle: ie,
44
+ getDiagramTitle: ce,
45
+ getAccDescription: oe,
46
+ setAccDescription: ne,
47
+ addClass: Fe,
48
+ getClasses: ze,
49
+ getStylesForClass: Ne
50
+ };
51
+ function J(r) {
52
+ if (!r.length)
53
+ return [];
54
+ const a = [], c = [];
55
+ return r.forEach((o) => {
56
+ const i = {
57
+ name: o.name,
58
+ children: o.type === "Leaf" ? void 0 : []
59
+ };
60
+ for (i.classSelector = o == null ? void 0 : o.classSelector, (o == null ? void 0 : o.cssCompiledStyles) && (i.cssCompiledStyles = [o.cssCompiledStyles]), o.type === "Leaf" && o.value !== void 0 && (i.value = o.value); c.length > 0 && c[c.length - 1].level >= o.level; )
61
+ c.pop();
62
+ if (c.length === 0)
63
+ a.push(i);
64
+ else {
65
+ const s = c[c.length - 1].node;
66
+ s.children ? s.children.push(i) : s.children = [i];
67
+ }
68
+ o.type !== "Leaf" && c.push({ node: i, level: o.level });
69
+ }), a;
70
+ }
71
+ p(J, "buildHierarchy");
72
+ var Pe = /* @__PURE__ */ p((r) => {
73
+ ye(r, D);
74
+ const a = [];
75
+ for (const i of r.TreemapRows ?? [])
76
+ i.$type === "ClassDefStatement" && D.addClass(i.className ?? "", i.styleText ?? "");
77
+ for (const i of r.TreemapRows ?? []) {
78
+ const s = i.item;
79
+ if (!s)
80
+ continue;
81
+ const S = i.indent ? parseInt(i.indent) : 0, T = Ae(s), F = s.classSelector ? D.getStylesForClass(s.classSelector) : [], l = F.length > 0 ? F.join(";") : void 0, z = {
82
+ level: S,
83
+ name: T,
84
+ type: s.$type,
85
+ value: s.value,
86
+ classSelector: s.classSelector,
87
+ cssCompiledStyles: l
88
+ };
89
+ a.push(z);
90
+ }
91
+ const c = J(a), o = /* @__PURE__ */ p((i, s) => {
92
+ for (const S of i)
93
+ D.addNode(S, s), S.children && S.children.length > 0 && o(S.children, s + 1);
94
+ }, "addNodesRecursively");
95
+ o(c, 0);
96
+ }, "populate"), Ae = /* @__PURE__ */ p((r) => r.name ? String(r.name) : "", "getItemName"), Ve = {
97
+ parse: /* @__PURE__ */ p(async (r) => {
98
+ try {
99
+ const c = await xe("treemap", r);
100
+ G.debug("Treemap AST:", c), Pe(c);
101
+ } catch (a) {
102
+ throw G.error("Error parsing treemap:", a), a;
103
+ }
104
+ }, "parse")
105
+ }, We = 10, $ = 10, M = 25, Me = /* @__PURE__ */ p((r, a, c, o) => {
106
+ const i = o.db, s = i.getConfig(), S = s.padding ?? We, T = i.getDiagramTitle(), F = i.getRoot(), { themeVariables: l } = U();
107
+ if (!F)
108
+ return;
109
+ const z = T ? 30 : 0, N = he(a), O = s.nodeWidth ? s.nodeWidth * $ : 960, X = s.nodeHeight ? s.nodeHeight * $ : 500, R = O, Y = X + z;
110
+ N.attr("viewBox", `0 0 ${R} ${Y}`), me(N, Y, R, s.useMaxWidth);
111
+ let x;
112
+ try {
113
+ const e = s.valueFormat || ",";
114
+ if (e === "$0,0")
115
+ x = /* @__PURE__ */ p((t) => "$" + W(",")(t), "valueFormat");
116
+ else if (e.startsWith("$") && e.includes(",")) {
117
+ const t = /\.\d+/.exec(e), n = t ? t[0] : "";
118
+ x = /* @__PURE__ */ p((h) => "$" + W("," + n)(h), "valueFormat");
119
+ } else if (e.startsWith("$")) {
120
+ const t = e.substring(1);
121
+ x = /* @__PURE__ */ p((n) => "$" + W(t || "")(n), "valueFormat");
122
+ } else
123
+ x = W(e);
124
+ } catch (e) {
125
+ G.error("Error creating format function:", e), x = W(",");
126
+ }
127
+ const k = B().range([
128
+ "transparent",
129
+ l.cScale0,
130
+ l.cScale1,
131
+ l.cScale2,
132
+ l.cScale3,
133
+ l.cScale4,
134
+ l.cScale5,
135
+ l.cScale6,
136
+ l.cScale7,
137
+ l.cScale8,
138
+ l.cScale9,
139
+ l.cScale10,
140
+ l.cScale11
141
+ ]), Q = B().range([
142
+ "transparent",
143
+ l.cScalePeer0,
144
+ l.cScalePeer1,
145
+ l.cScalePeer2,
146
+ l.cScalePeer3,
147
+ l.cScalePeer4,
148
+ l.cScalePeer5,
149
+ l.cScalePeer6,
150
+ l.cScalePeer7,
151
+ l.cScalePeer8,
152
+ l.cScalePeer9,
153
+ l.cScalePeer10,
154
+ l.cScalePeer11
155
+ ]), E = B().range([
156
+ l.cScaleLabel0,
157
+ l.cScaleLabel1,
158
+ l.cScaleLabel2,
159
+ l.cScaleLabel3,
160
+ l.cScaleLabel4,
161
+ l.cScaleLabel5,
162
+ l.cScaleLabel6,
163
+ l.cScaleLabel7,
164
+ l.cScaleLabel8,
165
+ l.cScaleLabel9,
166
+ l.cScaleLabel10,
167
+ l.cScaleLabel11
168
+ ]);
169
+ T && N.append("text").attr("x", R / 2).attr("y", z / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(T);
170
+ const j = N.append("g").attr("transform", `translate(0, ${z})`).attr("class", "treemapContainer"), Z = be(F).sum((e) => e.value ?? 0).sort((e, t) => (t.value ?? 0) - (e.value ?? 0)), q = ve().size([O, X]).paddingTop(
171
+ (e) => e.children && e.children.length > 0 ? M + $ : 0
172
+ ).paddingInner(S).paddingLeft((e) => e.children && e.children.length > 0 ? $ : 0).paddingRight((e) => e.children && e.children.length > 0 ? $ : 0).paddingBottom((e) => e.children && e.children.length > 0 ? $ : 0).round(true)(Z), ee = q.descendants().filter((e) => e.children && e.children.length > 0), P = j.selectAll(".treemapSection").data(ee).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
173
+ P.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", M).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), P.append("clipPath").attr("id", (e, t) => `clip-section-${a}-${t}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", M), P.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, t) => `treemapSection section${t}`).attr("fill", (e) => k(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => Q(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
174
+ if (e.depth === 0)
175
+ return "display: none;";
176
+ const t = L({ cssCompiledStyles: e.data.cssCompiledStyles });
177
+ return t.nodeStyles + ";" + t.borderStyles.join(";");
178
+ }), P.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", M / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("style", (e) => {
179
+ if (e.depth === 0)
180
+ return "display: none;";
181
+ const t = "dominant-baseline: middle; font-size: 12px; fill:" + E(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", n = L({ cssCompiledStyles: e.data.cssCompiledStyles });
182
+ return t + n.labelStyles.replace("color:", "fill:");
183
+ }).each(function(e) {
184
+ if (e.depth === 0)
185
+ return;
186
+ const t = H(this), n = e.data.name;
187
+ t.text(n);
188
+ const h = e.x1 - e.x0, u = 6;
189
+ let g;
190
+ s.showValues !== false && e.value ? g = h - 10 - 30 - 10 - u : g = h - u - 6;
191
+ const y = Math.max(15, g), d = t.node();
192
+ if (d.getComputedTextLength() > y) {
193
+ const m = "...";
194
+ let f = n;
195
+ for (; f.length > 0; ) {
196
+ if (f = n.substring(0, f.length - 1), f.length === 0) {
197
+ t.text(m), d.getComputedTextLength() > y && t.text("");
198
+ break;
199
+ }
200
+ if (t.text(f + m), d.getComputedTextLength() <= y)
201
+ break;
202
+ }
203
+ }
204
+ }), s.showValues !== false && P.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", M / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? x(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
205
+ if (e.depth === 0)
206
+ return "display: none;";
207
+ const t = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + E(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", n = L({ cssCompiledStyles: e.data.cssCompiledStyles });
208
+ return t + n.labelStyles.replace("color:", "fill:");
209
+ });
210
+ const te = q.leaves(), _ = j.selectAll(".treemapLeafGroup").data(te).enter().append("g").attr("class", (e, t) => `treemapNode treemapLeafGroup leaf${t}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
211
+ _.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", "treemapLeaf").attr("fill", (e) => e.parent ? k(e.parent.data.name) : k(e.data.name)).attr("style", (e) => L({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? k(e.parent.data.name) : k(e.data.name)).attr("stroke-width", 3), _.append("clipPath").attr("id", (e, t) => `clip-${a}-${t}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), _.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
212
+ const t = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + E(e.data.name) + ";", n = L({ cssCompiledStyles: e.data.cssCompiledStyles });
213
+ return t + n.labelStyles.replace("color:", "fill:");
214
+ }).attr("clip-path", (e, t) => `url(#clip-${a}-${t})`).text((e) => e.data.name).each(function(e) {
215
+ const t = H(this), n = e.x1 - e.x0, h = e.y1 - e.y0, u = t.node(), g = 4, w = n - 2 * g, y = h - 2 * g;
216
+ if (w < 10 || y < 10) {
217
+ t.style("display", "none");
218
+ return;
219
+ }
220
+ let d = parseInt(t.style("font-size"), 10);
221
+ const b = 8, m = 28, f = 0.6, v = 6, A = 2;
222
+ for (; u.getComputedTextLength() > w && d > b; )
223
+ d--, t.style("font-size", `${d}px`);
224
+ let V = Math.max(
225
+ v,
226
+ Math.min(m, Math.round(d * f))
227
+ ), I = d + A + V;
228
+ for (; I > y && d > b && (d--, V = Math.max(
229
+ v,
230
+ Math.min(m, Math.round(d * f))
231
+ ), !(V < v && d === b)); )
232
+ t.style("font-size", `${d}px`), I = d + A + V;
233
+ t.style("font-size", `${d}px`), (u.getComputedTextLength() > w || d < b || y < d) && t.style("display", "none");
234
+ }), s.showValues !== false && _.append("text").attr("class", "treemapValue").attr("x", (t) => (t.x1 - t.x0) / 2).attr("y", function(t) {
235
+ return (t.y1 - t.y0) / 2;
236
+ }).attr("style", (t) => {
237
+ const n = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + E(t.data.name) + ";", h = L({ cssCompiledStyles: t.data.cssCompiledStyles });
238
+ return n + h.labelStyles.replace("color:", "fill:");
239
+ }).attr("clip-path", (t, n) => `url(#clip-${a}-${n})`).text((t) => t.value ? x(t.value) : "").each(function(t) {
240
+ const n = H(this), h = this.parentNode;
241
+ if (!h) {
242
+ n.style("display", "none");
243
+ return;
244
+ }
245
+ const u = H(h).select(".treemapLabel");
246
+ if (u.empty() || u.style("display") === "none") {
247
+ n.style("display", "none");
248
+ return;
249
+ }
250
+ const g = parseFloat(u.style("font-size")), w = 28, y = 0.6, d = 6, b = 2, m = Math.max(
251
+ d,
252
+ Math.min(w, Math.round(g * y))
253
+ );
254
+ n.style("font-size", `${m}px`);
255
+ const v = (t.y1 - t.y0) / 2 + g / 2 + b;
256
+ n.attr("y", v);
257
+ const A = t.x1 - t.x0, le = t.y1 - t.y0 - 4, se = A - 2 * 4;
258
+ n.node().getComputedTextLength() > se || v + m > le || m < d ? n.style("display", "none") : n.style("display", null);
259
+ });
260
+ const ae = s.diagramPadding ?? 8;
261
+ re(N, ae, "flowchart", (s == null ? void 0 : s.useMaxWidth) || false);
262
+ }, "draw"), De = /* @__PURE__ */ p(function(r, a) {
263
+ return a.db.getClasses();
264
+ }, "getClasses"), Ee = { draw: Me, getClasses: De }, _e = {
265
+ sectionStrokeColor: "black",
266
+ sectionStrokeWidth: "1",
267
+ sectionFillColor: "#efefef",
268
+ leafStrokeColor: "black",
269
+ leafStrokeWidth: "1",
270
+ leafFillColor: "#efefef",
271
+ labelColor: "black",
272
+ labelFontSize: "12px",
273
+ valueFontSize: "10px",
274
+ valueColor: "black",
275
+ titleColor: "black",
276
+ titleFontSize: "14px"
277
+ }, He = /* @__PURE__ */ p(({
278
+ treemap: r
279
+ } = {}) => {
280
+ const a = K(_e, r);
281
+ return `
282
+ .treemapNode.section {
283
+ stroke: ${a.sectionStrokeColor};
284
+ stroke-width: ${a.sectionStrokeWidth};
285
+ fill: ${a.sectionFillColor};
286
+ }
287
+ .treemapNode.leaf {
288
+ stroke: ${a.leafStrokeColor};
289
+ stroke-width: ${a.leafStrokeWidth};
290
+ fill: ${a.leafFillColor};
291
+ }
292
+ .treemapLabel {
293
+ fill: ${a.labelColor};
294
+ font-size: ${a.labelFontSize};
295
+ }
296
+ .treemapValue {
297
+ fill: ${a.valueColor};
298
+ font-size: ${a.valueFontSize};
299
+ }
300
+ .treemapTitle {
301
+ fill: ${a.titleColor};
302
+ font-size: ${a.titleFontSize};
303
+ }
304
+ `;
305
+ }, "getStyles"), Re = He, Je = {
306
+ parser: Ve,
307
+ db: D,
308
+ renderer: Ee,
309
+ styles: Re
310
+ };
311
+ export {
312
+ Je as diagram
313
+ };
@@ -0,0 +1,137 @@
1
+ import { p as y } from "./chunk-353BL4L5-DE1uUKLI.js";
2
+ import { _ as i, s as B, g as S, t as z, q as F, a as P, b as E, F as w, K as W, e as T, z as D, G as _, H as A, l as x } from "./mermaid-CRRCnedu.js";
3
+ import { p as N } from "./treemap-FKARHQ26-BOli4yXg.js";
4
+ var m = {
5
+ packet: []
6
+ }, v = structuredClone(m), L = A.packet, Y = /* @__PURE__ */ i(() => {
7
+ const t = w({
8
+ ...L,
9
+ ..._().packet
10
+ });
11
+ return t.showBits && (t.paddingY += 10), t;
12
+ }, "getConfig"), G = /* @__PURE__ */ i(() => v.packet, "getPacket"), H = /* @__PURE__ */ i((t) => {
13
+ t.length > 0 && v.packet.push(t);
14
+ }, "pushWord"), I = /* @__PURE__ */ i(() => {
15
+ D(), v = structuredClone(m);
16
+ }, "clear"), u = {
17
+ pushWord: H,
18
+ getPacket: G,
19
+ getConfig: Y,
20
+ clear: I,
21
+ setAccTitle: E,
22
+ getAccTitle: P,
23
+ setDiagramTitle: F,
24
+ getDiagramTitle: z,
25
+ getAccDescription: S,
26
+ setAccDescription: B
27
+ }, K = 1e4, M = /* @__PURE__ */ i((t) => {
28
+ y(t, u);
29
+ let e = -1, o = [], s = 1;
30
+ const { bitsPerRow: n } = u.getConfig();
31
+ for (let { start: a, end: r, bits: c, label: f } of t.blocks) {
32
+ if (a !== void 0 && r !== void 0 && r < a)
33
+ throw new Error(`Packet block ${a} - ${r} is invalid. End must be greater than start.`);
34
+ if (a ?? (a = e + 1), a !== e + 1)
35
+ throw new Error(
36
+ `Packet block ${a} - ${r ?? a} is not contiguous. It should start from ${e + 1}.`
37
+ );
38
+ if (c === 0)
39
+ throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
40
+ for (r ?? (r = a + (c ?? 1) - 1), c ?? (c = r - a + 1), e = r, x.debug(`Packet block ${a} - ${e} with label ${f}`); o.length <= n + 1 && u.getPacket().length < K; ) {
41
+ const [d, p] = O({ start: a, end: r, bits: c, label: f }, s, n);
42
+ if (o.push(d), d.end + 1 === s * n && (u.pushWord(o), o = [], s++), !p)
43
+ break;
44
+ ({ start: a, end: r, bits: c, label: f } = p);
45
+ }
46
+ }
47
+ u.pushWord(o);
48
+ }, "populate"), O = /* @__PURE__ */ i((t, e, o) => {
49
+ if (t.start === void 0)
50
+ throw new Error("start should have been set during first phase");
51
+ if (t.end === void 0)
52
+ throw new Error("end should have been set during first phase");
53
+ if (t.start > t.end)
54
+ throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);
55
+ if (t.end + 1 <= e * o)
56
+ return [t, void 0];
57
+ const s = e * o - 1, n = e * o;
58
+ return [
59
+ {
60
+ start: t.start,
61
+ end: s,
62
+ label: t.label,
63
+ bits: s - t.start
64
+ },
65
+ {
66
+ start: n,
67
+ end: t.end,
68
+ label: t.label,
69
+ bits: t.end - n
70
+ }
71
+ ];
72
+ }, "getNextFittingBlock"), q = {
73
+ parse: /* @__PURE__ */ i(async (t) => {
74
+ const e = await N("packet", t);
75
+ x.debug(e), M(e);
76
+ }, "parse")
77
+ }, R = /* @__PURE__ */ i((t, e, o, s) => {
78
+ const n = s.db, a = n.getConfig(), { rowHeight: r, paddingY: c, bitWidth: f, bitsPerRow: d } = a, p = n.getPacket(), l = n.getDiagramTitle(), k = r + c, g = k * (p.length + 1) - (l ? 0 : r), b = f * d + 2, h = W(e);
79
+ h.attr("viewbox", `0 0 ${b} ${g}`), T(h, g, b, a.useMaxWidth);
80
+ for (const [C, $] of p.entries())
81
+ U(h, $, C, a);
82
+ h.append("text").text(l).attr("x", b / 2).attr("y", g - k / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
83
+ }, "draw"), U = /* @__PURE__ */ i((t, e, o, { rowHeight: s, paddingX: n, paddingY: a, bitWidth: r, bitsPerRow: c, showBits: f }) => {
84
+ const d = t.append("g"), p = o * (s + a) + a;
85
+ for (const l of e) {
86
+ const k = l.start % c * r + 1, g = (l.end - l.start + 1) * r - n;
87
+ if (d.append("rect").attr("x", k).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), d.append("text").attr("x", k + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(l.label), !f)
88
+ continue;
89
+ const b = l.end === l.start, h = p - 2;
90
+ d.append("text").attr("x", k + (b ? g / 2 : 0)).attr("y", h).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", b ? "middle" : "start").text(l.start), b || d.append("text").attr("x", k + g).attr("y", h).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(l.end);
91
+ }
92
+ }, "drawWord"), X = { draw: R }, j = {
93
+ byteFontSize: "10px",
94
+ startByteColor: "black",
95
+ endByteColor: "black",
96
+ labelColor: "black",
97
+ labelFontSize: "12px",
98
+ titleColor: "black",
99
+ titleFontSize: "14px",
100
+ blockStrokeColor: "black",
101
+ blockStrokeWidth: "1",
102
+ blockFillColor: "#efefef"
103
+ }, J = /* @__PURE__ */ i(({ packet: t } = {}) => {
104
+ const e = w(j, t);
105
+ return `
106
+ .packetByte {
107
+ font-size: ${e.byteFontSize};
108
+ }
109
+ .packetByte.start {
110
+ fill: ${e.startByteColor};
111
+ }
112
+ .packetByte.end {
113
+ fill: ${e.endByteColor};
114
+ }
115
+ .packetLabel {
116
+ fill: ${e.labelColor};
117
+ font-size: ${e.labelFontSize};
118
+ }
119
+ .packetTitle {
120
+ fill: ${e.titleColor};
121
+ font-size: ${e.titleFontSize};
122
+ }
123
+ .packetBlock {
124
+ stroke: ${e.blockStrokeColor};
125
+ stroke-width: ${e.blockStrokeWidth};
126
+ fill: ${e.blockFillColor};
127
+ }
128
+ `;
129
+ }, "styles"), tt = {
130
+ parser: q,
131
+ db: u,
132
+ renderer: X,
133
+ styles: J
134
+ };
135
+ export {
136
+ tt as diagram
137
+ };
@@ -1,6 +1,6 @@
1
- import { p as k } from "./chunk-4BMEZGHF-CKIxJWxP.js";
2
- import { _ as l, s as R, g as F, t as I, q as _, a as E, b as D, K as G, z, F as y, G as C, H as P, l as H, M as V } from "./mermaid-DCIbF0Rd.js";
3
- import { p as W } from "./radar-MK3ICKWK-BMSp8zaN.js";
1
+ import { p as k } from "./chunk-353BL4L5-DE1uUKLI.js";
2
+ import { _ as l, s as R, g as F, t as I, q as _, a as E, b as D, K as G, z, F as y, G as C, H as P, l as H, M as V } from "./mermaid-CRRCnedu.js";
3
+ import { p as W } from "./treemap-FKARHQ26-BOli4yXg.js";
4
4
  var x = {
5
5
  showLegend: true,
6
6
  ticks: 5,
@@ -1,7 +1,8 @@
1
1
  var _a;
2
- import { g as vt, s as Dt } from "./chunk-RZ5BOZE2-D7Ag0UF8.js";
3
- import { _ as o, b as wt, a as Vt, s as Lt, g as Mt, q as Bt, t as Ft, c as $, l as D, z as Yt, y as Pt, B as zt, D as Gt, p as Kt, r as Zt, d as Ut, u as jt } from "./mermaid-DCIbF0Rd.js";
4
- import { c as Wt } from "./channel-BQIWHLpc.js";
2
+ import { g as vt } from "./chunk-BFAMUDN2-D9C6R9UM.js";
3
+ import { s as Dt } from "./chunk-SKB7J2MH-CxMkQppY.js";
4
+ import { _ as o, b as wt, a as Vt, s as Lt, g as Mt, q as Bt, t as Ft, c as $, l as D, z as Yt, y as Pt, B as zt, D as Gt, p as Kt, r as Zt, d as Ut, u as jt } from "./mermaid-CRRCnedu.js";
5
+ import { c as Wt } from "./channel-Dv_KwBSx.js";
5
6
  var ut = function() {
6
7
  var e = /* @__PURE__ */ o(function(N, n, a, c) {
7
8
  for (a = a || {}, c = N.length; c--; a[N[c]] = n) ;
@@ -829,7 +830,7 @@ var qt = /* @__PURE__ */ o(async function(e, i, d, l) {
829
830
  stroke: ${e.lineColor} !important;
830
831
  stroke-width: 1;
831
832
  }
832
- `, "getStyles"), $t = Jt, ie = {
833
+ `, "getStyles"), $t = Jt, re = {
833
834
  parser: Qt,
834
835
  get db() {
835
836
  return new Xt();
@@ -838,5 +839,5 @@ var qt = /* @__PURE__ */ o(async function(e, i, d, l) {
838
839
  styles: $t
839
840
  };
840
841
  export {
841
- ie as diagram
842
+ re as diagram
842
843
  };