@mechane-ai/elements 0.51.0 → 0.52.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/{article-CRlhq9oA.js → article-BDVuehRt.js} +1 -1
- package/dist/article.js +1 -1
- package/dist/catalog.json +42 -1
- package/dist/{categorical-values-BYP_R5gS.js → categorical-values-BoS03HcI.js} +1 -1
- 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 -13
- 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 +3 -3
- 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 +2 -2
- package/dist/collections.js +1 -1
- package/dist/{dates-ckJdYF7t.js → dates-CjlTzw00.js} +1 -1
- package/dist/{dumbbell-plot-BC8d_IJy.js → dumbbell-plot-Xxl6P7D1.js} +3 -3
- package/dist/{embedding-map-Bj8krO-d.js → embedding-map-tU8hT_aC.js} +3 -3
- package/dist/{figure-frame-koVKcXph.js → figure-frame-BKc9TvtX.js} +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/{image-grid-CLhol2jy.js → image-grid-BZy2lkNb.js} +2 -2
- package/dist/kits/evaluation.js +4 -4
- package/dist/kits/interpretability.js +7 -7
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +463 -183
- package/dist/kits/training.js +3 -3
- package/dist/mdx.js +2 -2
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +1 -1
- package/dist/packages/charts/src/plot/plot-layout.d.ts +0 -6
- package/dist/packages/charts/src/timeline/event-strip.d.ts +12 -2
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +5 -11
- package/dist/packages/kits/src/research/collection-page.d.ts +9 -0
- package/dist/packages/kits/src/research/index.d.ts +3 -1
- package/dist/packages/kits/src/research/lineage-graph.d.ts +40 -0
- package/dist/{plot-layout-B2xRt-_k.js → plot-layout-D8j-ozGR.js} +102 -86
- package/dist/{plot-surface-0cKFwtws.js → plot-surface-5e3xeiub.js} +1 -1
- package/dist/{reference-lines-nSxcZVF5.js → reference-lines-1FttCg46.js} +1 -1
- package/dist/{scene-4ePpWdmE.js → scene-8F-fQksU.js} +4 -4
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DWZIYDty.js → slope-chart-B35ZfaYn.js} +4 -4
- package/dist/{src-DNclWY4V.js → src-fvoTU3Bq.js} +377 -377
- package/dist/{time-series-CsngFxr1.js → time-series-DoFMGmFV.js} +612 -590
- package/dist/{token-heatmap-BQLIxPky.js → token-heatmap-DLPQWwMv.js} +3 -3
- package/dist/{token-predictions-C3B5L-eO.js → token-predictions-D_Jwf8Aw.js} +3 -3
- package/dist/{tree-diagram-Dau9jeXS.js → tree-diagram-DreDBCvt.js} +4 -4
- package/dist/{treemap-DWrMQndu.js → treemap-MVX-wa4t.js} +4 -4
- package/dist/{violin-plot-D05ODcyc.js → violin-plot-Bi71NqXF.js} +3 -3
- package/dist/waterfall-8y8ANO3c.js +605 -0
- package/package.json +1 -1
- package/recipes/calendar-workspace.tsx +39 -0
- package/skills/use-elements/references/workspace.md +8 -6
- package/dist/waterfall-BkLLv2Lm.js +0 -576
|
@@ -1,576 +0,0 @@
|
|
|
1
|
-
import { c as e } from "./src-9EJskqB_.js";
|
|
2
|
-
import { A as t, E as n, M as r, S as i, f as a, j as o, l as s, s as c } from "./plot-layout-B2xRt-_k.js";
|
|
3
|
-
import { i as l } from "./chart-link-AE_xuxiP.js";
|
|
4
|
-
import { a as u } from "./tone-scope-DKiSw-JR.js";
|
|
5
|
-
import { n as d, r as f } from "./figure-format-B8kRZMlo.js";
|
|
6
|
-
import { a as p, o as m, r as ee } from "./scale-C2xgZyZN.js";
|
|
7
|
-
import { t as h } from "./chart-cursor-1mFd48Jc.js";
|
|
8
|
-
import { i as g, l as te, n as ne, r as re, t as _ } from "./figure-frame-koVKcXph.js";
|
|
9
|
-
import { n as ie } from "./plot-width-D3hTycYX.js";
|
|
10
|
-
import { t as v } from "./plot-axes-D5S9BnBa.js";
|
|
11
|
-
import { a as y, c as ae, f as oe, r as se } from "./plot-marks-FVsbFkUs.js";
|
|
12
|
-
import { n as ce, r as le, t as ue } from "./plot-surface-0cKFwtws.js";
|
|
13
|
-
import { t as de } from "./locate-Bcg3QcP4.js";
|
|
14
|
-
import * as fe from "@stylexjs/stylex";
|
|
15
|
-
import { useId as pe } from "react";
|
|
16
|
-
import { stackSpans as me } from "@ui-sdk/core";
|
|
17
|
-
import { Fragment as he, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
18
|
-
import { Waterfall as S, WaterfallBar as C, WaterfallCell as ge, WaterfallColumnHeader as w, WaterfallHeaderRow as T, WaterfallRow as _e, WaterfallRowHeader as E } from "@ui-sdk/react/waterfall";
|
|
19
|
-
// packages/charts/src/timeline/event-strip.tsx
|
|
20
|
-
var D = {
|
|
21
|
-
lanes: 12,
|
|
22
|
-
events: 1e3
|
|
23
|
-
}, O = 22, k = 6, ve = 14, ye = 3, A = 5, be = 14, xe = 4, j = 18, M = 4, Se = 6.5, Ce = 12, N = .5, P = 1e3, F = 60 * P, I = 60 * F, L = 24 * I, R = {
|
|
24
|
-
unit: "second",
|
|
25
|
-
size: P
|
|
26
|
-
}, we = [
|
|
27
|
-
{
|
|
28
|
-
unit: "day",
|
|
29
|
-
size: L
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
unit: "hour",
|
|
33
|
-
size: I
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
unit: "minute",
|
|
37
|
-
size: F
|
|
38
|
-
},
|
|
39
|
-
R
|
|
40
|
-
], Te = { separator: {
|
|
41
|
-
kfzvcC: "x47corl",
|
|
42
|
-
$$css: !0
|
|
43
|
-
} };
|
|
44
|
-
function z(e) {
|
|
45
|
-
return s({
|
|
46
|
-
width: Infinity,
|
|
47
|
-
valueLabels: e,
|
|
48
|
-
hasXTitle: !0,
|
|
49
|
-
hasYTitle: !1
|
|
50
|
-
}).left;
|
|
51
|
-
}
|
|
52
|
-
function Ee(e, t) {
|
|
53
|
-
let n = we.find((t) => e >= t.size) ?? R;
|
|
54
|
-
return f({
|
|
55
|
-
value: e / n.size,
|
|
56
|
-
locale: t,
|
|
57
|
-
format: {
|
|
58
|
-
style: "unit",
|
|
59
|
-
unit: n.unit,
|
|
60
|
-
unitDisplay: "long",
|
|
61
|
-
maximumFractionDigits: 1
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function De({ lanes: e, events: t, markers: n, domain: i, zone: a }) {
|
|
66
|
-
let o = m(i);
|
|
67
|
-
if (o !== void 0) return o;
|
|
68
|
-
if (a === void 0) return "A function time format needs a timeZone beside it, so the axis ticks fall on that zone.";
|
|
69
|
-
if (e.length > D.lanes || t.length > D.events) return `This strip draws at most ${D.lanes} lanes and ${D.events} events. Supply a shorter window.`;
|
|
70
|
-
if (!r(e) || !r(t) || !r(n)) return "Lanes, events and markers must each have unique identifiers.";
|
|
71
|
-
let s = new Set(e.map((e) => e.id)), c = t.find((e) => !s.has(e.laneId));
|
|
72
|
-
if (c !== void 0) return `Event ${c.id} names lane ${c.laneId}, which is not supplied.`;
|
|
73
|
-
let l = t.find((e) => {
|
|
74
|
-
let t = e.end !== void 0 && (p(e.end, i) || e.end <= e.start);
|
|
75
|
-
return p(e.start, i) || t;
|
|
76
|
-
});
|
|
77
|
-
return l === void 0 ? n.some((e) => p(e.at, i)) ? "A marker lies outside the domain." : void 0 : `Event ${l.id} must start inside the domain and, when it has an end, end after its start inside the domain.`;
|
|
78
|
-
}
|
|
79
|
-
function B(e) {
|
|
80
|
-
let { lanes: r, events: f, domain: p, markers: m = [], gutterWidth: S, timeFormat: C, timeZone: ge, selected: w, onSelectedChange: T, ..._e } = e, { emptyLabel: E = "No events in this window.", ...D } = _e, { locale: P, title: F } = D, I = le("compact"), L = pe(), R = u(), we = l();
|
|
81
|
-
if (D.status === "loading") return /* @__PURE__ */ b(g, {
|
|
82
|
-
...D,
|
|
83
|
-
height: "compact"
|
|
84
|
-
});
|
|
85
|
-
let z = typeof C == "function" ? ge : C.timeZone, B = De({
|
|
86
|
-
lanes: r,
|
|
87
|
-
events: f,
|
|
88
|
-
markers: m,
|
|
89
|
-
domain: p,
|
|
90
|
-
zone: z
|
|
91
|
-
});
|
|
92
|
-
if (B !== void 0 || z === void 0) return /* @__PURE__ */ b(re, {
|
|
93
|
-
...D,
|
|
94
|
-
message: B ?? "The strip needs a time zone."
|
|
95
|
-
});
|
|
96
|
-
function V(e) {
|
|
97
|
-
return d({
|
|
98
|
-
timestamp: e,
|
|
99
|
-
locale: P,
|
|
100
|
-
format: C
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
let H = s({
|
|
104
|
-
width: I.width,
|
|
105
|
-
valueLabels: r.map((e) => e.label),
|
|
106
|
-
hasXTitle: !0,
|
|
107
|
-
hasYTitle: !1
|
|
108
|
-
}), U = S === void 0 ? H : {
|
|
109
|
-
...H,
|
|
110
|
-
left: S
|
|
111
|
-
}, W = Math.max(1, I.width - U.left - U.right), G = ee({
|
|
112
|
-
domain: p,
|
|
113
|
-
range: [U.left, U.left + W]
|
|
114
|
-
}), K = m.map((e) => {
|
|
115
|
-
let t = G.position(e.at), n = `${e.label} ${V(e.at)}`, r = n.length * Se + 8, i = t > U.left + W * N;
|
|
116
|
-
return {
|
|
117
|
-
marker: e,
|
|
118
|
-
at: t,
|
|
119
|
-
text: n,
|
|
120
|
-
isEnd: i,
|
|
121
|
-
start: i ? t - r : t,
|
|
122
|
-
end: i ? t : t + r
|
|
123
|
-
};
|
|
124
|
-
}), q = me(K.map((e) => ({
|
|
125
|
-
id: e.marker.id,
|
|
126
|
-
track: "markers",
|
|
127
|
-
start: e.start,
|
|
128
|
-
end: e.end
|
|
129
|
-
}))), Oe = Math.max(0, ...K.map((e) => (q.get(e.marker.id)?.lane ?? 0) + 1)), J = U.top + Oe * j, Y = (p[1] - p[0]) * be / W, ke = (p[1] - p[0]) * ye / W, Ae = me(f.map((e) => ({
|
|
130
|
-
id: e.id,
|
|
131
|
-
track: e.laneId,
|
|
132
|
-
start: e.end === void 0 ? e.start - Y * N : e.start,
|
|
133
|
-
end: e.end === void 0 ? e.start + Y * N : Math.max(e.end, e.start + ke)
|
|
134
|
-
}))), je = r.map((e) => Math.max(1, ...f.flatMap((t) => t.laneId === e.id ? [(Ae.get(t.id)?.lane ?? 0) + 1] : []))), Me = r.flatMap((e, t) => Array.from({ length: je[t] ?? 1 }, (t, n) => ({
|
|
135
|
-
laneId: e.id,
|
|
136
|
-
row: n
|
|
137
|
-
}))), Ne = J + Me.length * O + r.length * k * 2 + U.bottom, X = c({
|
|
138
|
-
width: I.width,
|
|
139
|
-
height: Ne,
|
|
140
|
-
margins: {
|
|
141
|
-
...U,
|
|
142
|
-
top: J
|
|
143
|
-
}
|
|
144
|
-
}), Z = r.map((e, t) => {
|
|
145
|
-
let n = Me.findIndex((t) => t.laneId === e.id), r = X.top + t * k * 2 + n * O;
|
|
146
|
-
return {
|
|
147
|
-
lane: e,
|
|
148
|
-
index: t,
|
|
149
|
-
start: r,
|
|
150
|
-
end: r + (je[t] ?? 1) * O + 12
|
|
151
|
-
};
|
|
152
|
-
}), Pe = a({
|
|
153
|
-
domain: p,
|
|
154
|
-
length: X.innerWidth,
|
|
155
|
-
timeFormat: C,
|
|
156
|
-
locale: P,
|
|
157
|
-
timeZone: z
|
|
158
|
-
}), Fe = Pe.values.map((e, t) => ({
|
|
159
|
-
key: String(e),
|
|
160
|
-
position: G.position(e),
|
|
161
|
-
label: Pe.labels[t] ?? ""
|
|
162
|
-
})), Ie = Z.map((e) => ({
|
|
163
|
-
key: e.lane.id,
|
|
164
|
-
position: (e.start + e.end) * N,
|
|
165
|
-
label: e.lane.label
|
|
166
|
-
})), Q = f.map((e, t) => ({
|
|
167
|
-
event: e,
|
|
168
|
-
index: t
|
|
169
|
-
})).toSorted((e, t) => e.event.start === t.event.start ? e.index - t.index : e.event.start - t.event.start).map((e) => e.event).map((e, t) => {
|
|
170
|
-
let n = Z.find((t) => t.lane.id === e.laneId), i = n?.index ?? 0, a = r[i], o = Ae.get(e.id)?.lane ?? 0, s = (n?.start ?? X.top) + k + (o + N) * O, c = G.position(e.start), l = e.end === void 0 ? c : Math.max(c + ye, G.position(e.end)), u = e.tone ?? R({
|
|
171
|
-
id: e.laneId,
|
|
172
|
-
tone: a?.tone,
|
|
173
|
-
index: i
|
|
174
|
-
});
|
|
175
|
-
return {
|
|
176
|
-
event: e,
|
|
177
|
-
rank: t,
|
|
178
|
-
laneIndex: i,
|
|
179
|
-
laneLabel: a?.label ?? e.laneId,
|
|
180
|
-
x1: c,
|
|
181
|
-
x2: l,
|
|
182
|
-
y: s,
|
|
183
|
-
tone: u
|
|
184
|
-
};
|
|
185
|
-
}), $ = Q.map(({ event: e, laneLabel: t }) => {
|
|
186
|
-
let n = e.end === void 0 ? V(e.start) : `${V(e.start)} – ${V(e.end)} · ${Ee(e.end - e.start, P)}`;
|
|
187
|
-
return {
|
|
188
|
-
id: e.id,
|
|
189
|
-
label: [
|
|
190
|
-
t,
|
|
191
|
-
e.label,
|
|
192
|
-
n,
|
|
193
|
-
e.detail
|
|
194
|
-
].filter((e) => e !== void 0).join(" · ")
|
|
195
|
-
};
|
|
196
|
-
}), Le = 1 / (r.length * 2 + 1), Re = de({
|
|
197
|
-
marks: Q.map((e) => ({
|
|
198
|
-
id: e.event.id,
|
|
199
|
-
x: (e.x1 + e.x2) * N,
|
|
200
|
-
y: e.y
|
|
201
|
-
})),
|
|
202
|
-
width: X.width,
|
|
203
|
-
height: X.height
|
|
204
|
-
});
|
|
205
|
-
function ze(e) {
|
|
206
|
-
let t = e.x / e.width * X.width, n = e.y / e.height * X.height;
|
|
207
|
-
return Q.findLast((e) => t >= e.x1 - A - xe && t <= e.x2 + A + xe && Math.abs(n - e.y) <= O * N)?.event.id ?? Re(e);
|
|
208
|
-
}
|
|
209
|
-
return /* @__PURE__ */ b(n, {
|
|
210
|
-
...we,
|
|
211
|
-
items: $,
|
|
212
|
-
place: (e) => {
|
|
213
|
-
let t = Q.find((t) => t.event.id === e), n = t?.rank ?? 0, r = (t?.laneIndex ?? 0) * Le;
|
|
214
|
-
return t === void 0 ? void 0 : {
|
|
215
|
-
left: n,
|
|
216
|
-
right: n,
|
|
217
|
-
top: r,
|
|
218
|
-
bottom: r
|
|
219
|
-
};
|
|
220
|
-
},
|
|
221
|
-
locate: ze,
|
|
222
|
-
selected: w ?? null,
|
|
223
|
-
onSelect: T,
|
|
224
|
-
render: (e, { inspected: n, cursor: r }) => {
|
|
225
|
-
let a = Q.find((e) => e.event.id === r);
|
|
226
|
-
return /* @__PURE__ */ b(ne, {
|
|
227
|
-
...D,
|
|
228
|
-
figure: e,
|
|
229
|
-
footer: f.length === 0 ? void 0 : /* @__PURE__ */ b(i, {
|
|
230
|
-
id: L,
|
|
231
|
-
children: t($, n)
|
|
232
|
-
}),
|
|
233
|
-
children: f.length === 0 ? /* @__PURE__ */ b(_, { children: E }) : /* @__PURE__ */ x(he, { children: [/* @__PURE__ */ x(ce, {
|
|
234
|
-
plotRef: I.ref,
|
|
235
|
-
box: X,
|
|
236
|
-
label: o({
|
|
237
|
-
title: F,
|
|
238
|
-
marks: "events",
|
|
239
|
-
isSelectable: T !== void 0
|
|
240
|
-
}),
|
|
241
|
-
readoutId: L,
|
|
242
|
-
children: [
|
|
243
|
-
/* @__PURE__ */ b(v, {
|
|
244
|
-
box: X,
|
|
245
|
-
xTicks: Fe,
|
|
246
|
-
yTicks: Ie,
|
|
247
|
-
xTitle: `Time (${z})`,
|
|
248
|
-
grid: "x"
|
|
249
|
-
}),
|
|
250
|
-
Z.slice(1).map((e) => /* @__PURE__ */ b("line", {
|
|
251
|
-
x1: X.left,
|
|
252
|
-
x2: X.right,
|
|
253
|
-
y1: e.start,
|
|
254
|
-
y2: e.start,
|
|
255
|
-
...fe.props(ie.grid, Te.separator)
|
|
256
|
-
}, e.lane.id)),
|
|
257
|
-
/* @__PURE__ */ b(ue, {
|
|
258
|
-
box: X,
|
|
259
|
-
children: Q.map((e) => e.event.end === void 0 ? /* @__PURE__ */ b(y, {
|
|
260
|
-
x: e.x1,
|
|
261
|
-
y: e.y,
|
|
262
|
-
radius: A,
|
|
263
|
-
tone: e.tone,
|
|
264
|
-
isInspected: n === e.event.id,
|
|
265
|
-
isSelected: w === e.event.id
|
|
266
|
-
}, e.event.id) : /* @__PURE__ */ b(se, {
|
|
267
|
-
x: e.x1,
|
|
268
|
-
y: e.y - ve * N,
|
|
269
|
-
width: e.x2 - e.x1,
|
|
270
|
-
height: ve,
|
|
271
|
-
tone: e.tone,
|
|
272
|
-
isInspected: n === e.event.id,
|
|
273
|
-
isSelected: w === e.event.id
|
|
274
|
-
}, e.event.id))
|
|
275
|
-
}),
|
|
276
|
-
K.map(({ marker: e, at: t, text: n, isEnd: r }) => {
|
|
277
|
-
let i = q.get(e.id)?.lane ?? 0, a = X.top - 8 - i * j;
|
|
278
|
-
return /* @__PURE__ */ x("g", { children: [/* @__PURE__ */ b(oe, {
|
|
279
|
-
x1: t,
|
|
280
|
-
x2: t,
|
|
281
|
-
y1: a + M,
|
|
282
|
-
y2: X.bottom,
|
|
283
|
-
stroke: "dashed"
|
|
284
|
-
}), /* @__PURE__ */ b(ae, {
|
|
285
|
-
x: r ? t - M : t + M,
|
|
286
|
-
y: a,
|
|
287
|
-
anchor: r ? "end" : "start",
|
|
288
|
-
children: n
|
|
289
|
-
})] }, e.id);
|
|
290
|
-
}),
|
|
291
|
-
a !== void 0 && /* @__PURE__ */ b(h, {
|
|
292
|
-
x: (a.x1 + a.x2) * N,
|
|
293
|
-
top: X.top,
|
|
294
|
-
bottom: X.bottom,
|
|
295
|
-
width: Ce
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
}), /* @__PURE__ */ b(te, {
|
|
299
|
-
label: `${F} events`,
|
|
300
|
-
columns: [{
|
|
301
|
-
id: "event",
|
|
302
|
-
label: "Event"
|
|
303
|
-
}],
|
|
304
|
-
rows: $.map((e) => ({
|
|
305
|
-
id: e.id,
|
|
306
|
-
values: [e.label]
|
|
307
|
-
}))
|
|
308
|
-
})] })
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
// packages/charts/src/timeline/waterfall.tsx
|
|
314
|
-
var V = 5, H = {
|
|
315
|
-
cell: {
|
|
316
|
-
k3XXqK: "x1t137rt",
|
|
317
|
-
kZs9gx: "x19rmrnh",
|
|
318
|
-
k7shQP: "x9v5kkp",
|
|
319
|
-
kPJHz1: "x13qnu6",
|
|
320
|
-
kiEn40: "x7s97pk",
|
|
321
|
-
$$css: !0
|
|
322
|
-
},
|
|
323
|
-
plot: {
|
|
324
|
-
k7Eaqz: "xeuugli",
|
|
325
|
-
kUOVxO: "xl4o6ss",
|
|
326
|
-
kBCFzs: "x1npkx4u x1v577k8",
|
|
327
|
-
kbNqZ1: "x1ms6mhf x1aa6nly",
|
|
328
|
-
$$css: !0
|
|
329
|
-
},
|
|
330
|
-
neutral: {
|
|
331
|
-
kMwMTN: "x153jb6y",
|
|
332
|
-
$$css: !0
|
|
333
|
-
},
|
|
334
|
-
positive: {
|
|
335
|
-
kMwMTN: "x7ixh4y",
|
|
336
|
-
$$css: !0
|
|
337
|
-
},
|
|
338
|
-
negative: {
|
|
339
|
-
kMwMTN: "xr5kp14",
|
|
340
|
-
$$css: !0
|
|
341
|
-
}
|
|
342
|
-
}, U = {
|
|
343
|
-
neutral: H.neutral,
|
|
344
|
-
positive: H.positive,
|
|
345
|
-
negative: H.negative
|
|
346
|
-
}, W = [
|
|
347
|
-
0,
|
|
348
|
-
.5,
|
|
349
|
-
1
|
|
350
|
-
], G = 100;
|
|
351
|
-
function K({ items: t, start: n, end: r, rowLabel: i, summaryLabel: a, emptyLabel: o = "No timing records are available.", selected: s, selectedRef: c, onSelectedChange: l, offsetFormat: u, ...d }) {
|
|
352
|
-
let { title: p, locale: m } = d, h = q({
|
|
353
|
-
items: t,
|
|
354
|
-
start: n,
|
|
355
|
-
end: r
|
|
356
|
-
});
|
|
357
|
-
if (h !== void 0) return /* @__PURE__ */ b(re, {
|
|
358
|
-
...d,
|
|
359
|
-
message: h
|
|
360
|
-
});
|
|
361
|
-
let g = r - n, te = ee({
|
|
362
|
-
domain: [n, r],
|
|
363
|
-
range: [0, G]
|
|
364
|
-
}), _ = g > 0 ? W : [0], ie = t.some((e) => e.geometry.kind !== "unavailable");
|
|
365
|
-
function v(e) {
|
|
366
|
-
return f({
|
|
367
|
-
value: e,
|
|
368
|
-
locale: m,
|
|
369
|
-
format: u
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
let y = new Map(t.map((e) => [e.id, Y({
|
|
373
|
-
geometry: e.geometry,
|
|
374
|
-
start: n,
|
|
375
|
-
offset: v
|
|
376
|
-
})])), ae = t.map((e) => ({
|
|
377
|
-
value: e.id,
|
|
378
|
-
label: `${e.label} · ${e.detail} · ${e.summary} · ${y.get(e.id)}`,
|
|
379
|
-
...J(e.geometry)
|
|
380
|
-
})), oe = t.length === 0 ? /* @__PURE__ */ b("div", {
|
|
381
|
-
role: "group",
|
|
382
|
-
"aria-label": p,
|
|
383
|
-
className: "xeuugli x1hz01jw x12h1iku",
|
|
384
|
-
children: /* @__PURE__ */ b("p", {
|
|
385
|
-
className: "x1ghz6dp x1c8xbx5",
|
|
386
|
-
children: /* @__PURE__ */ b(e, {
|
|
387
|
-
tone: "muted",
|
|
388
|
-
children: o
|
|
389
|
-
})
|
|
390
|
-
})
|
|
391
|
-
}) : /* @__PURE__ */ x(S, {
|
|
392
|
-
items: ae,
|
|
393
|
-
range: [n, r],
|
|
394
|
-
value: s ?? null,
|
|
395
|
-
onValueChange: (e, t) => {
|
|
396
|
-
e !== null && l(e, t);
|
|
397
|
-
},
|
|
398
|
-
getBarLabel: (e) => y.get(e.value) ?? "",
|
|
399
|
-
"aria-label": p,
|
|
400
|
-
className: "xeuugli x1hz01jw x12h1iku",
|
|
401
|
-
children: [/* @__PURE__ */ x(T, {
|
|
402
|
-
className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy x17tes2r x153jb6y xy8obcc xso031l x1q0q8m5 x1qndepd",
|
|
403
|
-
children: [
|
|
404
|
-
/* @__PURE__ */ b(w, { children: /* @__PURE__ */ b(e, {
|
|
405
|
-
variant: "caption",
|
|
406
|
-
tone: "muted",
|
|
407
|
-
children: i
|
|
408
|
-
}) }),
|
|
409
|
-
/* @__PURE__ */ b(w, {
|
|
410
|
-
"aria-label": "Timing",
|
|
411
|
-
className: "xeuugli xl4o6ss x1npkx4u x1v577k8 x1ms6mhf x1aa6nly x78zum5 x1qughib x6s0dn4 xy8obcc xas2l8k xss6m8b",
|
|
412
|
-
children: ie ? _.map((e) => /* @__PURE__ */ b("span", { children: v(g * e) }, e)) : /* @__PURE__ */ b("span", { children: "Timing unavailable" })
|
|
413
|
-
}),
|
|
414
|
-
/* @__PURE__ */ b(w, {
|
|
415
|
-
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b",
|
|
416
|
-
children: /* @__PURE__ */ b(e, {
|
|
417
|
-
variant: "caption",
|
|
418
|
-
tone: "muted",
|
|
419
|
-
children: a
|
|
420
|
-
})
|
|
421
|
-
})
|
|
422
|
-
]
|
|
423
|
-
}), t.map((t) => {
|
|
424
|
-
let n = y.get(t.id), r = s === t.id;
|
|
425
|
-
return /* @__PURE__ */ x(_e, {
|
|
426
|
-
value: t.id,
|
|
427
|
-
ref: r ? c : void 0,
|
|
428
|
-
"aria-controls": t.controls,
|
|
429
|
-
...{
|
|
430
|
-
0: { className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy xn9t2bk x1wiwyrm xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6" },
|
|
431
|
-
1: { className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy xn9t2bk x1wiwyrm xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 x1r7kqkb xh3r7i3" }
|
|
432
|
-
}[!!r | 0],
|
|
433
|
-
children: [
|
|
434
|
-
/* @__PURE__ */ x(E, {
|
|
435
|
-
className: "xeuugli xrvj5dj xfko13i x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
436
|
-
children: [/* @__PURE__ */ b(e, { children: t.label }), /* @__PURE__ */ b("span", {
|
|
437
|
-
title: t.detail,
|
|
438
|
-
...{
|
|
439
|
-
0: { className: "xb3r6kr xuxw1ft xlyipyv" },
|
|
440
|
-
1: { className: "xb3r6kr xlyipyv xeaf4i8 xj0a0fe" }
|
|
441
|
-
}[!!r | 0],
|
|
442
|
-
children: /* @__PURE__ */ b(e, {
|
|
443
|
-
variant: "caption",
|
|
444
|
-
tone: "muted",
|
|
445
|
-
children: t.detail
|
|
446
|
-
})
|
|
447
|
-
})]
|
|
448
|
-
}),
|
|
449
|
-
/* @__PURE__ */ b(C, {
|
|
450
|
-
title: n,
|
|
451
|
-
...fe.props(H.plot, H.cell, U[t.tone ?? "neutral"]),
|
|
452
|
-
children: t.geometry.kind === "unavailable" ? /* @__PURE__ */ b(e, {
|
|
453
|
-
variant: "caption",
|
|
454
|
-
tone: "muted",
|
|
455
|
-
children: n
|
|
456
|
-
}) : /* @__PURE__ */ x("svg", {
|
|
457
|
-
"aria-hidden": !0,
|
|
458
|
-
className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
|
|
459
|
-
children: [_.map((e) => /* @__PURE__ */ b("line", {
|
|
460
|
-
x1: `${e * G}%`,
|
|
461
|
-
x2: `${e * G}%`,
|
|
462
|
-
y1: "0",
|
|
463
|
-
y2: "18",
|
|
464
|
-
className: "x13hfdr1"
|
|
465
|
-
}, e)), /* @__PURE__ */ b(Oe, {
|
|
466
|
-
geometry: t.geometry,
|
|
467
|
-
scale: te
|
|
468
|
-
})]
|
|
469
|
-
})
|
|
470
|
-
}),
|
|
471
|
-
/* @__PURE__ */ x(ge, {
|
|
472
|
-
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
473
|
-
children: [/* @__PURE__ */ b(e, {
|
|
474
|
-
variant: "caption",
|
|
475
|
-
tone: "muted",
|
|
476
|
-
children: t.summary
|
|
477
|
-
}), r && /* @__PURE__ */ b(e, {
|
|
478
|
-
variant: "caption",
|
|
479
|
-
tone: "muted",
|
|
480
|
-
children: n
|
|
481
|
-
})]
|
|
482
|
-
})
|
|
483
|
-
]
|
|
484
|
-
}, t.id);
|
|
485
|
-
})]
|
|
486
|
-
});
|
|
487
|
-
return /* @__PURE__ */ b(ne, {
|
|
488
|
-
...d,
|
|
489
|
-
children: oe
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
function q({ items: e, start: t, end: n }) {
|
|
493
|
-
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(n - t) || n < t) return "The timing domain must have finite, ordered endpoints.";
|
|
494
|
-
if (!r(e)) return "Timing records must have unique identifiers.";
|
|
495
|
-
for (let r of e) {
|
|
496
|
-
let e = r.geometry;
|
|
497
|
-
if (e.kind === "interval") {
|
|
498
|
-
if (!Number.isFinite(e.start) || !Number.isFinite(e.end) || e.end < e.start) return "Timing intervals must have finite, ordered endpoints.";
|
|
499
|
-
if (e.start < t || e.end > n) return "Timing intervals must fit inside the supplied domain.";
|
|
500
|
-
}
|
|
501
|
-
if (e.kind === "point" && (!Number.isFinite(e.at) || e.at < t || e.at > n)) return "Timing points must be finite and fit inside the supplied domain.";
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
function Oe({ geometry: e, scale: t }) {
|
|
505
|
-
switch (e.kind) {
|
|
506
|
-
case "unavailable": return null;
|
|
507
|
-
case "interval": {
|
|
508
|
-
let n = t.position(e.start), r = t.position(e.end) - n;
|
|
509
|
-
return r === 0 ? /* @__PURE__ */ b("circle", {
|
|
510
|
-
cx: `${n}%`,
|
|
511
|
-
cy: 9,
|
|
512
|
-
r: 3,
|
|
513
|
-
className: "x117rol3"
|
|
514
|
-
}) : /* @__PURE__ */ b("rect", {
|
|
515
|
-
x: `${n}%`,
|
|
516
|
-
y: 6,
|
|
517
|
-
width: `${r}%`,
|
|
518
|
-
height: 6,
|
|
519
|
-
rx: 2,
|
|
520
|
-
className: "x117rol3"
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
case "point": {
|
|
524
|
-
let n = t.position(e.at);
|
|
525
|
-
switch (e.marker) {
|
|
526
|
-
case "filled": return /* @__PURE__ */ b("circle", {
|
|
527
|
-
cx: `${n}%`,
|
|
528
|
-
cy: 9,
|
|
529
|
-
r: 3,
|
|
530
|
-
className: "x117rol3"
|
|
531
|
-
});
|
|
532
|
-
case "hollow": return /* @__PURE__ */ b("circle", {
|
|
533
|
-
cx: `${n}%`,
|
|
534
|
-
cy: 9,
|
|
535
|
-
r: 3.5,
|
|
536
|
-
className: "x1fytgo2 x73je2i xvlca1e"
|
|
537
|
-
});
|
|
538
|
-
case "diamond": return /* @__PURE__ */ b("svg", {
|
|
539
|
-
x: `${n}%`,
|
|
540
|
-
y: 9,
|
|
541
|
-
width: 1,
|
|
542
|
-
height: 1,
|
|
543
|
-
overflow: "visible",
|
|
544
|
-
children: /* @__PURE__ */ b("path", {
|
|
545
|
-
d: `M0 -${V} ${V} 0 0 ${V} -${V} 0Z`,
|
|
546
|
-
className: "x117rol3"
|
|
547
|
-
})
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
function J(e) {
|
|
554
|
-
switch (e.kind) {
|
|
555
|
-
case "interval": return {
|
|
556
|
-
start: e.start,
|
|
557
|
-
duration: e.end - e.start
|
|
558
|
-
};
|
|
559
|
-
case "point": return {
|
|
560
|
-
start: e.at,
|
|
561
|
-
duration: 0
|
|
562
|
-
};
|
|
563
|
-
case "unavailable": return {
|
|
564
|
-
start: NaN,
|
|
565
|
-
duration: NaN
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
function Y({ geometry: e, start: t, offset: n }) {
|
|
570
|
-
switch (e.kind) {
|
|
571
|
-
case "interval": return `Start ${n(e.start - t)}, end ${n(e.end - t)}, duration ${n(e.end - e.start)}`;
|
|
572
|
-
case "point": return `At ${n(e.at - t)}`;
|
|
573
|
-
case "unavailable": return "Timing unavailable";
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
export { D as i, B as n, z as r, K as t };
|