@mechane-ai/elements 0.67.0 → 0.68.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/dist/ai.js +225 -224
- package/dist/{article-anMy8fA5.js → article-Ni152e-v.js} +104 -89
- package/dist/article.js +1 -1
- package/dist/catalog.json +71 -1
- package/dist/{categorical-values-Bh7ZkEQn.js → categorical-values-6Iz03F1i.js} +1 -1
- package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/plot.js +16 -15
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/{dumbbell-plot-BQDGe0sQ.js → dumbbell-plot-jaQvOctJ.js} +4 -4
- package/dist/{embedding-map-DmmknG7A.js → embedding-map-DnZL1kvY.js} +5 -5
- package/dist/figure-format-BVb7yFCA.js +46 -0
- package/dist/{figure-frame-DlyNTDzh.js → figure-frame-96zFqsWz.js} +1 -1
- package/dist/{image-grid-CxEAQvTf.js → image-grid-B6fdmE9c.js} +3 -3
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +8 -8
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +641 -229
- package/dist/kits/training.js +4 -4
- package/dist/lesson.js +3 -3
- package/dist/markdown-JeuBeMDZ.js +293 -0
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/plot/index.d.ts +2 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
- package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
- package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +7 -0
- package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
- package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
- package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
- package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
- package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
- package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
- package/dist/{param-CKr8EYxF.js → param-Dk92C-K1.js} +1 -1
- package/dist/plot-CpTwLIYN.js +101 -0
- package/dist/{plot-layout-CVzSbcU7.js → plot-layout-1MG72ZWn.js} +151 -101
- package/dist/{plot-surface-CBhI1alw.js → plot-surface-8-FZI94y.js} +1 -1
- package/dist/{reference-lines-C970JwWZ.js → reference-lines-C18o1yEY.js} +1 -1
- package/dist/{scene-C3dCxckI.js → scene-B8dppj5V.js} +7 -7
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DekEJxsy.js → slope-chart-CELflRJd.js} +5 -5
- package/dist/styles2.css +12 -0
- package/dist/{time-series-BSNnijxf.js → time-series-DtAtGoT_.js} +6 -6
- package/dist/{timeline-CnxfYSIg.js → timeline-CzianQir.js} +4 -4
- package/dist/{token-heatmap-CJaXo56P.js → token-heatmap-m6oaMwkK.js} +273 -288
- package/dist/{token-predictions-Bi7aKPnh.js → token-predictions-CpGVjOIs.js} +4 -4
- package/dist/{transport-CXj0DV6o.js → transport-DQ1yzsQl.js} +2 -2
- package/dist/{tree-diagram-BxOZsjr1.js → tree-diagram-D9ekymCQ.js} +4 -4
- package/dist/{treemap-B2yOAetT.js → treemap-DT8q65LQ.js} +5 -5
- package/dist/{use-tween-C1TWJwce.js → use-tween-DbXVZBR8.js} +1 -1
- package/dist/{violin-plot-W2L_2JRo.js → violin-plot-83HSjnQM.js} +4 -4
- package/dist/visible-motion-D6NwjGNz.js +24 -0
- package/dist/{waterfall-Bt73N2Ng.js → waterfall-DmApvdrY.js} +4 -4
- package/package.json +1 -1
- package/recipes/recorded-motion.tsx +14 -0
- package/skills/review-elements/SKILL.md +4 -0
- package/skills/review-explainer/SKILL.md +4 -0
- package/skills/use-elements/SKILL.md +2 -0
- package/skills/use-elements/references/kits.md +23 -0
- package/skills/write-explainer/SKILL.md +5 -0
- package/dist/figure-format-B8kRZMlo.js +0 -36
- package/dist/markdown-Diffqqm7.js +0 -313
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { r as e } from "./tokens.stylex-dF5CACEJ.js";
|
|
2
2
|
import { d as t, l as n, s as r } from "./dates-OTq-xU33.js";
|
|
3
|
-
import { A as i, D as a, E as o, M as s, O as c, S as l, a as u, j as d, k as f } from "./plot-layout-
|
|
3
|
+
import { A as i, D as a, E as o, M as s, O as c, S as l, a as u, j as d, k as f } from "./plot-layout-1MG72ZWn.js";
|
|
4
4
|
import { i as p } from "./chart-link-AE_xuxiP.js";
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as ae } from "./color-legend-
|
|
10
|
-
import { m as
|
|
11
|
-
import * as
|
|
5
|
+
import { r as m } from "./figure-format-BVb7yFCA.js";
|
|
6
|
+
import { i as h, l as g, n as _, r as ee, t as te } from "./figure-frame-96zFqsWz.js";
|
|
7
|
+
import { n as ne, t as re } from "./plot-width-D3hTycYX.js";
|
|
8
|
+
import { n as v, r as y, t as ie } from "./heatmap-scale-Zte6Ya-g.js";
|
|
9
|
+
import { t as ae } from "./color-legend-4As8881l.js";
|
|
10
|
+
import { m as b } from "./values-963L6n1m.js";
|
|
11
|
+
import * as x from "@stylexjs/stylex";
|
|
12
12
|
import { useId as oe, useRef as se } from "react";
|
|
13
|
-
import { announce as ce, cellsToText as
|
|
14
|
-
import { Fragment as
|
|
13
|
+
import { announce as ce, cellsToText as S, isRTL as le } from "@ui-sdk/core";
|
|
14
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
15
|
+
import { dateFormatter as E } from "@ui-sdk/core/date";
|
|
15
16
|
// packages/charts/src/matrix/matrix-cells.ts
|
|
16
|
-
var
|
|
17
|
+
var D = {
|
|
17
18
|
digitPx: 7,
|
|
18
19
|
insetPx: 5,
|
|
19
20
|
sides: 2,
|
|
20
21
|
percent: 100
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
-
return Math.floor((e -
|
|
23
|
+
function ue(e) {
|
|
24
|
+
return Math.floor((e - D.insetPx * D.sides) / D.digitPx);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
let i = typeof n != "function" && n.style === "percent" ? e *
|
|
26
|
+
function de({ value: e, locale: t, format: n, capacity: r }) {
|
|
27
|
+
let i = typeof n != "function" && n.style === "percent" ? e * D.percent : e;
|
|
27
28
|
return (typeof n == "function" || !(typeof n != "function" && (e === 0 || Math.abs(i) >= 1)) ? [n] : [
|
|
28
29
|
n,
|
|
29
30
|
{
|
|
@@ -37,33 +38,33 @@ function fe({ value: e, locale: t, format: n, capacity: r }) {
|
|
|
37
38
|
minimumFractionDigits: 0,
|
|
38
39
|
maximumFractionDigits: 1
|
|
39
40
|
}
|
|
40
|
-
]).map((n) =>
|
|
41
|
+
]).map((n) => m({
|
|
41
42
|
value: e,
|
|
42
43
|
locale: t,
|
|
43
44
|
format: n
|
|
44
45
|
})).find((e) => e.length <= r);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function fe(e, t, n) {
|
|
47
48
|
switch (e.kind) {
|
|
48
49
|
case "masked": return "×";
|
|
49
50
|
case "missing": return "—";
|
|
50
51
|
case "value": return n ? "!" : t ?? (e.value === 0 ? "0" : "•");
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function pe({ cell: e, domain: t, locale: n, format: r }) {
|
|
54
55
|
if (e === void 0) return "Not supplied";
|
|
55
56
|
switch (e.kind) {
|
|
56
|
-
case "value": return `${
|
|
57
|
+
case "value": return `${m({
|
|
57
58
|
value: e.value,
|
|
58
59
|
locale: n,
|
|
59
60
|
format: r
|
|
60
|
-
})}${
|
|
61
|
+
})}${y(e.value, t) ? "" : " (outside domain)"}`;
|
|
61
62
|
case "masked": return `Masked: ${e.reason}`;
|
|
62
63
|
case "missing": return `Missing: ${e.reason}`;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
// packages/charts/src/matrix/matrix-mark.tsx
|
|
66
|
-
var
|
|
67
|
+
var O = {
|
|
67
68
|
interactive: {
|
|
68
69
|
kkrTdU: "x1ypdohk",
|
|
69
70
|
k3XXqK: "x1t137rt",
|
|
@@ -87,7 +88,7 @@ var D = {
|
|
|
87
88
|
$$css: !0
|
|
88
89
|
}, { "--x-boxShadow": e ?? void 0 }]
|
|
89
90
|
};
|
|
90
|
-
function
|
|
91
|
+
function me({ view: e, isSelectable: t, appearance: n, children: r }) {
|
|
91
92
|
let i = e.isInspected || e.isSelected, o = t && e.cell !== void 0;
|
|
92
93
|
return /* @__PURE__ */ w(a, {
|
|
93
94
|
value: e.id,
|
|
@@ -100,19 +101,19 @@ function he({ view: e, isSelectable: t, appearance: n, children: r }) {
|
|
|
100
101
|
}) : /* @__PURE__ */ w("span", { role: "img" }),
|
|
101
102
|
"aria-label": e.label,
|
|
102
103
|
title: e.label,
|
|
103
|
-
...
|
|
104
|
+
...x.props(...n, o && O.interactive, e.edges !== void 0 && O.edges(e.edges), i && O.marked, !i && e.isCursor && ne.cursor),
|
|
104
105
|
children: r
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
// packages/charts/src/matrix/matrix-range.ts
|
|
108
|
-
function
|
|
109
|
+
function k(e, t) {
|
|
109
110
|
return e.findIndex((e) => e.id === t);
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
if (e !== null) return [e.anchor, e.end].every((e) =>
|
|
112
|
+
function he(e, { rows: t, columns: n }) {
|
|
113
|
+
if (e !== null) return [e.anchor, e.end].every((e) => k(t, e.rowId) >= 0 && k(n, e.columnId) >= 0) ? void 0 : "The cell range must refer to a supplied row and column at both corners.";
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
let r =
|
|
115
|
+
function ge(e, { rows: t, columns: n }) {
|
|
116
|
+
let r = k(t, e.anchor.rowId), i = k(t, e.end.rowId), a = k(n, e.anchor.columnId), o = k(n, e.end.columnId);
|
|
116
117
|
return {
|
|
117
118
|
top: Math.min(r, i),
|
|
118
119
|
bottom: Math.max(r, i),
|
|
@@ -120,23 +121,23 @@ function _e(e, { rows: t, columns: n }) {
|
|
|
120
121
|
right: Math.max(a, o)
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function _e(e, t, n) {
|
|
124
125
|
let r = t >= e.top && t <= e.bottom, i = n >= e.left && n <= e.right;
|
|
125
126
|
return r && i;
|
|
126
127
|
}
|
|
127
|
-
var
|
|
128
|
+
var A = {
|
|
128
129
|
ArrowUp: -1,
|
|
129
130
|
ArrowDown: 1
|
|
130
|
-
},
|
|
131
|
+
}, ve = {
|
|
131
132
|
ArrowLeft: -1,
|
|
132
133
|
ArrowRight: 1
|
|
133
134
|
};
|
|
134
|
-
function
|
|
135
|
-
let o = t?.anchor ?? n, s = t?.end ?? n, c =
|
|
135
|
+
function ye({ key: e, range: t, from: n, isReversed: r, rows: i, columns: a }) {
|
|
136
|
+
let o = t?.anchor ?? n, s = t?.end ?? n, c = k(i, s.rowId), l = k(a, s.columnId), u = a.length - 1, d = r ? -1 : 1, f = {
|
|
136
137
|
Home: 0,
|
|
137
138
|
End: u
|
|
138
|
-
}, p =
|
|
139
|
-
if (h === void 0 &&
|
|
139
|
+
}, p = ve[e], m = A[e] ?? 0, h = f[e] ?? (p === void 0 ? void 0 : l + p * d);
|
|
140
|
+
if (h === void 0 && A[e] === void 0) return;
|
|
140
141
|
let g = i[Math.max(0, Math.min(i.length - 1, c + m))], _ = a[Math.max(0, Math.min(u, h ?? l))];
|
|
141
142
|
if (g !== void 0 && _ !== void 0) return {
|
|
142
143
|
anchor: o,
|
|
@@ -146,7 +147,7 @@ function be({ key: e, range: t, from: n, isReversed: r, rows: i, columns: a }) {
|
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function be({ rows: e, columns: t }) {
|
|
150
151
|
let [n, r, i, a] = [
|
|
151
152
|
e[0],
|
|
152
153
|
e.at(-1),
|
|
@@ -164,24 +165,24 @@ function xe({ rows: e, columns: t }) {
|
|
|
164
165
|
}
|
|
165
166
|
};
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function xe({ bounds: e, rows: t, columns: n, read: r }) {
|
|
168
169
|
let i = t.slice(e.top, e.bottom + 1).map((t) => n.slice(e.left, e.right + 1).map((e) => r({
|
|
169
170
|
rowId: t.id,
|
|
170
171
|
columnId: e.id
|
|
171
172
|
})));
|
|
172
|
-
return
|
|
173
|
+
return S(i.map((e) => [...e]));
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
+
function j({ items: e, from: t, to: n, noun: r }) {
|
|
175
176
|
let i = e[t]?.label ?? "", a = e[n]?.label ?? "";
|
|
176
177
|
return t === n ? `${r} ${i}` : `${r}s ${i} to ${a}`;
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
-
return `${r === 1 ? "1 cell" : `${r} cells`} selected: ${
|
|
179
|
+
function Se({ bounds: e, rows: t, columns: n, count: r, rowNoun: i = "row", columnNoun: a = "column" }) {
|
|
180
|
+
return `${r === 1 ? "1 cell" : `${r} cells`} selected: ${j({
|
|
180
181
|
items: t,
|
|
181
182
|
from: e.top,
|
|
182
183
|
to: e.bottom,
|
|
183
184
|
noun: i
|
|
184
|
-
})}, ${
|
|
185
|
+
})}, ${j({
|
|
185
186
|
items: n,
|
|
186
187
|
from: e.left,
|
|
187
188
|
to: e.right,
|
|
@@ -189,7 +190,7 @@ function Ce({ bounds: e, rows: t, columns: n, count: r, rowNoun: i = "row", colu
|
|
|
189
190
|
})}`;
|
|
190
191
|
}
|
|
191
192
|
// packages/charts/src/matrix/matrix-strip.tsx
|
|
192
|
-
var
|
|
193
|
+
var Ce = {
|
|
193
194
|
k1xSpc: "xrvj5dj",
|
|
194
195
|
kumcoG: "xqketvx",
|
|
195
196
|
k1C7PZ: "xuwhhnn",
|
|
@@ -198,11 +199,11 @@ var we = {
|
|
|
198
199
|
k7Eaqz: "xeuugli",
|
|
199
200
|
kMv6JI: "x1hz01jw",
|
|
200
201
|
$$css: !0
|
|
201
|
-
},
|
|
202
|
+
}, we = {
|
|
202
203
|
kKwaWg: "x1e87kdn",
|
|
203
204
|
$$css: !0
|
|
204
|
-
},
|
|
205
|
-
grid: (e) => [
|
|
205
|
+
}, M = {
|
|
206
|
+
grid: (e) => [Ce, { "--x-gridTemplateColumns": `minmax(48px, max-content) repeat(${e}, minmax(14px, 1fr))` == null ? void 0 : `minmax(48px, max-content) repeat(${e}, minmax(14px, 1fr))` }],
|
|
206
207
|
header: {
|
|
207
208
|
k7Eaqz: "xeuugli",
|
|
208
209
|
khDVqt: "xuxw1ft",
|
|
@@ -241,7 +242,7 @@ var we = {
|
|
|
241
242
|
kLWn49: "xo5v014",
|
|
242
243
|
$$css: !0
|
|
243
244
|
},
|
|
244
|
-
measured: (e) => [
|
|
245
|
+
measured: (e) => [we, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
|
|
245
246
|
empty: {
|
|
246
247
|
kWkggS: "x1r7kqkb",
|
|
247
248
|
$$css: !0
|
|
@@ -256,7 +257,7 @@ var we = {
|
|
|
256
257
|
kVAM5u: "x159tnba",
|
|
257
258
|
$$css: !0
|
|
258
259
|
}
|
|
259
|
-
},
|
|
260
|
+
}, Te = {
|
|
260
261
|
clip: {
|
|
261
262
|
kVQacm: "xb3r6kr",
|
|
262
263
|
kg5iWk: "xbrixnn",
|
|
@@ -268,7 +269,7 @@ var we = {
|
|
|
268
269
|
k9WMMc: "x1yc453h",
|
|
269
270
|
$$css: !0
|
|
270
271
|
}
|
|
271
|
-
},
|
|
272
|
+
}, N = {
|
|
272
273
|
text: { $$css: !0 },
|
|
273
274
|
mono: {
|
|
274
275
|
kMv6JI: "xiard35",
|
|
@@ -276,22 +277,22 @@ var we = {
|
|
|
276
277
|
$$css: !0
|
|
277
278
|
}
|
|
278
279
|
};
|
|
279
|
-
function
|
|
280
|
-
let t = e.cell === void 0 || e.cell.kind === "masked" ?
|
|
280
|
+
function P(e) {
|
|
281
|
+
let t = e.cell === void 0 || e.cell.kind === "masked" ? M.empty : M.dashed;
|
|
281
282
|
return [
|
|
282
|
-
|
|
283
|
-
e.fill === void 0 ? t :
|
|
284
|
-
e.marking === "outlined" &&
|
|
283
|
+
M.cell,
|
|
284
|
+
e.fill === void 0 ? t : M.measured(e.fill),
|
|
285
|
+
e.marking === "outlined" && M.outlined
|
|
285
286
|
];
|
|
286
287
|
}
|
|
287
|
-
function
|
|
288
|
+
function F(e) {
|
|
288
289
|
return e.cell?.kind === "value" && !e.isOutside ? "" : e.glyph;
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
+
function Ee({ rows: e, columns: t, rowTitle: n, columnTitle: r, font: i, headers: a, viewAt: o, isSelectable: s }) {
|
|
291
292
|
return /* @__PURE__ */ T("div", {
|
|
292
|
-
...
|
|
293
|
+
...x.props(M.grid(t.length)),
|
|
293
294
|
children: [
|
|
294
|
-
r !== void 0 && /* @__PURE__ */ T(
|
|
295
|
+
r !== void 0 && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", { "aria-hidden": !0 }), /* @__PURE__ */ w("span", {
|
|
295
296
|
"aria-hidden": !0,
|
|
296
297
|
className: "xeuugli xuxw1ft xy8obcc xas2l8k xbixft xk4h15q x17d9j0x",
|
|
297
298
|
children: r
|
|
@@ -304,7 +305,7 @@ function De({ rows: e, columns: t, rowTitle: n, columnTitle: r, font: i, headers
|
|
|
304
305
|
t.map((e) => /* @__PURE__ */ w("span", {
|
|
305
306
|
"aria-hidden": !0,
|
|
306
307
|
title: e.label,
|
|
307
|
-
...
|
|
308
|
+
...x.props(M.header, Te[a], N[i]),
|
|
308
309
|
children: e.axisLabel ?? e.label
|
|
309
310
|
}, e.id)),
|
|
310
311
|
e.map((e) => /* @__PURE__ */ T("div", {
|
|
@@ -312,18 +313,18 @@ function De({ rows: e, columns: t, rowTitle: n, columnTitle: r, font: i, headers
|
|
|
312
313
|
children: [/* @__PURE__ */ w("span", {
|
|
313
314
|
"aria-hidden": !0,
|
|
314
315
|
title: e.label,
|
|
315
|
-
...
|
|
316
|
+
...x.props(M.rowLabel, N[i]),
|
|
316
317
|
children: e.label
|
|
317
318
|
}), t.map((t) => {
|
|
318
319
|
let n = o(e.id, t.id);
|
|
319
320
|
return n === void 0 ? /* @__PURE__ */ w("span", {
|
|
320
321
|
"aria-hidden": !0,
|
|
321
322
|
className: "xqtp20y"
|
|
322
|
-
}, t.id) : /* @__PURE__ */ w(
|
|
323
|
+
}, t.id) : /* @__PURE__ */ w(me, {
|
|
323
324
|
view: n,
|
|
324
325
|
isSelectable: s,
|
|
325
|
-
appearance:
|
|
326
|
-
children:
|
|
326
|
+
appearance: P(n),
|
|
327
|
+
children: F(n)
|
|
327
328
|
}, t.id);
|
|
328
329
|
})]
|
|
329
330
|
}, e.id))
|
|
@@ -331,11 +332,11 @@ function De({ rows: e, columns: t, rowTitle: n, columnTitle: r, font: i, headers
|
|
|
331
332
|
});
|
|
332
333
|
}
|
|
333
334
|
// packages/charts/src/matrix/matrix-types.ts
|
|
334
|
-
function
|
|
335
|
+
function I(e, t) {
|
|
335
336
|
return JSON.stringify([e, t]);
|
|
336
337
|
}
|
|
337
338
|
// packages/charts/src/matrix/matrix-figure.tsx
|
|
338
|
-
var
|
|
339
|
+
var L = { cells: 4096 }, R = 2, De = 2, Oe = 7.5, ke = 160, Ae = 12, je = 8, z = 2, Me = {
|
|
339
340
|
shown: {
|
|
340
341
|
min: 40,
|
|
341
342
|
max: 56
|
|
@@ -344,10 +345,10 @@ var I = { cells: 4096 }, L = 2, Oe = 2, ke = 7.5, Ae = 160, je = 12, Me = 8, R =
|
|
|
344
345
|
min: 16,
|
|
345
346
|
max: 36
|
|
346
347
|
}
|
|
347
|
-
},
|
|
348
|
+
}, Ne = {
|
|
348
349
|
kKwaWg: "x1e87kdn",
|
|
349
350
|
$$css: !0
|
|
350
|
-
},
|
|
351
|
+
}, B = {
|
|
351
352
|
axisText: {
|
|
352
353
|
k1xSpc: "x104kibb",
|
|
353
354
|
kVQacm: "xb3r6kr",
|
|
@@ -411,7 +412,7 @@ var I = { cells: 4096 }, L = 2, Oe = 2, ke = 7.5, Ae = 160, je = 12, Me = 8, R =
|
|
|
411
412
|
kcqcaj: "xss6m8b",
|
|
412
413
|
$$css: !0
|
|
413
414
|
},
|
|
414
|
-
measured: (e) => [
|
|
415
|
+
measured: (e) => [Ne, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
|
|
415
416
|
missing: {
|
|
416
417
|
kMwMTN: "x153jb6y",
|
|
417
418
|
kWkggS: "x1r7kqkb",
|
|
@@ -432,25 +433,25 @@ var I = { cells: 4096 }, L = 2, Oe = 2, ke = 7.5, Ae = 160, je = 12, Me = 8, R =
|
|
|
432
433
|
kMwMTN: "x153jb6y",
|
|
433
434
|
$$css: !0
|
|
434
435
|
}
|
|
435
|
-
},
|
|
436
|
+
}, Pe = {
|
|
436
437
|
shown: {
|
|
437
438
|
k7Eaqz: "x1gjsuxi",
|
|
438
439
|
kAzted: "x17oiadl",
|
|
439
440
|
$$css: !0
|
|
440
441
|
},
|
|
441
442
|
hidden: { $$css: !0 }
|
|
442
|
-
},
|
|
443
|
+
}, Fe = {
|
|
443
444
|
text: { $$css: !0 },
|
|
444
445
|
mono: {
|
|
445
446
|
kMv6JI: "xiard35",
|
|
446
447
|
khDVqt: "x1sdyfia",
|
|
447
448
|
$$css: !0
|
|
448
449
|
}
|
|
449
|
-
},
|
|
450
|
+
}, Ie = {
|
|
450
451
|
value: void 0,
|
|
451
|
-
masked:
|
|
452
|
-
missing:
|
|
453
|
-
},
|
|
452
|
+
masked: B.masked,
|
|
453
|
+
missing: B.missing
|
|
454
|
+
}, Le = 28, Re = /* @__PURE__ */ new Set([
|
|
454
455
|
"ArrowLeft",
|
|
455
456
|
"ArrowRight",
|
|
456
457
|
"ArrowUp",
|
|
@@ -458,77 +459,77 @@ var I = { cells: 4096 }, L = 2, Oe = 2, ke = 7.5, Ae = 160, je = 12, Me = 8, R =
|
|
|
458
459
|
"Home",
|
|
459
460
|
"End"
|
|
460
461
|
]);
|
|
461
|
-
function
|
|
462
|
-
if (t === void 0 || !
|
|
462
|
+
function ze(t, n, r) {
|
|
463
|
+
if (t === void 0 || !_e(t, n, r)) return;
|
|
463
464
|
let i = e.ink, a = [
|
|
464
|
-
n === t.top ? `inset 0 ${
|
|
465
|
-
n === t.bottom ? `inset 0 -${
|
|
466
|
-
r === t.left ? `inset ${
|
|
467
|
-
r === t.right ? `inset -${
|
|
465
|
+
n === t.top ? `inset 0 ${R}px 0 0 ${i}` : void 0,
|
|
466
|
+
n === t.bottom ? `inset 0 -${R}px 0 0 ${i}` : void 0,
|
|
467
|
+
r === t.left ? `inset ${R}px 0 0 0 ${i}` : void 0,
|
|
468
|
+
r === t.right ? `inset -${R}px 0 0 0 ${i}` : void 0
|
|
468
469
|
].filter((e) => e !== void 0);
|
|
469
470
|
return a.length === 0 ? void 0 : a.join(", ");
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
+
function Be(e, { lineCharacters: t, font: n }) {
|
|
472
473
|
let r = Array.from(e).length;
|
|
473
474
|
if (n === "mono" || r <= t) return r <= t;
|
|
474
475
|
let i = e.split(/(?<=[\s-])/u);
|
|
475
|
-
return r <= t *
|
|
476
|
+
return r <= t * z && i.every((e) => Array.from(e).length <= t);
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
-
let a =
|
|
478
|
+
function Ve({ rows: e, columns: t, cells: n, domain: r, palette: i }) {
|
|
479
|
+
let a = v({
|
|
479
480
|
domain: r,
|
|
480
481
|
palette: i
|
|
481
482
|
});
|
|
482
483
|
if (a !== null) return a;
|
|
483
|
-
if (e.length * t.length >
|
|
484
|
+
if (e.length * t.length > L.cells || n.length > L.cells) return `This matrix exceeds the ${L.cells}-cell render limit. Supply a smaller, labelled window.`;
|
|
484
485
|
if (!s(e) || !s(t) || !s(n)) return "Matrix rows, columns, and cells must have unique identifiers.";
|
|
485
486
|
let o = new Set(e.map((e) => e.id)), c = new Set(t.map((e) => e.id));
|
|
486
|
-
return n.some((e) => !o.has(e.rowId) || !c.has(e.columnId)) ? "Every matrix cell must refer to a supplied row and column." : n.some((e) => e.kind === "value" && !Number.isFinite(e.value)) ? "Measured matrix values must be finite. Use a missing cell for unavailable values." : new Set(n.map((e) =>
|
|
487
|
+
return n.some((e) => !o.has(e.rowId) || !c.has(e.columnId)) ? "Every matrix cell must refer to a supplied row and column." : n.some((e) => e.kind === "value" && !Number.isFinite(e.value)) ? "Measured matrix values must be finite. Use a missing cell for unavailable values." : new Set(n.map((e) => I(e.rowId, e.columnId))).size === n.length ? void 0 : "A matrix coordinate may contain only one cell.";
|
|
487
488
|
}
|
|
488
|
-
function
|
|
489
|
+
function He(e) {
|
|
489
490
|
return e?.kind === "value" ? String(e.value) : "";
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
-
let { emptyLabel: n, rows: r, columns: a, cells: s, domain: u, palette: f, valueFormat: m, glyphFormat:
|
|
493
|
-
if (
|
|
494
|
-
let
|
|
492
|
+
function V(t) {
|
|
493
|
+
let { emptyLabel: n, rows: r, columns: a, cells: s, domain: u, palette: f, valueFormat: m, glyphFormat: ne = m, valueLabel: v, variant: b, rowTitle: S, columnTitle: C, rowNoun: E, columnNoun: D, axisFont: O = "text", headers: k = "clip", cellValues: A = "shown", marking: ve, cellLabel: j = (e, t) => `${e.label} → ${t.label}`, valueText: Ce, copyText: we = He, notes: M = [], problem: Te, selected: N, onSelectedChange: P, cellRange: F = null, onCellRangeChange: L, ...R } = t, { locale: z, title: Ne } = R, V = oe(), H = se(null), U = re(), Ue = p();
|
|
494
|
+
if (R.status === "loading") return /* @__PURE__ */ w(h, { ...R });
|
|
495
|
+
let W = Te ?? Ve({
|
|
495
496
|
rows: r,
|
|
496
497
|
columns: a,
|
|
497
498
|
cells: s,
|
|
498
499
|
domain: u,
|
|
499
500
|
palette: f
|
|
500
|
-
}) ??
|
|
501
|
+
}) ?? he(F, {
|
|
501
502
|
rows: r,
|
|
502
503
|
columns: a
|
|
503
504
|
});
|
|
504
|
-
if (
|
|
505
|
-
...
|
|
506
|
-
message:
|
|
505
|
+
if (W !== void 0) return /* @__PURE__ */ w(ee, {
|
|
506
|
+
...R,
|
|
507
|
+
message: W
|
|
507
508
|
});
|
|
508
|
-
let
|
|
509
|
-
function
|
|
510
|
-
return
|
|
509
|
+
let G = b === "strip", We = new Map(s.map((e) => [I(e.rowId, e.columnId), e]));
|
|
510
|
+
function K(e, t) {
|
|
511
|
+
return We.get(I(e, t));
|
|
511
512
|
}
|
|
512
|
-
function
|
|
513
|
-
return
|
|
513
|
+
function Ge(e) {
|
|
514
|
+
return Ce?.(e) ?? pe({
|
|
514
515
|
cell: e,
|
|
515
516
|
domain: u,
|
|
516
|
-
locale:
|
|
517
|
+
locale: z,
|
|
517
518
|
format: m
|
|
518
519
|
});
|
|
519
520
|
}
|
|
520
|
-
let
|
|
521
|
+
let Ke = Math.max(Array.from(S ?? "").length, ...r.map((e) => Array.from(e.label).length)), qe = Math.min(ke, Ke * Oe) + Ae, Je = Me[A], q = U.width - qe - De * (a.length + 2), J = Math.min(Je.max, Math.max(Je.min, Math.floor(q / Math.max(1, a.length)))), Ye = Math.floor((J - je) / Oe), Xe = a.some((e) => !Be(e.label, {
|
|
521
522
|
lineCharacters: Ye,
|
|
522
|
-
font:
|
|
523
|
-
})), Ze =
|
|
524
|
-
let i =
|
|
523
|
+
font: O
|
|
524
|
+
})), Ze = ue(J), Y = r.flatMap((e, t) => a.flatMap((n, r) => {
|
|
525
|
+
let i = ve?.(e, n);
|
|
525
526
|
if (i === "hidden") return [];
|
|
526
|
-
let a =
|
|
527
|
+
let a = K(e.id, n.id), o = a?.id ?? I(e.id, n.id), s = a?.kind === "value" && !y(a.value, u), c = a?.kind === "value" && A === "shown" ? de({
|
|
527
528
|
value: a.value,
|
|
528
|
-
locale:
|
|
529
|
-
format:
|
|
529
|
+
locale: z,
|
|
530
|
+
format: ne,
|
|
530
531
|
capacity: Ze
|
|
531
|
-
}) : "", l = a === void 0 ? "·" :
|
|
532
|
+
}) : "", l = a === void 0 ? "·" : fe(a, c, s);
|
|
532
533
|
return [{
|
|
533
534
|
id: o,
|
|
534
535
|
row: e,
|
|
@@ -537,39 +538,39 @@ function B(t) {
|
|
|
537
538
|
columnIndex: r,
|
|
538
539
|
cell: a,
|
|
539
540
|
mark: i,
|
|
540
|
-
label: `${
|
|
541
|
+
label: `${j(e, n)}: ${Ge(a)}`,
|
|
541
542
|
isOutside: s,
|
|
542
543
|
glyph: l
|
|
543
544
|
}];
|
|
544
|
-
})), X = Y.length < r.length * a.length, Qe = Y.filter((e) =>
|
|
545
|
+
})), X = Y.length < r.length * a.length, Qe = Y.filter((e) => G || e.cell !== void 0).map(({ id: e, label: t }) => ({
|
|
545
546
|
id: e,
|
|
546
547
|
label: t
|
|
547
|
-
})), $e = new Map(Y.map((e) => [e.id, e])), Z =
|
|
548
|
+
})), $e = new Map(Y.map((e) => [e.id, e])), Z = F === null ? void 0 : ge(F, {
|
|
548
549
|
rows: r,
|
|
549
550
|
columns: a
|
|
550
|
-
}), et =
|
|
551
|
+
}), et = L !== void 0, tt = Z === void 0 ? void 0 : Se({
|
|
551
552
|
bounds: Z,
|
|
552
553
|
rows: r,
|
|
553
554
|
columns: a,
|
|
554
|
-
rowNoun:
|
|
555
|
-
columnNoun:
|
|
556
|
-
count: Y.filter((e) =>
|
|
555
|
+
rowNoun: E,
|
|
556
|
+
columnNoun: D,
|
|
557
|
+
count: Y.filter((e) => _e(Z, e.rowIndex, e.columnIndex)).length
|
|
557
558
|
});
|
|
558
559
|
function Q(e, t, n) {
|
|
559
|
-
if (
|
|
560
|
+
if (L?.(e, {
|
|
560
561
|
reason: t,
|
|
561
562
|
event: n
|
|
562
563
|
}), e !== null && t === "list-navigation") {
|
|
563
|
-
let t =
|
|
564
|
+
let t = ge(e, {
|
|
564
565
|
rows: r,
|
|
565
566
|
columns: a
|
|
566
|
-
}), n = Y.filter((e) =>
|
|
567
|
-
ce(
|
|
567
|
+
}), n = Y.filter((e) => _e(t, e.rowIndex, e.columnIndex)).length;
|
|
568
|
+
ce(Se({
|
|
568
569
|
bounds: t,
|
|
569
570
|
rows: r,
|
|
570
571
|
columns: a,
|
|
571
|
-
rowNoun:
|
|
572
|
-
columnNoun:
|
|
572
|
+
rowNoun: E,
|
|
573
|
+
columnNoun: D,
|
|
573
574
|
count: n
|
|
574
575
|
}));
|
|
575
576
|
}
|
|
@@ -591,22 +592,22 @@ function B(t) {
|
|
|
591
592
|
function it(e, t) {
|
|
592
593
|
let n = e.ctrlKey || e.metaKey;
|
|
593
594
|
if (n && e.key === "a") {
|
|
594
|
-
let t =
|
|
595
|
+
let t = be({
|
|
595
596
|
rows: r,
|
|
596
597
|
columns: a
|
|
597
598
|
});
|
|
598
599
|
t !== void 0 && (e.preventDefault(), Q(t, "list-navigation", e.nativeEvent));
|
|
599
600
|
return;
|
|
600
601
|
}
|
|
601
|
-
if (e.key === "Escape" || !e.shiftKey &&
|
|
602
|
-
|
|
602
|
+
if (e.key === "Escape" || !e.shiftKey && Re.has(e.key)) {
|
|
603
|
+
F !== null && Q(null, "list-navigation", e.nativeEvent);
|
|
603
604
|
return;
|
|
604
605
|
}
|
|
605
606
|
let i = nt(t);
|
|
606
607
|
if (!e.shiftKey || n || e.altKey || i === void 0) return;
|
|
607
|
-
let o =
|
|
608
|
+
let o = ye({
|
|
608
609
|
key: e.key,
|
|
609
|
-
range:
|
|
610
|
+
range: F,
|
|
610
611
|
from: i,
|
|
611
612
|
isReversed: le(e.currentTarget),
|
|
612
613
|
rows: r,
|
|
@@ -617,43 +618,43 @@ function B(t) {
|
|
|
617
618
|
function at(e, t) {
|
|
618
619
|
let n = rt(e.target);
|
|
619
620
|
n !== void 0 && (e.shiftKey ? Q({
|
|
620
|
-
anchor:
|
|
621
|
+
anchor: F?.anchor ?? nt(t) ?? n,
|
|
621
622
|
end: n
|
|
622
|
-
}, "item-press", e.nativeEvent) : (
|
|
623
|
+
}, "item-press", e.nativeEvent) : (H.current = n, F !== null && Q(null, "item-press", e.nativeEvent)));
|
|
623
624
|
}
|
|
624
625
|
function ot(e) {
|
|
625
|
-
let t =
|
|
626
|
+
let t = H.current, n = rt(e.target);
|
|
626
627
|
if (t === null || n === void 0 || e.buttons !== 1) return;
|
|
627
|
-
let r =
|
|
628
|
+
let r = F?.end.rowId === n.rowId && F.end.columnId === n.columnId, i = F === null && t.rowId === n.rowId && t.columnId === n.columnId;
|
|
628
629
|
!r && !i && Q({
|
|
629
630
|
anchor: t,
|
|
630
631
|
end: n
|
|
631
632
|
}, "drag", e.nativeEvent);
|
|
632
633
|
}
|
|
633
634
|
function st(e, t) {
|
|
634
|
-
let n = nt(t), i =
|
|
635
|
+
let n = nt(t), i = F ?? (n === void 0 ? void 0 : {
|
|
635
636
|
anchor: n,
|
|
636
637
|
end: n
|
|
637
638
|
});
|
|
638
639
|
if (i === void 0) return;
|
|
639
|
-
let o =
|
|
640
|
-
bounds:
|
|
640
|
+
let o = xe({
|
|
641
|
+
bounds: ge(i, {
|
|
641
642
|
rows: r,
|
|
642
643
|
columns: a
|
|
643
644
|
}),
|
|
644
645
|
rows: r,
|
|
645
646
|
columns: a,
|
|
646
|
-
read: ({ rowId: e, columnId: t }) => $e.has(
|
|
647
|
+
read: ({ rowId: e, columnId: t }) => $e.has(K(e, t)?.id ?? I(e, t)) ? we(K(e, t)) : ""
|
|
647
648
|
});
|
|
648
649
|
e.preventDefault(), e.clipboardData.setData("text/plain", o);
|
|
649
650
|
}
|
|
650
651
|
function ct(t) {
|
|
651
652
|
return new Map(Y.map((n) => {
|
|
652
|
-
let { cell: r, isOutside: i } = n, a = n.mark === "context" ? `color-mix(in srgb, ${e.muted} ${
|
|
653
|
+
let { cell: r, isOutside: i } = n, a = n.mark === "context" ? `color-mix(in srgb, ${e.muted} ${Le}%, ${e.surface})` : r?.kind === "value" && !i ? ie(r.value, {
|
|
653
654
|
domain: u,
|
|
654
655
|
palette: f
|
|
655
656
|
}) : void 0;
|
|
656
|
-
return [
|
|
657
|
+
return [I(n.row.id, n.column.id), {
|
|
657
658
|
id: n.id,
|
|
658
659
|
row: n.row,
|
|
659
660
|
column: n.column,
|
|
@@ -663,31 +664,31 @@ function B(t) {
|
|
|
663
664
|
fill: a,
|
|
664
665
|
isOutside: i,
|
|
665
666
|
marking: n.mark,
|
|
666
|
-
edges:
|
|
667
|
-
isSelected: r !== void 0 &&
|
|
667
|
+
edges: ze(Z, n.rowIndex, n.columnIndex),
|
|
668
|
+
isSelected: r !== void 0 && N === r.id,
|
|
668
669
|
isInspected: t.inspected === n.id,
|
|
669
670
|
isCursor: t.cursor === n.id
|
|
670
671
|
}];
|
|
671
672
|
}));
|
|
672
673
|
}
|
|
673
674
|
let lt = r.length === 0 || a.length === 0, $ = d({
|
|
674
|
-
title:
|
|
675
|
-
isSelectable:
|
|
676
|
-
}), ut = Y.some((e) => e.glyph === "•"), dt =
|
|
675
|
+
title: Ne,
|
|
676
|
+
isSelectable: P !== void 0
|
|
677
|
+
}), ut = Y.some((e) => e.glyph === "•"), dt = G || A === "hidden", ft = [
|
|
677
678
|
s.some((e) => e.kind === "masked") ? "× Masked" : void 0,
|
|
678
679
|
s.some((e) => e.kind === "missing") ? "— Missing" : void 0,
|
|
679
680
|
Y.some((e) => e.cell === void 0) ? "· Not supplied" : void 0,
|
|
680
|
-
s.some((e) => e.kind === "value" && !
|
|
681
|
+
s.some((e) => e.kind === "value" && !y(e.value, u)) ? "! Outside domain" : void 0,
|
|
681
682
|
dt ? "Inspect a cell for its exact value" : void 0,
|
|
682
683
|
!dt && ut ? "• Inspect a cell for its exact value" : void 0,
|
|
683
|
-
...
|
|
684
|
+
...M,
|
|
684
685
|
et ? "Shift with the arrow keys or a drag marks a block to copy" : void 0
|
|
685
686
|
].filter((e) => e !== void 0);
|
|
686
687
|
return /* @__PURE__ */ w(o, {
|
|
687
|
-
...
|
|
688
|
+
...Ue,
|
|
688
689
|
items: Qe,
|
|
689
|
-
columns:
|
|
690
|
-
place:
|
|
690
|
+
columns: G && !X ? a.length : void 0,
|
|
691
|
+
place: G && !X ? void 0 : (e) => {
|
|
691
692
|
let t = $e.get(e);
|
|
692
693
|
return t === void 0 ? void 0 : {
|
|
693
694
|
left: t.columnIndex,
|
|
@@ -696,9 +697,9 @@ function B(t) {
|
|
|
696
697
|
bottom: t.rowIndex + 1
|
|
697
698
|
};
|
|
698
699
|
},
|
|
699
|
-
selected:
|
|
700
|
-
onSelect:
|
|
701
|
-
s.some((t) => t.id === e) &&
|
|
700
|
+
selected: N ?? null,
|
|
701
|
+
onSelect: P === void 0 ? void 0 : (e, t) => {
|
|
702
|
+
s.some((t) => t.id === e) && P(e, t);
|
|
702
703
|
},
|
|
703
704
|
render: (e, t) => {
|
|
704
705
|
let o = ct(t), s = {
|
|
@@ -708,19 +709,19 @@ function B(t) {
|
|
|
708
709
|
onPointerDown: (e) => at(e, t.cursor),
|
|
709
710
|
onPointerMove: ot,
|
|
710
711
|
onPointerUp: () => {
|
|
711
|
-
|
|
712
|
+
H.current = null;
|
|
712
713
|
}
|
|
713
714
|
} : {}
|
|
714
715
|
};
|
|
715
|
-
return /* @__PURE__ */ w(
|
|
716
|
-
...
|
|
716
|
+
return /* @__PURE__ */ w(_, {
|
|
717
|
+
...R,
|
|
717
718
|
figure: e,
|
|
718
719
|
scaleLegend: lt ? void 0 : /* @__PURE__ */ w(ae, {
|
|
719
720
|
label: v,
|
|
720
721
|
domain: u,
|
|
721
722
|
palette: f,
|
|
722
723
|
valueFormat: m,
|
|
723
|
-
locale:
|
|
724
|
+
locale: z
|
|
724
725
|
}),
|
|
725
726
|
footer: lt ? void 0 : /* @__PURE__ */ T("div", {
|
|
726
727
|
className: "xrvj5dj x1n8ia3y",
|
|
@@ -731,11 +732,11 @@ function B(t) {
|
|
|
731
732
|
children: ft.map((e) => /* @__PURE__ */ w("li", { children: e }, e))
|
|
732
733
|
}),
|
|
733
734
|
/* @__PURE__ */ w(l, {
|
|
734
|
-
id:
|
|
735
|
+
id: V,
|
|
735
736
|
children: tt ?? i(Qe, t.inspected)
|
|
736
737
|
}),
|
|
737
|
-
/* @__PURE__ */ w(
|
|
738
|
-
label: `${
|
|
738
|
+
/* @__PURE__ */ w(g, {
|
|
739
|
+
label: `${Ne} cells`,
|
|
739
740
|
columns: [{
|
|
740
741
|
id: "cell",
|
|
741
742
|
label: "Cell"
|
|
@@ -744,33 +745,33 @@ function B(t) {
|
|
|
744
745
|
label: v
|
|
745
746
|
}],
|
|
746
747
|
rows: Y.map((e) => ({
|
|
747
|
-
id:
|
|
748
|
-
values: [
|
|
748
|
+
id: I(e.row.id, e.column.id),
|
|
749
|
+
values: [j(e.row, e.column), Ge(e.cell)]
|
|
749
750
|
}))
|
|
750
751
|
})
|
|
751
752
|
]
|
|
752
753
|
}),
|
|
753
|
-
children: lt ? /* @__PURE__ */ w(
|
|
754
|
-
ref:
|
|
754
|
+
children: lt ? /* @__PURE__ */ w(te, { children: n }) : /* @__PURE__ */ w("div", {
|
|
755
|
+
ref: U.ref,
|
|
755
756
|
className: "xeuugli",
|
|
756
757
|
children: /* @__PURE__ */ w(c, {
|
|
757
758
|
role: "group",
|
|
758
759
|
"aria-label": $,
|
|
759
|
-
"aria-describedby":
|
|
760
|
+
"aria-describedby": V,
|
|
760
761
|
...s,
|
|
761
762
|
...{
|
|
762
763
|
0: { className: "xysyzu8 x159tps6 xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal x-default-marker" },
|
|
763
764
|
1: { className: "xysyzu8 x159tps6 xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal x10dazmo x-default-marker" }
|
|
764
|
-
}[!!
|
|
765
|
-
children:
|
|
765
|
+
}[!!G | 0],
|
|
766
|
+
children: G ? /* @__PURE__ */ w(Ee, {
|
|
766
767
|
rows: r,
|
|
767
768
|
columns: a,
|
|
768
|
-
rowTitle:
|
|
769
|
+
rowTitle: S,
|
|
769
770
|
columnTitle: C,
|
|
770
|
-
font:
|
|
771
|
-
headers:
|
|
772
|
-
viewAt: (e, t) => o.get(
|
|
773
|
-
isSelectable:
|
|
771
|
+
font: O,
|
|
772
|
+
headers: k,
|
|
773
|
+
viewAt: (e, t) => o.get(I(e, t)),
|
|
774
|
+
isSelectable: P !== void 0
|
|
774
775
|
}) : /* @__PURE__ */ T("table", {
|
|
775
776
|
className: "x1vathgz x1jkpq5q xezivpi x1hz01jw",
|
|
776
777
|
children: [/* @__PURE__ */ T("thead", { children: [C !== void 0 && /* @__PURE__ */ T("tr", { children: [/* @__PURE__ */ w("td", {}), /* @__PURE__ */ w("th", {
|
|
@@ -780,7 +781,7 @@ function B(t) {
|
|
|
780
781
|
children: C
|
|
781
782
|
})] }), /* @__PURE__ */ T("tr", { children: [/* @__PURE__ */ w("th", {
|
|
782
783
|
className: "x1717udv xy8obcc xas2l8k x1yc453h xuxw1ft xbixft xk4h15q xngumbj",
|
|
783
|
-
children:
|
|
784
|
+
children: S
|
|
784
785
|
}), a.map((e) => /* @__PURE__ */ w("th", {
|
|
785
786
|
scope: "col",
|
|
786
787
|
title: e.label,
|
|
@@ -789,7 +790,7 @@ function B(t) {
|
|
|
789
790
|
1: { className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y xuxw1ft x3ajldb x2b8uid" }
|
|
790
791
|
}[!!Xe | 0],
|
|
791
792
|
children: /* @__PURE__ */ w("span", {
|
|
792
|
-
...
|
|
793
|
+
...x.props(Xe ? B.rotated : [B.axisText, B.width(J)], Fe[O]),
|
|
793
794
|
children: e.label
|
|
794
795
|
})
|
|
795
796
|
}, e.id))] })] }), /* @__PURE__ */ w("tbody", { children: r.map((e) => /* @__PURE__ */ T("tr", { children: [/* @__PURE__ */ w("th", {
|
|
@@ -797,25 +798,25 @@ function B(t) {
|
|
|
797
798
|
title: e.label,
|
|
798
799
|
className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft",
|
|
799
800
|
children: /* @__PURE__ */ w("span", {
|
|
800
|
-
...
|
|
801
|
+
...x.props(B.rowText, Fe[O]),
|
|
801
802
|
children: e.label
|
|
802
803
|
})
|
|
803
804
|
}), a.map((t) => {
|
|
804
|
-
let n = o.get(
|
|
805
|
+
let n = o.get(I(e.id, t.id));
|
|
805
806
|
return /* @__PURE__ */ w("td", {
|
|
806
|
-
...
|
|
807
|
-
children: n === void 0 ? null : /* @__PURE__ */ w(
|
|
807
|
+
...x.props(B.cell, B.width(J)),
|
|
808
|
+
children: n === void 0 ? null : /* @__PURE__ */ w(me, {
|
|
808
809
|
view: n,
|
|
809
|
-
isSelectable:
|
|
810
|
+
isSelectable: P !== void 0,
|
|
810
811
|
appearance: [
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
n.cell === void 0 ?
|
|
815
|
-
n.fill !== void 0 &&
|
|
816
|
-
n.isOutside &&
|
|
817
|
-
n.marking === "outlined" &&
|
|
818
|
-
n.marking === "context" &&
|
|
812
|
+
B.value,
|
|
813
|
+
B.square(J),
|
|
814
|
+
Pe[A],
|
|
815
|
+
n.cell === void 0 ? B.missing : Ie[n.cell.kind],
|
|
816
|
+
n.fill !== void 0 && B.measured(n.fill),
|
|
817
|
+
n.isOutside && B.missing,
|
|
818
|
+
n.marking === "outlined" && B.outlined,
|
|
819
|
+
n.marking === "context" && B.context
|
|
819
820
|
],
|
|
820
821
|
children: n.cell?.kind === "value" ? /* @__PURE__ */ w("span", {
|
|
821
822
|
className: "xpvm0e4 x1r97e56",
|
|
@@ -832,47 +833,47 @@ function B(t) {
|
|
|
832
833
|
});
|
|
833
834
|
}
|
|
834
835
|
// packages/charts/src/matrix/matrix-presets.ts
|
|
835
|
-
function
|
|
836
|
+
function H({ rows: e, columns: t, values: n, noun: r, limit: i }) {
|
|
836
837
|
return e.length > i || t.length > i ? `This matrix draws at most ${i} ${r} on each side. Supply a smaller, labelled window.` : !s(e) || !s(t) ? `Matrix ${r} must have unique identifiers.` : n.length === e.length && n.every((e) => e.length === t.length) ? void 0 : `Supply one line of values per row and one value per column, for every ${r}.`;
|
|
837
838
|
}
|
|
838
|
-
function
|
|
839
|
+
function U(e, t, n) {
|
|
839
840
|
return e[t]?.[n] ?? null;
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function Ue(e) {
|
|
842
843
|
return e.replaceAll(" ", "␣").replaceAll("\n", "⏎").replaceAll(" ", "⇥");
|
|
843
844
|
}
|
|
844
845
|
// packages/charts/src/matrix/attention-matrix.tsx
|
|
845
|
-
var
|
|
846
|
+
var W = { tokens: 64 }, G = "␣ space · ⏎ newline · ⇥ tab", We = {
|
|
846
847
|
minimumFractionDigits: 2,
|
|
847
848
|
maximumFractionDigits: 2
|
|
848
849
|
};
|
|
849
|
-
function
|
|
850
|
+
function K(e) {
|
|
850
851
|
return `${e.index} ${JSON.stringify(e.text)}`;
|
|
851
852
|
}
|
|
852
|
-
function
|
|
853
|
-
return [...e, ...t].some((e) => !Number.isSafeInteger(e.index) || e.index < 0) ? "Token positions must be whole numbers of zero or more." : [e, t].every((e) => new Set(e.map((e) => e.index)).size === e.length && s(e)) ? n.flat().some((e) => e !== null && !(e >= 0 && e <= 1)) ? "Attention weights must lie between 0 and 1. Use null for a weight that was not recorded." : r === "causal" && t.some((t, r) => e.some((e, i) => e.index > t.index &&
|
|
853
|
+
function Ge({ sources: e, destinations: t, weights: n, mask: r }) {
|
|
854
|
+
return [...e, ...t].some((e) => !Number.isSafeInteger(e.index) || e.index < 0) ? "Token positions must be whole numbers of zero or more." : [e, t].every((e) => new Set(e.map((e) => e.index)).size === e.length && s(e)) ? n.flat().some((e) => e !== null && !(e >= 0 && e <= 1)) ? "Attention weights must lie between 0 and 1. Use null for a weight that was not recorded." : r === "causal" && t.some((t, r) => e.some((e, i) => e.index > t.index && U(n, r, i) !== null)) ? "A pair under the causal mask must have a null weight, so masked never reads as zero." : void 0 : "Tokens on each side must have unique identifiers and positions.";
|
|
854
855
|
}
|
|
855
|
-
function
|
|
856
|
-
let { sources: t, destinations: n, weights: r, mask: i = "none", valueLabel: a = "Attention weight", valueFormat: o =
|
|
856
|
+
function Ke(e) {
|
|
857
|
+
let { sources: t, destinations: n, weights: r, mask: i = "none", valueLabel: a = "Attention weight", valueFormat: o = We, emptyLabel: s = "No tokens were supplied.", ...c } = e, l = n.map((e) => ({
|
|
857
858
|
id: e.id,
|
|
858
|
-
label:
|
|
859
|
+
label: Ue(e.text)
|
|
859
860
|
})), u = t.map((e) => ({
|
|
860
861
|
id: e.id,
|
|
861
|
-
label:
|
|
862
|
-
})), d = new Map(t.map((e) => [e.id, e])), f = new Map(n.map((e) => [e.id, e])), p =
|
|
862
|
+
label: Ue(e.text)
|
|
863
|
+
})), d = new Map(t.map((e) => [e.id, e])), f = new Map(n.map((e) => [e.id, e])), p = H({
|
|
863
864
|
rows: l,
|
|
864
865
|
columns: u,
|
|
865
866
|
values: r,
|
|
866
867
|
noun: "tokens",
|
|
867
|
-
limit:
|
|
868
|
-
}) ??
|
|
868
|
+
limit: W.tokens
|
|
869
|
+
}) ?? Ge({
|
|
869
870
|
sources: t,
|
|
870
871
|
destinations: n,
|
|
871
872
|
weights: r,
|
|
872
873
|
mask: i
|
|
873
874
|
}), m = n.flatMap((e, n) => t.map((t, a) => {
|
|
874
|
-
let o =
|
|
875
|
-
id:
|
|
875
|
+
let o = U(r, n, a), s = {
|
|
876
|
+
id: I(e.id, t.id),
|
|
876
877
|
rowId: e.id,
|
|
877
878
|
columnId: t.id
|
|
878
879
|
};
|
|
@@ -892,9 +893,9 @@ function qe(e) {
|
|
|
892
893
|
}));
|
|
893
894
|
function h(e, t) {
|
|
894
895
|
let n = f.get(e.id), r = d.get(t.id);
|
|
895
|
-
return r === void 0 || n === void 0 ? `${e.id} → ${t.id}` : `Destination ${
|
|
896
|
+
return r === void 0 || n === void 0 ? `${e.id} → ${t.id}` : `Destination ${K(n)} attends to source ${K(r)}`;
|
|
896
897
|
}
|
|
897
|
-
return /* @__PURE__ */ w(
|
|
898
|
+
return /* @__PURE__ */ w(V, {
|
|
898
899
|
...c,
|
|
899
900
|
emptyLabel: s,
|
|
900
901
|
problem: p,
|
|
@@ -912,11 +913,11 @@ function qe(e) {
|
|
|
912
913
|
columnNoun: "source",
|
|
913
914
|
axisFont: "mono",
|
|
914
915
|
cellLabel: h,
|
|
915
|
-
notes: [...t, ...n].some((e) => /\s/u.test(e.text)) ? [
|
|
916
|
+
notes: [...t, ...n].some((e) => /\s/u.test(e.text)) ? [G] : []
|
|
916
917
|
});
|
|
917
918
|
}
|
|
918
919
|
// packages/charts/src/matrix/calendar-heatmap.tsx
|
|
919
|
-
var
|
|
920
|
+
var qe = { days: 1096 }, Je = [
|
|
920
921
|
"sunday",
|
|
921
922
|
"monday",
|
|
922
923
|
"tuesday",
|
|
@@ -952,26 +953,14 @@ function $e({ from: e, to: n, weekStartsOn: i, locale: a }) {
|
|
|
952
953
|
let n = r(c, t);
|
|
953
954
|
return {
|
|
954
955
|
id: Je[(o + t) % q] ?? i,
|
|
955
|
-
label:
|
|
956
|
-
timestamp: u(n),
|
|
957
|
-
locale: a,
|
|
958
|
-
format: Xe
|
|
959
|
-
})
|
|
956
|
+
label: E(a, Xe).format(u(n))
|
|
960
957
|
};
|
|
961
958
|
}), f = Array.from({ length: l }, (i, o) => {
|
|
962
959
|
let s = r(c, o * q), l = Array.from({ length: q }, (e, t) => r(s, t)).filter((t) => X(t) >= X(e) && X(t) <= X(n)), d = l.find((e) => e.day === 1) ?? (o === 0 ? l[0] : void 0);
|
|
963
960
|
return {
|
|
964
961
|
id: t(s),
|
|
965
|
-
label: `Week of ${
|
|
966
|
-
|
|
967
|
-
locale: a,
|
|
968
|
-
format: Y
|
|
969
|
-
})}`,
|
|
970
|
-
axisLabel: d === void 0 ? "" : m({
|
|
971
|
-
timestamp: u(d),
|
|
972
|
-
locale: a,
|
|
973
|
-
format: Ze
|
|
974
|
-
})
|
|
962
|
+
label: `Week of ${E(a, Y).format(u(l[0] ?? s))}`,
|
|
963
|
+
axisLabel: d === void 0 ? "" : E(a, Ze).format(u(d))
|
|
975
964
|
};
|
|
976
965
|
}), p = X(n) - X(e) + 1;
|
|
977
966
|
return {
|
|
@@ -988,14 +977,14 @@ function $e({ from: e, to: n, weekStartsOn: i, locale: a }) {
|
|
|
988
977
|
};
|
|
989
978
|
}
|
|
990
979
|
function Z({ days: e, from: t, to: r }) {
|
|
991
|
-
return t === void 0 || r === void 0 || X(r) < X(t) ? "The range needs two valid dates as YYYY-MM-DD, the first on or before the last." : X(r) - X(t) + 1 >
|
|
980
|
+
return t === void 0 || r === void 0 || X(r) < X(t) ? "The range needs two valid dates as YYYY-MM-DD, the first on or before the last." : X(r) - X(t) + 1 > qe.days ? `This calendar draws at most ${qe.days} days. Supply a shorter range.` : e.map((e) => n(e.date)).some((e) => e === void 0 || X(e) < X(t) || X(e) > X(r)) ? "Every day must be a valid YYYY-MM-DD date inside the range." : new Set(e.map((e) => e.date)).size === e.length ? e.some((e) => e.value !== null && !Number.isFinite(e.value)) ? "Day values must be finite. Use null for a day without a value." : void 0 : "Each date may appear only once.";
|
|
992
981
|
}
|
|
993
982
|
function et(e) {
|
|
994
|
-
let { days: t, range: r, weekStartsOn: i, valueLabel: a, valueFormat: o, domain: s, emptyLabel: c = "No days were supplied.", ...l } = e, { locale: d } = l, f = n(r.from), p = n(r.to),
|
|
983
|
+
let { days: t, range: r, weekStartsOn: i, valueLabel: a, valueFormat: o, domain: s, emptyLabel: c = "No days were supplied.", ...l } = e, { locale: d } = l, f = n(r.from), p = n(r.to), m = Z({
|
|
995
984
|
days: t,
|
|
996
985
|
from: f,
|
|
997
986
|
to: p
|
|
998
|
-
}),
|
|
987
|
+
}), h = m === void 0 && t.length > 0 && f !== void 0 && p !== void 0 ? $e({
|
|
999
988
|
from: f,
|
|
1000
989
|
to: p,
|
|
1001
990
|
weekStartsOn: i,
|
|
@@ -1004,8 +993,8 @@ function et(e) {
|
|
|
1004
993
|
rows: [],
|
|
1005
994
|
columns: [],
|
|
1006
995
|
dates: []
|
|
1007
|
-
},
|
|
1008
|
-
let r =
|
|
996
|
+
}, g = new Map(t.map((e) => [e.date, e.value])), _ = new Map(h.dates.map((e) => [`${e.rowId} ${e.columnId}`, e.date])), ee = h.dates.map(({ date: e, rowId: t, columnId: n }) => {
|
|
997
|
+
let r = g.get(e) ?? null;
|
|
1009
998
|
return r === null ? {
|
|
1010
999
|
id: e,
|
|
1011
1000
|
rowId: t,
|
|
@@ -1020,24 +1009,20 @@ function et(e) {
|
|
|
1020
1009
|
value: r
|
|
1021
1010
|
};
|
|
1022
1011
|
});
|
|
1023
|
-
function
|
|
1024
|
-
return
|
|
1012
|
+
function te(e, t) {
|
|
1013
|
+
return _.get(`${e.id} ${t.id}`);
|
|
1025
1014
|
}
|
|
1026
|
-
function
|
|
1027
|
-
let r = n(
|
|
1028
|
-
return r === void 0 ? `${e.label}, ${t.label}` :
|
|
1029
|
-
timestamp: X(r) * J,
|
|
1030
|
-
locale: d,
|
|
1031
|
-
format: Y
|
|
1032
|
-
});
|
|
1015
|
+
function ne(e, t) {
|
|
1016
|
+
let r = n(te(e, t) ?? "");
|
|
1017
|
+
return r === void 0 ? `${e.label}, ${t.label}` : E(d, Y).format(X(r) * J);
|
|
1033
1018
|
}
|
|
1034
|
-
return /* @__PURE__ */ w(
|
|
1019
|
+
return /* @__PURE__ */ w(V, {
|
|
1035
1020
|
...l,
|
|
1036
1021
|
emptyLabel: c,
|
|
1037
|
-
problem:
|
|
1038
|
-
rows:
|
|
1039
|
-
columns:
|
|
1040
|
-
cells:
|
|
1022
|
+
problem: m,
|
|
1023
|
+
rows: h.rows,
|
|
1024
|
+
columns: h.columns,
|
|
1025
|
+
cells: ee,
|
|
1041
1026
|
domain: s ?? u({
|
|
1042
1027
|
values: t.map((e) => e.value),
|
|
1043
1028
|
isZeroBased: !0
|
|
@@ -1049,8 +1034,8 @@ function et(e) {
|
|
|
1049
1034
|
headers: "overflow",
|
|
1050
1035
|
rowNoun: "weekday",
|
|
1051
1036
|
columnNoun: "week",
|
|
1052
|
-
marking: (e, t) =>
|
|
1053
|
-
cellLabel:
|
|
1037
|
+
marking: (e, t) => te(e, t) === void 0 ? "hidden" : void 0,
|
|
1038
|
+
cellLabel: ne
|
|
1054
1039
|
});
|
|
1055
1040
|
}
|
|
1056
1041
|
// packages/charts/src/matrix/confusion-matrix.tsx
|
|
@@ -1062,14 +1047,14 @@ function rt(e) {
|
|
|
1062
1047
|
return e.every((e) => e.every((e) => Number.isSafeInteger(e) && e >= 0)) ? void 0 : "Confusion counts must be whole numbers of zero or more.";
|
|
1063
1048
|
}
|
|
1064
1049
|
function it(e) {
|
|
1065
|
-
let { classes: t, counts: n, normalize: r = "none", valueLabel: i = "Examples", valueFormat: a = Q, shareFormat: o = nt, emptyLabel: s = "No classes were supplied.", ...c } = e, { locale: l } = c, u = r === "row", d =
|
|
1050
|
+
let { classes: t, counts: n, normalize: r = "none", valueLabel: i = "Examples", valueFormat: a = Q, shareFormat: o = nt, emptyLabel: s = "No classes were supplied.", ...c } = e, { locale: l } = c, u = r === "row", d = H({
|
|
1066
1051
|
rows: t,
|
|
1067
1052
|
columns: t,
|
|
1068
1053
|
values: n,
|
|
1069
1054
|
noun: "classes",
|
|
1070
1055
|
limit: tt.classes
|
|
1071
|
-
}) ?? rt(n), f = t.map((e, t) =>
|
|
1072
|
-
let a =
|
|
1056
|
+
}) ?? rt(n), f = t.map((e, t) => b(n[t] ?? [])), p = t.flatMap((e, r) => t.map((t, i) => {
|
|
1057
|
+
let a = U(n, r, i) ?? 0, o = f[r] ?? 0, s = I(e.id, t.id), c = o === 0 ? null : a / o;
|
|
1073
1058
|
return {
|
|
1074
1059
|
cell: u && c === null ? {
|
|
1075
1060
|
id: s,
|
|
@@ -1088,22 +1073,22 @@ function it(e) {
|
|
|
1088
1073
|
share: c,
|
|
1089
1074
|
actual: e
|
|
1090
1075
|
};
|
|
1091
|
-
})),
|
|
1076
|
+
})), h = new Map(p.map((e) => [e.cell.id, e])), g = Math.max(1, ...p.map((e) => e.count));
|
|
1092
1077
|
function _(e) {
|
|
1093
|
-
let t = e === void 0 ? void 0 :
|
|
1078
|
+
let t = e === void 0 ? void 0 : h.get(e.id);
|
|
1094
1079
|
if (t === void 0) return "Not supplied";
|
|
1095
|
-
let n =
|
|
1080
|
+
let n = m({
|
|
1096
1081
|
value: t.count,
|
|
1097
1082
|
locale: l,
|
|
1098
1083
|
format: a
|
|
1099
|
-
}), r =
|
|
1084
|
+
}), r = m({
|
|
1100
1085
|
value: t.share,
|
|
1101
1086
|
locale: l,
|
|
1102
1087
|
format: o
|
|
1103
1088
|
});
|
|
1104
1089
|
return t.share === null ? n : `${n} (${r} of actual ${t.actual.label})`;
|
|
1105
1090
|
}
|
|
1106
|
-
return /* @__PURE__ */ w(
|
|
1091
|
+
return /* @__PURE__ */ w(V, {
|
|
1107
1092
|
...c,
|
|
1108
1093
|
emptyLabel: s,
|
|
1109
1094
|
problem: d,
|
|
@@ -1122,7 +1107,7 @@ function it(e) {
|
|
|
1122
1107
|
marking: (e, t) => e.id === t.id ? "outlined" : void 0,
|
|
1123
1108
|
cellLabel: (e, t) => `Actual ${e.label}, predicted ${t.label}`,
|
|
1124
1109
|
valueText: _,
|
|
1125
|
-
copyText: (e) => e === void 0 ? "" : String(
|
|
1110
|
+
copyText: (e) => e === void 0 ? "" : String(h.get(e.id)?.count ?? ""),
|
|
1126
1111
|
notes: ["Outlined: actual and predicted agree"]
|
|
1127
1112
|
});
|
|
1128
1113
|
}
|
|
@@ -1132,18 +1117,18 @@ var at = { variables: 64 }, ot = {
|
|
|
1132
1117
|
maximumFractionDigits: 2
|
|
1133
1118
|
};
|
|
1134
1119
|
function st(e) {
|
|
1135
|
-
return e.flat().some((e) => e !== null && !(e >= -1 && e <= 1)) ? "Correlation coefficients must lie between -1 and 1. Use null for a pair that was not computed." : e.every((t, n) => t.every((t, r) => t ===
|
|
1120
|
+
return e.flat().some((e) => e !== null && !(e >= -1 && e <= 1)) ? "Correlation coefficients must lie between -1 and 1. Use null for a pair that was not computed." : e.every((t, n) => t.every((t, r) => t === U(e, r, n))) ? void 0 : "A correlation matrix must be symmetric: each pair needs the same value both ways.";
|
|
1136
1121
|
}
|
|
1137
1122
|
function ct(e) {
|
|
1138
|
-
let { variables: t, coefficients: n, triangle: r = "full", valueLabel: i = "Correlation coefficient", valueFormat: a = ot, emptyLabel: o = "No variables were supplied.", ...s } = e, c =
|
|
1123
|
+
let { variables: t, coefficients: n, triangle: r = "full", valueLabel: i = "Correlation coefficient", valueFormat: a = ot, emptyLabel: o = "No variables were supplied.", ...s } = e, c = H({
|
|
1139
1124
|
rows: t,
|
|
1140
1125
|
columns: t,
|
|
1141
1126
|
values: n,
|
|
1142
1127
|
noun: "variables",
|
|
1143
1128
|
limit: at.variables
|
|
1144
1129
|
}) ?? st(n), l = new Map(t.map((e, t) => [e.id, t])), u = t.flatMap((e, r) => t.map((t, i) => {
|
|
1145
|
-
let a =
|
|
1146
|
-
id:
|
|
1130
|
+
let a = U(n, r, i), o = {
|
|
1131
|
+
id: I(e.id, t.id),
|
|
1147
1132
|
rowId: e.id,
|
|
1148
1133
|
columnId: t.id
|
|
1149
1134
|
};
|
|
@@ -1161,7 +1146,7 @@ function ct(e) {
|
|
|
1161
1146
|
let n = l.get(e.id) ?? 0, i = l.get(t.id) ?? 0;
|
|
1162
1147
|
return n === i ? "context" : r === "lower" && i > n ? "hidden" : void 0;
|
|
1163
1148
|
}
|
|
1164
|
-
return /* @__PURE__ */ w(
|
|
1149
|
+
return /* @__PURE__ */ w(V, {
|
|
1165
1150
|
...s,
|
|
1166
1151
|
emptyLabel: o,
|
|
1167
1152
|
problem: c,
|
|
@@ -1180,7 +1165,7 @@ function ct(e) {
|
|
|
1180
1165
|
}
|
|
1181
1166
|
// packages/charts/src/matrix/matrix.tsx
|
|
1182
1167
|
function lt({ variant: e = "values", emptyLabel: t = "No matrix values were supplied.", ...n }) {
|
|
1183
|
-
return /* @__PURE__ */ w(
|
|
1168
|
+
return /* @__PURE__ */ w(V, {
|
|
1184
1169
|
...n,
|
|
1185
1170
|
variant: e,
|
|
1186
1171
|
emptyLabel: t
|
|
@@ -1234,58 +1219,58 @@ var $ = {
|
|
|
1234
1219
|
}
|
|
1235
1220
|
}, ut = { tokens: 2048 };
|
|
1236
1221
|
function dt(e) {
|
|
1237
|
-
let { tokens: t, domain: n, palette: r, valueLabel: s, valueFormat: c, selected: u, onSelectedChange: m, ...
|
|
1238
|
-
function
|
|
1222
|
+
let { tokens: t, domain: n, palette: r, valueLabel: s, valueFormat: c, selected: u, onSelectedChange: m, ...re } = e, { emptyLabel: v = "No tokens were supplied.", ...b } = re, { locale: se, title: ce } = b;
|
|
1223
|
+
function S(e) {
|
|
1239
1224
|
return ft({
|
|
1240
1225
|
token: e,
|
|
1241
1226
|
domain: n,
|
|
1242
|
-
locale:
|
|
1227
|
+
locale: se,
|
|
1243
1228
|
format: c
|
|
1244
1229
|
});
|
|
1245
1230
|
}
|
|
1246
|
-
let
|
|
1231
|
+
let le = t.map((e) => ({
|
|
1247
1232
|
id: e.id,
|
|
1248
|
-
label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${s}: ${
|
|
1249
|
-
})),
|
|
1250
|
-
if (
|
|
1251
|
-
...
|
|
1233
|
+
label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${s}: ${S(e)}`
|
|
1234
|
+
})), C = oe(), E = p();
|
|
1235
|
+
if (b.status === "loading") return /* @__PURE__ */ w(h, {
|
|
1236
|
+
...b,
|
|
1252
1237
|
height: "compact"
|
|
1253
1238
|
});
|
|
1254
|
-
let
|
|
1239
|
+
let D = pt({
|
|
1255
1240
|
tokens: t,
|
|
1256
1241
|
domain: n,
|
|
1257
1242
|
palette: r
|
|
1258
1243
|
});
|
|
1259
|
-
return
|
|
1260
|
-
...
|
|
1261
|
-
items:
|
|
1244
|
+
return D === null ? /* @__PURE__ */ w(o, {
|
|
1245
|
+
...E,
|
|
1246
|
+
items: le,
|
|
1262
1247
|
arrows: "both",
|
|
1263
1248
|
selected: u ?? null,
|
|
1264
1249
|
onSelect: m,
|
|
1265
|
-
render: (e, { inspected: o, cursor: p }) => /* @__PURE__ */ T(
|
|
1266
|
-
...
|
|
1250
|
+
render: (e, { inspected: o, cursor: p }) => /* @__PURE__ */ T(_, {
|
|
1251
|
+
...b,
|
|
1267
1252
|
figure: e,
|
|
1268
1253
|
scaleLegend: /* @__PURE__ */ w(ae, {
|
|
1269
1254
|
label: s,
|
|
1270
1255
|
domain: n,
|
|
1271
1256
|
palette: r,
|
|
1272
1257
|
valueFormat: c,
|
|
1273
|
-
locale:
|
|
1258
|
+
locale: se
|
|
1274
1259
|
}),
|
|
1275
1260
|
footer: /* @__PURE__ */ w(l, {
|
|
1276
|
-
id:
|
|
1277
|
-
children: i(
|
|
1261
|
+
id: C,
|
|
1262
|
+
children: i(le, o)
|
|
1278
1263
|
}),
|
|
1279
|
-
children: [t.length === 0 ? /* @__PURE__ */ w(
|
|
1264
|
+
children: [t.length === 0 ? /* @__PURE__ */ w(te, { children: v }) : /* @__PURE__ */ w(f, {
|
|
1280
1265
|
role: "group",
|
|
1281
1266
|
"aria-label": d({
|
|
1282
|
-
title:
|
|
1267
|
+
title: ce,
|
|
1283
1268
|
isSelectable: m !== void 0
|
|
1284
1269
|
}),
|
|
1285
|
-
"aria-describedby":
|
|
1270
|
+
"aria-describedby": C,
|
|
1286
1271
|
className: "x1ghz6dp xbixft xiard35 xtqrqnz x1778rvt x126k92a xj0a0fe x-default-marker",
|
|
1287
1272
|
children: t.map((e, t) => {
|
|
1288
|
-
let i = u === e.id, s = i || o === e.id, c = e.score !== null && !
|
|
1273
|
+
let i = u === e.id, s = i || o === e.id, c = e.score !== null && !y(e.score, n), l = le[t]?.label;
|
|
1289
1274
|
return /* @__PURE__ */ w(a, {
|
|
1290
1275
|
value: e.id,
|
|
1291
1276
|
render: m === void 0 ? /* @__PURE__ */ w("span", {}) : /* @__PURE__ */ w("button", {
|
|
@@ -1295,15 +1280,15 @@ function dt(e) {
|
|
|
1295
1280
|
"aria-pressed": i
|
|
1296
1281
|
}),
|
|
1297
1282
|
title: m === void 0 ? l : void 0,
|
|
1298
|
-
...
|
|
1283
|
+
...x.props($.token, e.score === null || c ? $.missing : $.color(ie(e.score, {
|
|
1299
1284
|
domain: n,
|
|
1300
1285
|
palette: r
|
|
1301
|
-
})), m !== void 0 && $.interactive, s && $.selected, !s && p === e.id &&
|
|
1286
|
+
})), m !== void 0 && $.interactive, s && $.selected, !s && p === e.id && ne.cursor),
|
|
1302
1287
|
children: e.text
|
|
1303
1288
|
}, e.id);
|
|
1304
1289
|
})
|
|
1305
|
-
}), /* @__PURE__ */ w(
|
|
1306
|
-
label: `${
|
|
1290
|
+
}), /* @__PURE__ */ w(g, {
|
|
1291
|
+
label: `${ce} token values`,
|
|
1307
1292
|
columns: [
|
|
1308
1293
|
{
|
|
1309
1294
|
id: "index",
|
|
@@ -1323,26 +1308,26 @@ function dt(e) {
|
|
|
1323
1308
|
values: [
|
|
1324
1309
|
String(e.index),
|
|
1325
1310
|
JSON.stringify(e.text),
|
|
1326
|
-
|
|
1311
|
+
S(e)
|
|
1327
1312
|
]
|
|
1328
1313
|
}))
|
|
1329
1314
|
})]
|
|
1330
1315
|
})
|
|
1331
|
-
}) : /* @__PURE__ */ w(
|
|
1332
|
-
...
|
|
1333
|
-
message:
|
|
1316
|
+
}) : /* @__PURE__ */ w(ee, {
|
|
1317
|
+
...b,
|
|
1318
|
+
message: D
|
|
1334
1319
|
});
|
|
1335
1320
|
}
|
|
1336
1321
|
function ft({ token: e, domain: t, locale: n, format: r }) {
|
|
1337
|
-
let i =
|
|
1322
|
+
let i = m({
|
|
1338
1323
|
value: e.score,
|
|
1339
1324
|
locale: n,
|
|
1340
1325
|
format: r
|
|
1341
1326
|
});
|
|
1342
|
-
return e.score === null ||
|
|
1327
|
+
return e.score === null || y(e.score, t) ? i : `${i} (outside domain)`;
|
|
1343
1328
|
}
|
|
1344
1329
|
function pt({ tokens: e, domain: t, palette: n }) {
|
|
1345
|
-
let r =
|
|
1330
|
+
let r = v({
|
|
1346
1331
|
domain: t,
|
|
1347
1332
|
palette: n
|
|
1348
1333
|
});
|
|
@@ -1351,4 +1336,4 @@ function pt({ tokens: e, domain: t, palette: n }) {
|
|
|
1351
1336
|
return t || n;
|
|
1352
1337
|
}) ? "Token indices must be nonnegative integers and measured scores must be finite. Use null for unavailable scores." : null : r;
|
|
1353
1338
|
}
|
|
1354
|
-
export { at as a, et as c,
|
|
1339
|
+
export { at as a, et as c, W as d, L as f, ct as i, qe as l, ut as n, it as o, I as p, lt as r, tt as s, dt as t, Ke as u };
|