@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.
- package/README.md +8 -6
- package/dist/ai.js +3 -3
- package/dist/{chart-theme-Bwr9YSP1.js → categorical-values-BECG-J6R.js} +4 -54
- package/dist/{chart-frame-C0UBu4ku.js → chart-frame-CJFnI39T.js} +78 -93
- package/dist/{chart-input-Ccr2NJ6J.js → chart-input-DwAobO8Y.js} +2 -2
- package/dist/chart-navigation-CBIeNtJq.js +67 -0
- package/dist/charts/cartesian.js +631 -618
- package/dist/charts/distribution.js +298 -267
- package/dist/charts/graph.js +113 -122
- package/dist/charts/hierarchy.js +12 -12
- package/dist/charts/matrix.js +208 -200
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +3 -3
- package/dist/{code-block-DT1TCkTC.js → code-block-aC0Htt4N.js} +33 -32
- package/dist/collections.js +597 -351
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content.js +1 -1
- package/dist/elements.css +22 -2
- package/dist/feedback.js +1 -1
- package/dist/navigation/commands.js +4 -3
- package/dist/packages/charts/src/chart-data.d.ts +13 -3
- package/dist/packages/charts/src/chart-frame.d.ts +2 -5
- package/dist/packages/charts/src/chart-navigation.d.ts +19 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -2
- package/dist/packages/collections/src/collection-filters.d.ts +20 -0
- package/dist/packages/collections/src/data-table.d.ts +4 -6
- package/dist/packages/collections/src/index.d.ts +4 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +30 -0
- package/dist/packages/feedback/src/index.d.ts +2 -2
- package/dist/packages/feedback/src/notifications.d.ts +35 -0
- package/dist/packages/feedback/src/toast.d.ts +1 -1
- package/dist/packages/navigation/src/commands/command.d.ts +1 -0
- package/dist/plot-width-BQQS-mw9.js +67 -0
- package/dist/{src-D9DktxEq.js → src-DWjAoOyd.js} +1 -1
- package/dist/{src-DXdsMc_Z.js → src-nkgFDl-g.js} +246 -207
- package/package.json +1 -1
- package/dist/plot-width--OgdohB5.js +0 -18
package/dist/charts/graph.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import { t } from "../
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import * as
|
|
6
|
-
import { useId as
|
|
7
|
-
import { Fragment as
|
|
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
|
|
9
|
+
var f = {
|
|
10
10
|
kVAEAm: "x1n2onr6",
|
|
11
11
|
$$css: !0
|
|
12
|
-
},
|
|
12
|
+
}, p = {
|
|
13
13
|
canvas: (e, t) => [
|
|
14
|
-
|
|
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
|
-
},
|
|
85
|
-
function
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 (
|
|
94
|
-
title:
|
|
95
|
-
report:
|
|
96
|
-
description:
|
|
97
|
-
message:
|
|
100
|
+
if (E !== null) return /* @__PURE__ */ u(o, {
|
|
101
|
+
title: a,
|
|
102
|
+
report: f,
|
|
103
|
+
description: m,
|
|
104
|
+
message: E
|
|
98
105
|
});
|
|
99
|
-
let
|
|
100
|
-
return
|
|
101
|
-
title:
|
|
102
|
-
report:
|
|
103
|
-
description:
|
|
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__ */
|
|
106
|
-
title:
|
|
107
|
-
report:
|
|
108
|
-
description:
|
|
109
|
-
footer:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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__ */
|
|
117
|
-
...
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
width:
|
|
120
|
-
height:
|
|
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__ */
|
|
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__ */
|
|
139
|
+
children: /* @__PURE__ */ u("path", {
|
|
133
140
|
d: "M0,0 L8,4 L0,8 Z",
|
|
134
141
|
className: "x8futc7"
|
|
135
142
|
})
|
|
136
143
|
}) }),
|
|
137
|
-
|
|
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__ */
|
|
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__ */
|
|
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
|
-
|
|
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,
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
d
|
|
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__ */
|
|
169
|
+
children: /* @__PURE__ */ u("title", { children: e.label })
|
|
163
170
|
}, e.id);
|
|
164
171
|
})
|
|
165
172
|
]
|
|
166
|
-
}),
|
|
167
|
-
let n = [
|
|
168
|
-
...
|
|
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(", "),
|
|
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__ */
|
|
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
|
|
185
|
+
return S === void 0 ? /* @__PURE__ */ u("div", {
|
|
186
|
+
onPointerEnter: () => w.inspect(t.id),
|
|
179
187
|
role: "group",
|
|
180
|
-
"aria-label":
|
|
181
|
-
title:
|
|
182
|
-
...
|
|
183
|
-
children:
|
|
184
|
-
}, t.id) : /* @__PURE__ */
|
|
188
|
+
"aria-label": r,
|
|
189
|
+
title: r,
|
|
190
|
+
...i,
|
|
191
|
+
children: a
|
|
192
|
+
}, t.id) : /* @__PURE__ */ u("button", {
|
|
185
193
|
type: "button",
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"aria-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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__ */
|
|
205
|
+
}) : /* @__PURE__ */ u("p", {
|
|
196
206
|
className: "x1ghz6dp x153jb6y",
|
|
197
|
-
children:
|
|
198
|
-
}),
|
|
199
|
-
label:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
})
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
|
|
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
|
-
})
|
|
231
|
+
})]
|
|
241
232
|
});
|
|
242
233
|
}
|
|
243
|
-
function
|
|
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 ${
|
|
245
|
-
if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${
|
|
246
|
-
let
|
|
247
|
-
return !
|
|
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) => !
|
|
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
|
|
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 {
|
|
262
|
+
export { _ as MAX_RELATION_DIMENSION, h as MAX_RELATION_EDGES, g as MAX_RELATION_GROUPS, m as MAX_RELATION_NODES, v as RelationGraph };
|
package/dist/charts/hierarchy.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as s } from "../plot-width
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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)),
|
|
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 &&
|
|
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:
|
|
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,
|