@mechane-ai/elements 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +1 -1
- package/dist/{article-DPDk0Xgp.js → article-COShcQPh.js} +1 -1
- package/dist/article.js +1 -1
- package/dist/catalog.json +9 -1
- package/dist/{categorical-values-CGavb4HZ.js → categorical-values-DdZLdWhL.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 -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 +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/commands-D0bF2JxV.js +107 -0
- package/dist/{dumbbell-plot-DJOyXW7m.js → dumbbell-plot-BeHhL-01.js} +3 -3
- package/dist/{embedding-map-BSlNwXs2.js → embedding-map-DbETVJXp.js} +3 -3
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-C2hCrRX4.js → figure-frame-ClYRIRAq.js} +2 -2
- package/dist/{image-grid-D0Xk_KNk.js → image-grid-DB5U7Jtx.js} +2 -2
- package/dist/kits/evaluation.js +4 -4
- package/dist/kits/interpretability.js +8 -8
- package/dist/kits/operations.js +5 -5
- package/dist/kits/research.js +5 -5
- package/dist/kits/training.js +4 -4
- package/dist/layout.js +1 -1
- package/dist/mdx.js +2 -2
- package/dist/navigation/commands.js +1 -95
- package/dist/packages/charts/src/timeline/event-strip.d.ts +2 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/devtools-bar.d.ts +9 -0
- package/dist/packages/layout/src/index.d.ts +1 -0
- package/dist/packages/layout/src/shell-bottom-bar.d.ts +4 -0
- package/dist/packages/navigation/src/commands/command.d.ts +1 -0
- package/dist/{plot-layout-PBlcYu9p.js → plot-layout-B-b6tioh.js} +1 -1
- package/dist/{plot-surface-CdqANDC1.js → plot-surface-BlR44uTL.js} +1 -1
- package/dist/{reference-lines-Cdrs0B3S.js → reference-lines-BDfsv8dy.js} +1 -1
- package/dist/{scene-CcJb3zcs.js → scene-CY05-A1k.js} +4 -4
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-CagCaJYG.js → slope-chart-DTyF1lNG.js} +4 -4
- package/dist/{src-LEom7AhF.js → src-4qgpiWvP.js} +1 -1
- package/dist/{src-Bg4eyJZO.js → src-C-Wg9m9H.js} +2 -1
- package/dist/{src-DhWMspwr.js → src-Cuwx-PLT.js} +371 -282
- package/dist/styles2.css +33 -1
- package/dist/{time-series-g4trCNxp.js → time-series-CoAtNizi.js} +6 -6
- package/dist/{token-heatmap-CgJNUXJH.js → token-heatmap-o_9l6vaq.js} +2 -2
- package/dist/{token-predictions-BMVVfAL3.js → token-predictions-DaAztlOS.js} +3 -3
- package/dist/{tree-diagram-BHLewHQl.js → tree-diagram-BDj4TGXb.js} +3 -3
- package/dist/{treemap-n3Er3k6e.js → treemap-DUSFlCPK.js} +4 -4
- package/dist/{violin-plot-qCMn4e1I.js → violin-plot-ULdC_dcY.js} +3 -3
- package/dist/waterfall-BjUXqaWu.js +615 -0
- package/package.json +1 -1
- package/skills/use-elements/references/workspace.md +6 -0
- package/dist/waterfall-ChExGsn8.js +0 -605
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import { T as e, c as t, m as n } from "./src-9EJskqB_.js";
|
|
2
|
+
import { A as r, E as i, M as a, S as o, f as s, j as c, l, s as ee } from "./plot-layout-B-b6tioh.js";
|
|
3
|
+
import { i as u } from "./chart-link-AE_xuxiP.js";
|
|
4
|
+
import { a as d } from "./tone-scope-DKiSw-JR.js";
|
|
5
|
+
import { n as te, r as ne } from "./figure-format-B8kRZMlo.js";
|
|
6
|
+
import { a as f, o as p, r as re } from "./scale-C2xgZyZN.js";
|
|
7
|
+
import { t as ie } from "./chart-cursor-1mFd48Jc.js";
|
|
8
|
+
import { i as m, l as ae, n as oe, r as se, t as ce } from "./figure-frame-ClYRIRAq.js";
|
|
9
|
+
import { n as h } from "./plot-width-D3hTycYX.js";
|
|
10
|
+
import { t as le } from "./plot-axes-D5S9BnBa.js";
|
|
11
|
+
import { a as ue, c as de, f as fe, r as pe } from "./plot-marks-FVsbFkUs.js";
|
|
12
|
+
import { n as me, r as he, t as ge } from "./plot-surface-BlR44uTL.js";
|
|
13
|
+
import * as _e from "@stylexjs/stylex";
|
|
14
|
+
import { useId as ve, useState as ye } from "react";
|
|
15
|
+
import { stackSpans as be } from "@ui-sdk/core";
|
|
16
|
+
import { Fragment as xe, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
|
+
import { Waterfall as v, WaterfallBar as Se, WaterfallCell as y, WaterfallColumnHeader as b, WaterfallHeaderRow as x, WaterfallRow as S, WaterfallRowHeader as Ce } from "@ui-sdk/react/waterfall";
|
|
18
|
+
// packages/charts/src/timeline/event-strip.tsx
|
|
19
|
+
var C = {
|
|
20
|
+
lanes: 12,
|
|
21
|
+
events: 1e3
|
|
22
|
+
}, w = 24, T = 8, we = 14, Te = 4, E = 5, Ee = 14, De = 5, Oe = 18, D = 5, ke = .65, Ae = 6.5, je = 12, O = .5, k = .04, A = 1e3, j = 60 * A, M = 60 * j, N = 24 * M, P = {
|
|
23
|
+
unit: "second",
|
|
24
|
+
size: A
|
|
25
|
+
}, F = [
|
|
26
|
+
{
|
|
27
|
+
unit: "day",
|
|
28
|
+
size: N
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
unit: "hour",
|
|
32
|
+
size: M
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
unit: "minute",
|
|
36
|
+
size: j
|
|
37
|
+
},
|
|
38
|
+
P
|
|
39
|
+
], Me = { separator: {
|
|
40
|
+
kfzvcC: "x47corl",
|
|
41
|
+
$$css: !0
|
|
42
|
+
} };
|
|
43
|
+
function I(e) {
|
|
44
|
+
return l({
|
|
45
|
+
width: Infinity,
|
|
46
|
+
valueLabels: e,
|
|
47
|
+
hasXTitle: !0,
|
|
48
|
+
hasYTitle: !1
|
|
49
|
+
}).left;
|
|
50
|
+
}
|
|
51
|
+
function Ne(e, t) {
|
|
52
|
+
let n = F.find((t) => e >= t.size) ?? P;
|
|
53
|
+
return ne({
|
|
54
|
+
value: e / n.size,
|
|
55
|
+
locale: t,
|
|
56
|
+
format: {
|
|
57
|
+
style: "unit",
|
|
58
|
+
unit: n.unit,
|
|
59
|
+
unitDisplay: "long",
|
|
60
|
+
maximumFractionDigits: 1
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function Pe(e, t) {
|
|
65
|
+
let n = [...e.flatMap((e) => e.end === void 0 ? [e.start] : [e.start, e.end]), ...t.map((e) => e.at)];
|
|
66
|
+
if (n.length === 0) return [0, M];
|
|
67
|
+
let r = Math.min(...n), i = Math.max(...n), a = i - r, o = a > 0 ? Math.max(j, Math.round(a * k)) : M * O;
|
|
68
|
+
return [r - o, i + o];
|
|
69
|
+
}
|
|
70
|
+
function Fe({ lanes: e, events: t, markers: n, domain: r, zone: i }) {
|
|
71
|
+
let o = p(r);
|
|
72
|
+
if (o !== void 0) return o;
|
|
73
|
+
if (i === void 0) return "A function time format needs a timeZone beside it, so the axis ticks fall on that zone.";
|
|
74
|
+
if (e.length > C.lanes || t.length > C.events) return `This strip draws at most ${C.lanes} lanes and ${C.events} events. Supply a shorter window.`;
|
|
75
|
+
if (!a(e) || !a(t) || !a(n)) return "Lanes, events and markers must each have unique identifiers.";
|
|
76
|
+
let s = new Set(e.map((e) => e.id)), c = t.find((e) => !s.has(e.laneId));
|
|
77
|
+
if (c !== void 0) return `Event ${c.id} names lane ${c.laneId}, which is not supplied.`;
|
|
78
|
+
let l = t.find((e) => {
|
|
79
|
+
let t = e.end !== void 0 && (f(e.end, r) || e.end <= e.start);
|
|
80
|
+
return f(e.start, r) || t;
|
|
81
|
+
});
|
|
82
|
+
return l === void 0 ? n.some((e) => f(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.`;
|
|
83
|
+
}
|
|
84
|
+
function Ie(t) {
|
|
85
|
+
let { lanes: a, events: ne, domain: f, markers: p = [], windows: v, defaultWindowId: Se, windowId: y, onWindowChange: b, gutterWidth: x, timeFormat: S, timeZone: Ce, selected: C, onSelectedChange: k, ...A } = t, { emptyLabel: j = "No events in this window.", ...M } = A, { locale: N, title: P } = M, F = he("compact"), I = ve(), Ie = d(), L = u(), R = v?.[0]?.id ?? "", [Le, Re] = ye(() => Se ?? R), z = y ?? Le;
|
|
86
|
+
function ze(e) {
|
|
87
|
+
y === void 0 && Re(e), b?.(e);
|
|
88
|
+
}
|
|
89
|
+
if (M.status === "loading") return /* @__PURE__ */ g(m, {
|
|
90
|
+
...M,
|
|
91
|
+
height: "compact"
|
|
92
|
+
});
|
|
93
|
+
let B = ne.map((e) => e.end !== void 0 && e.end <= e.start ? {
|
|
94
|
+
...e,
|
|
95
|
+
end: void 0
|
|
96
|
+
} : e), V = f ?? Pe(B, p), Be = v === void 0 || v.length === 0 ? void 0 : v.find((e) => e.id === z) ?? v[0], H = Be?.durationMs ?? null, Ve = H !== null && H > 0, U = Ve ? [Math.max(V[0], V[1] - H), V[1]] : V, W = Ve ? B.flatMap((e) => {
|
|
97
|
+
if ((e.end ?? e.start) < U[0] || e.start > U[1]) return [];
|
|
98
|
+
let t = Math.max(U[0], e.start), n = e.end === void 0 ? void 0 : Math.min(U[1], e.end), r = n !== void 0 && n > t ? n : void 0;
|
|
99
|
+
return [{
|
|
100
|
+
...e,
|
|
101
|
+
start: t,
|
|
102
|
+
end: r
|
|
103
|
+
}];
|
|
104
|
+
}) : B, He = Ve ? p.filter((e) => e.at >= U[0] && e.at <= U[1]) : p, G = typeof S == "function" ? Ce : S.timeZone, Ue = Fe({
|
|
105
|
+
lanes: a,
|
|
106
|
+
events: W,
|
|
107
|
+
markers: He,
|
|
108
|
+
domain: U,
|
|
109
|
+
zone: G
|
|
110
|
+
});
|
|
111
|
+
if (Ue !== void 0 || G === void 0) return /* @__PURE__ */ g(se, {
|
|
112
|
+
...M,
|
|
113
|
+
message: Ue ?? "The strip needs a time zone."
|
|
114
|
+
});
|
|
115
|
+
let We = v === void 0 || v.length <= 1 ? M.actions : /* @__PURE__ */ _(n, { children: [v.map((t) => {
|
|
116
|
+
let n = t.id === Be?.id;
|
|
117
|
+
return /* @__PURE__ */ g(e, {
|
|
118
|
+
type: "button",
|
|
119
|
+
density: "compact",
|
|
120
|
+
variant: n ? "outline" : "ghost",
|
|
121
|
+
"aria-pressed": n,
|
|
122
|
+
onClick: () => ze(t.id),
|
|
123
|
+
children: t.label
|
|
124
|
+
}, t.id);
|
|
125
|
+
}), M.actions] });
|
|
126
|
+
function K(e) {
|
|
127
|
+
return te({
|
|
128
|
+
timestamp: e,
|
|
129
|
+
locale: N,
|
|
130
|
+
format: S
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
let Ge = l({
|
|
134
|
+
width: F.width,
|
|
135
|
+
valueLabels: a.map((e) => e.label),
|
|
136
|
+
hasXTitle: !0,
|
|
137
|
+
hasYTitle: !1
|
|
138
|
+
}), q = x === void 0 ? Ge : {
|
|
139
|
+
...Ge,
|
|
140
|
+
left: x
|
|
141
|
+
}, J = Math.max(1, F.width - q.left - q.right), Y = re({
|
|
142
|
+
domain: U,
|
|
143
|
+
range: [q.left, q.left + J]
|
|
144
|
+
}), Ke = He.map((e) => {
|
|
145
|
+
let t = Y.position(e.at), n = e.label, r = `${e.label} · ${K(e.at)}`, i = n.length * Ae + 10, a = t > q.left + J * ke;
|
|
146
|
+
return {
|
|
147
|
+
marker: e,
|
|
148
|
+
at: t,
|
|
149
|
+
text: n,
|
|
150
|
+
tooltip: r,
|
|
151
|
+
isEnd: a,
|
|
152
|
+
start: a ? t - i : t,
|
|
153
|
+
end: a ? t : t + i
|
|
154
|
+
};
|
|
155
|
+
}), qe = be(Ke.map((e) => ({
|
|
156
|
+
id: e.marker.id,
|
|
157
|
+
track: "markers",
|
|
158
|
+
start: e.start,
|
|
159
|
+
end: e.end
|
|
160
|
+
}))), Je = Math.max(0, ...Ke.map((e) => (qe.get(e.marker.id)?.lane ?? 0) + 1)), Ye = q.top + Je * Oe, Xe = (U[1] - U[0]) * Ee / J, Ze = (U[1] - U[0]) * Te / J, Qe = be(W.map((e) => ({
|
|
161
|
+
id: e.id,
|
|
162
|
+
track: e.laneId,
|
|
163
|
+
start: e.end === void 0 ? e.start - Xe * O : e.start,
|
|
164
|
+
end: e.end === void 0 ? e.start + Xe * O : Math.max(e.end, e.start + Ze)
|
|
165
|
+
}))), $e = a.map((e) => Math.max(1, ...W.flatMap((t) => t.laneId === e.id ? [(Qe.get(t.id)?.lane ?? 0) + 1] : []))), et = a.flatMap((e, t) => Array.from({ length: $e[t] ?? 1 }, (t, n) => ({
|
|
166
|
+
laneId: e.id,
|
|
167
|
+
row: n
|
|
168
|
+
}))), tt = Ye + et.length * w + a.length * T * 2 + q.bottom, X = ee({
|
|
169
|
+
width: F.width,
|
|
170
|
+
height: tt,
|
|
171
|
+
margins: {
|
|
172
|
+
...q,
|
|
173
|
+
top: Ye
|
|
174
|
+
}
|
|
175
|
+
}), Z = a.map((e, t) => {
|
|
176
|
+
let n = et.findIndex((t) => t.laneId === e.id), r = X.top + t * T * 2 + n * w;
|
|
177
|
+
return {
|
|
178
|
+
lane: e,
|
|
179
|
+
index: t,
|
|
180
|
+
start: r,
|
|
181
|
+
end: r + ($e[t] ?? 1) * w + 16
|
|
182
|
+
};
|
|
183
|
+
}), nt = s({
|
|
184
|
+
domain: U,
|
|
185
|
+
length: X.innerWidth,
|
|
186
|
+
timeFormat: S,
|
|
187
|
+
locale: N,
|
|
188
|
+
timeZone: G
|
|
189
|
+
}), rt = nt.values.map((e, t) => ({
|
|
190
|
+
key: String(e),
|
|
191
|
+
position: Y.position(e),
|
|
192
|
+
label: nt.labels[t] ?? ""
|
|
193
|
+
})), it = Z.map((e) => ({
|
|
194
|
+
key: e.lane.id,
|
|
195
|
+
position: (e.start + e.end) * O,
|
|
196
|
+
label: e.lane.label
|
|
197
|
+
})), Q = W.map((e, t) => ({
|
|
198
|
+
event: e,
|
|
199
|
+
index: t
|
|
200
|
+
})).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) => {
|
|
201
|
+
let n = Z.find((t) => t.lane.id === e.laneId), r = n?.index ?? 0, i = a[r], o = Qe.get(e.id)?.lane ?? 0, s = (n?.start ?? X.top) + T + (o + O) * w, c = Y.position(e.start), l = e.end === void 0 ? c : Math.max(c + Te, Y.position(e.end)), ee = e.tone ?? Ie({
|
|
202
|
+
id: e.laneId,
|
|
203
|
+
tone: i?.tone,
|
|
204
|
+
index: r
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
event: e,
|
|
208
|
+
rank: t,
|
|
209
|
+
laneIndex: r,
|
|
210
|
+
laneLabel: i?.label ?? e.laneId,
|
|
211
|
+
x1: c,
|
|
212
|
+
x2: l,
|
|
213
|
+
y: s,
|
|
214
|
+
tone: ee
|
|
215
|
+
};
|
|
216
|
+
}), $ = Q.map(({ event: e, laneLabel: t }) => {
|
|
217
|
+
let n = e.end === void 0 ? K(e.start) : `${K(e.start)} – ${K(e.end)} · ${Ne(e.end - e.start, N)}`;
|
|
218
|
+
return {
|
|
219
|
+
id: e.id,
|
|
220
|
+
label: [
|
|
221
|
+
t,
|
|
222
|
+
e.label,
|
|
223
|
+
n,
|
|
224
|
+
e.detail
|
|
225
|
+
].filter((e) => e !== void 0).join(" · ")
|
|
226
|
+
};
|
|
227
|
+
}), at = 1 / (a.length * 2 + 1);
|
|
228
|
+
function ot(e) {
|
|
229
|
+
let t = e.x / e.width * X.width, n = e.y / e.height * X.height, r, i = Infinity;
|
|
230
|
+
for (let e of Q) if (t >= e.x1 - E - De && t <= e.x2 + E + De && Math.abs(n - e.y) <= w * O) {
|
|
231
|
+
let a = Math.max(e.x1, Math.min(e.x2, t)), o = Math.hypot(t - a, n - e.y);
|
|
232
|
+
o <= i && (i = o, r = e.event.id);
|
|
233
|
+
}
|
|
234
|
+
return r;
|
|
235
|
+
}
|
|
236
|
+
return /* @__PURE__ */ g(i, {
|
|
237
|
+
...L,
|
|
238
|
+
items: $,
|
|
239
|
+
place: (e) => {
|
|
240
|
+
let t = Q.find((t) => t.event.id === e), n = t?.rank ?? 0, r = (t?.laneIndex ?? 0) * at;
|
|
241
|
+
return t === void 0 ? void 0 : {
|
|
242
|
+
left: n,
|
|
243
|
+
right: n,
|
|
244
|
+
top: r,
|
|
245
|
+
bottom: r
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
locate: ot,
|
|
249
|
+
selected: C ?? null,
|
|
250
|
+
onSelect: k,
|
|
251
|
+
render: (e, { inspected: t, cursor: n }) => {
|
|
252
|
+
let i = Q.find((e) => e.event.id === n);
|
|
253
|
+
return /* @__PURE__ */ g(oe, {
|
|
254
|
+
...M,
|
|
255
|
+
actions: We,
|
|
256
|
+
figure: e,
|
|
257
|
+
footer: W.length === 0 ? void 0 : /* @__PURE__ */ g(o, {
|
|
258
|
+
id: I,
|
|
259
|
+
children: r($, t)
|
|
260
|
+
}),
|
|
261
|
+
children: W.length === 0 ? /* @__PURE__ */ g(ce, { children: j }) : /* @__PURE__ */ _(xe, { children: [/* @__PURE__ */ _(me, {
|
|
262
|
+
plotRef: F.ref,
|
|
263
|
+
box: X,
|
|
264
|
+
label: c({
|
|
265
|
+
title: P,
|
|
266
|
+
marks: "events",
|
|
267
|
+
isSelectable: k !== void 0
|
|
268
|
+
}),
|
|
269
|
+
readoutId: I,
|
|
270
|
+
children: [
|
|
271
|
+
Z.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ g("rect", {
|
|
272
|
+
x: X.left,
|
|
273
|
+
y: e.start,
|
|
274
|
+
width: X.innerWidth,
|
|
275
|
+
height: e.end - e.start,
|
|
276
|
+
className: "x2wnxhi x1rcfr07 x47corl"
|
|
277
|
+
}, `band-${e.lane.id}`) : null),
|
|
278
|
+
/* @__PURE__ */ g(le, {
|
|
279
|
+
box: X,
|
|
280
|
+
xTicks: rt,
|
|
281
|
+
yTicks: it,
|
|
282
|
+
xTitle: `Time (${G})`,
|
|
283
|
+
grid: "x"
|
|
284
|
+
}),
|
|
285
|
+
Z.slice(1).map((e) => /* @__PURE__ */ g("line", {
|
|
286
|
+
x1: X.left,
|
|
287
|
+
x2: X.right,
|
|
288
|
+
y1: e.start,
|
|
289
|
+
y2: e.start,
|
|
290
|
+
..._e.props(h.grid, Me.separator)
|
|
291
|
+
}, e.lane.id)),
|
|
292
|
+
/* @__PURE__ */ g(ge, {
|
|
293
|
+
box: X,
|
|
294
|
+
children: Q.map((e) => e.event.end === void 0 ? /* @__PURE__ */ g(ue, {
|
|
295
|
+
x: e.x1,
|
|
296
|
+
y: e.y,
|
|
297
|
+
radius: E,
|
|
298
|
+
tone: e.tone,
|
|
299
|
+
isInspected: t === e.event.id,
|
|
300
|
+
isSelected: C === e.event.id
|
|
301
|
+
}, e.event.id) : /* @__PURE__ */ g(pe, {
|
|
302
|
+
x: e.x1,
|
|
303
|
+
y: e.y - we * O,
|
|
304
|
+
width: e.x2 - e.x1,
|
|
305
|
+
height: we,
|
|
306
|
+
tone: e.tone,
|
|
307
|
+
isInspected: t === e.event.id,
|
|
308
|
+
isSelected: C === e.event.id
|
|
309
|
+
}, e.event.id))
|
|
310
|
+
}),
|
|
311
|
+
Ke.map(({ marker: e, at: t, text: n, tooltip: r, isEnd: i }) => {
|
|
312
|
+
let a = qe.get(e.id)?.lane ?? 0, o = X.top - 10 - a * Oe, s = Math.max(X.left + D, Math.min(X.right - D, i ? t - D : t + D));
|
|
313
|
+
return /* @__PURE__ */ _("g", { children: [
|
|
314
|
+
/* @__PURE__ */ g("title", { children: r }),
|
|
315
|
+
/* @__PURE__ */ g(fe, {
|
|
316
|
+
x1: t,
|
|
317
|
+
x2: t,
|
|
318
|
+
y1: o + D,
|
|
319
|
+
y2: X.bottom,
|
|
320
|
+
stroke: "dashed"
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ g(de, {
|
|
323
|
+
x: s,
|
|
324
|
+
y: o,
|
|
325
|
+
anchor: i ? "end" : "start",
|
|
326
|
+
children: n
|
|
327
|
+
})
|
|
328
|
+
] }, e.id);
|
|
329
|
+
}),
|
|
330
|
+
i !== void 0 && /* @__PURE__ */ g(ie, {
|
|
331
|
+
x: (i.x1 + i.x2) * O,
|
|
332
|
+
top: X.top,
|
|
333
|
+
bottom: X.bottom,
|
|
334
|
+
width: je
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
}), /* @__PURE__ */ g(ae, {
|
|
338
|
+
label: `${P} events`,
|
|
339
|
+
columns: [{
|
|
340
|
+
id: "event",
|
|
341
|
+
label: "Event"
|
|
342
|
+
}],
|
|
343
|
+
rows: $.map((e) => ({
|
|
344
|
+
id: e.id,
|
|
345
|
+
values: [e.label]
|
|
346
|
+
}))
|
|
347
|
+
})] })
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
// packages/charts/src/timeline/waterfall.tsx
|
|
353
|
+
var L = 5, R = {
|
|
354
|
+
cell: {
|
|
355
|
+
k3XXqK: "x1t137rt",
|
|
356
|
+
kZs9gx: "x19rmrnh",
|
|
357
|
+
k7shQP: "x9v5kkp",
|
|
358
|
+
kPJHz1: "x13qnu6",
|
|
359
|
+
kiEn40: "x7s97pk",
|
|
360
|
+
$$css: !0
|
|
361
|
+
},
|
|
362
|
+
plot: {
|
|
363
|
+
k7Eaqz: "xeuugli",
|
|
364
|
+
kUOVxO: "xl4o6ss",
|
|
365
|
+
kBCFzs: "x1npkx4u x1v577k8",
|
|
366
|
+
kbNqZ1: "x1ms6mhf x1aa6nly",
|
|
367
|
+
$$css: !0
|
|
368
|
+
},
|
|
369
|
+
neutral: {
|
|
370
|
+
kMwMTN: "x153jb6y",
|
|
371
|
+
$$css: !0
|
|
372
|
+
},
|
|
373
|
+
positive: {
|
|
374
|
+
kMwMTN: "x7ixh4y",
|
|
375
|
+
$$css: !0
|
|
376
|
+
},
|
|
377
|
+
negative: {
|
|
378
|
+
kMwMTN: "xr5kp14",
|
|
379
|
+
$$css: !0
|
|
380
|
+
}
|
|
381
|
+
}, Le = {
|
|
382
|
+
neutral: R.neutral,
|
|
383
|
+
positive: R.positive,
|
|
384
|
+
negative: R.negative
|
|
385
|
+
}, Re = [
|
|
386
|
+
0,
|
|
387
|
+
.5,
|
|
388
|
+
1
|
|
389
|
+
], z = 100;
|
|
390
|
+
function ze({ items: e, start: n, end: r, rowLabel: i, summaryLabel: a, emptyLabel: o = "No timing records are available.", selected: s, selectedRef: c, onSelectedChange: l, offsetFormat: ee, ...u }) {
|
|
391
|
+
let { title: d, locale: te } = u, f = B({
|
|
392
|
+
items: e,
|
|
393
|
+
start: n,
|
|
394
|
+
end: r
|
|
395
|
+
});
|
|
396
|
+
if (f !== void 0) return /* @__PURE__ */ g(se, {
|
|
397
|
+
...u,
|
|
398
|
+
message: f
|
|
399
|
+
});
|
|
400
|
+
let p = r - n, ie = re({
|
|
401
|
+
domain: [n, r],
|
|
402
|
+
range: [0, z]
|
|
403
|
+
}), m = p > 0 ? Re : [0], ae = e.some((e) => e.geometry.kind !== "unavailable");
|
|
404
|
+
function ce(e) {
|
|
405
|
+
return ne({
|
|
406
|
+
value: e,
|
|
407
|
+
locale: te,
|
|
408
|
+
format: ee
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
let h = new Map(e.map((e) => [e.id, H({
|
|
412
|
+
geometry: e.geometry,
|
|
413
|
+
start: n,
|
|
414
|
+
offset: ce
|
|
415
|
+
})])), le = e.map((e) => ({
|
|
416
|
+
value: e.id,
|
|
417
|
+
label: `${e.label} · ${e.detail} · ${e.summary} · ${h.get(e.id)}`,
|
|
418
|
+
...Be(e.geometry)
|
|
419
|
+
})), ue = e.length === 0 ? /* @__PURE__ */ g("div", {
|
|
420
|
+
role: "group",
|
|
421
|
+
"aria-label": d,
|
|
422
|
+
className: "xeuugli x1hz01jw x12h1iku",
|
|
423
|
+
children: /* @__PURE__ */ g("p", {
|
|
424
|
+
className: "x1ghz6dp x1c8xbx5",
|
|
425
|
+
children: /* @__PURE__ */ g(t, {
|
|
426
|
+
tone: "muted",
|
|
427
|
+
children: o
|
|
428
|
+
})
|
|
429
|
+
})
|
|
430
|
+
}) : /* @__PURE__ */ _(v, {
|
|
431
|
+
items: le,
|
|
432
|
+
range: [n, r],
|
|
433
|
+
value: s ?? null,
|
|
434
|
+
onValueChange: (e, t) => {
|
|
435
|
+
e !== null && l(e, t);
|
|
436
|
+
},
|
|
437
|
+
getBarLabel: (e) => h.get(e.value) ?? "",
|
|
438
|
+
"aria-label": d,
|
|
439
|
+
className: "xeuugli x1hz01jw x12h1iku",
|
|
440
|
+
children: [/* @__PURE__ */ _(x, {
|
|
441
|
+
className: "xrvj5dj x13sfnbj x1prkh4w x6s0dn4 x1gkm1c7 x1y1mm1b xh8yej3 x9f619 x1doqdfy x17tes2r x153jb6y xy8obcc xso031l x1q0q8m5 x1qndepd",
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ g(b, { children: /* @__PURE__ */ g(t, {
|
|
444
|
+
variant: "caption",
|
|
445
|
+
tone: "muted",
|
|
446
|
+
children: i
|
|
447
|
+
}) }),
|
|
448
|
+
/* @__PURE__ */ g(b, {
|
|
449
|
+
"aria-label": "Timing",
|
|
450
|
+
className: "xeuugli xl4o6ss x1npkx4u x1v577k8 x1ms6mhf x1aa6nly x78zum5 x1qughib x6s0dn4 xy8obcc xas2l8k xss6m8b",
|
|
451
|
+
children: ae ? m.map((e) => /* @__PURE__ */ g("span", { children: ce(p * e) }, e)) : /* @__PURE__ */ g("span", { children: "Timing unavailable" })
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ g(b, {
|
|
454
|
+
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b",
|
|
455
|
+
children: /* @__PURE__ */ g(t, {
|
|
456
|
+
variant: "caption",
|
|
457
|
+
tone: "muted",
|
|
458
|
+
children: a
|
|
459
|
+
})
|
|
460
|
+
})
|
|
461
|
+
]
|
|
462
|
+
}), e.map((e) => {
|
|
463
|
+
let n = h.get(e.id), r = s === e.id;
|
|
464
|
+
return /* @__PURE__ */ _(S, {
|
|
465
|
+
value: e.id,
|
|
466
|
+
ref: r ? c : void 0,
|
|
467
|
+
"aria-controls": e.controls,
|
|
468
|
+
...{
|
|
469
|
+
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" },
|
|
470
|
+
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" }
|
|
471
|
+
}[!!r | 0],
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ _(Ce, {
|
|
474
|
+
className: "xeuugli xrvj5dj xfko13i x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
475
|
+
children: [/* @__PURE__ */ g(t, { children: e.label }), /* @__PURE__ */ g("span", {
|
|
476
|
+
title: e.detail,
|
|
477
|
+
...{
|
|
478
|
+
0: { className: "xb3r6kr xuxw1ft xlyipyv" },
|
|
479
|
+
1: { className: "xb3r6kr xlyipyv xeaf4i8 xj0a0fe" }
|
|
480
|
+
}[!!r | 0],
|
|
481
|
+
children: /* @__PURE__ */ g(t, {
|
|
482
|
+
variant: "caption",
|
|
483
|
+
tone: "muted",
|
|
484
|
+
children: e.detail
|
|
485
|
+
})
|
|
486
|
+
})]
|
|
487
|
+
}),
|
|
488
|
+
/* @__PURE__ */ g(Se, {
|
|
489
|
+
title: n,
|
|
490
|
+
..._e.props(R.plot, R.cell, Le[e.tone ?? "neutral"]),
|
|
491
|
+
children: e.geometry.kind === "unavailable" ? /* @__PURE__ */ g(t, {
|
|
492
|
+
variant: "caption",
|
|
493
|
+
tone: "muted",
|
|
494
|
+
children: n
|
|
495
|
+
}) : /* @__PURE__ */ _("svg", {
|
|
496
|
+
"aria-hidden": !0,
|
|
497
|
+
className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
|
|
498
|
+
children: [m.map((e) => /* @__PURE__ */ g("line", {
|
|
499
|
+
x1: `${e * z}%`,
|
|
500
|
+
x2: `${e * z}%`,
|
|
501
|
+
y1: "0",
|
|
502
|
+
y2: "18",
|
|
503
|
+
className: "x13hfdr1"
|
|
504
|
+
}, e)), /* @__PURE__ */ g(V, {
|
|
505
|
+
geometry: e.geometry,
|
|
506
|
+
scale: ie
|
|
507
|
+
})]
|
|
508
|
+
})
|
|
509
|
+
}),
|
|
510
|
+
/* @__PURE__ */ _(y, {
|
|
511
|
+
className: "xrvj5dj xfko13i xeuugli x1k3v4rp x14r0xmm x1ms6mhf xp4054r xj0a0fe xss6m8b x1t137rt x19rmrnh x9v5kkp x13qnu6 x7s97pk",
|
|
512
|
+
children: [/* @__PURE__ */ g(t, {
|
|
513
|
+
variant: "caption",
|
|
514
|
+
tone: "muted",
|
|
515
|
+
children: e.summary
|
|
516
|
+
}), r && /* @__PURE__ */ g(t, {
|
|
517
|
+
variant: "caption",
|
|
518
|
+
tone: "muted",
|
|
519
|
+
children: n
|
|
520
|
+
})]
|
|
521
|
+
})
|
|
522
|
+
]
|
|
523
|
+
}, e.id);
|
|
524
|
+
})]
|
|
525
|
+
});
|
|
526
|
+
return /* @__PURE__ */ g(oe, {
|
|
527
|
+
...u,
|
|
528
|
+
children: ue
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
function B({ items: e, start: t, end: n }) {
|
|
532
|
+
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(n - t) || n < t) return "The timing domain must have finite, ordered endpoints.";
|
|
533
|
+
if (!a(e)) return "Timing records must have unique identifiers.";
|
|
534
|
+
for (let r of e) {
|
|
535
|
+
let e = r.geometry;
|
|
536
|
+
if (e.kind === "interval") {
|
|
537
|
+
if (!Number.isFinite(e.start) || !Number.isFinite(e.end) || e.end < e.start) return "Timing intervals must have finite, ordered endpoints.";
|
|
538
|
+
if (e.start < t || e.end > n) return "Timing intervals must fit inside the supplied domain.";
|
|
539
|
+
}
|
|
540
|
+
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.";
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function V({ geometry: e, scale: t }) {
|
|
544
|
+
switch (e.kind) {
|
|
545
|
+
case "unavailable": return null;
|
|
546
|
+
case "interval": {
|
|
547
|
+
let n = t.position(e.start), r = t.position(e.end) - n;
|
|
548
|
+
return r === 0 ? /* @__PURE__ */ g("circle", {
|
|
549
|
+
cx: `${n}%`,
|
|
550
|
+
cy: 9,
|
|
551
|
+
r: 3,
|
|
552
|
+
className: "x117rol3"
|
|
553
|
+
}) : /* @__PURE__ */ g("rect", {
|
|
554
|
+
x: `${n}%`,
|
|
555
|
+
y: 6,
|
|
556
|
+
width: `${r}%`,
|
|
557
|
+
height: 6,
|
|
558
|
+
rx: 2,
|
|
559
|
+
className: "x117rol3"
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
case "point": {
|
|
563
|
+
let n = t.position(e.at);
|
|
564
|
+
switch (e.marker) {
|
|
565
|
+
case "filled": return /* @__PURE__ */ g("circle", {
|
|
566
|
+
cx: `${n}%`,
|
|
567
|
+
cy: 9,
|
|
568
|
+
r: 3,
|
|
569
|
+
className: "x117rol3"
|
|
570
|
+
});
|
|
571
|
+
case "hollow": return /* @__PURE__ */ g("circle", {
|
|
572
|
+
cx: `${n}%`,
|
|
573
|
+
cy: 9,
|
|
574
|
+
r: 3.5,
|
|
575
|
+
className: "x1fytgo2 x73je2i xvlca1e"
|
|
576
|
+
});
|
|
577
|
+
case "diamond": return /* @__PURE__ */ g("svg", {
|
|
578
|
+
x: `${n}%`,
|
|
579
|
+
y: 9,
|
|
580
|
+
width: 1,
|
|
581
|
+
height: 1,
|
|
582
|
+
overflow: "visible",
|
|
583
|
+
children: /* @__PURE__ */ g("path", {
|
|
584
|
+
d: `M0 -${L} ${L} 0 0 ${L} -${L} 0Z`,
|
|
585
|
+
className: "x117rol3"
|
|
586
|
+
})
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function Be(e) {
|
|
593
|
+
switch (e.kind) {
|
|
594
|
+
case "interval": return {
|
|
595
|
+
start: e.start,
|
|
596
|
+
duration: e.end - e.start
|
|
597
|
+
};
|
|
598
|
+
case "point": return {
|
|
599
|
+
start: e.at,
|
|
600
|
+
duration: 0
|
|
601
|
+
};
|
|
602
|
+
case "unavailable": return {
|
|
603
|
+
start: NaN,
|
|
604
|
+
duration: NaN
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function H({ geometry: e, start: t, offset: n }) {
|
|
609
|
+
switch (e.kind) {
|
|
610
|
+
case "interval": return `Start ${n(e.start - t)}, end ${n(e.end - t)}, duration ${n(e.end - e.start)}`;
|
|
611
|
+
case "point": return `At ${n(e.at - t)}`;
|
|
612
|
+
case "unavailable": return "Timing unavailable";
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
export { C as i, Ie as n, I as r, ze as t };
|
package/package.json
CHANGED
|
@@ -5,6 +5,12 @@ Mount one `AppShell` around the router outlet. `AppShell` locks the viewport at
|
|
|
5
5
|
show only the active area's pages, and put Settings/account controls in `railFooter`. On a phone use the shell's drawer
|
|
6
6
|
and its navigation callback.
|
|
7
7
|
|
|
8
|
+
Place workspace-wide bottom controls in `AppShell.bottomBar`. The row takes its content's actual height, including the
|
|
9
|
+
bottom safe area. Nested pages fill the remaining space. Bottom toasts clear the row even when its height changes. For
|
|
10
|
+
DevTools, call `useDevToolsBar` once in the signed-in shell with an app-specific local storage key and pass
|
|
11
|
+
`isVisible ? <DevToolsBar /> : null` to the slot. The shortcut is Command–Option–Shift–Backslash. The bar uses the
|
|
12
|
+
toolbar height by default. Set `--mechane-devtools-bar-height` on the shell's ancestor to change its minimum height.
|
|
13
|
+
|
|
8
14
|
Compose `PageSection` directly inside `PageLayout`. Its `summary` and `children` slots supply the standard inset gutter,
|
|
9
15
|
and `breakdown` spans the pane for a `DataTable` or `EventMonth`. The `calendar-workspace` recipe uses the grid as a
|
|
10
16
|
breakdown and shows the selected day's full event names in the inset body of a sibling section. `PageContent` inside an
|