@mechane-ai/elements 0.36.0 → 0.38.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 (39) hide show
  1. package/README.md +8 -6
  2. package/dist/ai.js +3 -3
  3. package/dist/{chart-theme-Bwr9YSP1.js → categorical-values-BECG-J6R.js} +4 -54
  4. package/dist/{chart-frame-C0UBu4ku.js → chart-frame-CJFnI39T.js} +78 -93
  5. package/dist/{chart-input-Ccr2NJ6J.js → chart-input-DwAobO8Y.js} +2 -2
  6. package/dist/chart-navigation-CBIeNtJq.js +67 -0
  7. package/dist/charts/cartesian.js +631 -618
  8. package/dist/charts/distribution.js +298 -267
  9. package/dist/charts/graph.js +113 -122
  10. package/dist/charts/hierarchy.js +12 -12
  11. package/dist/charts/matrix.js +208 -200
  12. package/dist/charts/timeline.js +2 -2
  13. package/dist/charts.js +3 -3
  14. package/dist/{code-block-DT1TCkTC.js → code-block-aC0Htt4N.js} +33 -32
  15. package/dist/collections.js +597 -351
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +1 -1
  18. package/dist/content/markdown.js +1 -1
  19. package/dist/content.js +1 -1
  20. package/dist/elements.css +22 -2
  21. package/dist/feedback.js +1 -1
  22. package/dist/navigation/commands.js +4 -3
  23. package/dist/packages/charts/src/chart-data.d.ts +13 -3
  24. package/dist/packages/charts/src/chart-frame.d.ts +2 -5
  25. package/dist/packages/charts/src/chart-navigation.d.ts +19 -0
  26. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -2
  27. package/dist/packages/collections/src/collection-filters.d.ts +20 -0
  28. package/dist/packages/collections/src/data-table.d.ts +4 -6
  29. package/dist/packages/collections/src/index.d.ts +4 -0
  30. package/dist/packages/collections/src/use-collection-controls.d.ts +30 -0
  31. package/dist/packages/feedback/src/index.d.ts +2 -2
  32. package/dist/packages/feedback/src/notifications.d.ts +35 -0
  33. package/dist/packages/feedback/src/toast.d.ts +1 -1
  34. package/dist/packages/navigation/src/commands/command.d.ts +1 -0
  35. package/dist/plot-width-BQQS-mw9.js +67 -0
  36. package/dist/{src-D9DktxEq.js → src-DWjAoOyd.js} +1 -1
  37. package/dist/{src-DXdsMc_Z.js → src-nkgFDl-g.js} +246 -207
  38. package/package.json +1 -1
  39. package/dist/plot-width--OgdohB5.js +0 -18
@@ -1,17 +1,17 @@
1
- import { c as e } from "../src-DXdsMc_Z.js";
2
- import { t } from "../use-scroll-tab-index-Dxpdh4W7.js";
3
- import { a as n, n as r, r as i, t as a } from "../chart-frame-C0UBu4ku.js";
4
- import { n as o, t as s } from "../chart-input-Ccr2NJ6J.js";
5
- import * as c from "@stylexjs/stylex";
6
- import { useId as l } from "react";
7
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
1
+ import { c as e } from "../src-nkgFDl-g.js";
2
+ import { n as t, t as n } from "../chart-navigation-CBIeNtJq.js";
3
+ import { i as r, n as i } from "../chart-frame-CJFnI39T.js";
4
+ import { n as a, t as o } from "../chart-input-DwAobO8Y.js";
5
+ import * as s from "@stylexjs/stylex";
6
+ import { useId as c } from "react";
7
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  // packages/charts/src/graph/relation-graph.tsx
9
- var p = {
9
+ var f = {
10
10
  kVAEAm: "x1n2onr6",
11
11
  $$css: !0
12
- }, m = {
12
+ }, p = {
13
13
  canvas: (e, t) => [
14
- p,
14
+ f,
15
15
  {
16
16
  kzqmXN: e == null ? e : "x5lhr3w",
17
17
  kZKoxP: t == null ? t : "x16ye13r",
@@ -81,47 +81,54 @@ var p = {
81
81
  kInvED: "x2ssjo2",
82
82
  $$css: !0
83
83
  }
84
- }, h = 256, g = 1024, _ = 256, v = 8192;
85
- function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v = [], width: y, height: S, selection: C, emptyLabel: w }) {
86
- let T = l(), E = t(), D = b({
87
- nodes: g,
88
- edges: _,
89
- groups: v,
90
- width: y,
91
- height: S
84
+ }, m = 256, h = 1024, g = 256, _ = 8192;
85
+ function v({ title: a, report: f, description: m, nodes: h, edges: g, groups: _ = [], width: v, height: x, selection: S, emptyLabel: C }) {
86
+ let w = n({
87
+ title: a,
88
+ selection: S,
89
+ items: h.map((e) => ({
90
+ id: e.id,
91
+ label: [e.label, e.description].filter((e) => e !== void 0).join(", ")
92
+ }))
93
+ }), T = c(), E = y({
94
+ nodes: h,
95
+ edges: g,
96
+ groups: _,
97
+ width: v,
98
+ height: x
92
99
  });
93
- if (D !== null) return /* @__PURE__ */ d(s, {
94
- title: o,
95
- report: p,
96
- description: h,
97
- message: D
100
+ if (E !== null) return /* @__PURE__ */ u(o, {
101
+ title: a,
102
+ report: f,
103
+ description: m,
104
+ message: E
98
105
  });
99
- let O = new Map(g.map((e) => [e.id, e])), k = x(_, O), A = C?.selectedId === void 0 ? void 0 : O.get(C.selectedId), j = g.length > 0;
100
- return k === null ? /* @__PURE__ */ d(s, {
101
- title: o,
102
- report: p,
103
- description: h,
106
+ let D = new Map(h.map((e) => [e.id, e])), O = b(g, D), k = h.length > 0;
107
+ return O === null ? /* @__PURE__ */ u(o, {
108
+ title: a,
109
+ report: f,
110
+ description: m,
104
111
  message: "Every relationship must refer to two supplied nodes."
105
- }) : /* @__PURE__ */ f(i, {
106
- title: o,
107
- report: p,
108
- description: h,
109
- footer: C !== void 0 && j ? /* @__PURE__ */ d(n, { children: A === void 0 ? "Select a node to inspect its record." : [A.label, A.description].filter((e) => e !== void 0).join(" · ") }) : void 0,
110
- children: [j ? /* @__PURE__ */ d("div", {
111
- ref: E.ref,
112
- role: "region",
113
- "aria-label": `${o} graph`,
114
- tabIndex: E.tabIndex,
112
+ }) : /* @__PURE__ */ d(i, {
113
+ title: a,
114
+ report: f,
115
+ description: m,
116
+ footer: /* @__PURE__ */ u(r, {
117
+ id: w.id,
118
+ children: w.label ?? "\xA0"
119
+ }),
120
+ children: [k ? /* @__PURE__ */ u("div", {
121
+ ...w.props,
115
122
  className: "xysyzu8 xzuc9lq xeuugli x1t137rt xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
116
- children: /* @__PURE__ */ f("div", {
117
- ...c.props(m.canvas(y, S)),
118
- children: [/* @__PURE__ */ f("svg", {
119
- width: y,
120
- height: S,
123
+ children: /* @__PURE__ */ d("div", {
124
+ ...s.props(p.canvas(v, x)),
125
+ children: [/* @__PURE__ */ d("svg", {
126
+ width: v,
127
+ height: x,
121
128
  "aria-hidden": !0,
122
129
  className: "x10l6tqk x10a8y8t x1lliihq",
123
130
  children: [
124
- /* @__PURE__ */ d("defs", { children: /* @__PURE__ */ d("marker", {
131
+ /* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("marker", {
125
132
  id: T,
126
133
  markerWidth: 8,
127
134
  markerHeight: 8,
@@ -129,133 +136,117 @@ function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v
129
136
  refY: 4,
130
137
  orient: "auto",
131
138
  markerUnits: "userSpaceOnUse",
132
- children: /* @__PURE__ */ d("path", {
139
+ children: /* @__PURE__ */ u("path", {
133
140
  d: "M0,0 L8,4 L0,8 Z",
134
141
  className: "x8futc7"
135
142
  })
136
143
  }) }),
137
- v.map((e) => /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("rect", {
144
+ _.map((e) => /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
138
145
  x: e.x,
139
146
  y: e.y,
140
147
  width: e.width,
141
148
  height: e.height,
142
149
  className: "x2wnxhi x13hfdr1 xnpr05h"
143
- }), /* @__PURE__ */ d("svg", {
150
+ }), /* @__PURE__ */ u("svg", {
144
151
  x: e.x,
145
152
  y: e.y,
146
153
  width: e.width,
147
154
  height: e.height,
148
155
  overflow: "hidden",
149
- children: /* @__PURE__ */ d("text", {
156
+ children: /* @__PURE__ */ u("text", {
150
157
  x: 12,
151
158
  y: 20,
152
159
  className: "x1q7gtio x1hz01jw xy8obcc",
153
160
  children: e.label
154
161
  })
155
162
  })] }, e.id)),
156
- k.map(({ edge: e, source: t, target: n }) => {
157
- let r = t.x < n.x, i = t.x + (r ? t.width : 0), a = n.x + (r ? 0 : n.width), o = t.y + t.height / 2, s = n.y + n.height / 2, c = (i + a) / 2, l = t.x + t.width / 2, u = t.id === n.id ? `M${l - 12},${t.y} C${l - 48},${t.y - 36} ${l + 48},${t.y - 36} ${l + 12},${t.y}` : `M${i},${o} C${c},${o} ${c},${s} ${a},${s}`;
158
- return /* @__PURE__ */ d("path", {
159
- d: u,
163
+ O.map(({ edge: e, source: t, target: n }) => {
164
+ let r = t.x < n.x, i = t.x + (r ? t.width : 0), a = n.x + (r ? 0 : n.width), o = t.y + t.height / 2, s = n.y + n.height / 2, c = (i + a) / 2, l = t.x + t.width / 2, d = t.id === n.id ? `M${l - 12},${t.y} C${l - 48},${t.y - 36} ${l + 48},${t.y - 36} ${l + 12},${t.y}` : `M${i},${o} C${c},${o} ${c},${s} ${a},${s}`;
165
+ return /* @__PURE__ */ u("path", {
166
+ d,
160
167
  markerEnd: e.direction === "directed" ? `url(#${T})` : void 0,
161
168
  className: "xbh8q5q x1crw9hw xhr4kjn",
162
- children: /* @__PURE__ */ d("title", { children: e.label })
169
+ children: /* @__PURE__ */ u("title", { children: e.label })
163
170
  }, e.id);
164
171
  })
165
172
  ]
166
- }), g.map((t) => {
167
- let n = [
168
- ...v.filter((e) => e.nodeIds.includes(t.id)).map((e) => e.label),
173
+ }), h.map((t) => {
174
+ let n = w.label !== void 0 && w.activeId === t.id, r = [
175
+ ..._.filter((e) => e.nodeIds.includes(t.id)).map((e) => e.label),
169
176
  t.label,
170
177
  t.description
171
- ].filter((e) => e !== void 0).join(", "), r = c.props(m.node, m.position(t.x, t.y), m.size(t.width, t.height), m.tone(e[t.tone]), C !== void 0 && m.action, C?.selectedId === t.id && m.selected), i = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", {
178
+ ].filter((e) => e !== void 0).join(", "), i = s.props(p.node, p.position(t.x, t.y), p.size(t.width, t.height), p.tone(e[t.tone]), S !== void 0 && p.action, (S?.selectedId === t.id || n) && p.selected), a = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
172
179
  className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
173
180
  children: t.label
174
- }), t.description !== void 0 && t.height >= 56 && /* @__PURE__ */ d("span", {
181
+ }), t.description !== void 0 && t.height >= 56 && /* @__PURE__ */ u("span", {
175
182
  className: "xy8obcc xas2l8k x153jb6y xb3r6kr xlyipyv xuxw1ft",
176
183
  children: t.description
177
184
  })] });
178
- return C === void 0 ? /* @__PURE__ */ d("div", {
185
+ return S === void 0 ? /* @__PURE__ */ u("div", {
186
+ onPointerEnter: () => w.inspect(t.id),
179
187
  role: "group",
180
- "aria-label": n,
181
- title: n,
182
- ...r,
183
- children: i
184
- }, t.id) : /* @__PURE__ */ d("button", {
188
+ "aria-label": r,
189
+ title: r,
190
+ ...i,
191
+ children: a
192
+ }, t.id) : /* @__PURE__ */ u("button", {
185
193
  type: "button",
186
- "aria-label": n,
187
- title: n,
188
- "aria-pressed": C.selectedId === t.id,
189
- onClick: () => C.onSelect(t.id),
190
- ...r,
191
- children: i
194
+ tabIndex: -1,
195
+ onPointerEnter: () => w.inspect(t.id),
196
+ "aria-label": r,
197
+ title: r,
198
+ "aria-pressed": S.selectedId === t.id,
199
+ onClick: () => S.onSelect(t.id),
200
+ ...i,
201
+ children: a
192
202
  }, t.id);
193
203
  })]
194
204
  })
195
- }) : /* @__PURE__ */ d("p", {
205
+ }) : /* @__PURE__ */ u("p", {
196
206
  className: "x1ghz6dp x153jb6y",
197
- children: w
198
- }), j ? /* @__PURE__ */ f(a, {
199
- label: "Graph data",
200
- children: [
201
- /* @__PURE__ */ d("ul", {
202
- "aria-label": "Nodes",
203
- className: "x1ghz6dp x1717udv xe8uvvx",
204
- children: g.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(r, {
205
- label: [e.label, e.description].filter((e) => e !== void 0).join(", "),
206
- isSelected: C?.selectedId === e.id,
207
- onSelect: C === void 0 ? void 0 : () => C.onSelect(e.id),
208
- children: /* @__PURE__ */ f("span", {
209
- className: "xrvj5dj xfko13i xeuugli xh8yej3",
210
- children: [/* @__PURE__ */ d("span", { children: e.label }), e.description !== void 0 && /* @__PURE__ */ d("span", {
211
- className: "x153jb6y xy8obcc xas2l8k",
212
- children: e.description
213
- })]
214
- })
215
- }) }, e.id))
216
- }),
217
- v.length > 0 && /* @__PURE__ */ d("ul", {
218
- "aria-label": "Groups",
219
- className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
220
- children: v.map((e) => /* @__PURE__ */ f("li", { children: [
221
- e.label,
222
- ": ",
223
- e.nodeIds.map((e) => O.get(e)?.label).join(", ")
224
- ] }, e.id))
225
- }),
226
- k.length > 0 && /* @__PURE__ */ d("ul", {
227
- "aria-label": "Relationships",
228
- className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
229
- children: k.map(({ edge: e, source: t, target: n }) => /* @__PURE__ */ f("li", { children: [
230
- t.label,
231
- " ",
232
- e.direction === "directed" ? "→" : "↔",
233
- " ",
234
- n.label,
235
- ": ",
236
- e.label
237
- ] }, e.id))
238
- })
207
+ children: C
208
+ }), /* @__PURE__ */ u(t, {
209
+ label: `${a} graph data`,
210
+ columns: [{
211
+ id: "kind",
212
+ label: "Kind"
213
+ }, {
214
+ id: "description",
215
+ label: "Description"
216
+ }],
217
+ rows: [
218
+ ...h.map((e) => ({
219
+ id: `node:${e.id}`,
220
+ values: ["Node", [e.label, e.description].filter((e) => e !== void 0).join(", ")]
221
+ })),
222
+ ..._.map((e) => ({
223
+ id: `group:${e.id}`,
224
+ values: ["Group", `${e.label}: ${e.nodeIds.map((e) => D.get(e)?.label).join(", ")}`]
225
+ })),
226
+ ...O.map(({ edge: e, source: t, target: n }) => ({
227
+ id: `edge:${e.id}`,
228
+ values: ["Relationship", `${t.label + (e.direction === "directed" ? " → " : " ↔ ") + n.label}: ${e.label}`]
229
+ }))
239
230
  ]
240
- }) : null]
231
+ })]
241
232
  });
242
233
  }
243
- function b({ nodes: e, edges: t, groups: n, width: r, height: i }) {
244
- if (!Number.isFinite(r) || r <= 0 || r > 8192 || !Number.isFinite(i) || i <= 0 || i > 8192) return `Graph dimensions must be finite, positive, and at most ${v} pixels.`;
245
- if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${g} relationships, or 256 groups. Supply a smaller, labelled neighborhood.`;
246
- let a = new Set(e.map((e) => e.id));
247
- return !o(e) || !o(t) || !o(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
234
+ function y({ nodes: e, edges: t, groups: n, width: r, height: i }) {
235
+ if (!Number.isFinite(r) || r <= 0 || r > 8192 || !Number.isFinite(i) || i <= 0 || i > 8192) return `Graph dimensions must be finite, positive, and at most ${_} pixels.`;
236
+ if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${h} relationships, or 256 groups. Supply a smaller, labelled neighborhood.`;
237
+ let o = new Set(e.map((e) => e.id));
238
+ return !a(e) || !a(t) || !a(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
248
239
  if (!Number.isFinite(e.width) || !Number.isFinite(e.height) || e.width <= 0 || e.height <= 0) return !0;
249
240
  let t = !Number.isFinite(e.x) || e.x < 0 || e.x + e.width > r, n = !Number.isFinite(e.y) || e.y < 0 || e.y + e.height > i;
250
241
  return t || n;
251
- }) ? "Graph boxes must have finite, positive dimensions and fit inside the supplied canvas." : e.some((e) => e.width < 44 || e.height < 44) ? "Graph node boxes must be at least 44 by 44 pixels." : t.some((t) => t.sourceId === t.targetId && e.some((e) => e.id === t.sourceId && e.y < 36)) ? "A self-relationship needs at least 36 pixels of space above its node." : n.some((e) => new Set(e.nodeIds).size !== e.nodeIds.length || e.nodeIds.some((e) => !a.has(e))) ? "Each group must contain unique references to supplied nodes." : n.some((t) => t.nodeIds.some((n) => {
242
+ }) ? "Graph boxes must have finite, positive dimensions and fit inside the supplied canvas." : e.some((e) => e.width < 44 || e.height < 44) ? "Graph node boxes must be at least 44 by 44 pixels." : t.some((t) => t.sourceId === t.targetId && e.some((e) => e.id === t.sourceId && e.y < 36)) ? "A self-relationship needs at least 36 pixels of space above its node." : n.some((e) => new Set(e.nodeIds).size !== e.nodeIds.length || e.nodeIds.some((e) => !o.has(e))) ? "Each group must contain unique references to supplied nodes." : n.some((t) => t.nodeIds.some((n) => {
252
243
  let r = e.find((e) => e.id === n);
253
244
  if (r === void 0) return !1;
254
245
  let i = r.x < t.x || r.x + r.width > t.x + t.width, a = r.y < t.y || r.y + r.height > t.y + t.height;
255
246
  return i || a;
256
247
  })) ? "A group box must contain the node boxes assigned to it." : null;
257
248
  }
258
- function x(e, t) {
249
+ function b(e, t) {
259
250
  let n = [];
260
251
  for (let r of e) {
261
252
  let e = t.get(r.sourceId), i = t.get(r.targetId);
@@ -268,4 +259,4 @@ function x(e, t) {
268
259
  }
269
260
  return n;
270
261
  }
271
- export { v as MAX_RELATION_DIMENSION, g as MAX_RELATION_EDGES, _ as MAX_RELATION_GROUPS, h as MAX_RELATION_NODES, y as RelationGraph };
262
+ export { _ as MAX_RELATION_DIMENSION, h as MAX_RELATION_EDGES, g as MAX_RELATION_GROUPS, m as MAX_RELATION_NODES, v as RelationGraph };
@@ -1,8 +1,8 @@
1
- import { c as e } from "../src-DXdsMc_Z.js";
2
- import { a as t, i as n, n as r, t as i } from "../chart-theme-Bwr9YSP1.js";
3
- import { r as a } from "../chart-frame-C0UBu4ku.js";
4
- import { t as o } from "../chart-input-Ccr2NJ6J.js";
5
- import { t as s } from "../plot-width--OgdohB5.js";
1
+ import { c as e } from "../src-nkgFDl-g.js";
2
+ import { i as t, r as n, t as r } from "../categorical-values-BECG-J6R.js";
3
+ import { n as i } from "../chart-frame-CJFnI39T.js";
4
+ import { t as a } from "../chart-input-DwAobO8Y.js";
5
+ import { n as o, t as s } from "../plot-width-BQQS-mw9.js";
6
6
  import * as c from "@stylexjs/stylex";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  import { Treemap as d, hierarchy as f } from "@visx/hierarchy";
@@ -14,7 +14,7 @@ var p = { treeRect: {
14
14
  } };
15
15
  function m({ title: m, report: h, description: g, items: _, formatValue: v, selection: y, height: b = 180 }) {
16
16
  let x = t(_), S = _.reduce((e, t) => e + (t.value ?? 0), 0), { ref: C, width: w } = s();
17
- if (x !== void 0 || !Number.isFinite(b) || b < 48) return /* @__PURE__ */ l(o, {
17
+ if (x !== void 0 || !Number.isFinite(b) || b < 48) return /* @__PURE__ */ l(a, {
18
18
  title: m,
19
19
  report: h,
20
20
  description: g,
@@ -32,14 +32,14 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
32
32
  tone: "neutral",
33
33
  children: T
34
34
  }, (e) => e.children === void 0 ? void 0 : [...e.children]).sum((e) => e.value);
35
- return /* @__PURE__ */ u(a, {
35
+ return /* @__PURE__ */ u(i, {
36
36
  title: m,
37
37
  report: h,
38
38
  description: g,
39
39
  children: [
40
40
  /* @__PURE__ */ l("div", {
41
41
  ref: C,
42
- ...c.props(i.plot),
42
+ ...c.props(o.plot),
43
43
  children: S === 0 ? /* @__PURE__ */ l("p", {
44
44
  className: "x153jb6y x1ghz6dp xy8obcc",
45
45
  children: "No positive values to size the areas"
@@ -48,13 +48,13 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
48
48
  "aria-label": `${m}. Areas compare recorded values.`,
49
49
  viewBox: `0 0 ${w} ${b}`,
50
50
  height: b,
51
- ...c.props(i.svg),
51
+ ...c.props(o.svg),
52
52
  children: /* @__PURE__ */ l(d, {
53
53
  root: E,
54
54
  size: [w, b],
55
55
  paddingInner: 2,
56
56
  children: (t) => t.leaves().map((t) => {
57
- let n = t.x1 - t.x0 > 96 && t.y1 - t.y0 > 40, r = Math.max(1, Math.floor((t.x1 - t.x0 - 16) / 7)), a = t.data.label.length > r ? `${t.data.label.slice(0, r - 1)}…` : t.data.label;
57
+ let n = t.x1 - t.x0 > 96 && t.y1 - t.y0 > 40, r = Math.max(1, Math.floor((t.x1 - t.x0 - 16) / 7)), i = t.data.label.length > r ? `${t.data.label.slice(0, r - 1)}…` : t.data.label;
58
58
  return /* @__PURE__ */ u("g", { children: [
59
59
  /* @__PURE__ */ l("rect", {
60
60
  x: t.x0,
@@ -63,7 +63,7 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
63
63
  height: t.y1 - t.y0,
64
64
  fill: e[t.data.tone],
65
65
  fillOpacity: .18,
66
- ...c.props(p.treeRect, y?.selectedId === t.data.id && i.selected)
66
+ ...c.props(p.treeRect, y?.selectedId === t.data.id && o.selected)
67
67
  }),
68
68
  /* @__PURE__ */ u("title", { children: [
69
69
  t.data.label,
@@ -80,7 +80,7 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
80
80
  x: 8,
81
81
  y: 18,
82
82
  className: "xlrhuyr x1hz01jw xy8obcc",
83
- children: a
83
+ children: i
84
84
  }), v(t.data.value).length * 12 < t.x1 - t.x0 - 16 && /* @__PURE__ */ l("text", {
85
85
  x: 8,
86
86
  y: 34,