@mechane-ai/elements 0.19.0 → 0.20.1
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 +15 -4
- package/dist/ai.js +4 -4
- package/dist/{categorical-values-D-sSI9JB.js → categorical-values-DG0kzYxN.js} +2 -2
- package/dist/{chart-frame-vwS7YVgv.js → chart-frame-DxAZ0h_q.js} +50 -51
- package/dist/{chart-input-D6Fw2UGV.js → chart-input-Dru0GScv.js} +2 -2
- package/dist/charts/cartesian.js +279 -229
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +82 -80
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +136 -134
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +1 -1
- package/dist/code-block-DlUwVaPP.js +182 -0
- package/dist/collections.js +144 -143
- package/dist/{constants.stylex-bbdiv1fD.js → constants.stylex-BILvnwUk.js} +1 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +108 -102
- package/dist/content/tree.js +43 -41
- package/dist/{content-link-rdxJ94P8.js → content-link-BIMrgXbz.js} +1 -1
- package/dist/content.js +139 -137
- package/dist/elements.css +34 -0
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +349 -212
- package/dist/navigation/commands.js +1 -1
- package/dist/navigation.js +0 -1
- package/dist/packages/charts/src/chart-cursor.d.ts +7 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -7
- package/dist/packages/feedback/src/async-region.d.ts +3 -1
- package/dist/packages/foundations/src/constants.stylex.d.ts +1 -0
- package/dist/packages/foundations/src/use-scroll-tab-index.d.ts +6 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/navigation-rail.d.ts +18 -0
- package/dist/packages/layout/src/sidebar.d.ts +2 -1
- package/dist/pierre-diff-CHQsoQSZ.js +72 -0
- package/dist/{pierre-theme-BUeJim8s.js → pierre-theme-CLgk9v3e.js} +1 -1
- package/dist/{pierre-tree-BQBbAhmI.js → pierre-tree-D3XsgEH6.js} +4 -4
- package/dist/{src-BVsyKLQ8.js → src-0mocxTaR.js} +64 -43
- package/dist/{src-Dven_9lR.js → src-D4zPPr32.js} +1 -1
- package/dist/{src-BXh4g2VY.js → src-qU5Z5LRH.js} +1 -0
- package/dist/tokens.js +1 -1
- package/dist/use-scroll-tab-index-Dxpdh4W7.js +45 -0
- package/package.json +1 -1
- package/packages/foundations/src/constants.stylex.ts +1 -1
- package/dist/code-block-DB42-a0M.js +0 -180
- package/dist/pierre-diff-C_j0nxwS.js +0 -71
package/dist/charts/matrix.js
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
import { r as e } from "../tokens.stylex-DTHHFbyl.js";
|
|
2
|
-
import { n as t, r as n, t as r } from "../chart-input-
|
|
3
|
-
import { a as i, n as a, r as o, s, t as c } from "../chart-frame-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { n as t, r as n, t as r } from "../chart-input-Dru0GScv.js";
|
|
3
|
+
import { a as i, n as a, r as o, s, t as c } from "../chart-frame-DxAZ0h_q.js";
|
|
4
|
+
import { t as l } from "../use-scroll-tab-index-Dxpdh4W7.js";
|
|
5
|
+
import * as u from "@stylexjs/stylex";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
7
|
// packages/charts/src/matrix/heatmap-scale.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
8
|
+
var p = 100;
|
|
9
|
+
function m({ domain: e, palette: t }) {
|
|
9
10
|
return n(e) ? t === "diverging" && (e[0] >= 0 || e[1] <= 0) ? "A diverging color domain must include negative and positive values." : null : "The color domain must contain two finite, increasing endpoints.";
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function h(e, t) {
|
|
12
13
|
return e >= t[0] && e <= t[1];
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function g(t, { domain: n, palette: r }) {
|
|
15
16
|
if (r === "diverging") {
|
|
16
|
-
let r = t < 0 ? n[0] : n[1], i = Math.abs(t) / Math.abs(r) *
|
|
17
|
+
let r = t < 0 ? n[0] : n[1], i = Math.abs(t) / Math.abs(r) * p;
|
|
17
18
|
return `color-mix(in srgb, ${t < 0 ? s.negative : s.positive} ${i}%, ${e.surface})`;
|
|
18
19
|
}
|
|
19
|
-
let i = (t - n[0]) / (n[1] - n[0]) *
|
|
20
|
+
let i = (t - n[0]) / (n[1] - n[0]) * p;
|
|
20
21
|
return `color-mix(in srgb, ${s.series1} ${i}%, ${e.surface})`;
|
|
21
22
|
}
|
|
22
23
|
// packages/charts/src/matrix/color-legend.tsx
|
|
23
|
-
var
|
|
24
|
+
var _ = {
|
|
24
25
|
kUk6DE: "x98rzlu",
|
|
25
26
|
$$css: !0
|
|
26
|
-
},
|
|
27
|
-
|
|
27
|
+
}, v = { sample: (e) => [
|
|
28
|
+
_,
|
|
28
29
|
{
|
|
29
30
|
kWkggS: e == null ? e : "xl8spv7",
|
|
30
31
|
$$css: !0
|
|
31
32
|
},
|
|
32
33
|
{ "--x-backgroundColor": e ?? void 0 }
|
|
33
|
-
] },
|
|
34
|
-
function
|
|
35
|
-
let i =
|
|
34
|
+
] }, y = 20;
|
|
35
|
+
function b({ label: e, domain: t, palette: n, formatValue: r }) {
|
|
36
|
+
let i = m({
|
|
36
37
|
domain: t,
|
|
37
38
|
palette: n
|
|
38
39
|
});
|
|
39
|
-
if (i !== null) return /* @__PURE__ */
|
|
40
|
+
if (i !== null) return /* @__PURE__ */ d("p", {
|
|
40
41
|
role: "status",
|
|
41
42
|
className: "xrvj5dj xunmzkg x1ghz6dp xeuugli x1jkqq1h x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
|
|
42
43
|
children: i
|
|
43
44
|
});
|
|
44
|
-
let a = Array.from({ length: 21 }, (e, n) => t[0] + (t[1] - t[0]) * n /
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
let a = Array.from({ length: 21 }, (e, n) => t[0] + (t[1] - t[0]) * n / y);
|
|
46
|
+
return /* @__PURE__ */ f("div", {
|
|
46
47
|
"aria-label": `${e}: ${r(t[0])} to ${r(t[1])}`,
|
|
47
48
|
className: "xrvj5dj xunmzkg x1ghz6dp xeuugli x1jkqq1h x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
|
|
48
49
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ f("span", { children: [e, n === "diverging" && ` · Neutral: ${r(0)}`] }),
|
|
51
|
+
/* @__PURE__ */ d("div", {
|
|
51
52
|
"aria-hidden": !0,
|
|
52
53
|
className: "x78zum5 xdk7pt xmkeg23 x1y0btm7 x1ey3b81",
|
|
53
|
-
children: a.map((e) => /* @__PURE__ */
|
|
54
|
+
children: a.map((e) => /* @__PURE__ */ d("span", { ...u.props(v.sample(g(e, {
|
|
54
55
|
domain: t,
|
|
55
56
|
palette: n
|
|
56
57
|
}))) }, e))
|
|
57
58
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ f("div", {
|
|
59
60
|
"aria-hidden": !0,
|
|
60
61
|
className: "x78zum5 x1qughib x1n8ia3y xss6m8b",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ d("span", {
|
|
62
63
|
className: "xeuugli",
|
|
63
64
|
children: r(t[0])
|
|
64
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ d("span", {
|
|
65
66
|
className: "xeuugli xp4054r",
|
|
66
67
|
children: r(t[1])
|
|
67
68
|
})]
|
|
@@ -70,10 +71,10 @@ function y({ label: e, domain: t, palette: n, formatValue: r }) {
|
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
// packages/charts/src/matrix/matrix.tsx
|
|
73
|
-
var
|
|
74
|
+
var x = {
|
|
74
75
|
kKwaWg: "x1e87kdn",
|
|
75
76
|
$$css: !0
|
|
76
|
-
},
|
|
77
|
+
}, S = {
|
|
77
78
|
value: {
|
|
78
79
|
k1xSpc: "x78zum5",
|
|
79
80
|
kGNEyG: "x6s0dn4",
|
|
@@ -112,7 +113,7 @@ var b = {
|
|
|
112
113
|
kInvED: "x2ssjo2",
|
|
113
114
|
$$css: !0
|
|
114
115
|
},
|
|
115
|
-
measured: (e) => [
|
|
116
|
+
measured: (e) => [x, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
|
|
116
117
|
missing: {
|
|
117
118
|
kMwMTN: "x153jb6y",
|
|
118
119
|
kWkggS: "x1r7kqkb",
|
|
@@ -124,108 +125,109 @@ var b = {
|
|
|
124
125
|
kWkggS: "x1r7kqkb",
|
|
125
126
|
$$css: !0
|
|
126
127
|
}
|
|
127
|
-
},
|
|
128
|
+
}, C = {
|
|
128
129
|
value: void 0,
|
|
129
|
-
masked:
|
|
130
|
-
missing:
|
|
131
|
-
},
|
|
132
|
-
function
|
|
133
|
-
let
|
|
130
|
+
masked: S.masked,
|
|
131
|
+
missing: S.missing
|
|
132
|
+
}, w = 4096, T = 6;
|
|
133
|
+
function E({ title: e, description: t, rows: n, columns: s, cells: u, domain: p, palette: m, valueLabel: g, formatValue: _, selection: v, emptyLabel: y }) {
|
|
134
|
+
let x = l(), S = A({
|
|
134
135
|
rows: n,
|
|
135
136
|
columns: s,
|
|
136
|
-
cells:
|
|
137
|
-
domain:
|
|
138
|
-
palette:
|
|
137
|
+
cells: u,
|
|
138
|
+
domain: p,
|
|
139
|
+
palette: m
|
|
139
140
|
});
|
|
140
|
-
if (
|
|
141
|
+
if (S !== null) return /* @__PURE__ */ d(r, {
|
|
141
142
|
title: e,
|
|
142
143
|
description: t,
|
|
143
|
-
message:
|
|
144
|
+
message: S
|
|
144
145
|
});
|
|
145
|
-
let
|
|
146
|
-
for (let e of
|
|
147
|
-
let t =
|
|
148
|
-
t.set(e.columnId, e),
|
|
146
|
+
let C = /* @__PURE__ */ new Map();
|
|
147
|
+
for (let e of u) {
|
|
148
|
+
let t = C.get(e.rowId) ?? /* @__PURE__ */ new Map();
|
|
149
|
+
t.set(e.columnId, e), C.set(e.rowId, t);
|
|
149
150
|
}
|
|
150
|
-
let
|
|
151
|
-
return /* @__PURE__ */
|
|
151
|
+
let w = u.find((e) => e.id === v?.selectedId), E = n.find((e) => e.id === w?.rowId), O = s.find((e) => e.id === w?.columnId), j = w === void 0 ? void 0 : `${E?.label ?? w.rowId} → ${O?.label ?? w.columnId}: ${k(w, p, _)}`;
|
|
152
|
+
return /* @__PURE__ */ d(o, {
|
|
152
153
|
title: e,
|
|
153
154
|
description: t,
|
|
154
|
-
footer: /* @__PURE__ */
|
|
155
|
+
footer: /* @__PURE__ */ f("div", {
|
|
155
156
|
className: "xrvj5dj x1n8ia3y",
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
label:
|
|
159
|
-
domain:
|
|
160
|
-
palette:
|
|
161
|
-
formatValue:
|
|
158
|
+
/* @__PURE__ */ d(b, {
|
|
159
|
+
label: g,
|
|
160
|
+
domain: p,
|
|
161
|
+
palette: m,
|
|
162
|
+
formatValue: _
|
|
162
163
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ f("ul", {
|
|
164
165
|
"aria-label": "Cell states",
|
|
165
166
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc",
|
|
166
167
|
children: [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
u.some((e) => e.kind === "masked") && /* @__PURE__ */ d("li", { children: "× Masked" }),
|
|
169
|
+
u.some((e) => e.kind === "missing") && /* @__PURE__ */ d("li", { children: "— Missing" }),
|
|
170
|
+
u.length < n.length * s.length && /* @__PURE__ */ d("li", { children: "· Not supplied" }),
|
|
171
|
+
u.some((e) => e.kind === "value" && !h(e.value, p)) && /* @__PURE__ */ d("li", { children: "! Outside domain" }),
|
|
172
|
+
u.some((e) => e.kind === "value" && _(e.value).length > T) && /* @__PURE__ */ d("li", { children: "• See exact values in View data" })
|
|
172
173
|
]
|
|
173
174
|
}),
|
|
174
|
-
|
|
175
|
-
n.length > 0 && s.length > 0 && /* @__PURE__ */
|
|
175
|
+
v !== void 0 && /* @__PURE__ */ d(i, { children: j ?? "Select a cell to inspect its value." }),
|
|
176
|
+
n.length > 0 && s.length > 0 && /* @__PURE__ */ d(c, { children: /* @__PURE__ */ d("ul", {
|
|
176
177
|
className: "xe8uvvx x1ghz6dp x1717udv",
|
|
177
178
|
children: n.flatMap((e) => s.map((t) => {
|
|
178
|
-
let n =
|
|
179
|
-
return /* @__PURE__ */
|
|
179
|
+
let n = C.get(e.id)?.get(t.id), r = `${e.label} → ${t.label}`, i = k(n, p, _);
|
|
180
|
+
return /* @__PURE__ */ d("li", { children: /* @__PURE__ */ f(a, {
|
|
180
181
|
label: `${r}: ${i}`,
|
|
181
|
-
isSelected: n !== void 0 &&
|
|
182
|
-
onSelect: n === void 0 ||
|
|
183
|
-
children: [/* @__PURE__ */
|
|
182
|
+
isSelected: n !== void 0 && v?.selectedId === n.id,
|
|
183
|
+
onSelect: n === void 0 || v === void 0 ? void 0 : () => v.onSelect(n.id),
|
|
184
|
+
children: [/* @__PURE__ */ d("span", { children: r }), /* @__PURE__ */ d("span", { children: i })]
|
|
184
185
|
}) }, JSON.stringify([e.id, t.id]));
|
|
185
186
|
}))
|
|
186
187
|
}) })
|
|
187
188
|
]
|
|
188
189
|
}),
|
|
189
|
-
children: n.length === 0 || s.length === 0 ? /* @__PURE__ */
|
|
190
|
+
children: n.length === 0 || s.length === 0 ? /* @__PURE__ */ d("p", {
|
|
190
191
|
className: "x1ghz6dp x153jb6y xtqrqnz x1778rvt",
|
|
191
|
-
children:
|
|
192
|
-
}) : /* @__PURE__ */
|
|
192
|
+
children: y
|
|
193
|
+
}) : /* @__PURE__ */ d("div", {
|
|
194
|
+
ref: x.ref,
|
|
193
195
|
role: "region",
|
|
194
196
|
"aria-label": `${e} cells`,
|
|
195
|
-
tabIndex:
|
|
197
|
+
tabIndex: x.tabIndex,
|
|
196
198
|
className: "xysyzu8 x14eurpq xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal",
|
|
197
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ f("table", {
|
|
198
200
|
className: "x1vathgz x1jkpq5q xezivpi x1hz01jw",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
|
|
200
202
|
"aria-label": "Row",
|
|
201
203
|
className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft"
|
|
202
|
-
}), s.map((e) => /* @__PURE__ */
|
|
204
|
+
}), s.map((e) => /* @__PURE__ */ d("th", {
|
|
203
205
|
scope: "col",
|
|
204
206
|
title: e.label,
|
|
205
207
|
className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft",
|
|
206
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ d("span", {
|
|
207
209
|
className: "x1lliihq x100vrsf x1ff4b4a xb3r6kr xlyipyv x2b8uid x1hmw7ec",
|
|
208
210
|
children: e.label
|
|
209
211
|
})
|
|
210
|
-
}, e.id))] }) }), /* @__PURE__ */
|
|
212
|
+
}, e.id))] }) }), /* @__PURE__ */ d("tbody", { children: n.map((e) => /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
|
|
211
213
|
scope: "row",
|
|
212
214
|
title: e.label,
|
|
213
215
|
className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft",
|
|
214
|
-
children: /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ d("span", {
|
|
215
217
|
className: "x1lliihq x18qnofl xb3r6kr xlyipyv xx67isq",
|
|
216
218
|
children: e.label
|
|
217
219
|
})
|
|
218
220
|
}), s.map((t) => {
|
|
219
|
-
let n =
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
+
let n = C.get(e.id)?.get(t.id);
|
|
222
|
+
return /* @__PURE__ */ d("td", {
|
|
221
223
|
className: "x1717udv x100vrsf x1ff4b4a x2b8uid",
|
|
222
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ d(D, {
|
|
223
225
|
cell: n,
|
|
224
226
|
label: `${e.label}, ${t.label}`,
|
|
225
|
-
domain:
|
|
226
|
-
palette:
|
|
227
|
-
formatValue:
|
|
228
|
-
selection:
|
|
227
|
+
domain: p,
|
|
228
|
+
palette: m,
|
|
229
|
+
formatValue: _,
|
|
230
|
+
selection: v
|
|
229
231
|
})
|
|
230
232
|
}, t.id);
|
|
231
233
|
})] }, e.id)) })]
|
|
@@ -233,59 +235,59 @@ function T({ title: e, description: t, rows: n, columns: s, cells: l, domain: f,
|
|
|
233
235
|
})
|
|
234
236
|
});
|
|
235
237
|
}
|
|
236
|
-
function
|
|
237
|
-
if (e === void 0) return /* @__PURE__ */
|
|
238
|
+
function D({ cell: e, label: t, domain: n, palette: r, formatValue: i, selection: a }) {
|
|
239
|
+
if (e === void 0) return /* @__PURE__ */ d("span", {
|
|
238
240
|
role: "img",
|
|
239
241
|
"aria-label": `${t}: not supplied`,
|
|
240
242
|
title: `${t}: not supplied`,
|
|
241
243
|
className: "x78zum5 x6s0dn4 xl56j7k x100vrsf x1ff4b4a x1vqgdyp x992rv9 x9f619 xmkeg23 x1ey3b81 x1717udv x1hz01jw xy8obcc xj57cvi xas2l8k xss6m8b x153jb6y x1r7kqkb xbsl7fq",
|
|
242
244
|
children: "·"
|
|
243
245
|
});
|
|
244
|
-
let o = e.kind === "value" && !
|
|
246
|
+
let o = e.kind === "value" && !h(e.value, n), s = k(e, n, i), c = `${t}: ${s}`, l = e.kind === "value" && !o ? g(e.value, {
|
|
245
247
|
domain: n,
|
|
246
248
|
palette: r
|
|
247
|
-
}) : void 0, f =
|
|
249
|
+
}) : void 0, f = u.props(S.value, C[e.kind], l !== void 0 && S.measured(l), o && S.missing, a !== void 0 && S.interactive, a?.selectedId === e.id && S.selected), p = O(e, s, o), m = e.kind === "value" ? /* @__PURE__ */ d("span", {
|
|
248
250
|
className: "xpvm0e4 x1r97e56",
|
|
249
251
|
children: p
|
|
250
252
|
}) : p;
|
|
251
|
-
return a === void 0 ? /* @__PURE__ */
|
|
253
|
+
return a === void 0 ? /* @__PURE__ */ d("span", {
|
|
252
254
|
role: "img",
|
|
253
255
|
"aria-label": c,
|
|
254
256
|
title: c,
|
|
255
257
|
...f,
|
|
256
|
-
children:
|
|
257
|
-
}) : /* @__PURE__ */
|
|
258
|
+
children: m
|
|
259
|
+
}) : /* @__PURE__ */ d("button", {
|
|
258
260
|
type: "button",
|
|
259
261
|
"aria-label": c,
|
|
260
262
|
title: c,
|
|
261
263
|
"aria-pressed": a.selectedId === e.id,
|
|
262
264
|
onClick: () => a.onSelect(e.id),
|
|
263
265
|
...f,
|
|
264
|
-
children:
|
|
266
|
+
children: m
|
|
265
267
|
});
|
|
266
268
|
}
|
|
267
|
-
function
|
|
269
|
+
function O(e, t, n) {
|
|
268
270
|
switch (e.kind) {
|
|
269
271
|
case "masked": return "×";
|
|
270
272
|
case "missing": return "—";
|
|
271
|
-
case "value": return n ? "!" : t.length <=
|
|
273
|
+
case "value": return n ? "!" : t.length <= T ? t : e.value === 0 ? "0" : "•";
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
|
-
function
|
|
276
|
+
function k(e, t, n) {
|
|
275
277
|
if (e === void 0) return "Not supplied";
|
|
276
278
|
switch (e.kind) {
|
|
277
|
-
case "value": return `${n(e.value)}${
|
|
279
|
+
case "value": return `${n(e.value)}${h(e.value, t) ? "" : " (outside domain)"}`;
|
|
278
280
|
case "masked": return `Masked: ${e.reason}`;
|
|
279
281
|
case "missing": return `Missing: ${e.reason}`;
|
|
280
282
|
}
|
|
281
283
|
}
|
|
282
|
-
function
|
|
283
|
-
let o =
|
|
284
|
+
function A({ rows: e, columns: n, cells: r, domain: i, palette: a }) {
|
|
285
|
+
let o = m({
|
|
284
286
|
domain: i,
|
|
285
287
|
palette: a
|
|
286
288
|
});
|
|
287
289
|
if (o !== null) return o;
|
|
288
|
-
if (e.length * n.length > 4096 || r.length > 4096) return `This matrix exceeds the ${
|
|
290
|
+
if (e.length * n.length > 4096 || r.length > 4096) return `This matrix exceeds the ${w}-cell render limit. Supply a smaller, labelled window.`;
|
|
289
291
|
let s = new Set(e.map((e) => e.id)), c = new Set(n.map((e) => e.id));
|
|
290
292
|
if (!t(e) || !t(n) || !t(r)) return "Matrix rows, columns, and cells must have unique identifiers.";
|
|
291
293
|
let l = /* @__PURE__ */ new Map();
|
|
@@ -299,7 +301,7 @@ function k({ rows: e, columns: n, cells: r, domain: i, palette: a }) {
|
|
|
299
301
|
return null;
|
|
300
302
|
}
|
|
301
303
|
// packages/charts/src/matrix/token-heatmap.tsx
|
|
302
|
-
var
|
|
304
|
+
var j = {
|
|
303
305
|
token: {
|
|
304
306
|
k1xSpc: "xt0psk2",
|
|
305
307
|
kmVPX3: "x1717udv",
|
|
@@ -344,47 +346,47 @@ var A = {
|
|
|
344
346
|
kInvED: "x1y3gkto",
|
|
345
347
|
$$css: !0
|
|
346
348
|
}
|
|
347
|
-
},
|
|
348
|
-
function
|
|
349
|
-
let
|
|
349
|
+
}, M = 2048;
|
|
350
|
+
function N({ title: e, description: t, tokens: n, domain: s, palette: l, valueLabel: p, formatValue: m, selection: _, emptyLabel: v }) {
|
|
351
|
+
let y = F({
|
|
350
352
|
tokens: n,
|
|
351
353
|
domain: s,
|
|
352
|
-
palette:
|
|
354
|
+
palette: l
|
|
353
355
|
});
|
|
354
|
-
if (
|
|
356
|
+
if (y !== null) return /* @__PURE__ */ d(r, {
|
|
355
357
|
title: e,
|
|
356
358
|
description: t,
|
|
357
|
-
message:
|
|
359
|
+
message: y
|
|
358
360
|
});
|
|
359
361
|
let x = n.find((e) => e.id === _?.selectedId);
|
|
360
|
-
return /* @__PURE__ */
|
|
362
|
+
return /* @__PURE__ */ f(o, {
|
|
361
363
|
title: e,
|
|
362
364
|
description: t,
|
|
363
|
-
footer: /* @__PURE__ */
|
|
365
|
+
footer: /* @__PURE__ */ f("div", {
|
|
364
366
|
className: "xrvj5dj x1n8ia3y",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ d(b, {
|
|
366
368
|
label: p,
|
|
367
369
|
domain: s,
|
|
368
|
-
palette:
|
|
369
|
-
formatValue:
|
|
370
|
-
}), _ !== void 0 && n.length > 0 && /* @__PURE__ */
|
|
370
|
+
palette: l,
|
|
371
|
+
formatValue: m
|
|
372
|
+
}), _ !== void 0 && n.length > 0 && /* @__PURE__ */ d(i, { children: x === void 0 ? "Select a token to inspect its exact text and score." : `Token ${x.index}, ${JSON.stringify(x.text)}, ${p}: ${P(x, s, m)}` })]
|
|
371
373
|
}),
|
|
372
|
-
children: [n.length === 0 ? /* @__PURE__ */
|
|
374
|
+
children: [n.length === 0 ? /* @__PURE__ */ d("p", {
|
|
373
375
|
className: "x1ghz6dp x153jb6y xtqrqnz x1778rvt",
|
|
374
376
|
children: v
|
|
375
|
-
}) : /* @__PURE__ */
|
|
377
|
+
}) : /* @__PURE__ */ d("p", {
|
|
376
378
|
"aria-label": `${e} token text`,
|
|
377
379
|
className: "x1ghz6dp xbixft xiard35 xtqrqnz x1778rvt x126k92a xj0a0fe",
|
|
378
380
|
children: n.map((e) => {
|
|
379
|
-
let t = e.score !== null && !
|
|
381
|
+
let t = e.score !== null && !h(e.score, s), n = `Token ${e.index}, ${JSON.stringify(e.text)}, ${p}: ${P(e, s, m)}`, r = u.props(j.token, e.score === null || t ? j.missing : j.color(g(e.score, {
|
|
380
382
|
domain: s,
|
|
381
|
-
palette:
|
|
382
|
-
})), _ !== void 0 &&
|
|
383
|
-
return _ === void 0 ? /* @__PURE__ */
|
|
383
|
+
palette: l
|
|
384
|
+
})), _ !== void 0 && j.interactive, _?.selectedId === e.id && j.selected);
|
|
385
|
+
return _ === void 0 ? /* @__PURE__ */ d("span", {
|
|
384
386
|
title: n,
|
|
385
387
|
...r,
|
|
386
388
|
children: e.text
|
|
387
|
-
}, e.id) : /* @__PURE__ */
|
|
389
|
+
}, e.id) : /* @__PURE__ */ d("button", {
|
|
388
390
|
type: "button",
|
|
389
391
|
"aria-label": n,
|
|
390
392
|
"aria-pressed": _.selectedId === e.id,
|
|
@@ -393,60 +395,60 @@ function M({ title: e, description: t, tokens: n, domain: s, palette: f, valueLa
|
|
|
393
395
|
children: e.text
|
|
394
396
|
}, e.id);
|
|
395
397
|
})
|
|
396
|
-
}), n.length > 0 && /* @__PURE__ */
|
|
398
|
+
}), n.length > 0 && /* @__PURE__ */ d(c, {
|
|
397
399
|
label: "Token values",
|
|
398
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ f("table", {
|
|
399
401
|
className: "xh8yej3 x1mwwwfo x1yc453h xy8obcc xas2l8k",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
|
403
|
+
/* @__PURE__ */ d("th", {
|
|
402
404
|
scope: "col",
|
|
403
405
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi",
|
|
404
406
|
children: "Index"
|
|
405
407
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ d("th", {
|
|
407
409
|
scope: "col",
|
|
408
410
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi",
|
|
409
411
|
children: "Exact text"
|
|
410
412
|
}),
|
|
411
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ d("th", {
|
|
412
414
|
scope: "col",
|
|
413
415
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi",
|
|
414
416
|
children: p
|
|
415
417
|
})
|
|
416
|
-
] }) }), /* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
+
] }) }), /* @__PURE__ */ d("tbody", { children: n.map((e) => /* @__PURE__ */ f("tr", { children: [
|
|
419
|
+
/* @__PURE__ */ d("td", {
|
|
418
420
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi x1df8dnd",
|
|
419
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ d(a, {
|
|
420
422
|
label: `Select token ${e.index}: ${JSON.stringify(e.text)}`,
|
|
421
423
|
isSelected: _?.selectedId === e.id,
|
|
422
424
|
onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
|
|
423
425
|
children: e.index
|
|
424
426
|
})
|
|
425
427
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ d("td", {
|
|
427
429
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi xiard35 x126k92a xj0a0fe",
|
|
428
430
|
children: JSON.stringify(e.text)
|
|
429
431
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ d("td", {
|
|
431
433
|
className: "x1hmw7ec x5g2kb4 xso031l x1q0q8m5 x1qndepd x1yc453h xj57cvi",
|
|
432
|
-
children:
|
|
434
|
+
children: P(e, s, m)
|
|
433
435
|
})
|
|
434
436
|
] }, e.id)) })]
|
|
435
437
|
})
|
|
436
438
|
})]
|
|
437
439
|
});
|
|
438
440
|
}
|
|
439
|
-
function
|
|
440
|
-
return e.score === null ? "Unavailable" : `${n(e.score)}${
|
|
441
|
+
function P(e, t, n) {
|
|
442
|
+
return e.score === null ? "Unavailable" : `${n(e.score)}${h(e.score, t) ? "" : " (outside domain)"}`;
|
|
441
443
|
}
|
|
442
|
-
function
|
|
443
|
-
let i =
|
|
444
|
+
function F({ tokens: e, domain: n, palette: r }) {
|
|
445
|
+
let i = m({
|
|
444
446
|
domain: n,
|
|
445
447
|
palette: r
|
|
446
448
|
});
|
|
447
|
-
return i === null ? e.length > 2048 ? `This token view exceeds the ${
|
|
449
|
+
return i === null ? e.length > 2048 ? `This token view exceeds the ${M}-token render limit. Supply a smaller, labelled window.` : !t(e) || new Set(e.map((e) => e.index)).size !== e.length ? "Tokens must have unique identifiers and supplied indices." : e.some((e) => {
|
|
448
450
|
let t = !Number.isSafeInteger(e.index) || e.index < 0, n = e.score !== null && !Number.isFinite(e.score);
|
|
449
451
|
return t || n;
|
|
450
452
|
}) ? "Token indices must be nonnegative integers and measured scores must be finite. Use null for unavailable scores." : null : i;
|
|
451
453
|
}
|
|
452
|
-
export {
|
|
454
|
+
export { b as ColorLegend, M as MAX_HEATMAP_TOKENS, w as MAX_MATRIX_CELLS, E as Matrix, N as TokenHeatmap };
|
package/dist/charts/timeline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import { n as t, t as n } from "../chart-input-
|
|
1
|
+
import { c as e } from "../src-qU5Z5LRH.js";
|
|
2
|
+
import { n as t, t as n } from "../chart-input-Dru0GScv.js";
|
|
3
3
|
import * as r from "@stylexjs/stylex";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { scaleLinear as o } from "@visx/scale";
|
package/dist/charts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as ChartFrame, i as ChartLegend } from "./chart-frame-
|
|
1
|
+
export { r as ChartFrame, i as ChartLegend } from "./chart-frame-DxAZ0h_q.js";
|