@mechane-ai/elements 0.49.0 → 0.49.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 +40 -2
- package/dist/{article-yyNPg6VU.js → article-CRlhq9oA.js} +531 -463
- package/dist/article.js +1 -1
- package/dist/catalog.json +29 -1
- package/dist/{categorical-values-DCznViFp.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/charts/cartesian.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 +1 -1
- package/dist/charts/plot.js +4 -4
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +7 -7
- package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-B-Tn7ewW.js} +45 -45
- package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bljn-A5q.js} +528 -528
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/{image-grid-DHqtj_zs.js → image-grid-mrG5u9oE.js} +47 -47
- package/dist/kits/evaluation.js +3 -3
- package/dist/kits/interpretability.js +6 -6
- package/dist/kits/operations.js +3 -3
- package/dist/kits/research.js +2 -2
- package/dist/kits/training.js +2 -2
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
- package/dist/packages/charts/src/index.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
- package/dist/packages/teaching/src/article/article.d.ts +6 -1
- package/dist/packages/teaching/src/article/figure.d.ts +20 -3
- package/dist/packages/teaching/src/article/index.d.ts +1 -1
- package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
- package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
- package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
- package/dist/packages/teaching/src/time/tween.d.ts +2 -0
- package/dist/{param-BE3VMSkH.js → param-BdqTpZER.js} +166 -99
- package/dist/{plot-layout-Bqe4-0qZ.js → plot-layout-B2xRt-_k.js} +144 -130
- package/dist/{plot-surface-DON6WUmk.js → plot-surface-0cKFwtws.js} +1 -1
- package/dist/{reference-lines-hjuD1rRZ.js → reference-lines-nSxcZVF5.js} +1 -1
- package/dist/{scene-BP0Ue0R5.js → scene-BwJKueD6.js} +1227 -1125
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-C8eeSgL4.js → slope-chart-CGTYbFxi.js} +179 -179
- package/dist/styles2.css +69 -14
- package/dist/{time-series-BL933QyA.js → time-series-Dh8y5ba0.js} +952 -948
- package/dist/{token-heatmap-BB65awva.js → token-heatmap-BTrZ3-N4.js} +84 -84
- package/dist/{token-predictions-Pa8eUGan.js → token-predictions-CUe4junQ.js} +126 -126
- package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
- package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dpqmo-fh.js} +115 -115
- package/dist/{treemap-CxxgABUg.js → treemap-BUSaVD3m.js} +27 -27
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-BxaLwdRi.js} +123 -123
- package/dist/{waterfall-DdoEXEkT.js → waterfall-CcDMdKec.js} +39 -39
- package/package.json +1 -1
- package/recipes/counting-cards.tsx +3 -3
- package/skills/review-explainer/SKILL.md +2 -1
- package/skills/upgrade-elements/references/releases.md +61 -0
- package/skills/use-elements/SKILL.md +3 -1
- package/skills/use-elements/references/styling.md +23 -0
- package/skills/use-elements/references/teaching.md +13 -0
- package/skills/write-explainer/references/article.md +50 -2
- package/skills/write-explainer/references/lesson.md +18 -9
- package/skills/write-explainer/references/scene-parts.md +17 -12
- package/skills/write-explainer/references/scene.md +25 -3
- package/dist/figure-frame-BjFzbl3m.js +0 -270
- package/dist/use-tween-5HZ55_9d.js +0 -72
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as e } from "./accessibility-P89UG9-r.js";
|
|
2
|
-
import { A as t,
|
|
2
|
+
import { A as t, E as n, M as r, S as i, a, j as o, l as s, n as c, o as l, s as u, t as d } from "./plot-layout-B2xRt-_k.js";
|
|
3
3
|
import { i as f, r as p } from "./chart-link-AE_xuxiP.js";
|
|
4
4
|
import { a as m } from "./tone-scope-DKiSw-JR.js";
|
|
5
5
|
import { r as h, t as g } from "./figure-format-B8kRZMlo.js";
|
|
6
6
|
import { a as _, o as v, r as y } from "./scale-C2xgZyZN.js";
|
|
7
7
|
import { t as b } from "./chart-cursor-1mFd48Jc.js";
|
|
8
|
-
import { c as x, i as ee, l as S, n as te, o as C, r as w, t as T } from "./figure-frame-
|
|
8
|
+
import { c as x, i as ee, l as S, n as te, o as C, r as w, t as T } from "./figure-frame-CEijciL7.js";
|
|
9
9
|
import { n as E } from "./plot-width-D3hTycYX.js";
|
|
10
10
|
import { t as D } from "./plot-axes-D5S9BnBa.js";
|
|
11
11
|
import { a as O, c as k, l as A, n as ne, o as re } from "./plot-marks-FVsbFkUs.js";
|
|
12
|
-
import { n as ie, r as ae, t as oe } from "./plot-surface-
|
|
12
|
+
import { n as ie, r as ae, t as oe } from "./plot-surface-0cKFwtws.js";
|
|
13
13
|
import { t as j } from "./label-spacing-BncjePGb.js";
|
|
14
14
|
import { n as se, t as ce } from "./label-place-Z0fryBZb.js";
|
|
15
|
-
import { t as le } from "./reference-lines-
|
|
15
|
+
import { t as le } from "./reference-lines-nSxcZVF5.js";
|
|
16
16
|
import { n as ue, r as M, t as de } from "./path-BglsXpnO.js";
|
|
17
17
|
import { t as fe } from "./locate-Bcg3QcP4.js";
|
|
18
18
|
import { t as N } from "./heatmap-scale-Zte6Ya-g.js";
|
|
@@ -93,26 +93,26 @@ function q({ lines: e, width: t, height: n }) {
|
|
|
93
93
|
}
|
|
94
94
|
// packages/charts/src/trend/column-figure.tsx
|
|
95
95
|
var J = 3.5;
|
|
96
|
-
function Y({ frame: e, emptyLabel:
|
|
96
|
+
function Y({ frame: e, emptyLabel: r, plotRef: a, box: s, xs: c, xTicks: l, yTicks: u, yTitle: d, lines: p, items: m, legend: h, marks: g, selected: _, onSelectedChange: v }) {
|
|
97
97
|
let y = pe(), b = f(), x = v !== void 0, ee = p.map((e) => ({
|
|
98
98
|
id: e.id,
|
|
99
|
-
points:
|
|
99
|
+
points: c.map((t, n) => ({
|
|
100
100
|
x: t,
|
|
101
101
|
y: e.ys[n] ?? null
|
|
102
102
|
}))
|
|
103
103
|
}));
|
|
104
|
-
return /* @__PURE__ */ I(
|
|
104
|
+
return /* @__PURE__ */ I(n, {
|
|
105
105
|
...b,
|
|
106
106
|
items: m,
|
|
107
107
|
selected: _,
|
|
108
108
|
onSelect: v,
|
|
109
109
|
locate: q({
|
|
110
110
|
lines: ee,
|
|
111
|
-
width:
|
|
112
|
-
height:
|
|
111
|
+
width: s.width,
|
|
112
|
+
height: s.height
|
|
113
113
|
}),
|
|
114
|
-
render: (
|
|
115
|
-
let _ = f.inspected ?? f.selected, v = ee.find((e) => e.id === f.cursor), b = p.toSorted((e, t) => Number(e.id === _) - Number(t.id === _)), C =
|
|
114
|
+
render: (n, f) => {
|
|
115
|
+
let _ = f.inspected ?? f.selected, v = ee.find((e) => e.id === f.cursor), b = p.toSorted((e, t) => Number(e.id === _) - Number(t.id === _)), C = c.length - 1;
|
|
116
116
|
function w(e, t) {
|
|
117
117
|
return p.flatMap((n) => {
|
|
118
118
|
let r = n.ys[e];
|
|
@@ -126,16 +126,16 @@ function Y({ frame: e, emptyLabel: t, plotRef: i, box: o, xs: s, xTicks: c, yTic
|
|
|
126
126
|
}
|
|
127
127
|
return /* @__PURE__ */ I(te, {
|
|
128
128
|
...e,
|
|
129
|
-
figure:
|
|
129
|
+
figure: n,
|
|
130
130
|
series: h,
|
|
131
|
-
footer: p.length === 0 ? void 0 : /* @__PURE__ */ I(
|
|
131
|
+
footer: p.length === 0 ? void 0 : /* @__PURE__ */ I(i, {
|
|
132
132
|
id: y,
|
|
133
|
-
children:
|
|
133
|
+
children: t(m, f.inspected)
|
|
134
134
|
}),
|
|
135
|
-
children: p.length === 0 ? /* @__PURE__ */ I(T, { children:
|
|
136
|
-
plotRef:
|
|
137
|
-
box:
|
|
138
|
-
label:
|
|
135
|
+
children: p.length === 0 ? /* @__PURE__ */ I(T, { children: r }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
|
|
136
|
+
plotRef: a,
|
|
137
|
+
box: s,
|
|
138
|
+
label: o({
|
|
139
139
|
title: e.title,
|
|
140
140
|
marks: g,
|
|
141
141
|
isSelectable: x
|
|
@@ -143,16 +143,16 @@ function Y({ frame: e, emptyLabel: t, plotRef: i, box: o, xs: s, xTicks: c, yTic
|
|
|
143
143
|
readoutId: y,
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ I(D, {
|
|
146
|
-
box:
|
|
147
|
-
xTicks:
|
|
148
|
-
yTicks:
|
|
149
|
-
yTitle:
|
|
146
|
+
box: s,
|
|
147
|
+
xTicks: l,
|
|
148
|
+
yTicks: u,
|
|
149
|
+
yTitle: d,
|
|
150
150
|
grid: "both"
|
|
151
151
|
}),
|
|
152
152
|
/* @__PURE__ */ L(oe, {
|
|
153
|
-
box:
|
|
153
|
+
box: s,
|
|
154
154
|
children: [b.map((e) => {
|
|
155
|
-
let t =
|
|
155
|
+
let t = c.map((t, n) => ({
|
|
156
156
|
x: t,
|
|
157
157
|
y: e.ys[n] ?? null
|
|
158
158
|
})), n = _ === null || _ === e.id ? "normal" : "receded";
|
|
@@ -173,17 +173,17 @@ function Y({ frame: e, emptyLabel: t, plotRef: i, box: o, xs: s, xTicks: c, yTic
|
|
|
173
173
|
}),
|
|
174
174
|
/* @__PURE__ */ I(_e, {
|
|
175
175
|
labels: w(0, (e) => e.startLabel),
|
|
176
|
-
x:
|
|
176
|
+
x: c[0] ?? s.left,
|
|
177
177
|
anchor: "end",
|
|
178
|
-
top:
|
|
179
|
-
bottom:
|
|
178
|
+
top: s.top,
|
|
179
|
+
bottom: s.bottom
|
|
180
180
|
}),
|
|
181
181
|
/* @__PURE__ */ I(_e, {
|
|
182
182
|
labels: w(C, (e) => e.endLabel),
|
|
183
|
-
x:
|
|
183
|
+
x: c[C] ?? s.right,
|
|
184
184
|
anchor: "start",
|
|
185
|
-
top:
|
|
186
|
-
bottom:
|
|
185
|
+
top: s.top,
|
|
186
|
+
bottom: s.bottom
|
|
187
187
|
})
|
|
188
188
|
]
|
|
189
189
|
}), /* @__PURE__ */ I(S, {
|
|
@@ -217,23 +217,23 @@ var Z = {
|
|
|
217
217
|
stages: 24,
|
|
218
218
|
rank: 100
|
|
219
219
|
}, Ce = 48, we = 18, Te = .5;
|
|
220
|
-
function Ee({ stages: e, items:
|
|
221
|
-
if (!
|
|
222
|
-
if (
|
|
223
|
-
let
|
|
224
|
-
if (
|
|
225
|
-
let i =
|
|
220
|
+
function Ee({ stages: e, items: t }) {
|
|
221
|
+
if (!r(e) || !r(t)) return "Stages and items must have unique identifiers.";
|
|
222
|
+
if (t.length > Z.items || e.length > Z.stages) return `This chart draws at most ${Z.items} items over ${Z.stages} stages.`;
|
|
223
|
+
let n = t.find((t) => t.ranks.length !== e.length);
|
|
224
|
+
if (n !== void 0) return `Item ${n.id} needs one rank for each of the ${e.length} stages.`;
|
|
225
|
+
let i = t.find((e) => e.ranks.some((e) => e === null ? !1 : !Number.isInteger(e) || e < 1 || e > Z.rank));
|
|
226
226
|
if (i !== void 0) return `Item ${i.id} has a rank that is not a whole number from 1 to ${Z.rank}.`;
|
|
227
|
-
let a = e.find((e,
|
|
228
|
-
let r =
|
|
227
|
+
let a = e.find((e, n) => {
|
|
228
|
+
let r = t.flatMap((e) => e.ranks[n] ?? []);
|
|
229
229
|
return new Set(r).size !== r.length;
|
|
230
230
|
});
|
|
231
231
|
return a === void 0 ? void 0 : `Two items share a rank at stage ${a.id}. Supply one item per rank.`;
|
|
232
232
|
}
|
|
233
233
|
function De(e) {
|
|
234
|
-
let { stages: t, items: n, height: r = "regular", ...i } = e, { emptyLabel: a = "No ranks are available.", ...
|
|
235
|
-
if (
|
|
236
|
-
...
|
|
234
|
+
let { stages: t, items: n, height: r = "regular", ...i } = e, { emptyLabel: a = "No ranks are available.", ...o } = i, { locale: c } = o, l = ae(r), d = m();
|
|
235
|
+
if (o.status === "loading") return /* @__PURE__ */ I(ee, {
|
|
236
|
+
...o,
|
|
237
237
|
height: r
|
|
238
238
|
});
|
|
239
239
|
let f = Ee({
|
|
@@ -241,7 +241,7 @@ function De(e) {
|
|
|
241
241
|
items: n
|
|
242
242
|
});
|
|
243
243
|
if (f !== void 0) return /* @__PURE__ */ I(w, {
|
|
244
|
-
...
|
|
244
|
+
...o,
|
|
245
245
|
message: f
|
|
246
246
|
});
|
|
247
247
|
function p(e) {
|
|
@@ -260,15 +260,15 @@ function De(e) {
|
|
|
260
260
|
})
|
|
261
261
|
})), v = Math.max(1, ...n.flatMap((e) => e.ranks.flatMap((e) => e ?? []))), b = W({
|
|
262
262
|
labels: _.map((e) => e.label),
|
|
263
|
-
width:
|
|
264
|
-
}), x =
|
|
265
|
-
width:
|
|
263
|
+
width: l.width
|
|
264
|
+
}), x = s({
|
|
265
|
+
width: l.width,
|
|
266
266
|
valueLabels: [String(v)],
|
|
267
267
|
hasXTitle: !1,
|
|
268
268
|
hasYTitle: !0
|
|
269
|
-
}), S =
|
|
270
|
-
width:
|
|
271
|
-
height: Math.max(
|
|
269
|
+
}), S = u({
|
|
270
|
+
width: l.width,
|
|
271
|
+
height: Math.max(l.height, G(Math.max(v, n.length)) + Ce),
|
|
272
272
|
margins: x
|
|
273
273
|
}), te = y({
|
|
274
274
|
domain: [Te, v + Te],
|
|
@@ -300,9 +300,9 @@ function De(e) {
|
|
|
300
300
|
label: `${e.label}: ${t.map((t, n) => `${t.label} ${p(e.ranks[n])}`).join(" · ")}`
|
|
301
301
|
}));
|
|
302
302
|
return /* @__PURE__ */ I(Y, {
|
|
303
|
-
frame:
|
|
303
|
+
frame: o,
|
|
304
304
|
emptyLabel: a,
|
|
305
|
-
plotRef:
|
|
305
|
+
plotRef: l.ref,
|
|
306
306
|
box: S,
|
|
307
307
|
xs: D,
|
|
308
308
|
xTicks: O,
|
|
@@ -326,11 +326,11 @@ var Q = {
|
|
|
326
326
|
references: 8,
|
|
327
327
|
markers: 8
|
|
328
328
|
}, Oe = 6, ke = 12, Ae = 12, je = 2.5;
|
|
329
|
-
function Me({ series: e, references:
|
|
329
|
+
function Me({ series: e, references: t, markers: n, xDomain: i, yDomain: a, x: o, y: s }) {
|
|
330
330
|
let c = v(i, o.scale) ?? v(a, s.scale);
|
|
331
331
|
if (c !== void 0) return c;
|
|
332
|
-
if (!
|
|
333
|
-
if (e.length > Q.series ||
|
|
332
|
+
if (!r(e) || !r(t)) return "Series and reference lines must have unique identifiers.";
|
|
333
|
+
if (e.length > Q.series || t.length > Q.references || n.length > Q.markers) return `This chart draws at most ${Q.series} series, ${Q.references} reference lines and ${Q.markers} markers.`;
|
|
334
334
|
for (let t of e) {
|
|
335
335
|
if (t.points.length > Q.pointsPerSeries) return `Series ${t.id} exceeds ${Q.pointsPerSeries} points. Supply a window or a coarser sample.`;
|
|
336
336
|
if (!t.points.every((e, n) => n === 0 || e.x > (t.points[n - 1]?.x ?? 0)) || t.points.some((e) => _(e.x, i))) return `Series ${t.id} needs strictly increasing x values inside the declared domain.`;
|
|
@@ -341,11 +341,11 @@ function Me({ series: e, references: n, markers: r, xDomain: i, yDomain: a, x: o
|
|
|
341
341
|
]).some((e) => e !== null && _(e, a))) return `Series ${t.id} has a value that is not finite or lies outside the declared domain.`;
|
|
342
342
|
if (t.points.some((e) => (e.lower ?? null) === null != ((e.upper ?? null) === null))) return `Series ${t.id} has an interval with one bound. Supply both bounds or neither.`;
|
|
343
343
|
}
|
|
344
|
-
if (
|
|
345
|
-
if (
|
|
344
|
+
if (t.some((e) => _(e.y, a))) return "A reference line lies outside the declared domain.";
|
|
345
|
+
if (n.some((e) => _(e.x, i))) return "A marker lies outside the x domain.";
|
|
346
346
|
}
|
|
347
347
|
function Ne(e) {
|
|
348
|
-
let { series: t, x:
|
|
348
|
+
let { series: t, x: r, y: i, references: s = [], curve: u = "linear", labels: d = "legend", height: g = "regular", ..._ } = e, { highlighted: v, markers: y = [], ...x } = _, { emptyLabel: E = "No observations are available.", ...j } = x, { locale: N, title: P } = j, F = ae(g), R = pe(), z = m(), B = f(), V = p({
|
|
349
349
|
ids: t.map((e) => e.id),
|
|
350
350
|
highlighted: v
|
|
351
351
|
});
|
|
@@ -357,33 +357,33 @@ function Ne(e) {
|
|
|
357
357
|
e.y,
|
|
358
358
|
e.lower ?? null,
|
|
359
359
|
e.upper ?? null
|
|
360
|
-
]), G =
|
|
360
|
+
]), G = r.domain ?? a({
|
|
361
361
|
values: H.map((e) => e.x),
|
|
362
|
-
scale: n.scale
|
|
363
|
-
}), ve = r.domain ?? i({
|
|
364
|
-
values: [...U, ...o.map((e) => e.y)],
|
|
365
362
|
scale: r.scale
|
|
363
|
+
}), ve = i.domain ?? a({
|
|
364
|
+
values: [...U, ...s.map((e) => e.y)],
|
|
365
|
+
scale: i.scale
|
|
366
366
|
}), K = Me({
|
|
367
367
|
series: t,
|
|
368
|
-
references:
|
|
368
|
+
references: s,
|
|
369
369
|
markers: y,
|
|
370
370
|
xDomain: G,
|
|
371
371
|
yDomain: ve,
|
|
372
|
-
x:
|
|
373
|
-
y:
|
|
372
|
+
x: r,
|
|
373
|
+
y: i
|
|
374
374
|
});
|
|
375
375
|
if (K !== void 0) return /* @__PURE__ */ I(w, {
|
|
376
376
|
...j,
|
|
377
377
|
message: K
|
|
378
378
|
});
|
|
379
|
-
let ye =
|
|
379
|
+
let ye = d === "inline" ? W({
|
|
380
380
|
labels: t.map((e) => e.label),
|
|
381
381
|
width: F.width
|
|
382
|
-
}) : 0, q =
|
|
382
|
+
}) : 0, q = l({
|
|
383
383
|
width: F.width,
|
|
384
384
|
height: F.height,
|
|
385
|
-
x:
|
|
386
|
-
y:
|
|
385
|
+
x: r,
|
|
386
|
+
y: i,
|
|
387
387
|
xDomain: G,
|
|
388
388
|
yDomain: ve,
|
|
389
389
|
locale: N,
|
|
@@ -400,14 +400,14 @@ function Ne(e) {
|
|
|
400
400
|
return h({
|
|
401
401
|
value: e,
|
|
402
402
|
locale: N,
|
|
403
|
-
format:
|
|
403
|
+
format: r.format
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
function X(e) {
|
|
407
407
|
return h({
|
|
408
408
|
value: e,
|
|
409
409
|
locale: N,
|
|
410
|
-
format:
|
|
410
|
+
format: i.format
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
function Z(e) {
|
|
@@ -430,7 +430,7 @@ function Ne(e) {
|
|
|
430
430
|
let t = Ce(e).map((e) => `${e.label}: ${e.value}`);
|
|
431
431
|
return {
|
|
432
432
|
id: String(e),
|
|
433
|
-
label: [`${
|
|
433
|
+
label: [`${r.label} ${Se(e)}`, ...t].join(" · ")
|
|
434
434
|
};
|
|
435
435
|
}), Te = Y.map((e) => ({
|
|
436
436
|
id: e.id,
|
|
@@ -483,7 +483,7 @@ function Ne(e) {
|
|
|
483
483
|
})
|
|
484
484
|
};
|
|
485
485
|
});
|
|
486
|
-
return /* @__PURE__ */ I(
|
|
486
|
+
return /* @__PURE__ */ I(n, {
|
|
487
487
|
...B,
|
|
488
488
|
items: we,
|
|
489
489
|
locate: fe({
|
|
@@ -492,27 +492,27 @@ function Ne(e) {
|
|
|
492
492
|
height: J.height,
|
|
493
493
|
axis: "x"
|
|
494
494
|
}),
|
|
495
|
-
render: (e, { inspected: t, cursor:
|
|
496
|
-
let
|
|
495
|
+
render: (e, { inspected: t, cursor: n }) => {
|
|
496
|
+
let a = xe.find((e) => String(e) === t), l = xe.find((e) => String(e) === n);
|
|
497
497
|
return /* @__PURE__ */ I(te, {
|
|
498
498
|
...j,
|
|
499
499
|
figure: e,
|
|
500
500
|
series: Te,
|
|
501
501
|
seriesLegend: H.length === 0 ? void 0 : /* @__PURE__ */ I(C, {
|
|
502
502
|
id: R,
|
|
503
|
-
label:
|
|
503
|
+
label: a === void 0 ? void 0 : `${r.label} ${Se(a)}`,
|
|
504
504
|
legend: Te,
|
|
505
|
-
rows:
|
|
506
|
-
x:
|
|
505
|
+
rows: a === void 0 ? [] : Ce(a),
|
|
506
|
+
x: a === void 0 ? 0 : q.x.position(a),
|
|
507
507
|
width: J.width,
|
|
508
|
-
hasLegend:
|
|
508
|
+
hasLegend: d === "legend"
|
|
509
509
|
}),
|
|
510
510
|
children: H.length === 0 ? /* @__PURE__ */ I(T, { children: E }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
|
|
511
511
|
plotRef: F.ref,
|
|
512
512
|
box: J,
|
|
513
|
-
label:
|
|
513
|
+
label: o({
|
|
514
514
|
title: P,
|
|
515
|
-
marks: `${
|
|
515
|
+
marks: `${r.label} values`,
|
|
516
516
|
isSelectable: !1
|
|
517
517
|
}),
|
|
518
518
|
readoutId: R,
|
|
@@ -521,8 +521,8 @@ function Ne(e) {
|
|
|
521
521
|
box: J,
|
|
522
522
|
xTicks: q.xTicks,
|
|
523
523
|
yTicks: q.yTicks,
|
|
524
|
-
xTitle:
|
|
525
|
-
yTitle:
|
|
524
|
+
xTitle: c(r),
|
|
525
|
+
yTitle: c(i)
|
|
526
526
|
}),
|
|
527
527
|
/* @__PURE__ */ L(oe, {
|
|
528
528
|
box: J,
|
|
@@ -542,7 +542,7 @@ function Ne(e) {
|
|
|
542
542
|
emphasis: t
|
|
543
543
|
}),
|
|
544
544
|
/* @__PURE__ */ I(A, {
|
|
545
|
-
d: M(n,
|
|
545
|
+
d: M(n, u),
|
|
546
546
|
tone: e.tone,
|
|
547
547
|
stroke: e.stroke,
|
|
548
548
|
emphasis: t
|
|
@@ -555,8 +555,8 @@ function Ne(e) {
|
|
|
555
555
|
emphasis: t
|
|
556
556
|
}, n.x))
|
|
557
557
|
] }, e.id);
|
|
558
|
-
}),
|
|
559
|
-
let t = e.points.find((e) => e.x ===
|
|
558
|
+
}), a !== void 0 && be.flatMap((e) => {
|
|
559
|
+
let t = e.points.find((e) => e.x === a);
|
|
560
560
|
return t === void 0 || t.y === null ? [] : [/* @__PURE__ */ I(O, {
|
|
561
561
|
x: q.x.position(t.x),
|
|
562
562
|
y: q.y.position(t.y),
|
|
@@ -576,7 +576,7 @@ function Ne(e) {
|
|
|
576
576
|
children: e.spot.text
|
|
577
577
|
})] }, e.key)),
|
|
578
578
|
/* @__PURE__ */ I(le, {
|
|
579
|
-
lines:
|
|
579
|
+
lines: s.map((e) => ({
|
|
580
580
|
id: e.id,
|
|
581
581
|
label: e.label,
|
|
582
582
|
value: e.y
|
|
@@ -586,7 +586,7 @@ function Ne(e) {
|
|
|
586
586
|
valueText: X,
|
|
587
587
|
obstacles: De
|
|
588
588
|
}),
|
|
589
|
-
|
|
589
|
+
d === "inline" && /* @__PURE__ */ I(_e, {
|
|
590
590
|
labels: be.flatMap((e) => {
|
|
591
591
|
let t = e.points.findLast((e) => e.y !== null);
|
|
592
592
|
return t === void 0 || t.y === null ? [] : [{
|
|
@@ -601,8 +601,8 @@ function Ne(e) {
|
|
|
601
601
|
top: J.top,
|
|
602
602
|
bottom: J.bottom
|
|
603
603
|
}),
|
|
604
|
-
|
|
605
|
-
x: q.x.position(
|
|
604
|
+
l !== void 0 && /* @__PURE__ */ I(b, {
|
|
605
|
+
x: q.x.position(l),
|
|
606
606
|
top: J.top,
|
|
607
607
|
bottom: J.bottom,
|
|
608
608
|
width: Ae
|
|
@@ -653,16 +653,16 @@ var Pe = {
|
|
|
653
653
|
$$css: !0
|
|
654
654
|
}, { "--x-fill": e ?? void 0 }]
|
|
655
655
|
};
|
|
656
|
-
function Ge({ series: e, xDomain:
|
|
657
|
-
let a = v(
|
|
656
|
+
function Ge({ series: e, xDomain: t, x: n, value: i }) {
|
|
657
|
+
let a = v(t, n.scale) ?? v(i.domain);
|
|
658
658
|
if (a !== void 0) return a;
|
|
659
659
|
if (i.scale !== void 0 && i.scale !== "linear") return "A horizon chart folds values on a linear axis.";
|
|
660
660
|
if (i.domain[0] > 0 || i.domain[1] < 0) return "The value domain must contain zero, which is where the rows fold.";
|
|
661
|
-
if (!
|
|
661
|
+
if (!r(e)) return "Series must have unique identifiers.";
|
|
662
662
|
if (e.length > Pe.series) return `This chart draws at most ${Pe.series} series. Supply the ones to compare.`;
|
|
663
663
|
let o = e.find((e) => e.points.length > Pe.pointsPerSeries);
|
|
664
664
|
if (o !== void 0) return `Series ${o.id} exceeds ${Pe.pointsPerSeries} points. Supply a coarser sample.`;
|
|
665
|
-
let s = e.find((e) => e.points.some((t, n) => n > 0 && t.x <= (e.points[n - 1]?.x ?? 0)) || e.points.some((e) => _(e.x,
|
|
665
|
+
let s = e.find((e) => e.points.some((t, n) => n > 0 && t.x <= (e.points[n - 1]?.x ?? 0)) || e.points.some((e) => _(e.x, t)));
|
|
666
666
|
if (s !== void 0) return `Series ${s.id} needs strictly increasing x values inside the declared domain.`;
|
|
667
667
|
let c = e.find((e) => e.points.some((e) => e.y !== null && _(e.y, i.domain)));
|
|
668
668
|
return c === void 0 ? void 0 : `Series ${c.id} has a value that is not finite or lies outside the declared domain.`;
|
|
@@ -702,19 +702,19 @@ function qe({ colors: e, format: t }) {
|
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
704
|
function Je(t) {
|
|
705
|
-
let { series:
|
|
705
|
+
let { series: r, x: i, value: l, bands: p, height: m = "regular", ...g } = t, { emptyLabel: _ = "No observations are available.", ...v } = g, { locale: C, title: O } = v, A = ae(m), ne = pe(), re = f();
|
|
706
706
|
if (v.status === "loading") return /* @__PURE__ */ I(ee, {
|
|
707
707
|
...v,
|
|
708
708
|
height: "compact"
|
|
709
709
|
});
|
|
710
|
-
let j =
|
|
710
|
+
let j = r.flatMap((e) => e.points), se = i.domain ?? a({
|
|
711
711
|
values: j.map((e) => e.x),
|
|
712
|
-
scale:
|
|
712
|
+
scale: i.scale
|
|
713
713
|
}), ce = Ge({
|
|
714
|
-
series:
|
|
714
|
+
series: r,
|
|
715
715
|
xDomain: se,
|
|
716
|
-
x:
|
|
717
|
-
value:
|
|
716
|
+
x: i,
|
|
717
|
+
value: l
|
|
718
718
|
});
|
|
719
719
|
if (ce !== void 0) return /* @__PURE__ */ I(w, {
|
|
720
720
|
...v,
|
|
@@ -724,34 +724,34 @@ function Je(t) {
|
|
|
724
724
|
return h({
|
|
725
725
|
value: e,
|
|
726
726
|
locale: C,
|
|
727
|
-
format:
|
|
727
|
+
format: i.format
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
function ue(e) {
|
|
731
731
|
return h({
|
|
732
732
|
value: e,
|
|
733
733
|
locale: C,
|
|
734
|
-
format:
|
|
734
|
+
format: l.format
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
|
-
let M = Fe[m], N = M - Ie, F =
|
|
737
|
+
let M = Fe[m], N = M - Ie, F = s({
|
|
738
738
|
width: A.width,
|
|
739
|
-
valueLabels:
|
|
739
|
+
valueLabels: r.map((e) => e.label),
|
|
740
740
|
hasXTitle: !0,
|
|
741
741
|
hasYTitle: !1
|
|
742
|
-
}), R =
|
|
742
|
+
}), R = u({
|
|
743
743
|
width: A.width,
|
|
744
|
-
height: F.top +
|
|
744
|
+
height: F.top + r.length * M + Ve,
|
|
745
745
|
margins: F
|
|
746
746
|
}), z = y({
|
|
747
|
-
type:
|
|
747
|
+
type: i.scale,
|
|
748
748
|
domain: se,
|
|
749
749
|
range: [R.left, R.right]
|
|
750
750
|
}), B = Ke({
|
|
751
|
-
domain:
|
|
751
|
+
domain: l.domain,
|
|
752
752
|
bands: p
|
|
753
|
-
}), V = he(R.left), H =
|
|
754
|
-
axis:
|
|
753
|
+
}), V = he(R.left), H = d({
|
|
754
|
+
axis: i,
|
|
755
755
|
domain: se,
|
|
756
756
|
length: R.innerWidth,
|
|
757
757
|
spacing: Be,
|
|
@@ -763,7 +763,7 @@ function Je(t) {
|
|
|
763
763
|
label: H.labels[t] ?? ""
|
|
764
764
|
})), W = [...new Set(j.map((e) => e.x))].toSorted((e, t) => e - t);
|
|
765
765
|
function G(e) {
|
|
766
|
-
return
|
|
766
|
+
return r.map((t) => ({
|
|
767
767
|
id: t.id,
|
|
768
768
|
label: t.label,
|
|
769
769
|
tone: "neutral",
|
|
@@ -772,13 +772,13 @@ function Je(t) {
|
|
|
772
772
|
}
|
|
773
773
|
let _e = W.map((e) => ({
|
|
774
774
|
id: String(e),
|
|
775
|
-
label: [`${
|
|
775
|
+
label: [`${i.label} ${le(e)}`, ...G(e).map((e) => `${e.label}: ${e.value}`)].join(" · ")
|
|
776
776
|
})), ve = W.map((e) => ({
|
|
777
777
|
id: String(e),
|
|
778
778
|
x: z.position(e),
|
|
779
779
|
y: 0
|
|
780
780
|
}));
|
|
781
|
-
return /* @__PURE__ */ I(
|
|
781
|
+
return /* @__PURE__ */ I(n, {
|
|
782
782
|
...re,
|
|
783
783
|
items: _e,
|
|
784
784
|
locate: fe({
|
|
@@ -787,16 +787,16 @@ function Je(t) {
|
|
|
787
787
|
height: R.height,
|
|
788
788
|
axis: "x"
|
|
789
789
|
}),
|
|
790
|
-
render: (t, { inspected:
|
|
791
|
-
let
|
|
790
|
+
render: (t, { inspected: n, cursor: a }) => {
|
|
791
|
+
let s = W.find((e) => String(e) === n), l = W.find((e) => String(e) === a), u = s === void 0 ? void 0 : `${i.label} ${le(s)}`, d = G(s);
|
|
792
792
|
return /* @__PURE__ */ I(te, {
|
|
793
793
|
...v,
|
|
794
794
|
figure: t,
|
|
795
|
-
scaleLegend:
|
|
795
|
+
scaleLegend: r.length === 0 ? void 0 : /* @__PURE__ */ I(qe, {
|
|
796
796
|
colors: B,
|
|
797
797
|
format: ue
|
|
798
798
|
}),
|
|
799
|
-
footer:
|
|
799
|
+
footer: r.length === 0 ? void 0 : /* @__PURE__ */ L("div", {
|
|
800
800
|
className: "xrvj5dj x1hnptsi xeuugli",
|
|
801
801
|
children: [/* @__PURE__ */ I("span", {
|
|
802
802
|
id: ne,
|
|
@@ -832,12 +832,12 @@ function Je(t) {
|
|
|
832
832
|
})]
|
|
833
833
|
})]
|
|
834
834
|
}),
|
|
835
|
-
children:
|
|
835
|
+
children: r.length === 0 || j.length === 0 ? /* @__PURE__ */ I(T, { children: _ }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
|
|
836
836
|
plotRef: A.ref,
|
|
837
837
|
box: R,
|
|
838
|
-
label:
|
|
838
|
+
label: o({
|
|
839
839
|
title: O,
|
|
840
|
-
marks: `${
|
|
840
|
+
marks: `${i.label} positions`,
|
|
841
841
|
isSelectable: !1
|
|
842
842
|
}),
|
|
843
843
|
readoutId: ne,
|
|
@@ -846,12 +846,12 @@ function Je(t) {
|
|
|
846
846
|
box: R,
|
|
847
847
|
xTicks: U,
|
|
848
848
|
yTicks: [],
|
|
849
|
-
xTitle:
|
|
849
|
+
xTitle: c(i),
|
|
850
850
|
grid: "x"
|
|
851
851
|
}),
|
|
852
852
|
/* @__PURE__ */ L(oe, {
|
|
853
853
|
box: R,
|
|
854
|
-
children: [
|
|
854
|
+
children: [r.map((e, t) => {
|
|
855
855
|
let n = R.top + t * M + N;
|
|
856
856
|
return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I("line", {
|
|
857
857
|
x1: R.left,
|
|
@@ -873,15 +873,15 @@ function Je(t) {
|
|
|
873
873
|
...P.props(We.layer(r))
|
|
874
874
|
}, `${t}${r}`);
|
|
875
875
|
}))] }, e.id);
|
|
876
|
-
}),
|
|
877
|
-
x1: z.position(
|
|
878
|
-
x2: z.position(
|
|
876
|
+
}), s !== void 0 && /* @__PURE__ */ I("line", {
|
|
877
|
+
x1: z.position(s),
|
|
878
|
+
x2: z.position(s),
|
|
879
879
|
y1: R.top,
|
|
880
880
|
y2: R.bottom,
|
|
881
881
|
...P.props(E.baseline)
|
|
882
882
|
})]
|
|
883
883
|
}),
|
|
884
|
-
|
|
884
|
+
r.map((e, t) => /* @__PURE__ */ I(k, {
|
|
885
885
|
x: R.left - Le,
|
|
886
886
|
y: R.top + t * M + N / 2 + Re,
|
|
887
887
|
anchor: "end",
|
|
@@ -914,54 +914,54 @@ var Ye = {
|
|
|
914
914
|
runs: 200,
|
|
915
915
|
pointsPerRun: 500
|
|
916
916
|
}, Xe = 4;
|
|
917
|
-
function Ze({ runs: e, featured:
|
|
917
|
+
function Ze({ runs: e, featured: t, summary: n, xDomain: i, yDomain: a, x: o, y: s }) {
|
|
918
918
|
let c = v(i, o.scale) ?? v(a, s.scale);
|
|
919
919
|
if (c !== void 0) return c;
|
|
920
|
-
if (!
|
|
920
|
+
if (!r(e)) return "Runs must have unique identifiers.";
|
|
921
921
|
if (e.length > Ye.runs) return `This chart draws at most ${Ye.runs} runs. Supply the runs to compare.`;
|
|
922
|
-
let l =
|
|
922
|
+
let l = t.find((t) => !e.some((e) => e.id === t));
|
|
923
923
|
if (l !== void 0) return `Highlighted run ${l} is not among the runs.`;
|
|
924
924
|
let u = [...e.map((e) => ({
|
|
925
925
|
id: e.id,
|
|
926
926
|
points: e.points
|
|
927
|
-
})), ...
|
|
927
|
+
})), ...n === void 0 ? [] : [{
|
|
928
928
|
id: "summary",
|
|
929
|
-
points:
|
|
929
|
+
points: n.points
|
|
930
930
|
}]], d = u.find((e) => e.points.length > Ye.pointsPerRun);
|
|
931
931
|
if (d !== void 0) return `Run ${d.id} exceeds ${Ye.pointsPerRun} points. Supply a window or a coarser sample.`;
|
|
932
932
|
let f = u.find((e) => e.points.some((t, n) => n > 0 && t.x <= (e.points[n - 1]?.x ?? 0)) || e.points.some((e) => _(e.x, i)));
|
|
933
933
|
if (f !== void 0) return `Run ${f.id} needs strictly increasing steps inside the declared domain.`;
|
|
934
934
|
let p = e.find((e) => e.points.some((e) => e.y !== null && _(e.y, a)));
|
|
935
|
-
return p === void 0 ? (
|
|
935
|
+
return p === void 0 ? (n?.points ?? []).every((e) => [
|
|
936
936
|
e.lower,
|
|
937
937
|
e.center,
|
|
938
938
|
e.upper
|
|
939
939
|
].every((e) => !_(e, a)) && e.lower <= e.center && e.center <= e.upper) ? void 0 : "The summary needs lower ≤ center ≤ upper inside the declared domain at every step." : `Run ${p.id} has a value that is not finite or lies outside the declared domain.`;
|
|
940
940
|
}
|
|
941
941
|
function Qe(e) {
|
|
942
|
-
let { runs:
|
|
942
|
+
let { runs: r, x: s, y: u, featured: d, summary: p, height: g = "regular", selected: _, onSelectedChange: v, ...y } = e, { emptyLabel: b = "No runs are available.", ...x } = y, { locale: C, title: E } = x, k = ae(g), re = pe(), j = m(), se = f(), [ce, le] = F(void 0);
|
|
943
943
|
if (x.status === "loading") return /* @__PURE__ */ I(ee, {
|
|
944
944
|
...x,
|
|
945
945
|
height: g
|
|
946
946
|
});
|
|
947
|
-
let fe = [...
|
|
947
|
+
let fe = [...r.flatMap((e) => e.points.map((e) => e.x)), ...(p?.points ?? []).map((e) => e.x)], N = [...r.flatMap((e) => e.points.map((e) => e.y)), ...(p?.points ?? []).flatMap((e) => [
|
|
948
948
|
e.lower,
|
|
949
949
|
e.center,
|
|
950
950
|
e.upper
|
|
951
|
-
])], P =
|
|
951
|
+
])], P = s.domain ?? a({
|
|
952
952
|
values: fe,
|
|
953
|
-
scale:
|
|
954
|
-
}), R =
|
|
953
|
+
scale: s.scale
|
|
954
|
+
}), R = u.domain ?? a({
|
|
955
955
|
values: N,
|
|
956
|
-
scale:
|
|
956
|
+
scale: u.scale
|
|
957
957
|
}), z = Ze({
|
|
958
|
-
runs:
|
|
959
|
-
featured:
|
|
958
|
+
runs: r,
|
|
959
|
+
featured: d,
|
|
960
960
|
summary: p,
|
|
961
961
|
xDomain: P,
|
|
962
962
|
yDomain: R,
|
|
963
|
-
x:
|
|
964
|
-
y:
|
|
963
|
+
x: s,
|
|
964
|
+
y: u
|
|
965
965
|
});
|
|
966
966
|
if (z !== void 0) return /* @__PURE__ */ I(w, {
|
|
967
967
|
...x,
|
|
@@ -971,48 +971,48 @@ function Qe(e) {
|
|
|
971
971
|
return h({
|
|
972
972
|
value: e,
|
|
973
973
|
locale: C,
|
|
974
|
-
format:
|
|
974
|
+
format: s.format
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
function V(e) {
|
|
978
978
|
return h({
|
|
979
979
|
value: e,
|
|
980
980
|
locale: C,
|
|
981
|
-
format:
|
|
981
|
+
format: u.format
|
|
982
982
|
});
|
|
983
983
|
}
|
|
984
984
|
let H = W({
|
|
985
985
|
width: k.width,
|
|
986
|
-
labels: [...
|
|
987
|
-
}), U =
|
|
986
|
+
labels: [...r.map((e) => e.label), ...p === void 0 ? [] : [p.label]]
|
|
987
|
+
}), U = l({
|
|
988
988
|
width: k.width,
|
|
989
989
|
height: k.height,
|
|
990
|
-
x:
|
|
991
|
-
y:
|
|
990
|
+
x: s,
|
|
991
|
+
y: u,
|
|
992
992
|
xDomain: P,
|
|
993
993
|
yDomain: R,
|
|
994
994
|
locale: C,
|
|
995
995
|
rightGutter: H
|
|
996
|
-
}), { box: G } = U, K =
|
|
996
|
+
}), { box: G } = U, K = r.map((e, t) => ({
|
|
997
997
|
...e,
|
|
998
998
|
line: e.points.map((e) => ({
|
|
999
999
|
x: U.x.position(e.x),
|
|
1000
1000
|
y: e.y === null ? null : U.y.position(e.y)
|
|
1001
1001
|
})),
|
|
1002
1002
|
index: t
|
|
1003
|
-
})), ye =
|
|
1003
|
+
})), ye = r.map((e) => {
|
|
1004
1004
|
let t = e.points.findLast((e) => e.y !== null);
|
|
1005
1005
|
return {
|
|
1006
1006
|
id: e.id,
|
|
1007
|
-
label: t === void 0 ? `${e.label}: no recorded values` : `${e.label}: last recorded ${
|
|
1007
|
+
label: t === void 0 ? `${e.label}: no recorded values` : `${e.label}: last recorded ${s.label} ${B(t.x)}, ${V(t.y)}`
|
|
1008
1008
|
};
|
|
1009
1009
|
});
|
|
1010
1010
|
function J(e) {
|
|
1011
1011
|
let t = K.find((t) => t.id === e)?.points.find((e) => e.x === ce?.x);
|
|
1012
|
-
return ce !== void 0 && ce.id === e && t !== void 0 ? ` · At ${
|
|
1012
|
+
return ce !== void 0 && ce.id === e && t !== void 0 ? ` · At ${s.label} ${B(t.x)}: ${V(t.y)}` : "";
|
|
1013
1013
|
}
|
|
1014
1014
|
function Y(e) {
|
|
1015
|
-
let t =
|
|
1015
|
+
let t = d.indexOf(e.id);
|
|
1016
1016
|
return j({
|
|
1017
1017
|
id: e.id,
|
|
1018
1018
|
tone: e.tone,
|
|
@@ -1041,15 +1041,15 @@ function Qe(e) {
|
|
|
1041
1041
|
x: U.x.position(e.x),
|
|
1042
1042
|
y0: U.y.position(e.lower),
|
|
1043
1043
|
y1: U.y.position(e.upper)
|
|
1044
|
-
})), Ce = [...
|
|
1045
|
-
let
|
|
1044
|
+
})), Ce = [...d.map((e, t) => {
|
|
1045
|
+
let n = r.find((t) => t.id === e);
|
|
1046
1046
|
return {
|
|
1047
1047
|
id: e,
|
|
1048
|
-
label:
|
|
1048
|
+
label: n?.label ?? e,
|
|
1049
1049
|
tone: j({
|
|
1050
1050
|
id: e,
|
|
1051
|
-
tone:
|
|
1052
|
-
index:
|
|
1051
|
+
tone: n?.tone,
|
|
1052
|
+
index: t
|
|
1053
1053
|
}),
|
|
1054
1054
|
shape: "line"
|
|
1055
1055
|
};
|
|
@@ -1059,18 +1059,18 @@ function Qe(e) {
|
|
|
1059
1059
|
tone: Se,
|
|
1060
1060
|
shape: "band"
|
|
1061
1061
|
}]];
|
|
1062
|
-
return /* @__PURE__ */ I(
|
|
1062
|
+
return /* @__PURE__ */ I(n, {
|
|
1063
1063
|
...se,
|
|
1064
1064
|
items: ye,
|
|
1065
1065
|
selected: _,
|
|
1066
1066
|
onSelect: v,
|
|
1067
1067
|
locate: xe,
|
|
1068
|
-
render: (e,
|
|
1069
|
-
let
|
|
1070
|
-
function
|
|
1071
|
-
return
|
|
1068
|
+
render: (e, n) => {
|
|
1069
|
+
let a = /* @__PURE__ */ new Set([n.inspected, n.selected]);
|
|
1070
|
+
function l(e) {
|
|
1071
|
+
return d.includes(e) || a.has(e);
|
|
1072
1072
|
}
|
|
1073
|
-
let f = K.filter((e) =>
|
|
1073
|
+
let f = K.filter((e) => l(e.id)), m = K.find((e) => e.id === n.cursor), h = [...f.flatMap((e) => {
|
|
1074
1074
|
let t = e.line.findLast((e) => e.y !== null), n = Y(e);
|
|
1075
1075
|
return t === void 0 || t.y === null ? [] : [{
|
|
1076
1076
|
id: e.id,
|
|
@@ -1088,14 +1088,14 @@ function Qe(e) {
|
|
|
1088
1088
|
...x,
|
|
1089
1089
|
figure: e,
|
|
1090
1090
|
series: Ce,
|
|
1091
|
-
footer:
|
|
1091
|
+
footer: r.length === 0 ? void 0 : /* @__PURE__ */ I(i, {
|
|
1092
1092
|
id: re,
|
|
1093
|
-
children: `${
|
|
1093
|
+
children: `${t(ye, n.inspected)}${J(n.inspected)}`
|
|
1094
1094
|
}),
|
|
1095
|
-
children:
|
|
1095
|
+
children: r.length === 0 ? /* @__PURE__ */ I(T, { children: b }) : /* @__PURE__ */ L(me, { children: [/* @__PURE__ */ L(ie, {
|
|
1096
1096
|
plotRef: k.ref,
|
|
1097
1097
|
box: G,
|
|
1098
|
-
label:
|
|
1098
|
+
label: o({
|
|
1099
1099
|
title: E,
|
|
1100
1100
|
marks: "runs",
|
|
1101
1101
|
isSelectable: v !== void 0
|
|
@@ -1106,13 +1106,13 @@ function Qe(e) {
|
|
|
1106
1106
|
box: G,
|
|
1107
1107
|
xTicks: U.xTicks,
|
|
1108
1108
|
yTicks: U.yTicks,
|
|
1109
|
-
xTitle: s
|
|
1110
|
-
yTitle:
|
|
1109
|
+
xTitle: c(s),
|
|
1110
|
+
yTitle: c(u)
|
|
1111
1111
|
}),
|
|
1112
1112
|
/* @__PURE__ */ L(oe, {
|
|
1113
1113
|
box: G,
|
|
1114
1114
|
children: [
|
|
1115
|
-
K.filter((e) => !
|
|
1115
|
+
K.filter((e) => !l(e.id)).map((e) => /* @__PURE__ */ I(A, {
|
|
1116
1116
|
d: M(e.line),
|
|
1117
1117
|
tone: "neutral",
|
|
1118
1118
|
emphasis: "context"
|
|
@@ -1171,24 +1171,24 @@ var $ = {
|
|
|
1171
1171
|
label: "",
|
|
1172
1172
|
format: {}
|
|
1173
1173
|
};
|
|
1174
|
-
function tt({ conditions: e, items:
|
|
1175
|
-
let a = v(
|
|
1174
|
+
function tt({ conditions: e, items: t, domain: n, value: i }) {
|
|
1175
|
+
let a = v(n, i.scale);
|
|
1176
1176
|
if (a !== void 0) return a;
|
|
1177
1177
|
if (e.length < $.conditionsMin || e.length > $.conditionsMax) return `This chart compares ${$.conditionsMin} to ${$.conditionsMax} conditions.`;
|
|
1178
|
-
if (!
|
|
1179
|
-
if (
|
|
1180
|
-
let o =
|
|
1178
|
+
if (!r(e) || !r(t)) return "Conditions and items must have unique identifiers.";
|
|
1179
|
+
if (t.length > $.items) return `This chart draws at most ${$.items} items. Supply the ones to compare.`;
|
|
1180
|
+
let o = t.find((t) => t.values.length !== e.length);
|
|
1181
1181
|
if (o !== void 0) return `Item ${o.id} needs one value for each of the ${e.length} conditions.`;
|
|
1182
|
-
let s =
|
|
1182
|
+
let s = t.find((e) => e.values.some((e) => e !== null && _(e, n)));
|
|
1183
1183
|
return s === void 0 ? void 0 : `Item ${s.id} has a value that is not finite or lies outside the declared domain.`;
|
|
1184
1184
|
}
|
|
1185
1185
|
function nt(e) {
|
|
1186
|
-
let { conditions: t, items: n, value: r, height:
|
|
1186
|
+
let { conditions: t, items: n, value: r, height: i = "regular", selected: o, onSelectedChange: s, ...c } = e, { emptyLabel: u = "No measurements are available.", ...d } = c, { locale: f } = d, p = ae(i), g = m();
|
|
1187
1187
|
if (d.status === "loading") return /* @__PURE__ */ I(ee, {
|
|
1188
1188
|
...d,
|
|
1189
|
-
height:
|
|
1189
|
+
height: i
|
|
1190
1190
|
});
|
|
1191
|
-
let _ = r.domain ??
|
|
1191
|
+
let _ = r.domain ?? a({
|
|
1192
1192
|
values: n.flatMap((e) => e.values),
|
|
1193
1193
|
scale: r.scale
|
|
1194
1194
|
}), v = tt({
|
|
@@ -1224,7 +1224,7 @@ function nt(e) {
|
|
|
1224
1224
|
}), te = W({
|
|
1225
1225
|
labels: b.map((e, t) => `${y(x[t]?.last)} ${e.label}`),
|
|
1226
1226
|
width: p.width
|
|
1227
|
-
}), C =
|
|
1227
|
+
}), C = l({
|
|
1228
1228
|
width: p.width,
|
|
1229
1229
|
height: Math.max(p.height, G(n.length) + $e),
|
|
1230
1230
|
x: et,
|