@mechane-ai/elements 0.58.1 → 0.60.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/README.md +55 -54
- package/dist/ai.js +1 -1
- package/dist/catalog.json +37 -1
- package/dist/chart-range-Du1gDxCY.js +163 -0
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/figure.js +2 -2
- package/dist/charts/timeline.js +3 -1
- package/dist/content.js +1 -1
- package/dist/kits/operations.js +2 -2
- package/dist/kits/research.js +2 -2
- package/dist/packages/charts/src/timeline/index.d.ts +5 -1
- package/dist/packages/charts/src/timeline/trace-timeline-layout.d.ts +85 -0
- package/dist/packages/charts/src/timeline/trace-timeline.d.ts +37 -0
- package/dist/packages/charts/src/timeline/waterfall.d.ts +23 -7
- package/dist/packages/content/src/has-renderable-node.d.ts +2 -0
- package/dist/packages/content/src/index.d.ts +1 -1
- package/dist/packages/content/src/playback-bar.d.ts +11 -4
- package/dist/packages/content/src/timeline-scrubber.d.ts +6 -2
- package/dist/src-BAlO76fa.js +1140 -0
- package/dist/styles2.css +47 -7
- package/dist/{time-series-CoAtNizi.js → time-series-BbUBF3IE.js} +521 -679
- package/dist/timeline-C1d9YJlJ.js +620 -0
- package/dist/waterfall-Dre6i02Z.js +684 -0
- package/package.json +1 -1
- package/skills/use-elements/SKILL.md +18 -18
- package/dist/src-DWKqgI2I.js +0 -957
- package/dist/waterfall-BjUXqaWu.js +0 -615
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import { T as e, c as t, m as n } from "./src-9EJskqB_.js";
|
|
2
|
+
import { t as r } from "./chart-tones-ei3BC2AL.js";
|
|
3
|
+
import { A as i, E as a, M as o, S as s, f as c, j as l, l as u, s as ee } from "./plot-layout-B-b6tioh.js";
|
|
4
|
+
import { i as d } from "./chart-link-AE_xuxiP.js";
|
|
5
|
+
import { a as f } from "./tone-scope-DKiSw-JR.js";
|
|
6
|
+
import { n as te, r as ne } from "./figure-format-B8kRZMlo.js";
|
|
7
|
+
import { a as p, o as m, r as re } from "./scale-C2xgZyZN.js";
|
|
8
|
+
import { t as h } from "./chart-cursor-1mFd48Jc.js";
|
|
9
|
+
import { i as ie, l as ae, n as oe, r as se, t as ce } from "./figure-frame-ClYRIRAq.js";
|
|
10
|
+
import { n as le } from "./plot-width-D3hTycYX.js";
|
|
11
|
+
import { t as g } from "./plot-axes-D5S9BnBa.js";
|
|
12
|
+
import { a as _, c as v, f as ue, r as y } from "./plot-marks-FVsbFkUs.js";
|
|
13
|
+
import { n as de, r as b, t as fe } from "./plot-surface-BlR44uTL.js";
|
|
14
|
+
import * as x from "@stylexjs/stylex";
|
|
15
|
+
import { useId as pe, useState as me } from "react";
|
|
16
|
+
import { stackSpans as he } from "@ui-sdk/core";
|
|
17
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
18
|
+
import { Waterfall as ge, WaterfallBar as _e, WaterfallCell as ve, WaterfallColumnHeader as T, WaterfallHeaderRow as E, WaterfallRow as ye, WaterfallRowHeader as D } from "@ui-sdk/react/waterfall";
|
|
19
|
+
// packages/charts/src/timeline/event-strip.tsx
|
|
20
|
+
var O = {
|
|
21
|
+
lanes: 12,
|
|
22
|
+
events: 1e3
|
|
23
|
+
}, k = 24, A = 8, be = 14, xe = 4, j = 5, Se = 14, Ce = 5, we = 18, M = 5, Te = .65, Ee = 6.5, De = 12, N = .5, Oe = .04, P = 1e3, F = 60 * P, I = 60 * F, ke = 24 * I, L = {
|
|
24
|
+
unit: "second",
|
|
25
|
+
size: P
|
|
26
|
+
}, Ae = [
|
|
27
|
+
{
|
|
28
|
+
unit: "day",
|
|
29
|
+
size: ke
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
unit: "hour",
|
|
33
|
+
size: I
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
unit: "minute",
|
|
37
|
+
size: F
|
|
38
|
+
},
|
|
39
|
+
L
|
|
40
|
+
], je = { separator: {
|
|
41
|
+
kfzvcC: "x47corl",
|
|
42
|
+
$$css: !0
|
|
43
|
+
} };
|
|
44
|
+
function Me(e) {
|
|
45
|
+
return u({
|
|
46
|
+
width: Infinity,
|
|
47
|
+
valueLabels: e,
|
|
48
|
+
hasXTitle: !0,
|
|
49
|
+
hasYTitle: !1
|
|
50
|
+
}).left;
|
|
51
|
+
}
|
|
52
|
+
function Ne(e, t) {
|
|
53
|
+
let n = Ae.find((t) => e >= t.size) ?? L;
|
|
54
|
+
return ne({
|
|
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 Pe(e, t) {
|
|
66
|
+
let n = [...e.flatMap((e) => e.end === void 0 ? [e.start] : [e.start, e.end]), ...t.map((e) => e.at)];
|
|
67
|
+
if (n.length === 0) return [0, I];
|
|
68
|
+
let r = Math.min(...n), i = Math.max(...n), a = i - r, o = a > 0 ? Math.max(F, Math.round(a * Oe)) : I * N;
|
|
69
|
+
return [r - o, i + o];
|
|
70
|
+
}
|
|
71
|
+
function Fe({ lanes: e, events: t, markers: n, domain: r, zone: i }) {
|
|
72
|
+
let a = m(r);
|
|
73
|
+
if (a !== void 0) return a;
|
|
74
|
+
if (i === void 0) return "A function time format needs a timeZone beside it, so the axis ticks fall on that zone.";
|
|
75
|
+
if (e.length > O.lanes || t.length > O.events) return `This strip draws at most ${O.lanes} lanes and ${O.events} events. Supply a shorter window.`;
|
|
76
|
+
if (!o(e) || !o(t) || !o(n)) return "Lanes, events and markers must each have unique identifiers.";
|
|
77
|
+
let s = new Set(e.map((e) => e.id)), c = t.find((e) => !s.has(e.laneId));
|
|
78
|
+
if (c !== void 0) return `Event ${c.id} names lane ${c.laneId}, which is not supplied.`;
|
|
79
|
+
let l = t.find((e) => {
|
|
80
|
+
let t = e.end !== void 0 && (p(e.end, r) || e.end <= e.start);
|
|
81
|
+
return p(e.start, r) || t;
|
|
82
|
+
});
|
|
83
|
+
return l === void 0 ? n.some((e) => p(e.at, r)) ? "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.`;
|
|
84
|
+
}
|
|
85
|
+
function Ie(t) {
|
|
86
|
+
let { lanes: r, events: o, domain: ne, markers: p = [], windows: m, defaultWindowId: ge, windowId: _e, onWindowChange: ve, gutterWidth: T, timeFormat: E, timeZone: ye, selected: D, onSelectedChange: O, ...Oe } = t, { emptyLabel: P = "No events in this window.", ...F } = Oe, { locale: I, title: ke } = F, L = b("compact"), Ae = pe(), Me = f(), Ie = d(), R = m?.[0]?.id ?? "", [Le, Re] = me(() => ge ?? R), ze = _e ?? Le;
|
|
87
|
+
function Be(e) {
|
|
88
|
+
_e === void 0 && Re(e), ve?.(e);
|
|
89
|
+
}
|
|
90
|
+
if (F.status === "loading") return /* @__PURE__ */ C(ie, {
|
|
91
|
+
...F,
|
|
92
|
+
height: "compact"
|
|
93
|
+
});
|
|
94
|
+
let z = o.map((e) => e.end !== void 0 && e.end <= e.start ? {
|
|
95
|
+
...e,
|
|
96
|
+
end: void 0
|
|
97
|
+
} : e), B = ne ?? Pe(z, p), V = m === void 0 || m.length === 0 ? void 0 : m.find((e) => e.id === ze) ?? m[0], H = V?.durationMs ?? null, U = H !== null && H > 0, W = U ? [Math.max(B[0], B[1] - H), B[1]] : B, G = U ? z.flatMap((e) => {
|
|
98
|
+
if ((e.end ?? e.start) < W[0] || e.start > W[1]) return [];
|
|
99
|
+
let t = Math.max(W[0], e.start), n = e.end === void 0 ? void 0 : Math.min(W[1], e.end), r = n !== void 0 && n > t ? n : void 0;
|
|
100
|
+
return [{
|
|
101
|
+
...e,
|
|
102
|
+
start: t,
|
|
103
|
+
end: r
|
|
104
|
+
}];
|
|
105
|
+
}) : z, Ve = U ? p.filter((e) => e.at >= W[0] && e.at <= W[1]) : p, K = typeof E == "function" ? ye : E.timeZone, He = Fe({
|
|
106
|
+
lanes: r,
|
|
107
|
+
events: G,
|
|
108
|
+
markers: Ve,
|
|
109
|
+
domain: W,
|
|
110
|
+
zone: K
|
|
111
|
+
});
|
|
112
|
+
if (He !== void 0 || K === void 0) return /* @__PURE__ */ C(se, {
|
|
113
|
+
...F,
|
|
114
|
+
message: He ?? "The strip needs a time zone."
|
|
115
|
+
});
|
|
116
|
+
let Ue = m === void 0 || m.length <= 1 ? F.actions : /* @__PURE__ */ w(n, { children: [m.map((t) => {
|
|
117
|
+
let n = t.id === V?.id;
|
|
118
|
+
return /* @__PURE__ */ C(e, {
|
|
119
|
+
type: "button",
|
|
120
|
+
density: "compact",
|
|
121
|
+
variant: n ? "outline" : "ghost",
|
|
122
|
+
"aria-pressed": n,
|
|
123
|
+
onClick: () => Be(t.id),
|
|
124
|
+
children: t.label
|
|
125
|
+
}, t.id);
|
|
126
|
+
}), F.actions] });
|
|
127
|
+
function q(e) {
|
|
128
|
+
return te({
|
|
129
|
+
timestamp: e,
|
|
130
|
+
locale: I,
|
|
131
|
+
format: E
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
let We = u({
|
|
135
|
+
width: L.width,
|
|
136
|
+
valueLabels: r.map((e) => e.label),
|
|
137
|
+
hasXTitle: !0,
|
|
138
|
+
hasYTitle: !1
|
|
139
|
+
}), J = T === void 0 ? We : {
|
|
140
|
+
...We,
|
|
141
|
+
left: T
|
|
142
|
+
}, Y = Math.max(1, L.width - J.left - J.right), X = re({
|
|
143
|
+
domain: W,
|
|
144
|
+
range: [J.left, J.left + Y]
|
|
145
|
+
}), Ge = Ve.map((e) => {
|
|
146
|
+
let t = X.position(e.at), n = e.label, r = `${e.label} · ${q(e.at)}`, i = n.length * Ee + 10, a = t > J.left + Y * Te;
|
|
147
|
+
return {
|
|
148
|
+
marker: e,
|
|
149
|
+
at: t,
|
|
150
|
+
text: n,
|
|
151
|
+
tooltip: r,
|
|
152
|
+
isEnd: a,
|
|
153
|
+
start: a ? t - i : t,
|
|
154
|
+
end: a ? t : t + i
|
|
155
|
+
};
|
|
156
|
+
}), Ke = he(Ge.map((e) => ({
|
|
157
|
+
id: e.marker.id,
|
|
158
|
+
track: "markers",
|
|
159
|
+
start: e.start,
|
|
160
|
+
end: e.end
|
|
161
|
+
}))), qe = Math.max(0, ...Ge.map((e) => (Ke.get(e.marker.id)?.lane ?? 0) + 1)), Je = J.top + qe * we, Ye = (W[1] - W[0]) * Se / Y, Xe = (W[1] - W[0]) * xe / Y, Ze = he(G.map((e) => ({
|
|
162
|
+
id: e.id,
|
|
163
|
+
track: e.laneId,
|
|
164
|
+
start: e.end === void 0 ? e.start - Ye * N : e.start,
|
|
165
|
+
end: e.end === void 0 ? e.start + Ye * N : Math.max(e.end, e.start + Xe)
|
|
166
|
+
}))), Qe = r.map((e) => Math.max(1, ...G.flatMap((t) => t.laneId === e.id ? [(Ze.get(t.id)?.lane ?? 0) + 1] : []))), $e = r.flatMap((e, t) => Array.from({ length: Qe[t] ?? 1 }, (t, n) => ({
|
|
167
|
+
laneId: e.id,
|
|
168
|
+
row: n
|
|
169
|
+
}))), et = Je + $e.length * k + r.length * A * 2 + J.bottom, Z = ee({
|
|
170
|
+
width: L.width,
|
|
171
|
+
height: et,
|
|
172
|
+
margins: {
|
|
173
|
+
...J,
|
|
174
|
+
top: Je
|
|
175
|
+
}
|
|
176
|
+
}), Q = r.map((e, t) => {
|
|
177
|
+
let n = $e.findIndex((t) => t.laneId === e.id), r = Z.top + t * A * 2 + n * k;
|
|
178
|
+
return {
|
|
179
|
+
lane: e,
|
|
180
|
+
index: t,
|
|
181
|
+
start: r,
|
|
182
|
+
end: r + (Qe[t] ?? 1) * k + 16
|
|
183
|
+
};
|
|
184
|
+
}), tt = c({
|
|
185
|
+
domain: W,
|
|
186
|
+
length: Z.innerWidth,
|
|
187
|
+
timeFormat: E,
|
|
188
|
+
locale: I,
|
|
189
|
+
timeZone: K
|
|
190
|
+
}), nt = tt.values.map((e, t) => ({
|
|
191
|
+
key: String(e),
|
|
192
|
+
position: X.position(e),
|
|
193
|
+
label: tt.labels[t] ?? ""
|
|
194
|
+
})), rt = Q.map((e) => ({
|
|
195
|
+
key: e.lane.id,
|
|
196
|
+
position: (e.start + e.end) * N,
|
|
197
|
+
label: e.lane.label
|
|
198
|
+
})), $ = G.map((e, t) => ({
|
|
199
|
+
event: e,
|
|
200
|
+
index: t
|
|
201
|
+
})).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) => {
|
|
202
|
+
let n = Q.find((t) => t.lane.id === e.laneId), i = n?.index ?? 0, a = r[i], o = Ze.get(e.id)?.lane ?? 0, s = (n?.start ?? Z.top) + A + (o + N) * k, c = X.position(e.start), l = e.end === void 0 ? c : Math.max(c + xe, X.position(e.end)), u = e.tone ?? Me({
|
|
203
|
+
id: e.laneId,
|
|
204
|
+
tone: a?.tone,
|
|
205
|
+
index: i
|
|
206
|
+
});
|
|
207
|
+
return {
|
|
208
|
+
event: e,
|
|
209
|
+
rank: t,
|
|
210
|
+
laneIndex: i,
|
|
211
|
+
laneLabel: a?.label ?? e.laneId,
|
|
212
|
+
x1: c,
|
|
213
|
+
x2: l,
|
|
214
|
+
y: s,
|
|
215
|
+
tone: u
|
|
216
|
+
};
|
|
217
|
+
}), it = $.map(({ event: e, laneLabel: t }) => {
|
|
218
|
+
let n = e.end === void 0 ? q(e.start) : `${q(e.start)} – ${q(e.end)} · ${Ne(e.end - e.start, I)}`;
|
|
219
|
+
return {
|
|
220
|
+
id: e.id,
|
|
221
|
+
label: [
|
|
222
|
+
t,
|
|
223
|
+
e.label,
|
|
224
|
+
n,
|
|
225
|
+
e.detail
|
|
226
|
+
].filter((e) => e !== void 0).join(" · ")
|
|
227
|
+
};
|
|
228
|
+
}), at = 1 / (r.length * 2 + 1);
|
|
229
|
+
function ot(e) {
|
|
230
|
+
let t = e.x / e.width * Z.width, n = e.y / e.height * Z.height, r, i = Infinity;
|
|
231
|
+
for (let e of $) if (t >= e.x1 - j - Ce && t <= e.x2 + j + Ce && Math.abs(n - e.y) <= k * N) {
|
|
232
|
+
let a = Math.max(e.x1, Math.min(e.x2, t)), o = Math.hypot(t - a, n - e.y);
|
|
233
|
+
o <= i && (i = o, r = e.event.id);
|
|
234
|
+
}
|
|
235
|
+
return r;
|
|
236
|
+
}
|
|
237
|
+
return /* @__PURE__ */ C(a, {
|
|
238
|
+
...Ie,
|
|
239
|
+
items: it,
|
|
240
|
+
place: (e) => {
|
|
241
|
+
let t = $.find((t) => t.event.id === e), n = t?.rank ?? 0, r = (t?.laneIndex ?? 0) * at;
|
|
242
|
+
return t === void 0 ? void 0 : {
|
|
243
|
+
left: n,
|
|
244
|
+
right: n,
|
|
245
|
+
top: r,
|
|
246
|
+
bottom: r
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
locate: ot,
|
|
250
|
+
selected: D ?? null,
|
|
251
|
+
onSelect: O,
|
|
252
|
+
render: (e, { inspected: t, cursor: n }) => {
|
|
253
|
+
let r = $.find((e) => e.event.id === n);
|
|
254
|
+
return /* @__PURE__ */ C(oe, {
|
|
255
|
+
...F,
|
|
256
|
+
actions: Ue,
|
|
257
|
+
figure: e,
|
|
258
|
+
footer: G.length === 0 ? void 0 : /* @__PURE__ */ C(s, {
|
|
259
|
+
id: Ae,
|
|
260
|
+
children: i(it, t)
|
|
261
|
+
}),
|
|
262
|
+
children: G.length === 0 ? /* @__PURE__ */ C(ce, { children: P }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w(de, {
|
|
263
|
+
plotRef: L.ref,
|
|
264
|
+
box: Z,
|
|
265
|
+
label: l({
|
|
266
|
+
title: ke,
|
|
267
|
+
marks: "events",
|
|
268
|
+
isSelectable: O !== void 0
|
|
269
|
+
}),
|
|
270
|
+
readoutId: Ae,
|
|
271
|
+
children: [
|
|
272
|
+
Q.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ C("rect", {
|
|
273
|
+
x: Z.left,
|
|
274
|
+
y: e.start,
|
|
275
|
+
width: Z.innerWidth,
|
|
276
|
+
height: e.end - e.start,
|
|
277
|
+
className: "x2wnxhi x1rcfr07 x47corl"
|
|
278
|
+
}, `band-${e.lane.id}`) : null),
|
|
279
|
+
/* @__PURE__ */ C(g, {
|
|
280
|
+
box: Z,
|
|
281
|
+
xTicks: nt,
|
|
282
|
+
yTicks: rt,
|
|
283
|
+
xTitle: `Time (${K})`,
|
|
284
|
+
grid: "x"
|
|
285
|
+
}),
|
|
286
|
+
Q.slice(1).map((e) => /* @__PURE__ */ C("line", {
|
|
287
|
+
x1: Z.left,
|
|
288
|
+
x2: Z.right,
|
|
289
|
+
y1: e.start,
|
|
290
|
+
y2: e.start,
|
|
291
|
+
...x.props(le.grid, je.separator)
|
|
292
|
+
}, e.lane.id)),
|
|
293
|
+
/* @__PURE__ */ C(fe, {
|
|
294
|
+
box: Z,
|
|
295
|
+
children: $.map((e) => e.event.end === void 0 ? /* @__PURE__ */ C(_, {
|
|
296
|
+
x: e.x1,
|
|
297
|
+
y: e.y,
|
|
298
|
+
radius: j,
|
|
299
|
+
tone: e.tone,
|
|
300
|
+
isInspected: t === e.event.id,
|
|
301
|
+
isSelected: D === e.event.id
|
|
302
|
+
}, e.event.id) : /* @__PURE__ */ C(y, {
|
|
303
|
+
x: e.x1,
|
|
304
|
+
y: e.y - be * N,
|
|
305
|
+
width: e.x2 - e.x1,
|
|
306
|
+
height: be,
|
|
307
|
+
tone: e.tone,
|
|
308
|
+
isInspected: t === e.event.id,
|
|
309
|
+
isSelected: D === e.event.id
|
|
310
|
+
}, e.event.id))
|
|
311
|
+
}),
|
|
312
|
+
Ge.map(({ marker: e, at: t, text: n, tooltip: r, isEnd: i }) => {
|
|
313
|
+
let a = Ke.get(e.id)?.lane ?? 0, o = Z.top - 10 - a * we, s = Math.max(Z.left + M, Math.min(Z.right - M, i ? t - M : t + M));
|
|
314
|
+
return /* @__PURE__ */ w("g", { children: [
|
|
315
|
+
/* @__PURE__ */ C("title", { children: r }),
|
|
316
|
+
/* @__PURE__ */ C(ue, {
|
|
317
|
+
x1: t,
|
|
318
|
+
x2: t,
|
|
319
|
+
y1: o + M,
|
|
320
|
+
y2: Z.bottom,
|
|
321
|
+
stroke: "dashed"
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ C(v, {
|
|
324
|
+
x: s,
|
|
325
|
+
y: o,
|
|
326
|
+
anchor: i ? "end" : "start",
|
|
327
|
+
children: n
|
|
328
|
+
})
|
|
329
|
+
] }, e.id);
|
|
330
|
+
}),
|
|
331
|
+
r !== void 0 && /* @__PURE__ */ C(h, {
|
|
332
|
+
x: (r.x1 + r.x2) * N,
|
|
333
|
+
top: Z.top,
|
|
334
|
+
bottom: Z.bottom,
|
|
335
|
+
width: De
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
}), /* @__PURE__ */ C(ae, {
|
|
339
|
+
label: `${ke} events`,
|
|
340
|
+
columns: [{
|
|
341
|
+
id: "event",
|
|
342
|
+
label: "Event"
|
|
343
|
+
}],
|
|
344
|
+
rows: it.map((e) => ({
|
|
345
|
+
id: e.id,
|
|
346
|
+
values: [e.label]
|
|
347
|
+
}))
|
|
348
|
+
})] })
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
// packages/charts/src/timeline/waterfall.tsx
|
|
354
|
+
var R = 5, Le = 6, Re = 14, ze = .5, Be = [
|
|
355
|
+
0,
|
|
356
|
+
.5,
|
|
357
|
+
1
|
|
358
|
+
], z = 100, B = {
|
|
359
|
+
k1xSpc: "x1rg5ohu",
|
|
360
|
+
kzqmXN: "x1v4s8kt",
|
|
361
|
+
kZKoxP: "xols6we",
|
|
362
|
+
kaIpWk: "x1ok0vyi",
|
|
363
|
+
kmuXW: "x2lah0s",
|
|
364
|
+
$$css: !0
|
|
365
|
+
}, V = {
|
|
366
|
+
cell: {
|
|
367
|
+
k7Eaqz: "xeuugli",
|
|
368
|
+
k3XXqK: "x1t137rt",
|
|
369
|
+
kZs9gx: "x19rmrnh",
|
|
370
|
+
k7shQP: "x9v5kkp",
|
|
371
|
+
kPJHz1: "x13qnu6",
|
|
372
|
+
kiEn40: "x7s97pk",
|
|
373
|
+
$$css: !0
|
|
374
|
+
},
|
|
375
|
+
nameWrap: {
|
|
376
|
+
k1xSpc: "x78zum5",
|
|
377
|
+
kGNEyG: "x6s0dn4",
|
|
378
|
+
kOIVth: "xunmzkg",
|
|
379
|
+
k7Eaqz: "xeuugli",
|
|
380
|
+
$$css: !0
|
|
381
|
+
},
|
|
382
|
+
indent: (e) => [{
|
|
383
|
+
kZCmMZ: e == null ? e : "xnvo3vl",
|
|
384
|
+
$$css: !0
|
|
385
|
+
}, { "--x-paddingInlineStart": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
|
|
386
|
+
leafDot: (e) => [
|
|
387
|
+
B,
|
|
388
|
+
{
|
|
389
|
+
kWkggS: e == null ? e : "xl8spv7",
|
|
390
|
+
$$css: !0
|
|
391
|
+
},
|
|
392
|
+
{ "--x-backgroundColor": e ?? void 0 }
|
|
393
|
+
],
|
|
394
|
+
plot: {
|
|
395
|
+
k7Eaqz: "xeuugli",
|
|
396
|
+
kUOVxO: "xl4o6ss",
|
|
397
|
+
kBCFzs: "x1npkx4u x1v577k8",
|
|
398
|
+
kbNqZ1: "x1ms6mhf x1aa6nly",
|
|
399
|
+
$$css: !0
|
|
400
|
+
},
|
|
401
|
+
toned: (e) => [{
|
|
402
|
+
kMwMTN: e == null ? e : "x14rh7hd",
|
|
403
|
+
$$css: !0
|
|
404
|
+
}, { "--x-color": e ?? void 0 }]
|
|
405
|
+
};
|
|
406
|
+
function H({ items: e, start: n, end: i, visibleRange: a, rowLabel: o, summaryLabel: s, density: c = "comfortable", emptyLabel: l = "No timing records are available.", selected: u, selectedRef: ee, onSelectedChange: d, highlightedIds: f, onActivate: te, offsetFormat: p, ...m }) {
|
|
407
|
+
let { title: h, locale: ie } = m, [ae, ce] = me(() => /* @__PURE__ */ new Set()), le = U({
|
|
408
|
+
items: e,
|
|
409
|
+
start: n,
|
|
410
|
+
end: i
|
|
411
|
+
});
|
|
412
|
+
if (le !== void 0) return /* @__PURE__ */ C(se, {
|
|
413
|
+
...m,
|
|
414
|
+
message: le
|
|
415
|
+
});
|
|
416
|
+
let g = a === void 0 ? n : Math.max(n, Math.min(i, a[0])), _ = a === void 0 ? i : Math.max(g, Math.min(i, a[1])), v = _ - g, ue = re({
|
|
417
|
+
domain: [g, _],
|
|
418
|
+
range: [0, z]
|
|
419
|
+
}), y = v > 0 ? Be : [0], de = e.some((e) => e.geometry.kind !== "unavailable"), b = new Map(e.map((e) => [e.id, e])), fe = new Set(e.flatMap((e) => e.parentId !== void 0 && b.has(e.parentId) ? [e.parentId] : []));
|
|
420
|
+
function pe(e) {
|
|
421
|
+
if (e.depth !== void 0) return Math.max(0, Math.min(Le, e.depth));
|
|
422
|
+
let t = 0, n = e.parentId, r = /* @__PURE__ */ new Set([e.id]);
|
|
423
|
+
for (; n !== void 0 && !r.has(n) && t < Le;) {
|
|
424
|
+
r.add(n);
|
|
425
|
+
let e = b.get(n);
|
|
426
|
+
if (e === void 0) break;
|
|
427
|
+
t += 1, n = e.parentId;
|
|
428
|
+
}
|
|
429
|
+
return t;
|
|
430
|
+
}
|
|
431
|
+
function he(e) {
|
|
432
|
+
let t = e.parentId, n = /* @__PURE__ */ new Set([e.id]);
|
|
433
|
+
for (; t !== void 0 && !n.has(t);) {
|
|
434
|
+
if (ae.has(t)) return !0;
|
|
435
|
+
n.add(t), t = b.get(t)?.parentId;
|
|
436
|
+
}
|
|
437
|
+
return !1;
|
|
438
|
+
}
|
|
439
|
+
let S = e.filter((e) => !he(e)), O = f !== void 0 && f.length > 0 ? new Set(f) : null;
|
|
440
|
+
function k(e) {
|
|
441
|
+
return ne({
|
|
442
|
+
value: e,
|
|
443
|
+
locale: ie,
|
|
444
|
+
format: p
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
let A = new Map(S.map((e) => [e.id, Ve({
|
|
448
|
+
geometry: e.geometry,
|
|
449
|
+
start: n,
|
|
450
|
+
offset: k
|
|
451
|
+
})])), be = S.map((e) => ({
|
|
452
|
+
value: e.id,
|
|
453
|
+
label: `${e.label} · ${e.detail} · ${e.summary} · ${A.get(e.id)}`,
|
|
454
|
+
...G(e.geometry)
|
|
455
|
+
}));
|
|
456
|
+
function xe(e) {
|
|
457
|
+
ce((t) => {
|
|
458
|
+
let n = new Set(t);
|
|
459
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
let j = c === "compact", Se = S.length === 0 ? /* @__PURE__ */ C("div", {
|
|
463
|
+
role: "group",
|
|
464
|
+
"aria-label": h,
|
|
465
|
+
className: "xeuugli x1hz01jw x12h1iku",
|
|
466
|
+
children: /* @__PURE__ */ C("p", {
|
|
467
|
+
className: "x1ghz6dp x1c8xbx5",
|
|
468
|
+
children: /* @__PURE__ */ C(t, {
|
|
469
|
+
tone: "muted",
|
|
470
|
+
children: l
|
|
471
|
+
})
|
|
472
|
+
})
|
|
473
|
+
}) : /* @__PURE__ */ w(ge, {
|
|
474
|
+
items: be,
|
|
475
|
+
range: [g, _],
|
|
476
|
+
value: u ?? null,
|
|
477
|
+
onValueChange: (e, t) => {
|
|
478
|
+
e !== null && d(e, t);
|
|
479
|
+
},
|
|
480
|
+
getBarLabel: (e) => A.get(e.value) ?? "",
|
|
481
|
+
"aria-label": h,
|
|
482
|
+
className: "xeuugli x1hz01jw x12h1iku",
|
|
483
|
+
children: [/* @__PURE__ */ w(E, {
|
|
484
|
+
className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy x1f9pz31 x153jb6y xy8obcc xso031l x1q0q8m5 x1qndepd",
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ C(T, { children: /* @__PURE__ */ C(t, {
|
|
487
|
+
variant: "caption",
|
|
488
|
+
tone: "muted",
|
|
489
|
+
children: o
|
|
490
|
+
}) }),
|
|
491
|
+
/* @__PURE__ */ C(T, {
|
|
492
|
+
"aria-label": "Timing",
|
|
493
|
+
className: "xeuugli xl4o6ss x1npkx4u x1v577k8 x1ms6mhf x1aa6nly x78zum5 x1qughib x6s0dn4 xy8obcc xas2l8k xss6m8b",
|
|
494
|
+
children: de ? y.map((e) => /* @__PURE__ */ C("span", { children: k(g - n + v * e) }, e)) : /* @__PURE__ */ C("span", { children: "Timing unavailable" })
|
|
495
|
+
}),
|
|
496
|
+
/* @__PURE__ */ C(T, {
|
|
497
|
+
className: "xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xb3r6kr xuxw1ft xlyipyv xss6m8b",
|
|
498
|
+
children: /* @__PURE__ */ C(t, {
|
|
499
|
+
variant: "caption",
|
|
500
|
+
tone: "muted",
|
|
501
|
+
children: s
|
|
502
|
+
})
|
|
503
|
+
})
|
|
504
|
+
]
|
|
505
|
+
}), S.map((e) => {
|
|
506
|
+
let n = A.get(e.id), i = u === e.id, a = O !== null && !O.has(e.id), o = e.tone ?? "neutral", s = r[o], c = pe(e), l = fe.has(e.id), d = ae.has(e.id);
|
|
507
|
+
return /* @__PURE__ */ w(ye, {
|
|
508
|
+
value: e.id,
|
|
509
|
+
ref: i ? ee : void 0,
|
|
510
|
+
"aria-controls": e.controls,
|
|
511
|
+
onDoubleClick: () => te?.(e.id),
|
|
512
|
+
...{
|
|
513
|
+
0: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xdd8jsf" },
|
|
514
|
+
4: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xc9qbxq" },
|
|
515
|
+
2: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xdd8jsf x1r7kqkb xh3r7i3" },
|
|
516
|
+
6: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xc9qbxq x1r7kqkb xh3r7i3" },
|
|
517
|
+
1: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xdd8jsf xtg6wg7" },
|
|
518
|
+
5: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xpvm0e4 xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xc9qbxq xtg6wg7" },
|
|
519
|
+
3: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xdd8jsf x1r7kqkb xh3r7i3 xtg6wg7" },
|
|
520
|
+
7: { className: "xrvj5dj xhbvagd x1prkh4w x6s0dn4 x1hm1d26 x8zbtdt xh8yej3 x9f619 x1doqdfy xc342km xso031l x1q0q8m5 x1qndepd xbixft x1hz01jw x1yc453h x1ypdohk x1t137rt xif5pkx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1t1lzn6 xc9qbxq x1r7kqkb xh3r7i3 xtg6wg7" }
|
|
521
|
+
}[!!j << 2 | !!i << 1 | !!a],
|
|
522
|
+
children: [
|
|
523
|
+
/* @__PURE__ */ C(D, {
|
|
524
|
+
className: "xeuugli x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
525
|
+
children: /* @__PURE__ */ w("div", {
|
|
526
|
+
...x.props(V.nameWrap, c > 0 && V.indent(c * Re)),
|
|
527
|
+
children: [l ? /* @__PURE__ */ C("button", {
|
|
528
|
+
type: "button",
|
|
529
|
+
"aria-label": d ? `Expand ${e.label}` : `Collapse ${e.label}`,
|
|
530
|
+
"aria-expanded": !d,
|
|
531
|
+
onClick: (t) => {
|
|
532
|
+
t.stopPropagation(), xe(e.id);
|
|
533
|
+
},
|
|
534
|
+
className: "x3nfvp2 x6s0dn4 xl56j7k x1xp8n7a xmix8c7 x2lah0s x1717udv xc342km x1ok0vyi xjbqb8w x153jb6y xy8obcc x1ypdohk x1mkwuse x16kmaj",
|
|
535
|
+
children: d ? "▸" : "▾"
|
|
536
|
+
}) : /* @__PURE__ */ C("span", { ...x.props(V.leafDot(s)) }), /* @__PURE__ */ w("div", {
|
|
537
|
+
className: "xeuugli x98rzlu xrvj5dj xfko13i",
|
|
538
|
+
children: [/* @__PURE__ */ C("span", {
|
|
539
|
+
title: `${e.label} — ${e.detail}`,
|
|
540
|
+
className: "x1lliihq xb3r6kr xuxw1ft xlyipyv",
|
|
541
|
+
children: /* @__PURE__ */ C(t, { children: e.label })
|
|
542
|
+
}), !j && /* @__PURE__ */ C("span", {
|
|
543
|
+
title: e.detail,
|
|
544
|
+
className: "x1lliihq xb3r6kr xuxw1ft xlyipyv",
|
|
545
|
+
children: /* @__PURE__ */ C(t, {
|
|
546
|
+
variant: "caption",
|
|
547
|
+
tone: "muted",
|
|
548
|
+
children: e.detail
|
|
549
|
+
})
|
|
550
|
+
})]
|
|
551
|
+
})]
|
|
552
|
+
})
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ C(_e, {
|
|
555
|
+
title: n,
|
|
556
|
+
...x.props(V.plot, V.cell, V.toned(s)),
|
|
557
|
+
children: e.geometry.kind === "unavailable" ? /* @__PURE__ */ C(t, {
|
|
558
|
+
variant: "caption",
|
|
559
|
+
tone: "muted",
|
|
560
|
+
children: n
|
|
561
|
+
}) : /* @__PURE__ */ w("svg", {
|
|
562
|
+
"aria-hidden": !0,
|
|
563
|
+
className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
|
|
564
|
+
children: [y.map((e) => /* @__PURE__ */ C("line", {
|
|
565
|
+
x1: `${e * z}%`,
|
|
566
|
+
x2: `${e * z}%`,
|
|
567
|
+
y1: "0",
|
|
568
|
+
y2: "18",
|
|
569
|
+
className: "x13hfdr1"
|
|
570
|
+
}, e)), /* @__PURE__ */ C(W, {
|
|
571
|
+
geometry: e.geometry,
|
|
572
|
+
scale: ue,
|
|
573
|
+
rangeStart: g,
|
|
574
|
+
rangeEnd: _
|
|
575
|
+
})]
|
|
576
|
+
})
|
|
577
|
+
}),
|
|
578
|
+
/* @__PURE__ */ C(ve, {
|
|
579
|
+
title: n,
|
|
580
|
+
className: "x1k3v4rp x14r0xmm x1ms6mhf xp4054r xb3r6kr xuxw1ft xlyipyv xss6m8b xeuugli x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
581
|
+
children: /* @__PURE__ */ C(t, {
|
|
582
|
+
variant: "caption",
|
|
583
|
+
tone: "muted",
|
|
584
|
+
children: e.summary
|
|
585
|
+
})
|
|
586
|
+
})
|
|
587
|
+
]
|
|
588
|
+
}, e.id);
|
|
589
|
+
})]
|
|
590
|
+
});
|
|
591
|
+
return /* @__PURE__ */ C(oe, {
|
|
592
|
+
...m,
|
|
593
|
+
children: Se
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
function U({ items: e, start: t, end: n }) {
|
|
597
|
+
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(n - t) || n < t) return "The timing domain must have finite, ordered endpoints.";
|
|
598
|
+
if (!o(e)) return "Timing records must have unique identifiers.";
|
|
599
|
+
for (let r of e) {
|
|
600
|
+
let e = r.geometry;
|
|
601
|
+
if (e.kind === "interval") {
|
|
602
|
+
if (!Number.isFinite(e.start) || !Number.isFinite(e.end) || e.end < e.start) return "Timing intervals must have finite, ordered endpoints.";
|
|
603
|
+
if (e.start < t || e.end > n) return "Timing intervals must fit inside the supplied domain.";
|
|
604
|
+
}
|
|
605
|
+
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.";
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function W({ geometry: e, scale: t, rangeStart: n, rangeEnd: r }) {
|
|
609
|
+
switch (e.kind) {
|
|
610
|
+
case "unavailable": return null;
|
|
611
|
+
case "interval": {
|
|
612
|
+
if (e.end < n || e.start > r) return null;
|
|
613
|
+
let i = Math.max(n, e.start), a = Math.min(r, e.end), o = t.position(i), s = t.position(a) - o;
|
|
614
|
+
if (e.end === e.start) return /* @__PURE__ */ C("circle", {
|
|
615
|
+
cx: `${o}%`,
|
|
616
|
+
cy: 9,
|
|
617
|
+
r: 3,
|
|
618
|
+
className: "x117rol3"
|
|
619
|
+
});
|
|
620
|
+
let c = Math.max(ze, Math.min(z - o, s));
|
|
621
|
+
return /* @__PURE__ */ C("rect", {
|
|
622
|
+
x: `${o}%`,
|
|
623
|
+
y: 5,
|
|
624
|
+
width: `${c}%`,
|
|
625
|
+
height: 8,
|
|
626
|
+
rx: 2.5,
|
|
627
|
+
className: "x117rol3"
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
case "point": {
|
|
631
|
+
if (e.at < n || e.at > r) return null;
|
|
632
|
+
let i = t.position(e.at);
|
|
633
|
+
switch (e.marker) {
|
|
634
|
+
case "filled": return /* @__PURE__ */ C("circle", {
|
|
635
|
+
cx: `${i}%`,
|
|
636
|
+
cy: 9,
|
|
637
|
+
r: 3,
|
|
638
|
+
className: "x117rol3"
|
|
639
|
+
});
|
|
640
|
+
case "hollow": return /* @__PURE__ */ C("circle", {
|
|
641
|
+
cx: `${i}%`,
|
|
642
|
+
cy: 9,
|
|
643
|
+
r: 3.5,
|
|
644
|
+
className: "x1fytgo2 x73je2i xvlca1e"
|
|
645
|
+
});
|
|
646
|
+
case "diamond": return /* @__PURE__ */ C("svg", {
|
|
647
|
+
x: `${i}%`,
|
|
648
|
+
y: 9,
|
|
649
|
+
width: 1,
|
|
650
|
+
height: 1,
|
|
651
|
+
overflow: "visible",
|
|
652
|
+
children: /* @__PURE__ */ C("path", {
|
|
653
|
+
d: `M0 -${R} ${R} 0 0 ${R} -${R} 0Z`,
|
|
654
|
+
className: "x117rol3"
|
|
655
|
+
})
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function G(e) {
|
|
662
|
+
switch (e.kind) {
|
|
663
|
+
case "interval": return {
|
|
664
|
+
start: e.start,
|
|
665
|
+
duration: e.end - e.start
|
|
666
|
+
};
|
|
667
|
+
case "point": return {
|
|
668
|
+
start: e.at,
|
|
669
|
+
duration: 0
|
|
670
|
+
};
|
|
671
|
+
case "unavailable": return {
|
|
672
|
+
start: NaN,
|
|
673
|
+
duration: NaN
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function Ve({ geometry: e, start: t, offset: n }) {
|
|
678
|
+
switch (e.kind) {
|
|
679
|
+
case "interval": return `Start ${n(e.start - t)}, end ${n(e.end - t)}, duration ${n(e.end - e.start)}`;
|
|
680
|
+
case "point": return `At ${n(e.at - t)}`;
|
|
681
|
+
case "unavailable": return "Timing unavailable";
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
export { O as i, Ie as n, Me as r, H as t };
|
package/package.json
CHANGED