@mechane-ai/elements 0.9.0 → 0.11.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/NOTICE +24 -0
- package/README.md +7 -1
- package/dist/ai.js +153 -133
- package/dist/{categorical-values-DYRiw5Qd.js → categorical-values-FYc43JCa.js} +4 -4
- package/dist/{chart-frame-RL1hCWBC.js → chart-frame-Bczk5sWj.js} +22 -14
- package/dist/{chart-input-Bm3ot1yD.js → chart-input-CbzVN76m.js} +2 -2
- package/dist/charts/cartesian.js +529 -450
- package/dist/charts/distribution.js +302 -261
- package/dist/charts/graph.js +137 -103
- package/dist/charts/hierarchy.js +7 -7
- package/dist/charts/matrix.js +187 -174
- package/dist/charts/timeline.js +119 -92
- package/dist/charts.js +1 -1
- package/dist/code-block-B7xzM3tD.js +180 -0
- package/dist/collections.js +319 -242
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +81 -63
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +115 -96
- package/dist/content/tree.js +43 -38
- package/dist/{content-link-BrPrpBof.js → content-link-CatGOrbo.js} +6 -2
- package/dist/content.js +172 -153
- package/dist/{assets/stylex.css → elements.css} +585 -229
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +25 -25
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +239 -192
- package/dist/navigation/commands.js +45 -42
- package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
- package/dist/navigation.js +10 -10
- package/dist/overlays.js +1 -1
- package/dist/packages/ai/src/conversation.d.ts +14 -2
- package/dist/packages/ai/src/index.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
- package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
- package/dist/packages/charts/src/chart-frame.d.ts +3 -0
- package/dist/packages/charts/src/chart-theme.d.ts +2 -1
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
- package/dist/packages/charts/src/timeline/waterfall.d.ts +3 -2
- package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
- package/dist/packages/collections/src/index.d.ts +1 -0
- package/dist/packages/collections/src/inspector.d.ts +6 -3
- package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
- package/dist/packages/content/src/viewer-styles.d.ts +64 -0
- package/dist/packages/core/src/agent-avatar-glyphs.d.ts +1 -1
- package/dist/packages/core/src/index.d.ts +1 -1
- package/dist/packages/core/src/surfaces.d.ts +5 -0
- package/dist/packages/feedback/src/index.d.ts +4 -1
- package/dist/packages/feedback/src/toast.d.ts +5 -27
- package/dist/packages/forms/src/field-styles.d.ts +9 -0
- package/dist/packages/forms/src/selection-styles.d.ts +18 -2
- package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
- package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
- package/dist/packages/foundations/src/tokens.stylex.d.ts +9 -0
- package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
- package/dist/packages/layout/src/sidebar.d.ts +3 -1
- package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
- package/dist/packages/overlays/src/dialog.d.ts +7 -3
- package/dist/pierre-diff--zsiHCCB.js +71 -0
- package/dist/pierre-theme-D9hnHv3Z.js +126 -0
- package/dist/{pierre-tree-CRk09rx7.js → pierre-tree-D47uA7lb.js} +3 -3
- package/dist/{src-Cc0Sadzr.js → src-C_heP5kL.js} +295 -221
- package/dist/src-Cs0dRc4X.js +617 -0
- package/dist/src-D05isEh_.js +1652 -0
- package/dist/src-DXsGTJgv.js +969 -0
- package/dist/tokens.js +33 -25
- package/dist/viewer-styles-CpHqp5Qv.js +70 -0
- package/package.json +2 -1
- package/packages/foundations/src/tokens.stylex.ts +55 -48
- package/styles.css +1 -1
- package/dist/code-block-B30xQKqg.js +0 -175
- package/dist/pierre-diff-CZdzgiYm.js +0 -66
- package/dist/pierre-theme-BpESNIsV.js +0 -96
- package/dist/popup-styles-CvtZDE2t.js +0 -135
- package/dist/src-CfDf8TY8.js +0 -466
- package/dist/src-DuuAmS-c.js +0 -360
- package/dist/src-elMBQ2Dh.js +0 -1087
package/dist/charts/graph.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import * as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-Bczk5sWj.js";
|
|
2
|
+
import { n as a, t as o } from "../chart-input-CbzVN76m.js";
|
|
3
|
+
import * as s from "@stylexjs/stylex";
|
|
4
|
+
import { useId as c } from "react";
|
|
5
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
6
|
// packages/charts/src/graph/relation-graph.tsx
|
|
7
|
-
var
|
|
7
|
+
var f = {
|
|
8
8
|
kVAEAm: "x1n2onr6",
|
|
9
9
|
$$css: !0
|
|
10
|
-
},
|
|
10
|
+
}, p = {
|
|
11
11
|
canvas: (e, t) => [
|
|
12
|
-
|
|
12
|
+
f,
|
|
13
13
|
{
|
|
14
14
|
kzqmXN: e == null ? e : "x5lhr3w",
|
|
15
15
|
kZKoxP: t == null ? t : "x16ye13r",
|
|
@@ -37,6 +37,7 @@ var u = {
|
|
|
37
37
|
kWkggS: "xpvm0e4",
|
|
38
38
|
k9WMMc: "x1yc453h",
|
|
39
39
|
kMv6JI: "x1hz01jw",
|
|
40
|
+
k63SB2: "xj57cvi",
|
|
40
41
|
kAzted: "xaeotn9 xwu7q15",
|
|
41
42
|
$$css: !0
|
|
42
43
|
},
|
|
@@ -62,151 +63,184 @@ var u = {
|
|
|
62
63
|
}, { "--x-borderLeftColor": e ?? void 0 }],
|
|
63
64
|
action: {
|
|
64
65
|
kkrTdU: "x1ypdohk",
|
|
66
|
+
k3XXqK: "x1t137rt",
|
|
65
67
|
kGzVvX: "xzro8vx",
|
|
68
|
+
kSReZ0: "x1ecmtor",
|
|
66
69
|
kPJHz1: "x13qnu6",
|
|
67
70
|
kZs9gx: "x19rmrnh",
|
|
68
71
|
k7shQP: "x9v5kkp",
|
|
69
|
-
kiEn40: "
|
|
72
|
+
kiEn40: "x1bqaal",
|
|
70
73
|
$$css: !0
|
|
71
74
|
},
|
|
72
75
|
selected: {
|
|
73
76
|
kMeerF: "x12ei19c",
|
|
74
77
|
kjBf7l: "xx9gdjd",
|
|
75
78
|
k3XXqK: "xaatb59",
|
|
76
|
-
kInvED: "
|
|
79
|
+
kInvED: "x2ssjo2",
|
|
77
80
|
$$css: !0
|
|
78
81
|
}
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
let
|
|
82
|
-
nodes:
|
|
83
|
-
edges:
|
|
84
|
-
groups:
|
|
85
|
-
width:
|
|
86
|
-
height:
|
|
82
|
+
}, m = 256, h = 1024, g = 256, _ = 8192;
|
|
83
|
+
function v({ title: a, description: f, nodes: m, edges: h, groups: g = [], width: _, height: v, selection: x, emptyLabel: S }) {
|
|
84
|
+
let C = c(), w = y({
|
|
85
|
+
nodes: m,
|
|
86
|
+
edges: h,
|
|
87
|
+
groups: g,
|
|
88
|
+
width: _,
|
|
89
|
+
height: v
|
|
87
90
|
});
|
|
88
|
-
if (
|
|
89
|
-
title:
|
|
90
|
-
description:
|
|
91
|
-
message:
|
|
91
|
+
if (w !== null) return /* @__PURE__ */ u(o, {
|
|
92
|
+
title: a,
|
|
93
|
+
description: f,
|
|
94
|
+
message: w
|
|
92
95
|
});
|
|
93
|
-
let
|
|
94
|
-
return
|
|
95
|
-
title:
|
|
96
|
-
description:
|
|
96
|
+
let T = new Map(m.map((e) => [e.id, e])), E = b(h, T), D = x?.selectedId === void 0 ? void 0 : T.get(x.selectedId), O = m.length > 0;
|
|
97
|
+
return E === null ? /* @__PURE__ */ u(o, {
|
|
98
|
+
title: a,
|
|
99
|
+
description: f,
|
|
97
100
|
message: "Every relationship must refer to two supplied nodes."
|
|
98
|
-
}) : /* @__PURE__ */
|
|
99
|
-
title:
|
|
100
|
-
description:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
children: b
|
|
104
|
-
}) : /* @__PURE__ */ c("div", {
|
|
101
|
+
}) : /* @__PURE__ */ d(n, {
|
|
102
|
+
title: a,
|
|
103
|
+
description: f,
|
|
104
|
+
footer: x !== void 0 && O ? /* @__PURE__ */ u(e, { children: D === void 0 ? "Select a node to inspect its record." : [D.label, D.description].filter((e) => e !== void 0).join(" · ") }) : void 0,
|
|
105
|
+
children: [O ? /* @__PURE__ */ u("div", {
|
|
105
106
|
role: "region",
|
|
106
|
-
"aria-label": `${
|
|
107
|
+
"aria-label": `${a} graph`,
|
|
107
108
|
tabIndex: 0,
|
|
108
|
-
className: "xysyzu8 xzuc9lq xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
-
...
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
-
width:
|
|
113
|
-
height:
|
|
109
|
+
className: "xysyzu8 xzuc9lq xeuugli x1t137rt xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
|
|
110
|
+
children: /* @__PURE__ */ d("div", {
|
|
111
|
+
...s.props(p.canvas(_, v)),
|
|
112
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
113
|
+
width: _,
|
|
114
|
+
height: v,
|
|
114
115
|
"aria-hidden": !0,
|
|
115
116
|
className: "x10l6tqk x10a8y8t x1lliihq",
|
|
116
117
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
id:
|
|
118
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("marker", {
|
|
119
|
+
id: C,
|
|
119
120
|
markerWidth: 8,
|
|
120
121
|
markerHeight: 8,
|
|
121
122
|
refX: 7,
|
|
122
123
|
refY: 4,
|
|
123
124
|
orient: "auto",
|
|
124
125
|
markerUnits: "userSpaceOnUse",
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ u("path", {
|
|
126
127
|
d: "M0,0 L8,4 L0,8 Z",
|
|
127
128
|
className: "x8futc7"
|
|
128
129
|
})
|
|
129
130
|
}) }),
|
|
130
|
-
|
|
131
|
+
g.map((e) => /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
|
|
131
132
|
x: e.x,
|
|
132
133
|
y: e.y,
|
|
133
134
|
width: e.width,
|
|
134
135
|
height: e.height,
|
|
135
136
|
className: "x2wnxhi x13hfdr1 xnpr05h"
|
|
136
|
-
}), /* @__PURE__ */
|
|
137
|
-
x: e.x
|
|
138
|
-
y: e.y
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
}), /* @__PURE__ */ u("svg", {
|
|
138
|
+
x: e.x,
|
|
139
|
+
y: e.y,
|
|
140
|
+
width: e.width,
|
|
141
|
+
height: e.height,
|
|
142
|
+
overflow: "hidden",
|
|
143
|
+
children: /* @__PURE__ */ u("text", {
|
|
144
|
+
x: 12,
|
|
145
|
+
y: 20,
|
|
146
|
+
className: "x1q7gtio x1hz01jw xy8obcc",
|
|
147
|
+
children: e.label
|
|
148
|
+
})
|
|
141
149
|
})] }, e.id)),
|
|
142
|
-
|
|
143
|
-
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,
|
|
144
|
-
return /* @__PURE__ */
|
|
150
|
+
E.map(({ edge: e, source: t, target: n }) => {
|
|
151
|
+
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}`;
|
|
152
|
+
return /* @__PURE__ */ u("path", {
|
|
145
153
|
d,
|
|
146
|
-
markerEnd: e.direction === "directed" ? `url(#${
|
|
154
|
+
markerEnd: e.direction === "directed" ? `url(#${C})` : void 0,
|
|
147
155
|
className: "xbh8q5q x1crw9hw xhr4kjn",
|
|
148
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ u("title", { children: e.label })
|
|
149
157
|
}, e.id);
|
|
150
158
|
})
|
|
151
159
|
]
|
|
152
|
-
}),
|
|
153
|
-
let
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
].filter((e) => e !== void 0).join(", "),
|
|
158
|
-
className: "xtqrqnz x1778rvt
|
|
159
|
-
children:
|
|
160
|
-
}),
|
|
161
|
-
className: "xy8obcc xas2l8k x153jb6y
|
|
162
|
-
children:
|
|
160
|
+
}), m.map((e) => {
|
|
161
|
+
let t = [
|
|
162
|
+
...g.filter((t) => t.nodeIds.includes(e.id)).map((e) => e.label),
|
|
163
|
+
e.label,
|
|
164
|
+
e.description
|
|
165
|
+
].filter((e) => e !== void 0).join(", "), n = s.props(p.node, p.position(e.x, e.y), p.size(e.width, e.height), p.tone(r[e.tone]), x !== void 0 && p.action, x?.selectedId === e.id && p.selected), i = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
166
|
+
className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
|
|
167
|
+
children: e.label
|
|
168
|
+
}), e.description !== void 0 && e.height >= 56 && /* @__PURE__ */ u("span", {
|
|
169
|
+
className: "xy8obcc xas2l8k x153jb6y xb3r6kr xlyipyv xuxw1ft",
|
|
170
|
+
children: e.description
|
|
163
171
|
})] });
|
|
164
|
-
return
|
|
172
|
+
return x === void 0 ? /* @__PURE__ */ u("div", {
|
|
165
173
|
role: "group",
|
|
166
|
-
"aria-label":
|
|
167
|
-
|
|
174
|
+
"aria-label": t,
|
|
175
|
+
title: t,
|
|
176
|
+
...n,
|
|
168
177
|
children: i
|
|
169
|
-
},
|
|
178
|
+
}, e.id) : /* @__PURE__ */ u("button", {
|
|
170
179
|
type: "button",
|
|
171
|
-
"aria-label":
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
"aria-label": t,
|
|
181
|
+
title: t,
|
|
182
|
+
"aria-pressed": x.selectedId === e.id,
|
|
183
|
+
onClick: () => x.onSelect(e.id),
|
|
184
|
+
...n,
|
|
175
185
|
children: i
|
|
176
|
-
},
|
|
186
|
+
}, e.id);
|
|
177
187
|
})]
|
|
178
188
|
})
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
children:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
}) : /* @__PURE__ */ u("p", {
|
|
190
|
+
className: "x1ghz6dp x153jb6y",
|
|
191
|
+
children: S
|
|
192
|
+
}), O ? /* @__PURE__ */ d(i, {
|
|
193
|
+
label: "Graph data",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ u("ul", {
|
|
196
|
+
"aria-label": "Nodes",
|
|
197
|
+
className: "x1ghz6dp x1717udv xe8uvvx",
|
|
198
|
+
children: m.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u(t, {
|
|
199
|
+
label: [e.label, e.description].filter((e) => e !== void 0).join(", "),
|
|
200
|
+
selected: x?.selectedId === e.id,
|
|
201
|
+
onSelect: x === void 0 ? void 0 : () => x.onSelect(e.id),
|
|
202
|
+
children: /* @__PURE__ */ d("span", {
|
|
203
|
+
className: "xrvj5dj xfko13i xeuugli xh8yej3",
|
|
204
|
+
children: [/* @__PURE__ */ u("span", { children: e.label }), e.description !== void 0 && /* @__PURE__ */ u("span", {
|
|
205
|
+
className: "x153jb6y xy8obcc xas2l8k",
|
|
206
|
+
children: e.description
|
|
207
|
+
})]
|
|
208
|
+
})
|
|
209
|
+
}) }, e.id))
|
|
210
|
+
}),
|
|
211
|
+
g.length > 0 && /* @__PURE__ */ u("ul", {
|
|
212
|
+
"aria-label": "Groups",
|
|
213
|
+
className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
|
|
214
|
+
children: g.map((e) => /* @__PURE__ */ d("li", { children: [
|
|
215
|
+
e.label,
|
|
216
|
+
": ",
|
|
217
|
+
e.nodeIds.map((e) => T.get(e)?.label).join(", ")
|
|
218
|
+
] }, e.id))
|
|
219
|
+
}),
|
|
220
|
+
E.length > 0 && /* @__PURE__ */ u("ul", {
|
|
221
|
+
"aria-label": "Relationships",
|
|
222
|
+
className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
|
|
223
|
+
children: E.map(({ edge: e, source: t, target: n }) => /* @__PURE__ */ d("li", { children: [
|
|
224
|
+
t.label,
|
|
225
|
+
" ",
|
|
226
|
+
e.direction === "directed" ? "→" : "↔",
|
|
227
|
+
" ",
|
|
228
|
+
n.label,
|
|
229
|
+
": ",
|
|
230
|
+
e.label
|
|
231
|
+
] }, e.id))
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
}) : null]
|
|
201
235
|
});
|
|
202
236
|
}
|
|
203
|
-
function
|
|
204
|
-
if (!Number.isFinite(
|
|
205
|
-
if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${
|
|
237
|
+
function y({ nodes: e, edges: t, groups: n, width: r, height: i }) {
|
|
238
|
+
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.`;
|
|
239
|
+
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.`;
|
|
206
240
|
let o = new Set(e.map((e) => e.id));
|
|
207
|
-
return !
|
|
241
|
+
return !a(e) || !a(t) || !a(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
|
|
208
242
|
if (!Number.isFinite(e.width) || !Number.isFinite(e.height) || e.width <= 0 || e.height <= 0) return !0;
|
|
209
|
-
let t = !Number.isFinite(e.x) || e.x < 0 || e.x + e.width >
|
|
243
|
+
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;
|
|
210
244
|
return t || n;
|
|
211
245
|
}) ? "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) => {
|
|
212
246
|
let r = e.find((e) => e.id === n);
|
|
@@ -215,7 +249,7 @@ function _({ nodes: e, edges: t, groups: n, width: i, height: a }) {
|
|
|
215
249
|
return i || a;
|
|
216
250
|
})) ? "A group box must contain the node boxes assigned to it." : null;
|
|
217
251
|
}
|
|
218
|
-
function
|
|
252
|
+
function b(e, t) {
|
|
219
253
|
let n = [];
|
|
220
254
|
for (let r of e) {
|
|
221
255
|
let e = t.get(r.sourceId), i = t.get(r.targetId);
|
|
@@ -228,4 +262,4 @@ function v(e, t) {
|
|
|
228
262
|
}
|
|
229
263
|
return n;
|
|
230
264
|
}
|
|
231
|
-
export {
|
|
265
|
+
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,6 +1,6 @@
|
|
|
1
|
-
import { i as e, r as t, t as n } from "../categorical-values-
|
|
2
|
-
import {
|
|
3
|
-
import { t as o } from "../chart-input-
|
|
1
|
+
import { i as e, r as t, t as n } from "../categorical-values-FYc43JCa.js";
|
|
2
|
+
import { o as r, r as i, s as a } from "../chart-frame-Bczk5sWj.js";
|
|
3
|
+
import { t as o } from "../chart-input-CbzVN76m.js";
|
|
4
4
|
import { t as s } from "../plot-width--OgdohB5.js";
|
|
5
5
|
import * as c from "@stylexjs/stylex";
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -30,7 +30,7 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
|
|
|
30
30
|
tone: "neutral",
|
|
31
31
|
children: w
|
|
32
32
|
}, (e) => e.children === void 0 ? void 0 : [...e.children]).sum((e) => e.value);
|
|
33
|
-
return /* @__PURE__ */ u(
|
|
33
|
+
return /* @__PURE__ */ u(i, {
|
|
34
34
|
title: m,
|
|
35
35
|
description: h,
|
|
36
36
|
children: [
|
|
@@ -51,14 +51,14 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
|
|
|
51
51
|
size: [C, y],
|
|
52
52
|
paddingInner: 2,
|
|
53
53
|
children: (e) => e.leaves().map((e) => {
|
|
54
|
-
let t = e.x1 - e.x0 > 96 && e.y1 - e.y0 > 40;
|
|
54
|
+
let t = e.x1 - e.x0 > 96 && e.y1 - e.y0 > 40, n = Math.max(1, Math.floor((e.x1 - e.x0 - 16) / 7)), i = e.data.label.length > n ? `${e.data.label.slice(0, n - 1)}…` : e.data.label;
|
|
55
55
|
return /* @__PURE__ */ u("g", { children: [
|
|
56
56
|
/* @__PURE__ */ l("rect", {
|
|
57
57
|
x: e.x0,
|
|
58
58
|
y: e.y0,
|
|
59
59
|
width: e.x1 - e.x0,
|
|
60
60
|
height: e.y1 - e.y0,
|
|
61
|
-
fill:
|
|
61
|
+
fill: a[e.data.tone],
|
|
62
62
|
fillOpacity: .18,
|
|
63
63
|
...c.props(p.treeRect, v?.selectedId === e.data.id && r.selected)
|
|
64
64
|
}),
|
|
@@ -77,7 +77,7 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
|
|
|
77
77
|
x: 8,
|
|
78
78
|
y: 18,
|
|
79
79
|
className: "xlrhuyr x1hz01jw xy8obcc",
|
|
80
|
-
children:
|
|
80
|
+
children: i
|
|
81
81
|
}), _(e.data.value).length * 12 < e.x1 - e.x0 - 16 && /* @__PURE__ */ l("text", {
|
|
82
82
|
x: 8,
|
|
83
83
|
y: 34,
|