@mechane-ai/elements 0.67.0 → 0.69.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 +226 -225
- package/dist/{article-anMy8fA5.js → article-CTSxWe4y.js} +104 -89
- package/dist/article.js +1 -1
- package/dist/catalog.json +131 -1
- package/dist/{categorical-values-Bh7ZkEQn.js → categorical-values-DwomVcSd.js} +1 -1
- package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/plot.js +16 -15
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content.js +1 -1
- package/dist/{dumbbell-plot-BQDGe0sQ.js → dumbbell-plot-S4RyfxmW.js} +5 -5
- package/dist/{embedding-map-DmmknG7A.js → embedding-map-Bm7aTA6z.js} +5 -5
- package/dist/figure-format-BVb7yFCA.js +46 -0
- package/dist/{figure-frame-DlyNTDzh.js → figure-frame-BHCNceS4.js} +1 -1
- package/dist/{image-grid-CxEAQvTf.js → image-grid-TTrLxvaI.js} +3 -3
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +8 -8
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +1087 -230
- package/dist/kits/training.js +4 -4
- package/dist/lesson.js +3 -3
- package/dist/locate-Dcq5ZZSk.js +14 -0
- package/dist/markdown-JeuBeMDZ.js +293 -0
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/plot/index.d.ts +3 -0
- package/dist/packages/charts/src/plot/locate.d.ts +3 -1
- package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
- package/dist/packages/charts/src/plot/spatial-layer.d.ts +36 -0
- package/dist/packages/charts/src/plot/step-history.d.ts +13 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
- package/dist/packages/content/src/timeline-scrubber.d.ts +3 -1
- package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +14 -0
- package/dist/packages/kits/src/research/motion-clip.d.ts +3 -0
- package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
- package/dist/packages/kits/src/research/motion-figure.d.ts +12 -0
- package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
- package/dist/packages/kits/src/research/motion-inspection.d.ts +14 -0
- package/dist/packages/kits/src/research/motion-location.d.ts +9 -0
- package/dist/packages/kits/src/research/motion-scene.d.ts +29 -0
- package/dist/packages/kits/src/research/motion-types.d.ts +54 -0
- package/dist/packages/kits/src/research/motion-view.d.ts +9 -0
- package/dist/packages/kits/src/research/native-motion-figure.d.ts +17 -0
- package/dist/packages/kits/src/research/native-motion.d.ts +18 -0
- package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
- package/dist/{param-CKr8EYxF.js → param-Dk92C-K1.js} +1 -1
- package/dist/plot-BIYlgY2B.js +223 -0
- package/dist/{plot-layout-CVzSbcU7.js → plot-layout-CNNFMC8H.js} +152 -102
- package/dist/{plot-surface-CBhI1alw.js → plot-surface-BSjoNIva.js} +1 -1
- package/dist/{reference-lines-C970JwWZ.js → reference-lines-Bet_hRyA.js} +1 -1
- package/dist/{scene-C3dCxckI.js → scene-C88Xkz4l.js} +7 -7
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DekEJxsy.js → slope-chart-B6Mtcta2.js} +6 -6
- package/dist/{src-BsqbWDxS.js → src-DCozYUGI.js} +146 -131
- package/dist/styles2.css +16 -4
- package/dist/{time-series-BSNnijxf.js → time-series-DJk-2Mt0.js} +7 -7
- package/dist/{timeline-CnxfYSIg.js → timeline-BHpj7i7K.js} +4 -4
- package/dist/{token-heatmap-CJaXo56P.js → token-heatmap-DEqEaoGE.js} +273 -288
- package/dist/{token-predictions-Bi7aKPnh.js → token-predictions-Bjdh0K-A.js} +5 -5
- package/dist/{transport-CXj0DV6o.js → transport-DQ1yzsQl.js} +2 -2
- package/dist/{tree-diagram-BxOZsjr1.js → tree-diagram-BxSDOBFj.js} +4 -4
- package/dist/{treemap-B2yOAetT.js → treemap-DzHAp4ia.js} +5 -5
- package/dist/{use-tween-C1TWJwce.js → use-tween-DbXVZBR8.js} +1 -1
- package/dist/{violin-plot-W2L_2JRo.js → violin-plot-B4Cf38Y9.js} +5 -5
- package/dist/visible-motion-D6NwjGNz.js +24 -0
- package/dist/{waterfall-Bt73N2Ng.js → waterfall-C9_pHZzv.js} +4 -4
- package/package.json +1 -1
- package/recipes/recorded-motion.tsx +14 -0
- package/skills/review-elements/SKILL.md +6 -0
- package/skills/review-explainer/SKILL.md +4 -0
- package/skills/use-elements/SKILL.md +2 -0
- package/skills/use-elements/references/kits.md +33 -0
- package/skills/write-explainer/SKILL.md +5 -0
- package/dist/figure-format-B8kRZMlo.js +0 -36
- package/dist/locate-Bcg3QcP4.js +0 -11
- package/dist/markdown-Diffqqm7.js +0 -313
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as e, u as t } from "./src-Bkov5TTa.js";
|
|
2
2
|
import { d as n } from "./src-CIyuaSCi.js";
|
|
3
3
|
import { n as r, t as i } from "./chart-tones-ei3BC2AL.js";
|
|
4
|
-
import { a, i as o, n as s, r as c } from "./figure-format-
|
|
4
|
+
import { a, i as o, n as s, r as c } from "./figure-format-BVb7yFCA.js";
|
|
5
5
|
import { r as l, t as u } from "./scale-C2xgZyZN.js";
|
|
6
6
|
import * as d from "@stylexjs/stylex";
|
|
7
7
|
import { createParts as f, mergeProps as p } from "@ui-sdk/react/primitive";
|
|
@@ -14,24 +14,24 @@ function re(e) {
|
|
|
14
14
|
return new Set(e.map((e) => e.id)).size === e.length;
|
|
15
15
|
}
|
|
16
16
|
// packages/charts/src/chart.tsx
|
|
17
|
-
var ie = 10,
|
|
17
|
+
var ie = 10, ae = "[data-slot=\"chart-mark\"]", oe = /* @__PURE__ */ new Set(["Enter", " "]), se = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp"]), ce = {
|
|
18
18
|
ArrowLeft: [-1, 0],
|
|
19
19
|
ArrowRight: [1, 0],
|
|
20
20
|
ArrowUp: [0, -1],
|
|
21
21
|
ArrowDown: [0, 1]
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function O(e, t) {
|
|
24
24
|
return t !== null && e.some((e) => e.id === t);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let t = [e.cursor, e.selected].find((t) =>
|
|
26
|
+
function k(e) {
|
|
27
|
+
let t = [e.cursor, e.selected].find((t) => O(e.items, t)) ?? e.items[0]?.id ?? null;
|
|
28
28
|
return {
|
|
29
|
-
inspected:
|
|
30
|
-
selected:
|
|
29
|
+
inspected: O(e.items, e.inspected) ? e.inspected : null,
|
|
30
|
+
selected: O(e.items, e.selected) ? e.selected : null,
|
|
31
31
|
cursor: t
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function le({ key: e, index: t, last: n, columns: r, isReversed: i }) {
|
|
35
35
|
let a = t - t % r, o = Math.min(n, a + r - 1), s = Math.max(a, t - 1), c = Math.min(o, t + 1);
|
|
36
36
|
return {
|
|
37
37
|
Home: a,
|
|
@@ -42,15 +42,15 @@ function ce({ key: e, index: t, last: n, columns: r, isReversed: i }) {
|
|
|
42
42
|
ArrowDown: t + r > n ? t : t + r
|
|
43
43
|
}[e];
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
if (r === "both" &&
|
|
45
|
+
function ue({ event: e, index: t, last: n, arrows: r, isReversed: i }) {
|
|
46
|
+
if (r === "both" && se.has(e.key)) return Math.max(0, Math.min(n, t + (e.key === "ArrowDown" ? 1 : -1)));
|
|
47
47
|
let a = ne(e, {
|
|
48
48
|
arrows: "horizontal",
|
|
49
49
|
dir: i ? "rtl" : "ltr"
|
|
50
50
|
});
|
|
51
51
|
if (a !== null) return a.bound === void 0 ? Math.max(0, Math.min(n, t + a.direction * (a.size === "large" ? ie : 1))) : a.bound === "min" ? 0 : n;
|
|
52
52
|
}
|
|
53
|
-
var
|
|
53
|
+
var A = b({
|
|
54
54
|
name: "chart",
|
|
55
55
|
options: {
|
|
56
56
|
items: "value",
|
|
@@ -83,7 +83,7 @@ var j = b({
|
|
|
83
83
|
api: (e) => {
|
|
84
84
|
let { store: t } = e, n = ee(e), r = !1, i = e.options().revision;
|
|
85
85
|
e.onOptions((e) => {
|
|
86
|
-
let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !
|
|
86
|
+
let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !O(e.items, n);
|
|
87
87
|
i = e.revision, r && n !== null && e.inspected === void 0 && t.set({ inspected: null });
|
|
88
88
|
});
|
|
89
89
|
function a(t) {
|
|
@@ -91,7 +91,7 @@ var j = b({
|
|
|
91
91
|
return r?.(t) ?? n.find((e) => e.id === t)?.label ?? t;
|
|
92
92
|
}
|
|
93
93
|
function o(i, o) {
|
|
94
|
-
if (i !== null && !
|
|
94
|
+
if (i !== null && !O(e.options().items, i) || (r = !1, i !== null && o.reason !== "item-hover" && t.set({ cursor: i }), t.get().inspected === i)) return !1;
|
|
95
95
|
let { reason: s, event: c } = o, l = n("inspected", i, c === void 0 ? { reason: s } : {
|
|
96
96
|
reason: s,
|
|
97
97
|
event: c
|
|
@@ -99,13 +99,13 @@ var j = b({
|
|
|
99
99
|
return l && i !== null && o.reason === "list-navigation" && v(i === t.get().selected ? `${a(i)}. Selected.` : a(i)), l;
|
|
100
100
|
}
|
|
101
101
|
function s(t, n) {
|
|
102
|
-
return
|
|
102
|
+
return O(e.options().items, t) ? !x(e, "onSelect", t, n === void 0 ? { reason: "item-press" } : {
|
|
103
103
|
reason: "item-press",
|
|
104
104
|
event: n
|
|
105
105
|
}) : !1;
|
|
106
106
|
}
|
|
107
107
|
function c(n, r) {
|
|
108
|
-
let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } =
|
|
108
|
+
let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } = k(t.get()), l = Math.max(0, i.findIndex((e) => e.id === c)), u = i.length - 1, d = ce[n.key];
|
|
109
109
|
if (s !== void 0 && d !== void 0) {
|
|
110
110
|
let e = c === null ? void 0 : s(c);
|
|
111
111
|
if (c === null || e === void 0) return i[l]?.id;
|
|
@@ -118,13 +118,13 @@ var j = b({
|
|
|
118
118
|
});
|
|
119
119
|
return w(e, t, d) ?? c;
|
|
120
120
|
}
|
|
121
|
-
let f = C(r), p = a === void 0 || a < 1 ?
|
|
121
|
+
let f = C(r), p = a === void 0 || a < 1 ? ue({
|
|
122
122
|
event: n,
|
|
123
123
|
index: l,
|
|
124
124
|
last: u,
|
|
125
125
|
arrows: o,
|
|
126
126
|
isReversed: f
|
|
127
|
-
}) :
|
|
127
|
+
}) : le({
|
|
128
128
|
key: n.key,
|
|
129
129
|
index: l,
|
|
130
130
|
last: u,
|
|
@@ -150,8 +150,8 @@ var j = b({
|
|
|
150
150
|
keydown(n, r) {
|
|
151
151
|
let i = n.altKey || n.ctrlKey || n.metaKey;
|
|
152
152
|
if (n.defaultPrevented || i || e.options().items.length === 0) return;
|
|
153
|
-
if (
|
|
154
|
-
let { cursor: r } =
|
|
153
|
+
if (oe.has(n.key)) {
|
|
154
|
+
let { cursor: r } = k(t.get());
|
|
155
155
|
!(n.target instanceof Element && n.target.closest("button, a, input, select, textarea") !== null) && r !== null && e.options().onSelect !== void 0 && (n.preventDefault(), s(r, n));
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ var j = b({
|
|
|
162
162
|
}));
|
|
163
163
|
},
|
|
164
164
|
focus(e, n) {
|
|
165
|
-
e.target === n && S() && o(
|
|
165
|
+
e.target === n && S() && o(k(t.get()).cursor, {
|
|
166
166
|
reason: "focus-in",
|
|
167
167
|
event: e
|
|
168
168
|
});
|
|
@@ -174,7 +174,7 @@ var j = b({
|
|
|
174
174
|
width: a.width,
|
|
175
175
|
height: a.height
|
|
176
176
|
});
|
|
177
|
-
s === void 0 ? i === "item-
|
|
177
|
+
s === void 0 ? (r || i === "item-press") && (o(null, {
|
|
178
178
|
reason: i,
|
|
179
179
|
event: t
|
|
180
180
|
}), r = !1) : (o(s, {
|
|
@@ -202,18 +202,18 @@ var j = b({
|
|
|
202
202
|
});
|
|
203
203
|
},
|
|
204
204
|
press(n) {
|
|
205
|
-
let { inspected: r } =
|
|
206
|
-
n?.target instanceof Element && n.target.closest(
|
|
205
|
+
let { inspected: r } = k(t.get());
|
|
206
|
+
n?.target instanceof Element && n.target.closest(ae) !== null || e.options().locate !== void 0 && r !== null && e.options().onSelect !== void 0 && s(r, n);
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
},
|
|
210
210
|
slots: (e) => ({
|
|
211
|
-
root: e({ state:
|
|
211
|
+
root: e({ state: k }),
|
|
212
212
|
plot: e({
|
|
213
|
-
state:
|
|
213
|
+
state: k,
|
|
214
214
|
attrs: (e) => ({
|
|
215
215
|
tabindex: e.items.length > 0 ? "0" : void 0,
|
|
216
|
-
"data-inspecting":
|
|
216
|
+
"data-inspecting": k(e).inspected === null ? void 0 : ""
|
|
217
217
|
}),
|
|
218
218
|
press: ({ api: e }, t) => e.press(t),
|
|
219
219
|
on: {
|
|
@@ -236,7 +236,7 @@ var j = b({
|
|
|
236
236
|
e.pointerType === "mouse" && t.leave(e);
|
|
237
237
|
},
|
|
238
238
|
mousedown: (e, { el: t }) => {
|
|
239
|
-
t !== void 0 && e.target instanceof Element && e.target.closest(
|
|
239
|
+
t !== void 0 && e.target instanceof Element && e.target.closest(ae) !== null && (e.preventDefault(), t.focus({ preventScroll: !0 }));
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
bind: (e, t) => {
|
|
@@ -285,14 +285,14 @@ var j = b({
|
|
|
285
285
|
items: (e) => e.items(),
|
|
286
286
|
closed: !0
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
288
|
+
}), de = f(A, { root: "figure" }).Root, j = f(A, {
|
|
289
289
|
root: "figure",
|
|
290
290
|
plot: "div",
|
|
291
291
|
mark: "span"
|
|
292
|
-
}), fe =
|
|
292
|
+
}), fe = j.Plot, pe = f(A, {
|
|
293
293
|
root: "figure",
|
|
294
294
|
plot: "p"
|
|
295
|
-
}).Plot, me =
|
|
295
|
+
}).Plot, me = j.Mark;
|
|
296
296
|
function he(e, t) {
|
|
297
297
|
return e.find((e) => e.id === t)?.label ?? "\xA0";
|
|
298
298
|
}
|
|
@@ -608,24 +608,45 @@ var B = 1e3, V = {
|
|
|
608
608
|
function Be({ domain: e, count: t, zoneOffset: n }) {
|
|
609
609
|
let [r, i] = e;
|
|
610
610
|
if (!(t > 0) || !(i > r)) return [];
|
|
611
|
-
let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s =
|
|
612
|
-
|
|
611
|
+
let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = typeof n == "number" ? () => n : n, c = o > ze ? Math.ceil((r + s(r)) / Re) * Re : 0;
|
|
612
|
+
function* l() {
|
|
613
|
+
let e = Math.ceil(r);
|
|
614
|
+
for (; e <= i;) {
|
|
615
|
+
let t = s(e), n = e + t - c, r = c + Math.ceil(n / o) * o - t;
|
|
616
|
+
r === e && (yield e);
|
|
617
|
+
let a = r === e ? e + o : r, l = Math.min(a, Math.floor(i));
|
|
618
|
+
e = s(l) === t ? a : Ve(e, l, s);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
let u = l();
|
|
622
|
+
return Array.from({ length: ke }, () => {
|
|
623
|
+
let e = u.next();
|
|
624
|
+
return e.done === !0 ? void 0 : e.value;
|
|
625
|
+
}).filter((e) => e !== void 0);
|
|
626
|
+
}
|
|
627
|
+
function Ve(e, t, n) {
|
|
628
|
+
let r = n(e), i = e, a = t;
|
|
629
|
+
for (; a - i > 1;) {
|
|
630
|
+
let e = i + Math.floor((a - i) / L);
|
|
631
|
+
n(e) === r ? i = e : a = e;
|
|
632
|
+
}
|
|
633
|
+
return a;
|
|
613
634
|
}
|
|
614
635
|
// packages/charts/src/plot/plot-layout.ts
|
|
615
|
-
var
|
|
636
|
+
var He = {
|
|
616
637
|
compact: 160,
|
|
617
638
|
regular: 260,
|
|
618
639
|
tall: 380
|
|
619
|
-
}, H = 7,
|
|
640
|
+
}, H = 7, Ue = 12, We = 44, Ge = 20, Ke = 28, qe = 24, Je = 12, Ye = 20, U = .4, Xe = .5, Ze = 2, Qe = 3, $e = 120, et = 6, tt = .4, nt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, rt = 3, it = .2, at = 16, ot = 14, st = "\n", ct = {
|
|
620
641
|
linear: void 0,
|
|
621
642
|
log: "log scale",
|
|
622
643
|
symlog: "symmetric log scale"
|
|
623
644
|
};
|
|
624
|
-
function
|
|
625
|
-
let t =
|
|
645
|
+
function lt(e) {
|
|
646
|
+
let t = ct[e.scale ?? "linear"];
|
|
626
647
|
return t === void 0 ? e.label : `${e.label} (${t})`;
|
|
627
648
|
}
|
|
628
|
-
function
|
|
649
|
+
function ut({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
|
|
629
650
|
let r = e.flatMap((e) => e !== null && Number.isFinite(e) ? [e] : []), i = t && n !== "log" ? [...r, 0] : r;
|
|
630
651
|
if (i.length === 0) return n === "log" ? [1, W] : [0, 1];
|
|
631
652
|
let a = Math.min(...i), o = Math.max(...i);
|
|
@@ -635,16 +656,16 @@ function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
|
|
|
635
656
|
}
|
|
636
657
|
if (a === o) return [a - 1, o + 1];
|
|
637
658
|
if (n === "symlog") return [a, o];
|
|
638
|
-
let [s, c] = R([a, o],
|
|
659
|
+
let [s, c] = R([a, o], rt), l = s === void 0 || c === void 0 ? o - a : c - s;
|
|
639
660
|
return [Math.floor(a / l) * l, Math.ceil(o / l) * l];
|
|
640
661
|
}
|
|
641
662
|
function q({ width: e, valueLabels: t, hasXTitle: n, hasYTitle: r, leftShare: i = U }) {
|
|
642
|
-
let a = Math.max(0, ...t.map((e) => e.length)) * H +
|
|
663
|
+
let a = Math.max(0, ...t.map((e) => e.length)) * H + Ue + (r ? Ke : 0);
|
|
643
664
|
return {
|
|
644
|
-
top:
|
|
645
|
-
right:
|
|
646
|
-
bottom:
|
|
647
|
-
left: Math.min(Math.max(
|
|
665
|
+
top: Je,
|
|
666
|
+
right: Ye,
|
|
667
|
+
bottom: qe + (n ? Ge : 0),
|
|
668
|
+
left: Math.min(Math.max(We, a), e * i)
|
|
648
669
|
};
|
|
649
670
|
}
|
|
650
671
|
function J({ width: e, height: t, margins: n }) {
|
|
@@ -660,10 +681,10 @@ function J({ width: e, height: t, margins: n }) {
|
|
|
660
681
|
innerHeight: i - n.top
|
|
661
682
|
};
|
|
662
683
|
}
|
|
663
|
-
function
|
|
684
|
+
function dt(e) {
|
|
664
685
|
return new Set(e).size === e.length;
|
|
665
686
|
}
|
|
666
|
-
function
|
|
687
|
+
function ft(e, t) {
|
|
667
688
|
return {
|
|
668
689
|
...e,
|
|
669
690
|
minimumSignificantDigits: void 0,
|
|
@@ -672,7 +693,7 @@ function Y(e, t) {
|
|
|
672
693
|
maximumFractionDigits: Math.max(e.maximumFractionDigits ?? 0, t)
|
|
673
694
|
};
|
|
674
695
|
}
|
|
675
|
-
function
|
|
696
|
+
function pt(e, t) {
|
|
676
697
|
return !t || typeof e == "function" || e.style !== "unit" ? e : {
|
|
677
698
|
...e,
|
|
678
699
|
style: "decimal",
|
|
@@ -680,36 +701,36 @@ function dt(e, t) {
|
|
|
680
701
|
unitDisplay: void 0
|
|
681
702
|
};
|
|
682
703
|
}
|
|
683
|
-
function
|
|
684
|
-
let i =
|
|
704
|
+
function Y({ values: e, axis: t, locale: n, hasTitle: r }) {
|
|
705
|
+
let i = pt(t.tickFormat ?? o(t.format), r), a = pt(t.format, r), s = (typeof i == "function" ? [i] : [
|
|
685
706
|
i,
|
|
686
|
-
...
|
|
687
|
-
...typeof a == "function" ? [] :
|
|
707
|
+
...nt.map((e) => ft(i, e)),
|
|
708
|
+
...typeof a == "function" ? [] : nt.map((e) => ft(a, e))
|
|
688
709
|
]).map((t) => e.map((e) => c({
|
|
689
710
|
value: e,
|
|
690
711
|
locale: n,
|
|
691
712
|
format: t
|
|
692
713
|
})));
|
|
693
|
-
return s.find(
|
|
714
|
+
return s.find(dt) ?? s.at(-1) ?? [];
|
|
694
715
|
}
|
|
695
|
-
function
|
|
696
|
-
return e >
|
|
716
|
+
function X(e) {
|
|
717
|
+
return e > $e ? Qe : Ze;
|
|
697
718
|
}
|
|
698
|
-
function
|
|
719
|
+
function mt(e) {
|
|
699
720
|
let t = e.tickFormat ?? e.format;
|
|
700
721
|
return typeof t == "function" || e.scale === "log" ? !1 : t.maximumFractionDigits === 0 && t.style !== "percent";
|
|
701
722
|
}
|
|
702
|
-
function
|
|
703
|
-
let o =
|
|
723
|
+
function Z({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
|
|
724
|
+
let o = X(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: et }, (n, r) => Le({
|
|
704
725
|
domain: t,
|
|
705
726
|
type: e.scale,
|
|
706
727
|
count: s + r
|
|
707
|
-
})).filter((e, t) => t === 0 || e.length * r *
|
|
708
|
-
if (
|
|
709
|
-
let t = f.filter((e) => Number.isInteger(e)), n = t.length >=
|
|
728
|
+
})).filter((e, t) => t === 0 || e.length * r * tt <= n), l = c.filter((e) => e.length >= o), u = l.find((e) => e[0] === t[0] && e.at(-1) === t[1]), d = l[0] ?? c[0] ?? [], f = u ?? d;
|
|
729
|
+
if (mt(e)) {
|
|
730
|
+
let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Ze ? t : f;
|
|
710
731
|
return {
|
|
711
732
|
values: n,
|
|
712
|
-
labels:
|
|
733
|
+
labels: Y({
|
|
713
734
|
values: n,
|
|
714
735
|
axis: e,
|
|
715
736
|
locale: i,
|
|
@@ -719,7 +740,7 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
|
|
|
719
740
|
}
|
|
720
741
|
return {
|
|
721
742
|
values: f,
|
|
722
|
-
labels:
|
|
743
|
+
labels: Y({
|
|
723
744
|
values: f,
|
|
724
745
|
axis: e,
|
|
725
746
|
locale: i,
|
|
@@ -727,24 +748,24 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
|
|
|
727
748
|
})
|
|
728
749
|
};
|
|
729
750
|
}
|
|
730
|
-
function
|
|
751
|
+
function Q(e, t) {
|
|
731
752
|
return t.values.map((n, r) => ({
|
|
732
753
|
key: String(n),
|
|
733
754
|
position: e.position(n),
|
|
734
755
|
label: t.labels[r] ?? ""
|
|
735
756
|
}));
|
|
736
757
|
}
|
|
737
|
-
function
|
|
758
|
+
function ht(e) {
|
|
738
759
|
let t = e.split(" ");
|
|
739
760
|
return t.slice(1).map((e, n) => {
|
|
740
761
|
let r = t.slice(0, n + 1).join(" "), i = t.slice(n + 1).join(" ");
|
|
741
762
|
return {
|
|
742
|
-
text: `${r}${
|
|
763
|
+
text: `${r}${st}${i}`,
|
|
743
764
|
longest: Math.max(r.length, i.length)
|
|
744
765
|
};
|
|
745
766
|
}).toSorted((e, t) => e.longest - t.longest)[0]?.text ?? e;
|
|
746
767
|
}
|
|
747
|
-
function
|
|
768
|
+
function gt(e, t) {
|
|
748
769
|
return t.flatMap((t) => {
|
|
749
770
|
let n = e.center(t.id);
|
|
750
771
|
return n === void 0 ? [] : [{
|
|
@@ -754,8 +775,8 @@ function mt(e, t) {
|
|
|
754
775
|
}];
|
|
755
776
|
});
|
|
756
777
|
}
|
|
757
|
-
function
|
|
758
|
-
let c =
|
|
778
|
+
function _t({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
|
|
779
|
+
let c = Z({
|
|
759
780
|
axis: r,
|
|
760
781
|
domain: a,
|
|
761
782
|
length: t,
|
|
@@ -774,7 +795,7 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
|
|
|
774
795
|
...u,
|
|
775
796
|
right: u.right + s
|
|
776
797
|
}
|
|
777
|
-
}), f =
|
|
798
|
+
}), f = Z({
|
|
778
799
|
axis: n,
|
|
779
800
|
domain: i,
|
|
780
801
|
length: d.innerWidth,
|
|
@@ -794,12 +815,12 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
|
|
|
794
815
|
box: d,
|
|
795
816
|
x: p,
|
|
796
817
|
y: m,
|
|
797
|
-
xTicks:
|
|
798
|
-
yTicks:
|
|
818
|
+
xTicks: Q(p, f),
|
|
819
|
+
yTicks: Q(m, c)
|
|
799
820
|
};
|
|
800
821
|
}
|
|
801
|
-
function
|
|
802
|
-
let p = r.map((e) => e.id), m = n === "columns", h =
|
|
822
|
+
function vt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = it, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
|
|
823
|
+
let p = r.map((e) => e.id), m = n === "columns", h = Z({
|
|
803
824
|
axis: i,
|
|
804
825
|
domain: a,
|
|
805
826
|
length: m ? t : e,
|
|
@@ -811,7 +832,7 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
|
|
|
811
832
|
valueLabels: m ? h.labels : r.map((e) => e.label),
|
|
812
833
|
hasXTitle: !m && f,
|
|
813
834
|
hasYTitle: m && f,
|
|
814
|
-
leftShare: m ? U :
|
|
835
|
+
leftShare: m ? U : Xe
|
|
815
836
|
}), _ = {
|
|
816
837
|
...g,
|
|
817
838
|
top: g.top + c,
|
|
@@ -824,15 +845,15 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
|
|
|
824
845
|
ids: p,
|
|
825
846
|
range: [v.left, v.right],
|
|
826
847
|
padding: s
|
|
827
|
-
}).step -
|
|
848
|
+
}).step - at, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
|
|
828
849
|
...e,
|
|
829
|
-
label:
|
|
830
|
-
})), x = m && ee && b.every((e) => e.label.split(
|
|
850
|
+
label: ht(e.label)
|
|
851
|
+
})), x = m && ee && b.every((e) => e.label.split(st).every((e) => e.length * H <= y)), S = x ? J({
|
|
831
852
|
width: e,
|
|
832
853
|
height: t,
|
|
833
854
|
margins: {
|
|
834
855
|
..._,
|
|
835
|
-
bottom: _.bottom +
|
|
856
|
+
bottom: _.bottom + ot
|
|
836
857
|
}
|
|
837
858
|
}) : v, C = u({
|
|
838
859
|
ids: p,
|
|
@@ -847,14 +868,14 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
|
|
|
847
868
|
box: S,
|
|
848
869
|
band: C,
|
|
849
870
|
value: w,
|
|
850
|
-
bandTicks:
|
|
851
|
-
valueTicks:
|
|
871
|
+
bandTicks: gt(C, x ? b : r),
|
|
872
|
+
valueTicks: Q(w, h)
|
|
852
873
|
};
|
|
853
874
|
}
|
|
854
|
-
function
|
|
875
|
+
function yt({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
|
|
855
876
|
return q({
|
|
856
877
|
width: Infinity,
|
|
857
|
-
valueLabels: t.flatMap(({ axis: t, domain: i }) =>
|
|
878
|
+
valueLabels: t.flatMap(({ axis: t, domain: i }) => Z({
|
|
858
879
|
axis: t,
|
|
859
880
|
domain: i,
|
|
860
881
|
length: e,
|
|
@@ -866,8 +887,8 @@ function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
|
|
|
866
887
|
hasYTitle: r
|
|
867
888
|
}).left;
|
|
868
889
|
}
|
|
869
|
-
function
|
|
870
|
-
let d =
|
|
890
|
+
function bt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
|
|
891
|
+
let d = Z({
|
|
871
892
|
axis: n,
|
|
872
893
|
domain: r,
|
|
873
894
|
length: t,
|
|
@@ -899,16 +920,16 @@ function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, time
|
|
|
899
920
|
box: m,
|
|
900
921
|
x: h,
|
|
901
922
|
y: g,
|
|
902
|
-
xTicks:
|
|
923
|
+
xTicks: Q(h, $({
|
|
903
924
|
domain: i,
|
|
904
925
|
length: m.innerWidth,
|
|
905
926
|
timeFormat: a,
|
|
906
927
|
locale: o
|
|
907
928
|
})),
|
|
908
|
-
yTicks:
|
|
929
|
+
yTicks: Q(g, d)
|
|
909
930
|
};
|
|
910
931
|
}
|
|
911
|
-
var
|
|
932
|
+
var xt = [
|
|
912
933
|
{
|
|
913
934
|
month: "short",
|
|
914
935
|
day: "numeric"
|
|
@@ -923,24 +944,53 @@ var yt = [
|
|
|
923
944
|
month: "short",
|
|
924
945
|
day: "numeric",
|
|
925
946
|
second: "2-digit"
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
year: "numeric",
|
|
950
|
+
month: "short",
|
|
951
|
+
day: "numeric",
|
|
952
|
+
second: "2-digit",
|
|
953
|
+
timeZoneName: "shortOffset"
|
|
926
954
|
}
|
|
927
955
|
];
|
|
928
|
-
function
|
|
929
|
-
let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : a(e
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
956
|
+
function $({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
|
|
957
|
+
let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : (e) => a(e, o), l = X(t), u = Math.max(l, Math.round(t / G));
|
|
958
|
+
function d(t) {
|
|
959
|
+
return Be({
|
|
960
|
+
domain: e,
|
|
961
|
+
count: t,
|
|
962
|
+
zoneOffset: c
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
function f() {
|
|
966
|
+
let e = d(u);
|
|
967
|
+
if (e.length >= l) return e;
|
|
968
|
+
let t = Array.from({ length: 5 }, (e, t) => u + t + 1);
|
|
969
|
+
for (let e of t) {
|
|
970
|
+
let t = d(e);
|
|
971
|
+
if (t.length >= l) return t;
|
|
972
|
+
}
|
|
973
|
+
return e;
|
|
974
|
+
}
|
|
975
|
+
let p = f();
|
|
976
|
+
function m(e) {
|
|
977
|
+
return p.map((t) => s({
|
|
978
|
+
timestamp: t,
|
|
979
|
+
locale: r,
|
|
980
|
+
format: e
|
|
981
|
+
}));
|
|
982
|
+
}
|
|
983
|
+
let h = m(n);
|
|
984
|
+
if (typeof n != "function" && n.dateStyle === void 0 && n.timeStyle === void 0) for (let e of xt) {
|
|
985
|
+
if (dt(h)) break;
|
|
986
|
+
h = m({
|
|
987
|
+
...e,
|
|
988
|
+
...n
|
|
989
|
+
});
|
|
990
|
+
}
|
|
941
991
|
return {
|
|
942
|
-
values:
|
|
943
|
-
labels:
|
|
992
|
+
values: p,
|
|
993
|
+
labels: h
|
|
944
994
|
};
|
|
945
995
|
}
|
|
946
|
-
export { he as A, Ce as C, me as D,
|
|
996
|
+
export { he as A, Ce as C, me as D, de as E, re as M, fe as O, De as S, P as T, Le as _, ut as a, Te as b, He as c, X as d, $ as f, z as g, R as h, vt as i, ge as j, pe as k, q as l, yt as m, lt as n, _t as o, bt as p, gt as r, J as s, Z as t, Y as u, Ie as v, we as w, Ee as x, Be as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e, t } from "./plot-width-D3hTycYX.js";
|
|
2
|
-
import { O as n, c as r } from "./plot-layout-
|
|
2
|
+
import { O as n, c as r } from "./plot-layout-CNNFMC8H.js";
|
|
3
3
|
import * as i from "@stylexjs/stylex";
|
|
4
4
|
import { useId as a } from "react";
|
|
5
5
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as e } from "./plot-layout-
|
|
1
|
+
import { M as e } from "./plot-layout-CNNFMC8H.js";
|
|
2
2
|
import { t } from "./label-spacing-BncjePGb.js";
|
|
3
3
|
import { n, t as r } from "./label-place-Z0fryBZb.js";
|
|
4
4
|
import { c as i, f as a } from "./plot-marks-DgCtcd3L.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { i as e } from "./chart-link-AE_xuxiP.js";
|
|
2
|
-
import { A as t, D as n, E as r, O as i, S as a, c as o, j as s, l as c, s as l, t as u, u as d } from "./plot-layout-
|
|
3
|
-
import { i as f, l as p, n as m, r as h, t as g } from "./figure-frame-
|
|
4
|
-
import { r as _, t as v } from "./plot-surface-
|
|
2
|
+
import { A as t, D as n, E as r, O as i, S as a, c as o, j as s, l as c, s as l, t as u, u as d } from "./plot-layout-CNNFMC8H.js";
|
|
3
|
+
import { i as f, l as p, n as m, r as h, t as g } from "./figure-frame-BHCNceS4.js";
|
|
4
|
+
import { r as _, t as v } from "./plot-surface-BSjoNIva.js";
|
|
5
5
|
import { a as y, i as b, r as x } from "./tone-scope-DKiSw-JR.js";
|
|
6
|
-
import { _ as S, a as C, g as w, o as T, t as E, u as D } from "./param-
|
|
6
|
+
import { _ as S, a as C, g as w, o as T, t as E, u as D } from "./param-Dk92C-K1.js";
|
|
7
7
|
import { n as O, t as k } from "./clock-DSm5lkNE.js";
|
|
8
8
|
import { o as A, r as j } from "./scale-C2xgZyZN.js";
|
|
9
|
-
import { t as M } from "./use-tween-
|
|
9
|
+
import { t as M } from "./use-tween-DbXVZBR8.js";
|
|
10
10
|
import { t as N } from "./chart-tones-ei3BC2AL.js";
|
|
11
11
|
import { r as P } from "./tokens.stylex-dF5CACEJ.js";
|
|
12
|
-
import { r as F } from "./figure-format-
|
|
12
|
+
import { r as F } from "./figure-format-BVb7yFCA.js";
|
|
13
13
|
import { n as I } from "./plot-width-D3hTycYX.js";
|
|
14
14
|
import { n as L, t as R } from "./label-place-Z0fryBZb.js";
|
|
15
15
|
import { a as z, c as ee, f as te, n as B, t as V, u as ne } from "./plot-marks-DgCtcd3L.js";
|
|
16
16
|
import { i as re, r as ie, t as ae } from "./path-BglsXpnO.js";
|
|
17
17
|
import { t as oe } from "./plot-axes-D5S9BnBa.js";
|
|
18
18
|
import { t as se } from "./heatmap-scale-Zte6Ya-g.js";
|
|
19
|
-
import { d as ce, f as le } from "./token-predictions-
|
|
19
|
+
import { d as ce, f as le } from "./token-predictions-Bjdh0K-A.js";
|
|
20
20
|
import * as H from "@stylexjs/stylex";
|
|
21
21
|
import { Children as ue, createContext as de, memo as fe, use as pe, useEffect as me, useId as he, useLayoutEffect as U, useMemo as ge, useRef as _e, useState as W, useSyncExternalStore as ve } from "react";
|
|
22
22
|
import { bindDrag as ye, dragThreshold as be } from "@ui-sdk/core";
|
package/dist/scene.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as LessonFlow, t as MorphScope, tt as Scene, H as SceneAxes, q as SceneBracket, G as SceneCallout, C as SceneCard, g as SceneCells, L as SceneCurve, U as SceneCustom, i as SceneFlow, J as SceneGroup, W as SceneHighlight, $ as SceneLayer, X as SceneNode, et as SceneOutside, I as ScenePoint, F as SceneProjection, P as SceneRegion, N as SceneRule, b as SceneSlot, x as SceneStack, u as SceneToken, l as SceneTokens, M as SceneVector, Y as SceneWire, w as cardRanks, T as cardSuits, v as cellGap, R as curveResolutions, nt as edgePoint, mt as fillLabel, a as flowNodeSize, s as flowPlan, c as flowPositions, n as morphLabels, rt as nodeBox, it as padRect, V as planeLabels, z as planeLimits, B as planeThicknesses, at as rectCenter, ot as rectsOverlap, E as sceneCardLabels, O as sceneCardSizes, y as sceneCellSizes, _ as sceneCellsLabels, st as sceneCircleSizes, Z as sceneContextColor, o as sceneFlowLabels, ht as sceneLabels, gt as sceneLimits, ct as sceneNodeSizes, Q as sceneOutlines, S as sceneStackLabels, _t as sceneStaggers, vt as sceneStore, d as sceneTokenLabels, lt as sidePoint, k as stackBounds, A as stackGaps, j as stackPlace, D as suitTones, p as tokenBox, m as tokenFlow, h as tokenGaps, f as tokenPercent, ut as unionRect, K as useObstacle, dt as useSceneContext, ft as useSceneFrames, pt as useSceneObject } from "./scene-
|
|
1
|
+
export { r as LessonFlow, t as MorphScope, tt as Scene, H as SceneAxes, q as SceneBracket, G as SceneCallout, C as SceneCard, g as SceneCells, L as SceneCurve, U as SceneCustom, i as SceneFlow, J as SceneGroup, W as SceneHighlight, $ as SceneLayer, X as SceneNode, et as SceneOutside, I as ScenePoint, F as SceneProjection, P as SceneRegion, N as SceneRule, b as SceneSlot, x as SceneStack, u as SceneToken, l as SceneTokens, M as SceneVector, Y as SceneWire, w as cardRanks, T as cardSuits, v as cellGap, R as curveResolutions, nt as edgePoint, mt as fillLabel, a as flowNodeSize, s as flowPlan, c as flowPositions, n as morphLabels, rt as nodeBox, it as padRect, V as planeLabels, z as planeLimits, B as planeThicknesses, at as rectCenter, ot as rectsOverlap, E as sceneCardLabels, O as sceneCardSizes, y as sceneCellSizes, _ as sceneCellsLabels, st as sceneCircleSizes, Z as sceneContextColor, o as sceneFlowLabels, ht as sceneLabels, gt as sceneLimits, ct as sceneNodeSizes, Q as sceneOutlines, S as sceneStackLabels, _t as sceneStaggers, vt as sceneStore, d as sceneTokenLabels, lt as sidePoint, k as stackBounds, A as stackGaps, j as stackPlace, D as suitTones, p as tokenBox, m as tokenFlow, h as tokenGaps, f as tokenPercent, ut as unionRect, K as useObstacle, dt as useSceneContext, ft as useSceneFrames, pt as useSceneObject } from "./scene-C88Xkz4l.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { t as e } from "./accessibility-P89UG9-r.js";
|
|
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-
|
|
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-CNNFMC8H.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
|
-
import { r as h, t as g } from "./figure-format-
|
|
5
|
+
import { r as h, t as g } from "./figure-format-BVb7yFCA.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 C, o as w, r as te, t as T } from "./figure-frame-
|
|
8
|
+
import { c as x, i as ee, l as S, n as C, o as w, r as te, t as T } from "./figure-frame-BHCNceS4.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-DgCtcd3L.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-BSjoNIva.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-Bet_hRyA.js";
|
|
16
16
|
import { n as ue, r as M, t as de } from "./path-BglsXpnO.js";
|
|
17
|
-
import { t as fe } from "./locate-
|
|
17
|
+
import { t as fe } from "./locate-Dcq5ZZSk.js";
|
|
18
18
|
import { t as N } from "./heatmap-scale-Zte6Ya-g.js";
|
|
19
19
|
import * as P from "@stylexjs/stylex";
|
|
20
20
|
import { useId as pe, useState as me } from "react";
|