@mechane-ai/elements 0.59.0 → 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 +54 -53
- package/dist/catalog.json +33 -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/kits/operations.js +2 -2
- package/dist/kits/research.js +1 -1
- 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/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/dist/waterfall-BjUXqaWu.js +0 -615
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ Every path below belongs to `@mechane-ai/elements`. There is one package, versio
|
|
|
142
142
|
| `/charts/matrix` | Matrices and their confusion, correlation, attention, and calendar presets, token heatmaps, and color legends. |
|
|
143
143
|
| `/charts/graph` | Supplied relationships, weighted flows, attribution graphs, and tree diagrams. |
|
|
144
144
|
| `/charts/hierarchy` | Treemaps and icicles. |
|
|
145
|
-
| `/charts/timeline` |
|
|
145
|
+
| `/charts/timeline` | Trace timelines, waterfall intervals and instants, and lanes of events. |
|
|
146
146
|
| `/charts/trend` | Curves over a step or layer, many runs, slopes, rank changes, and horizon rows. |
|
|
147
147
|
| `/charts/comparison` | Dot plots, dumbbells, and bullet bars. |
|
|
148
148
|
| `/charts/relationship` | Contours, scatter matrices, parallel coordinates, embedding maps, and density maps. |
|
|
@@ -410,58 +410,59 @@ chart answers. Each family is the import entry `@mechane-ai/elements/charts/<fam
|
|
|
410
410
|
[chart guide](https://github.com/mechane-ai/mechane/blob/main/workspaces/core/docs/ui-charts.md#choose-a-chart) adds
|
|
411
411
|
when to use each chart and when another is better. Use a table when exact comparison matters more than shape.
|
|
412
412
|
|
|
413
|
-
| Family entry | Chart | The reader asks
|
|
414
|
-
| ---------------------- | --------------------- |
|
|
415
|
-
| `/charts/trend` | `CurveChart` | How did a metric change over training steps or another ordered variable?
|
|
416
|
-
| `/charts/trend` | `RunsChart` | How does one run compare with the whole sweep it belongs to?
|
|
417
|
-
| `/charts/trend` | `SlopeChart` | How did each item move between two to six conditions?
|
|
418
|
-
| `/charts/trend` | `BumpChart` | How did the ranking of items change across stages?
|
|
419
|
-
| `/charts/trend` | `HorizonChart` | Which of many series run above or below normal, and when?
|
|
420
|
-
| `/charts/comparison` | `DotPlot` | How do a few models compare on each of several measures?
|
|
421
|
-
| `/charts/comparison` | `DumbbellPlot` | How much did each row change between two measurements?
|
|
422
|
-
| `/charts/comparison` | `BulletBar` | Is each measure meeting its target?
|
|
423
|
-
| `/charts/cartesian` | `BarChart` | How large is each amount, by category and series?
|
|
424
|
-
| `/charts/cartesian` | `BridgeChart` | Which changes add up to the difference between two totals?
|
|
425
|
-
| `/charts/cartesian` | `BreakdownBar` | How does one total split into parts?
|
|
426
|
-
| `/charts/cartesian` | `ScatterPlot` | How do two measures of the same records relate?
|
|
427
|
-
| `/charts/cartesian` | `LineChart` | How did a measure change over time?
|
|
428
|
-
| `/charts/cartesian` | `AreaChart` | How did a total and its parts change over time?
|
|
429
|
-
| `/charts/cartesian` | `SmallMultiples` | How do several related measures move together over the same time?
|
|
430
|
-
| `/charts/cartesian` | `Sparkline` | Which way is one measure trending, at a glance?
|
|
431
|
-
| `/charts/distribution` | `Histogram` | How are the values of one measure distributed?
|
|
432
|
-
| `/charts/distribution` | `ECDF` | What share of values falls below a given level?
|
|
433
|
-
| `/charts/distribution` | `IntervalPlot` | What is each estimate, and how uncertain is it?
|
|
434
|
-
| `/charts/distribution` | `RankedBars` | Which items rank highest on one measure?
|
|
435
|
-
| `/charts/distribution` | `BoxPlot` | How do the distributions of several groups compare?
|
|
436
|
-
| `/charts/distribution` | `ViolinPlot` | How does the shape of a distribution differ between groups?
|
|
437
|
-
| `/charts/distribution` | `StripPlot` | Where does every single value of each group fall?
|
|
438
|
-
| `/charts/distribution` | `Ridgeline` | How does a distribution shift across many ordered groups?
|
|
439
|
-
| `/charts/matrix` | `Matrix` | What is the value for every pair of two categories?
|
|
440
|
-
| `/charts/matrix` | `TokenHeatmap` | Which tokens of a text carry the most of a score?
|
|
441
|
-
| `/charts/matrix` | `ConfusionMatrix` | Which classes does a classifier confuse with which?
|
|
442
|
-
| `/charts/matrix` | `CorrelationMatrix` | Which measures move together?
|
|
443
|
-
| `/charts/matrix` | `AttentionMatrix` | Which earlier tokens does each token attend to?
|
|
444
|
-
| `/charts/matrix` | `CalendarHeatmap` | How does a daily measure vary by week and weekday?
|
|
445
|
-
| `/charts/graph` | `RelationGraph` | How are a few named things connected?
|
|
446
|
-
| `/charts/graph` | `FlowDiagram` | Where does a quantity go between stages?
|
|
447
|
-
| `/charts/graph` | `AttributionGraph` | Which features carry a model’s answer from the prompt to the output?
|
|
448
|
-
| `/charts/graph` | `TreeDiagram` | How is a hierarchy structured?
|
|
449
|
-
| `/charts/hierarchy` | `Treemap` | Which parts make up most of a total?
|
|
450
|
-
| `/charts/hierarchy` | `Icicle` | How does a total split through nested levels?
|
|
451
|
-
| `/charts/timeline` | `
|
|
452
|
-
| `/charts/timeline` | `
|
|
453
|
-
| `/charts/
|
|
454
|
-
| `/charts/relationship` | `
|
|
455
|
-
| `/charts/relationship` | `
|
|
456
|
-
| `/charts/relationship` | `
|
|
457
|
-
| `/charts/relationship` | `
|
|
458
|
-
| `/charts/
|
|
459
|
-
| `/charts/text` | `
|
|
460
|
-
| `/charts/text` | `
|
|
461
|
-
| `/charts/text` | `
|
|
462
|
-
| `/charts/
|
|
463
|
-
| `/charts/image` | `
|
|
464
|
-
| `/charts/image` | `
|
|
413
|
+
| Family entry | Chart | The reader asks |
|
|
414
|
+
| ---------------------- | --------------------- | ------------------------------------------------------------------------- |
|
|
415
|
+
| `/charts/trend` | `CurveChart` | How did a metric change over training steps or another ordered variable? |
|
|
416
|
+
| `/charts/trend` | `RunsChart` | How does one run compare with the whole sweep it belongs to? |
|
|
417
|
+
| `/charts/trend` | `SlopeChart` | How did each item move between two to six conditions? |
|
|
418
|
+
| `/charts/trend` | `BumpChart` | How did the ranking of items change across stages? |
|
|
419
|
+
| `/charts/trend` | `HorizonChart` | Which of many series run above or below normal, and when? |
|
|
420
|
+
| `/charts/comparison` | `DotPlot` | How do a few models compare on each of several measures? |
|
|
421
|
+
| `/charts/comparison` | `DumbbellPlot` | How much did each row change between two measurements? |
|
|
422
|
+
| `/charts/comparison` | `BulletBar` | Is each measure meeting its target? |
|
|
423
|
+
| `/charts/cartesian` | `BarChart` | How large is each amount, by category and series? |
|
|
424
|
+
| `/charts/cartesian` | `BridgeChart` | Which changes add up to the difference between two totals? |
|
|
425
|
+
| `/charts/cartesian` | `BreakdownBar` | How does one total split into parts? |
|
|
426
|
+
| `/charts/cartesian` | `ScatterPlot` | How do two measures of the same records relate? |
|
|
427
|
+
| `/charts/cartesian` | `LineChart` | How did a measure change over time? |
|
|
428
|
+
| `/charts/cartesian` | `AreaChart` | How did a total and its parts change over time? |
|
|
429
|
+
| `/charts/cartesian` | `SmallMultiples` | How do several related measures move together over the same time? |
|
|
430
|
+
| `/charts/cartesian` | `Sparkline` | Which way is one measure trending, at a glance? |
|
|
431
|
+
| `/charts/distribution` | `Histogram` | How are the values of one measure distributed? |
|
|
432
|
+
| `/charts/distribution` | `ECDF` | What share of values falls below a given level? |
|
|
433
|
+
| `/charts/distribution` | `IntervalPlot` | What is each estimate, and how uncertain is it? |
|
|
434
|
+
| `/charts/distribution` | `RankedBars` | Which items rank highest on one measure? |
|
|
435
|
+
| `/charts/distribution` | `BoxPlot` | How do the distributions of several groups compare? |
|
|
436
|
+
| `/charts/distribution` | `ViolinPlot` | How does the shape of a distribution differ between groups? |
|
|
437
|
+
| `/charts/distribution` | `StripPlot` | Where does every single value of each group fall? |
|
|
438
|
+
| `/charts/distribution` | `Ridgeline` | How does a distribution shift across many ordered groups? |
|
|
439
|
+
| `/charts/matrix` | `Matrix` | What is the value for every pair of two categories? |
|
|
440
|
+
| `/charts/matrix` | `TokenHeatmap` | Which tokens of a text carry the most of a score? |
|
|
441
|
+
| `/charts/matrix` | `ConfusionMatrix` | Which classes does a classifier confuse with which? |
|
|
442
|
+
| `/charts/matrix` | `CorrelationMatrix` | Which measures move together? |
|
|
443
|
+
| `/charts/matrix` | `AttentionMatrix` | Which earlier tokens does each token attend to? |
|
|
444
|
+
| `/charts/matrix` | `CalendarHeatmap` | How does a daily measure vary by week and weekday? |
|
|
445
|
+
| `/charts/graph` | `RelationGraph` | How are a few named things connected? |
|
|
446
|
+
| `/charts/graph` | `FlowDiagram` | Where does a quantity go between stages? |
|
|
447
|
+
| `/charts/graph` | `AttributionGraph` | Which features carry a model’s answer from the prompt to the output? |
|
|
448
|
+
| `/charts/graph` | `TreeDiagram` | How is a hierarchy structured? |
|
|
449
|
+
| `/charts/hierarchy` | `Treemap` | Which parts make up most of a total? |
|
|
450
|
+
| `/charts/hierarchy` | `Icicle` | How does a total split through nested levels? |
|
|
451
|
+
| `/charts/timeline` | `TraceTimeline` | How long did concurrent spans take across lanes, with zoom and highlight? |
|
|
452
|
+
| `/charts/timeline` | `Waterfall` | When did each step of a request or run start and end? |
|
|
453
|
+
| `/charts/timeline` | `EventStrip` | What happened when, across a few kinds of events? |
|
|
454
|
+
| `/charts/relationship` | `ContourPlot` | What does a value look like over two continuous inputs? |
|
|
455
|
+
| `/charts/relationship` | `ScatterMatrix` | How do several measures relate to each other, pair by pair? |
|
|
456
|
+
| `/charts/relationship` | `ParallelCoordinates` | Which records do well on many measures at once? |
|
|
457
|
+
| `/charts/relationship` | `EmbeddingMap` | How do many items cluster in a learned embedding space? |
|
|
458
|
+
| `/charts/relationship` | `DensityMap` | Where are points concentrated over two measures? |
|
|
459
|
+
| `/charts/text` | `TokenExamples` | On which passages, and which tokens, does a feature fire? |
|
|
460
|
+
| `/charts/text` | `TokenPredictions` | Which tokens does the model expect next, and how did that change? |
|
|
461
|
+
| `/charts/text` | `TokenGrid` | How does a per-token value change across layers or conditions? |
|
|
462
|
+
| `/charts/text` | `TokenLinks` | Which tokens most influence which later tokens? |
|
|
463
|
+
| `/charts/image` | `ImageGrid` | What do a set of images look like, with a value for each? |
|
|
464
|
+
| `/charts/image` | `AttributionOverlay` | Which parts of an image drove the model’s output? |
|
|
465
|
+
| `/charts/image` | `ImageAtlas` | How do images arrange over a two-dimensional layout? |
|
|
465
466
|
|
|
466
467
|
`ColorLegend`, the table cells in `/charts/cells`, the placeholders and the kits are not registered charts, so the guide
|
|
467
468
|
does not list them. `chartGuide` is exported from `@mechane-ai/elements/charts/figure`, so an application or an agent
|
package/dist/catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@mechane-ai/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"recipes": [
|
|
5
5
|
{
|
|
6
6
|
"slug": "allocation-report",
|
|
@@ -2425,6 +2425,38 @@
|
|
|
2425
2425
|
"kind": "value",
|
|
2426
2426
|
"declaration": "dist/packages/charts/src/timeline/event-strip.d.ts"
|
|
2427
2427
|
},
|
|
2428
|
+
"TraceAction": {
|
|
2429
|
+
"kind": "type",
|
|
2430
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
|
|
2431
|
+
},
|
|
2432
|
+
"TraceCategory": {
|
|
2433
|
+
"kind": "type",
|
|
2434
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
|
|
2435
|
+
},
|
|
2436
|
+
"TraceLane": {
|
|
2437
|
+
"kind": "type",
|
|
2438
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
|
|
2439
|
+
},
|
|
2440
|
+
"TraceSpan": {
|
|
2441
|
+
"kind": "type",
|
|
2442
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
|
|
2443
|
+
},
|
|
2444
|
+
"traceTimelineLimits": {
|
|
2445
|
+
"kind": "value",
|
|
2446
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
|
|
2447
|
+
},
|
|
2448
|
+
"TraceTimelineProps": {
|
|
2449
|
+
"kind": "type",
|
|
2450
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline.d.ts"
|
|
2451
|
+
},
|
|
2452
|
+
"TraceTimeline": {
|
|
2453
|
+
"kind": "value",
|
|
2454
|
+
"declaration": "dist/packages/charts/src/timeline/trace-timeline.d.ts"
|
|
2455
|
+
},
|
|
2456
|
+
"WaterfallDensity": {
|
|
2457
|
+
"kind": "type",
|
|
2458
|
+
"declaration": "dist/packages/charts/src/timeline/waterfall.d.ts"
|
|
2459
|
+
},
|
|
2428
2460
|
"WaterfallGeometry": {
|
|
2429
2461
|
"kind": "type",
|
|
2430
2462
|
"declaration": "dist/packages/charts/src/timeline/waterfall.d.ts"
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as e from "@stylexjs/stylex";
|
|
2
|
+
import { createParts as t } from "@ui-sdk/react/primitive";
|
|
3
|
+
import { createChange as n, createSpans as r, definePrimitive as i } from "@ui-sdk/core";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
// packages/charts/src/chart-range.tsx
|
|
6
|
+
var s = "axis", c = "selected", l = "drawn";
|
|
7
|
+
function u({ value: e }) {
|
|
8
|
+
return {
|
|
9
|
+
value: e,
|
|
10
|
+
spans: e === null ? [] : [{
|
|
11
|
+
id: c,
|
|
12
|
+
track: s,
|
|
13
|
+
start: e[0],
|
|
14
|
+
end: e[1]
|
|
15
|
+
}]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function d(e, t) {
|
|
19
|
+
let { draft: n } = e;
|
|
20
|
+
return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
|
|
21
|
+
}
|
|
22
|
+
var f = i({
|
|
23
|
+
name: "chart-range",
|
|
24
|
+
options: {
|
|
25
|
+
value: "value",
|
|
26
|
+
onValueChange: "callback",
|
|
27
|
+
min: "number",
|
|
28
|
+
max: "number",
|
|
29
|
+
step: "number",
|
|
30
|
+
describe: "value"
|
|
31
|
+
},
|
|
32
|
+
controlled: ["value"],
|
|
33
|
+
state: (e) => ({
|
|
34
|
+
...u(e),
|
|
35
|
+
draft: null
|
|
36
|
+
}),
|
|
37
|
+
sync: u,
|
|
38
|
+
api: (e) => {
|
|
39
|
+
let t = n(e);
|
|
40
|
+
function i(n, { id: r, action: i, reason: a, event: o }) {
|
|
41
|
+
let s = i === "delete" ? void 0 : n.find((e) => e.id === r), c = s === void 0 ? null : [s.start, s.end], l = t("value", c, o === void 0 ? { reason: a } : {
|
|
42
|
+
reason: a,
|
|
43
|
+
event: o
|
|
44
|
+
});
|
|
45
|
+
return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
|
|
46
|
+
}
|
|
47
|
+
let a = r(e, {
|
|
48
|
+
key: "spans",
|
|
49
|
+
draft: "draft",
|
|
50
|
+
axis: "x",
|
|
51
|
+
min: () => e.options().min,
|
|
52
|
+
max: () => e.options().max,
|
|
53
|
+
step: () => e.options().step,
|
|
54
|
+
create: (e) => ({
|
|
55
|
+
...e,
|
|
56
|
+
id: l
|
|
57
|
+
}),
|
|
58
|
+
label: (t) => e.options().describe([t.start, t.end]),
|
|
59
|
+
createAutoScroll: !1,
|
|
60
|
+
set: (e, t) => i(e, t)
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
spans: a,
|
|
64
|
+
shown(t) {
|
|
65
|
+
return d(t, a.spans(t)).map((t) => ({
|
|
66
|
+
id: t.id,
|
|
67
|
+
label: e.options().describe([t.start, t.end])
|
|
68
|
+
}));
|
|
69
|
+
},
|
|
70
|
+
draw(e) {
|
|
71
|
+
e.button === 0 && e.pointerType !== "touch" && a.trackPointerdown(e, s);
|
|
72
|
+
},
|
|
73
|
+
setRange(n, r) {
|
|
74
|
+
let { min: i, max: a, step: o } = e.options(), s = [Number(n), Number(r)].map((e) => i + Math.round((e - i) / o) * o), c = Math.max(i, Math.min(...s)), l = Math.min(a, Math.max(...s));
|
|
75
|
+
if (!Number.isFinite(c) || !Number.isFinite(l) || c >= l) throw Error(`Give a start and a later end between ${i} and ${a}.`);
|
|
76
|
+
return t("value", [c, l], { reason: "imperative" });
|
|
77
|
+
},
|
|
78
|
+
clear() {
|
|
79
|
+
return t("value", null, { reason: "imperative" });
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
slots: (e) => ({
|
|
84
|
+
root: e({
|
|
85
|
+
role: "group",
|
|
86
|
+
state: (e, { api: t }) => ({ spans: t.shown(e) }),
|
|
87
|
+
on: { pointerdown: (e, { api: t }) => t.draw(e) }
|
|
88
|
+
}),
|
|
89
|
+
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, s) }),
|
|
90
|
+
span: e({
|
|
91
|
+
role: "group",
|
|
92
|
+
props: { value: "string" },
|
|
93
|
+
attrs: (e, { api: t, key: n }) => {
|
|
94
|
+
let r = t.spans.spans(e).find((e) => e.id === n);
|
|
95
|
+
return {
|
|
96
|
+
...t.spans.spanAttrs(e, n),
|
|
97
|
+
tabindex: "0",
|
|
98
|
+
style: r === void 0 ? void 0 : t.spans.spanStyle(r)
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
bind: (e, { api: t, key: n }) => t.spans.bindSpan(e, n),
|
|
102
|
+
on: {
|
|
103
|
+
pointerdown: (e, { api: t, key: n }) => t.spans.spanPointerdown(e, n),
|
|
104
|
+
keydown: (e, { api: t, key: n }) => {
|
|
105
|
+
t.spans.keydown(e, n);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
agent: { actions: ["setRange", "clear"] }
|
|
111
|
+
}), p = t(f, {
|
|
112
|
+
root: "div",
|
|
113
|
+
track: "div",
|
|
114
|
+
span: "div"
|
|
115
|
+
}), m = p.Root, h = p.Track, g = p.Span, _ = {
|
|
116
|
+
kVAEAm: "x10l6tqk",
|
|
117
|
+
k87sOh: "x13vifvy",
|
|
118
|
+
kfzvcC: "x47corl",
|
|
119
|
+
$$css: !0
|
|
120
|
+
}, v = { track: (e, t, n) => [
|
|
121
|
+
_,
|
|
122
|
+
{
|
|
123
|
+
kbCHJM: e == null ? e : "xgq9j65",
|
|
124
|
+
kzqmXN: t == null ? t : "x5lhr3w",
|
|
125
|
+
kZKoxP: n == null ? n : "x16ye13r",
|
|
126
|
+
$$css: !0
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
130
|
+
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t),
|
|
131
|
+
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
|
|
132
|
+
}
|
|
133
|
+
] };
|
|
134
|
+
function y({ left: t, width: n, height: r, label: i, children: s, ...c }) {
|
|
135
|
+
return /* @__PURE__ */ a(m, {
|
|
136
|
+
...c,
|
|
137
|
+
"aria-label": i,
|
|
138
|
+
className: "x1n2onr6 xeuugli",
|
|
139
|
+
render: (i, { spans: c }) => /* @__PURE__ */ o("div", {
|
|
140
|
+
...i,
|
|
141
|
+
children: [s, /* @__PURE__ */ a(h, {
|
|
142
|
+
...e.props(v.track(t, n, r)),
|
|
143
|
+
children: c.map((e) => /* @__PURE__ */ o(g, {
|
|
144
|
+
value: e.id,
|
|
145
|
+
"aria-label": `Selected range, ${e.label}. Use arrow keys to move it, Shift and an arrow to move its end, and Delete to clear it.`,
|
|
146
|
+
className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ a("span", { className: "x10l6tqk x67bb7w x5ve5x3 x7it7wx x1ey2m1c xdk7pt x1jm3nie x1o753nm x1jzqe4 x3onkmb" }),
|
|
149
|
+
/* @__PURE__ */ a("span", {
|
|
150
|
+
"data-span-edge": "start",
|
|
151
|
+
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl x1765b1"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ a("span", {
|
|
154
|
+
"data-span-edge": "end",
|
|
155
|
+
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl xpa5qit"
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
}, e.id))
|
|
159
|
+
})]
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
export { y as t };
|
package/dist/charts/cartesian.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AreaChart, p as BarChart, m as BarChartPlaceholder, f as BreakdownBar, d as BridgeChart, n as LineChart, l as ScatterPlot, r as SmallMultiples, i as SmallMultiplesPlaceholder, s as Sparkline, a as TimeSeriesChartPlaceholder, u as scatterLimits, o as timeSeriesBandLimits, c as timeSeriesLimits } from "../time-series-
|
|
1
|
+
export { t as AreaChart, p as BarChart, m as BarChartPlaceholder, f as BreakdownBar, d as BridgeChart, n as LineChart, l as ScatterPlot, r as SmallMultiples, i as SmallMultiplesPlaceholder, s as Sparkline, a as TimeSeriesChartPlaceholder, u as scatterLimits, o as timeSeriesBandLimits, c as timeSeriesLimits } from "../time-series-BbUBF3IE.js";
|
package/dist/charts/figure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as e, f as t, l as n, n as r, p as i, r as a, s as o, t as s } from "../time-series-
|
|
1
|
+
import { d as e, f as t, l as n, n as r, p as i, r as a, s as o, t as s } from "../time-series-BbUBF3IE.js";
|
|
2
2
|
import { a as c, r as l, t as u } from "../dumbbell-plot-BeHhL-01.js";
|
|
3
3
|
import { a as d, d as f, f as p, l as ee, r as te, s as ne, t as re, u as ie } from "../violin-plot-ULdC_dcY.js";
|
|
4
4
|
import { a as ae, r as oe, s as se, t as ce } from "../tree-diagram-BDj4TGXb.js";
|
|
@@ -7,7 +7,7 @@ import { a as de, r as fe, t as pe } from "../image-grid-DB5U7Jtx.js";
|
|
|
7
7
|
import { c as me, i as he, o as m, r as ge, t as _e, u as ve } from "../token-heatmap-o_9l6vaq.js";
|
|
8
8
|
import { a as ye, l as be, r as xe, s as Se, t as Ce } from "../embedding-map-DbETVJXp.js";
|
|
9
9
|
import { a as we, c as Te, r as h, t as Ee } from "../token-predictions-DaAztlOS.js";
|
|
10
|
-
import { n as De, t as Oe } from "../waterfall-
|
|
10
|
+
import { n as De, t as Oe } from "../waterfall-Dre6i02Z.js";
|
|
11
11
|
import { a as ke, l as Ae, r as je, s as Me, t as Ne } from "../slope-chart-DTyF1lNG.js";
|
|
12
12
|
import { m as g } from "../values-963L6n1m.js";
|
|
13
13
|
import { a as _, r as v } from "../figure-frame-ClYRIRAq.js";
|
package/dist/charts/timeline.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../waterfall-Dre6i02Z.js";
|
|
2
|
+
import { n as i, t as a } from "../timeline-C1d9YJlJ.js";
|
|
3
|
+
export { t as EventStrip, a as TraceTimeline, r as Waterfall, n as eventStripGutter, e as eventStripLimits, i as traceTimelineLimits };
|
package/dist/kits/operations.js
CHANGED
|
@@ -3,8 +3,8 @@ import { r as t } from "../figure-format-B8kRZMlo.js";
|
|
|
3
3
|
import { t as n } from "../tone-scope-DKiSw-JR.js";
|
|
4
4
|
import { c as r, i, o as a, s as o } from "../src-9EJskqB_.js";
|
|
5
5
|
import { m as s } from "../src-C-Wg9m9H.js";
|
|
6
|
-
import { n as c } from "../waterfall-
|
|
7
|
-
import { r as l, s as u } from "../time-series-
|
|
6
|
+
import { n as c } from "../waterfall-Dre6i02Z.js";
|
|
7
|
+
import { r as l, s as u } from "../time-series-BbUBF3IE.js";
|
|
8
8
|
import { i as d, r as f } from "../src-4qgpiWvP.js";
|
|
9
9
|
import "@stylexjs/stylex";
|
|
10
10
|
import { useId as p } from "react";
|
package/dist/kits/research.js
CHANGED
|
@@ -6,7 +6,7 @@ import { D as w, _ as T, i as E, n as D } from "../src-Cuwx-PLT.js";
|
|
|
6
6
|
import { r as O } from "../figure-format-B8kRZMlo.js";
|
|
7
7
|
import { n as k } from "../src-na2DdkKI.js";
|
|
8
8
|
import { a as A, t as j } from "../tree-diagram-BDj4TGXb.js";
|
|
9
|
-
import { f as M } from "../time-series-
|
|
9
|
+
import { f as M } from "../time-series-BbUBF3IE.js";
|
|
10
10
|
import { i as N } from "../src-BAlO76fa.js";
|
|
11
11
|
import "@stylexjs/stylex";
|
|
12
12
|
import { useEffect as ee, useState as P } from "react";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export type { EventStripItem, EventStripLane, EventStripMarker, EventStripProps, EventStripTime, EventStripWindow, } from './event-strip.tsx';
|
|
2
2
|
export { EventStrip, eventStripGutter, eventStripLimits } from './event-strip.tsx';
|
|
3
|
-
export type {
|
|
3
|
+
export type { TraceAction, TraceCategory, TraceLane, TraceSpan } from './trace-timeline-layout.ts';
|
|
4
|
+
export { traceTimelineLimits } from './trace-timeline-layout.ts';
|
|
5
|
+
export type { TraceTimelineProps } from './trace-timeline.tsx';
|
|
6
|
+
export { TraceTimeline } from './trace-timeline.tsx';
|
|
7
|
+
export type { WaterfallDensity, WaterfallGeometry, WaterfallItem, WaterfallProps, WaterfallSelectDetails, WaterfallTone, } from './waterfall.tsx';
|
|
4
8
|
export { Waterfall } from './waterfall.tsx';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
3
|
+
/** One horizontal swimlane in a trace timeline, such as a thread, worker, or service. */
|
|
4
|
+
export type TraceLane = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
/** Default hue for spans in this lane when neither the span nor its category sets one. */
|
|
8
|
+
readonly tone?: ChartTone | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** One named span category used for color-coding and legend filtering. */
|
|
11
|
+
export type TraceCategory = {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly tone: ChartTone;
|
|
15
|
+
};
|
|
16
|
+
/** One timed execution span drawn as a horizontal bar in a swimlane. */
|
|
17
|
+
export type TraceSpan = {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly laneId: string;
|
|
20
|
+
readonly parentId?: string | undefined;
|
|
21
|
+
readonly label: string;
|
|
22
|
+
readonly detail?: string | undefined;
|
|
23
|
+
/** Start offset in the timeline's numeric unit. */
|
|
24
|
+
readonly start: number;
|
|
25
|
+
/** End offset in the timeline's numeric unit; must be >= start. */
|
|
26
|
+
readonly end: number;
|
|
27
|
+
/** Category id matching `categories` for color-coding and filtering. */
|
|
28
|
+
readonly category?: string | undefined;
|
|
29
|
+
/** Direct hue override; takes precedence over category and lane tone. */
|
|
30
|
+
readonly tone?: ChartTone | undefined;
|
|
31
|
+
/** Short badge shown beside the span name in the selection bar, such as an HTTP status or token count. */
|
|
32
|
+
readonly badge?: string | undefined;
|
|
33
|
+
/** Other span ids kept at full emphasis when this span is selected. */
|
|
34
|
+
readonly relatedIds?: ReadonlyArray<string> | undefined;
|
|
35
|
+
};
|
|
36
|
+
/** An action wired into the contextual selection bar below the timeline. */
|
|
37
|
+
export type TraceAction = {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly label: string;
|
|
40
|
+
readonly onSelect?: (() => void) | undefined;
|
|
41
|
+
readonly href?: string | undefined;
|
|
42
|
+
readonly isExternal?: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
/** The most lanes and spans one trace timeline draws before requiring aggregation. */
|
|
45
|
+
export declare const traceTimelineLimits: {
|
|
46
|
+
readonly lanes: 24;
|
|
47
|
+
readonly spans: 2000;
|
|
48
|
+
};
|
|
49
|
+
export declare const TRACE_ROW_HEIGHT = 26;
|
|
50
|
+
export declare const TRACE_LANE_PADDING = 6;
|
|
51
|
+
export declare const TRACE_BAR_HEIGHT = 18;
|
|
52
|
+
export declare const TRACE_BAR_MIN_WIDTH = 4;
|
|
53
|
+
export declare function traceProblem({ lanes, spans, domain, }: {
|
|
54
|
+
readonly lanes: ReadonlyArray<TraceLane>;
|
|
55
|
+
readonly spans: ReadonlyArray<TraceSpan>;
|
|
56
|
+
readonly domain: NumericDomain;
|
|
57
|
+
}): string | undefined;
|
|
58
|
+
export declare function clampRange(range: NumericDomain, domain: NumericDomain): NumericDomain;
|
|
59
|
+
export declare function zoomRange({ visible, domain, direction, anchorRatio, }: {
|
|
60
|
+
readonly visible: NumericDomain;
|
|
61
|
+
readonly domain: NumericDomain;
|
|
62
|
+
readonly direction: 'in' | 'out';
|
|
63
|
+
readonly anchorRatio?: number | undefined;
|
|
64
|
+
}): NumericDomain;
|
|
65
|
+
export declare function panRange({ visible, domain, direction, }: {
|
|
66
|
+
readonly visible: NumericDomain;
|
|
67
|
+
readonly domain: NumericDomain;
|
|
68
|
+
readonly direction: 'left' | 'right';
|
|
69
|
+
}): NumericDomain;
|
|
70
|
+
export declare function shiftRange({ visible, domain, delta, }: {
|
|
71
|
+
readonly visible: NumericDomain;
|
|
72
|
+
readonly domain: NumericDomain;
|
|
73
|
+
readonly delta: number;
|
|
74
|
+
}): NumericDomain;
|
|
75
|
+
export declare function fitSpanRange(span: TraceSpan, domain: NumericDomain): NumericDomain;
|
|
76
|
+
export declare function computeRelatedIds(selectedId: string | null | undefined, spans: ReadonlyArray<TraceSpan>): ReadonlySet<string> | undefined;
|
|
77
|
+
export declare function packLaneSpans({ lanes, spans, minExtent, }: {
|
|
78
|
+
readonly lanes: ReadonlyArray<TraceLane>;
|
|
79
|
+
readonly spans: ReadonlyArray<TraceSpan>;
|
|
80
|
+
readonly minExtent: number;
|
|
81
|
+
}): {
|
|
82
|
+
readonly rowBySpanId: ReadonlyMap<string, number>;
|
|
83
|
+
readonly rowCountByLane: ReadonlyArray<number>;
|
|
84
|
+
};
|
|
85
|
+
export declare function fitBarLabel(label: string, duration: string, widthPx: number): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
5
|
+
import type { TraceAction, TraceCategory, TraceLane, TraceSpan } from './trace-timeline-layout.ts';
|
|
6
|
+
/** Props for an APM-style swimlane span timeline with minimap zoom, panning, and causal highlighting. */
|
|
7
|
+
export type TraceTimelineProps = FigureProps & FigureSelectionProps & {
|
|
8
|
+
readonly lanes: ReadonlyArray<TraceLane>;
|
|
9
|
+
readonly spans: ReadonlyArray<TraceSpan>;
|
|
10
|
+
/** Full trace domain in `offsetFormat` units, such as `[0, 47.5]` seconds or `[0, 47500]` ms. */
|
|
11
|
+
readonly domain: NumericDomain;
|
|
12
|
+
/** Optional categories used to color-code bars and render clickable filter pills. */
|
|
13
|
+
readonly categories?: ReadonlyArray<TraceCategory> | undefined;
|
|
14
|
+
/** Controlled visible time window inside `domain`. Leave unset for uncontrolled zoom/pan. */
|
|
15
|
+
readonly visibleRange?: NumericDomain | undefined;
|
|
16
|
+
readonly onVisibleRangeChange?: ((range: NumericDomain) => void) | undefined;
|
|
17
|
+
/** How offsets and durations are formatted along the axis and selection bar. */
|
|
18
|
+
readonly offsetFormat: ValueFormat;
|
|
19
|
+
/**
|
|
20
|
+
* Explicit span ids kept at full emphasis; when omitted, selection highlights ancestors, children, and
|
|
21
|
+
* `relatedIds`.
|
|
22
|
+
*/
|
|
23
|
+
readonly highlightedIds?: ReadonlyArray<string> | undefined;
|
|
24
|
+
/** Called when the reader activates a span by double-clicking or pressing Enter while it is selected. */
|
|
25
|
+
readonly onActivateSpan?: ((span: TraceSpan) => void) | undefined;
|
|
26
|
+
/** Contextual actions rendered in the slim selection bar beneath the plot for the selected span. */
|
|
27
|
+
readonly spanActions?: ((span: TraceSpan) => ReadonlyArray<TraceAction>) | undefined;
|
|
28
|
+
/** Whether to display the brushable minimap overview scrubber above the swimlanes. Defaults to true. */
|
|
29
|
+
readonly isMinimapVisible?: boolean | undefined;
|
|
30
|
+
/** Label for the horizontal time axis. Defaults to "Elapsed". */
|
|
31
|
+
readonly xTitle?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* An APM-style swimlane span timeline for multi-step execution traces. It draws color-coded duration bars stacked per
|
|
35
|
+
* lane on a relative time axis. Readers can zoom and pan, highlight causally related spans, and trigger wired actions.
|
|
36
|
+
*/
|
|
37
|
+
export declare function TraceTimeline({ lanes, spans, domain, categories, visibleRange, onVisibleRangeChange, offsetFormat, selected, onSelectedChange, highlightedIds, onActivateSpan, spanActions, isMinimapVisible, xTitle, ...figure }: TraceTimelineProps): ReactNode;
|
|
@@ -3,6 +3,7 @@ import type { ReactNode, Ref } from 'react';
|
|
|
3
3
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
4
4
|
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
5
5
|
import type { FigureProps } from '../figure/figure-props.ts';
|
|
6
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
6
7
|
/** A row's timing: two recorded endpoints, one recorded instant, or none. Nothing is drawn from a missing endpoint. */
|
|
7
8
|
export type WaterfallGeometry = {
|
|
8
9
|
readonly kind: 'interval';
|
|
@@ -15,11 +16,17 @@ export type WaterfallGeometry = {
|
|
|
15
16
|
} | {
|
|
16
17
|
readonly kind: 'unavailable';
|
|
17
18
|
};
|
|
18
|
-
/** The
|
|
19
|
-
export type WaterfallTone =
|
|
19
|
+
/** The hues a waterfall row takes: neutral, semantic positive/negative, or any numbered series hue. */
|
|
20
|
+
export type WaterfallTone = ChartTone;
|
|
21
|
+
/** Row height density: compact single-line APM rows or comfortable uniform two-line rows. */
|
|
22
|
+
export type WaterfallDensity = 'compact' | 'comfortable';
|
|
20
23
|
/** One timed row. Rows keep the supplied order and share one scale. */
|
|
21
24
|
export type WaterfallItem = {
|
|
22
25
|
readonly id: string;
|
|
26
|
+
/** Optional parent row id to indent nested child spans and enable branch collapse. */
|
|
27
|
+
readonly parentId?: string | undefined;
|
|
28
|
+
/** Optional explicit indentation level (0–6) when `parentId` is omitted. */
|
|
29
|
+
readonly depth?: number | undefined;
|
|
23
30
|
readonly label: string;
|
|
24
31
|
readonly detail: string;
|
|
25
32
|
readonly summary: string;
|
|
@@ -31,23 +38,32 @@ export type WaterfallItem = {
|
|
|
31
38
|
};
|
|
32
39
|
/** Why the selection wants to change: a press or Enter on a row, or a call such as an agent's step. */
|
|
33
40
|
export type WaterfallSelectDetails = Parameters<NonNullable<SpansProps['onValueChange']>>[1];
|
|
41
|
+
/** Props for a uniform-row timing waterfall supporting full series color-coding, tree nesting, and zoom sync. */
|
|
34
42
|
export type WaterfallProps = Pick<FigureProps, 'title' | 'description' | 'report' | 'actions' | 'locale' | 'source' | 'transforms' | 'emptyLabel'> & {
|
|
35
43
|
readonly items: ReadonlyArray<WaterfallItem>;
|
|
36
|
-
/** The time domain every row shares, in the unit of `offsetFormat`. */
|
|
44
|
+
/** The full time domain every row shares, in the unit of `offsetFormat`. */
|
|
37
45
|
readonly start: number;
|
|
38
46
|
readonly end: number;
|
|
47
|
+
/** Optional zoomed time window inside `[start, end]` to sync with a parent timeline. */
|
|
48
|
+
readonly visibleRange?: NumericDomain | undefined;
|
|
39
49
|
readonly rowLabel: string;
|
|
40
50
|
readonly summaryLabel: string;
|
|
51
|
+
/** Uniform row density. Defaults to `'comfortable'`. */
|
|
52
|
+
readonly density?: WaterfallDensity | undefined;
|
|
41
53
|
readonly selected?: string | null | undefined;
|
|
42
54
|
/** The selected row, which takes focus, so an owner can return focus to it. */
|
|
43
55
|
readonly selectedRef?: Ref<HTMLDivElement> | undefined;
|
|
44
56
|
readonly onSelectedChange: (id: string, details: WaterfallSelectDetails) => void;
|
|
57
|
+
/** Optional row ids kept at full emphasis while non-matching rows recede. */
|
|
58
|
+
readonly highlightedIds?: ReadonlyArray<string> | undefined;
|
|
59
|
+
/** Called when the reader activates a row by double-clicking it. */
|
|
60
|
+
readonly onActivate?: ((id: string) => void) | undefined;
|
|
45
61
|
/** How a time from the start of the domain is written, with its unit. */
|
|
46
62
|
readonly offsetFormat: ValueFormat;
|
|
47
63
|
};
|
|
48
64
|
/**
|
|
49
|
-
* Recorded intervals and instants of many rows on one time scale, such as the steps of a request or
|
|
50
|
-
*
|
|
51
|
-
*
|
|
65
|
+
* Recorded intervals and instants of many rows on one time scale, such as the steps of a request or an agent run. Every
|
|
66
|
+
* row keeps a uniform fixed height with single-line ellipsis truncation, supports full series color-coding, optional
|
|
67
|
+
* parent-child hierarchy, and synced zoom windows via `visibleRange`.
|
|
52
68
|
*/
|
|
53
|
-
export declare function Waterfall({ items, start, end, rowLabel, summaryLabel, emptyLabel, selected, selectedRef, onSelectedChange, offsetFormat, ...frame }: WaterfallProps): ReactNode;
|
|
69
|
+
export declare function Waterfall({ items, start, end, visibleRange, rowLabel, summaryLabel, density, emptyLabel, selected, selectedRef, onSelectedChange, highlightedIds, onActivate, offsetFormat, ...frame }: WaterfallProps): ReactNode;
|