@mechane-ai/elements 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{article-CRlhq9oA.js → article-BDVuehRt.js} +1 -1
- package/dist/article.js +1 -1
- package/dist/catalog.json +42 -1
- package/dist/{categorical-values-BYP_R5gS.js → categorical-values-BoS03HcI.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -13
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +3 -3
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +2 -2
- package/dist/collections.js +1 -1
- package/dist/{dates-ckJdYF7t.js → dates-CjlTzw00.js} +1 -1
- package/dist/{dumbbell-plot-BC8d_IJy.js → dumbbell-plot-Xxl6P7D1.js} +3 -3
- package/dist/{embedding-map-Bj8krO-d.js → embedding-map-tU8hT_aC.js} +3 -3
- package/dist/{figure-frame-koVKcXph.js → figure-frame-BKc9TvtX.js} +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/{image-grid-CLhol2jy.js → image-grid-BZy2lkNb.js} +2 -2
- package/dist/kits/evaluation.js +4 -4
- package/dist/kits/interpretability.js +7 -7
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +463 -183
- package/dist/kits/training.js +3 -3
- package/dist/mdx.js +2 -2
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +1 -1
- package/dist/packages/charts/src/plot/plot-layout.d.ts +0 -6
- package/dist/packages/charts/src/timeline/event-strip.d.ts +12 -2
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +5 -11
- package/dist/packages/kits/src/research/collection-page.d.ts +9 -0
- package/dist/packages/kits/src/research/index.d.ts +3 -1
- package/dist/packages/kits/src/research/lineage-graph.d.ts +40 -0
- package/dist/{plot-layout-B2xRt-_k.js → plot-layout-D8j-ozGR.js} +102 -86
- package/dist/{plot-surface-0cKFwtws.js → plot-surface-5e3xeiub.js} +1 -1
- package/dist/{reference-lines-nSxcZVF5.js → reference-lines-1FttCg46.js} +1 -1
- package/dist/{scene-4ePpWdmE.js → scene-8F-fQksU.js} +4 -4
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DWZIYDty.js → slope-chart-B35ZfaYn.js} +4 -4
- package/dist/{src-DNclWY4V.js → src-fvoTU3Bq.js} +377 -377
- package/dist/{time-series-CsngFxr1.js → time-series-DoFMGmFV.js} +612 -590
- package/dist/{token-heatmap-BQLIxPky.js → token-heatmap-DLPQWwMv.js} +3 -3
- package/dist/{token-predictions-C3B5L-eO.js → token-predictions-D_Jwf8Aw.js} +3 -3
- package/dist/{tree-diagram-Dau9jeXS.js → tree-diagram-DreDBCvt.js} +4 -4
- package/dist/{treemap-DWrMQndu.js → treemap-MVX-wa4t.js} +4 -4
- package/dist/{violin-plot-D05ODcyc.js → violin-plot-Bi71NqXF.js} +3 -3
- package/dist/waterfall-8y8ANO3c.js +605 -0
- package/package.json +1 -1
- package/recipes/calendar-workspace.tsx +39 -0
- package/skills/use-elements/references/workspace.md +8 -6
- package/dist/waterfall-BkLLv2Lm.js +0 -576
package/dist/kits/training.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as e } from "../src-DIS0YOj0.js";
|
|
2
2
|
import { i as t, t as n } from "../tone-scope-DKiSw-JR.js";
|
|
3
|
-
import { r, s as i } from "../slope-chart-
|
|
3
|
+
import { r, s as i } from "../slope-chart-B35ZfaYn.js";
|
|
4
4
|
import { m as a } from "../src-npqwq3Sa.js";
|
|
5
|
-
import { T as o } from "../plot-layout-
|
|
5
|
+
import { T as o } from "../plot-layout-D8j-ozGR.js";
|
|
6
6
|
import { o as s, t as c } from "../cells-CNZE4us2.js";
|
|
7
7
|
import { r as l } from "../figure-format-B8kRZMlo.js";
|
|
8
|
-
import { d as u, g as d, u as f } from "../src-
|
|
8
|
+
import { d as u, g as d, u as f } from "../src-fvoTU3Bq.js";
|
|
9
9
|
import { c as p, o as m } from "../src-9EJskqB_.js";
|
|
10
10
|
import "@stylexjs/stylex";
|
|
11
11
|
import { useState as h } from "react";
|
package/dist/mdx.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-
|
|
1
|
+
import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-BDVuehRt.js";
|
|
2
2
|
import { n as se, t as ce } from "./param-BdqTpZER.js";
|
|
3
3
|
import { a as l, i as u, n as d, o as f, t as p } from "./transport-4V9rfYHN.js";
|
|
4
|
-
import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-
|
|
4
|
+
import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-8F-fQksU.js";
|
|
5
5
|
import { t as R } from "./code-block-BZsY2sh3.js";
|
|
6
6
|
import { t as z } from "./content-link-PnpcnTCx.js";
|
|
7
7
|
import * as B from "@stylexjs/stylex";
|
|
@@ -31,7 +31,7 @@ export type TreeDiagramProps = FigureProps & FigureSelectionProps & {
|
|
|
31
31
|
};
|
|
32
32
|
export declare const treeLimits: {
|
|
33
33
|
readonly nodes: 300;
|
|
34
|
-
readonly depth:
|
|
34
|
+
readonly depth: 32;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* A hierarchy drawn as a node-link tree: a decision tree, a module tree or a cut of a cluster dendrogram. Depth runs
|
|
@@ -105,12 +105,6 @@ export declare function tickTexts({ values, axis, locale, hasTitle, }: Pick<Axis
|
|
|
105
105
|
* their own ticks use it, so every axis agrees.
|
|
106
106
|
*/
|
|
107
107
|
export declare function ticksMinimum(length: number): number;
|
|
108
|
-
/**
|
|
109
|
-
* The ticks of a measured axis: round values on its scale, at least three on an axis longer than 120 pixels, each
|
|
110
|
-
* labelled so that no two read the same. Ticks that land on both ends of the domain win when they fit, so the lowest
|
|
111
|
-
* and highest marks never sit beyond the outer ticks. Every kernel layout labels its axes with it; a chart that draws
|
|
112
|
-
* an axis of its own calls it too.
|
|
113
|
-
*/
|
|
114
108
|
export declare function axisTicks({ axis, domain, length, spacing, locale, hasTitle }: AxisTicksInput): AxisTicks;
|
|
115
109
|
/**
|
|
116
110
|
* The ticks of a band axis: one at the center of each category, labelled with its name. A label may hold a line break,
|
|
@@ -29,6 +29,13 @@ export type EventStripMarker = {
|
|
|
29
29
|
readonly label: string;
|
|
30
30
|
readonly at: number;
|
|
31
31
|
};
|
|
32
|
+
/** A quick time-range preset shown in the strip header, such as 6h, 24h, or All. */
|
|
33
|
+
export type EventStripWindow = {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
/** Duration in milliseconds from the end of the strip domain, or `null` for the full span. */
|
|
37
|
+
readonly durationMs: number | null;
|
|
38
|
+
};
|
|
32
39
|
/**
|
|
33
40
|
* How the strip writes instants. Options name their own time zone; a function format needs `timeZone` beside it, so the
|
|
34
41
|
* axis ticks fall on that zone's clock.
|
|
@@ -43,9 +50,12 @@ export type EventStripTime = {
|
|
|
43
50
|
export type EventStripProps = FigureProps & FigureSelectionProps & EventStripTime & {
|
|
44
51
|
readonly lanes: ReadonlyArray<EventStripLane>;
|
|
45
52
|
readonly events: ReadonlyArray<EventStripItem>;
|
|
46
|
-
/**
|
|
47
|
-
readonly domain
|
|
53
|
+
/** First and last instant the strip spans in epoch ms. Absent fits events and markers automatically. */
|
|
54
|
+
readonly domain?: NumericDomain | undefined;
|
|
48
55
|
readonly markers?: ReadonlyArray<EventStripMarker> | undefined;
|
|
56
|
+
/** Optional time-window presets rendered in the figure header. */
|
|
57
|
+
readonly windows?: ReadonlyArray<EventStripWindow> | undefined;
|
|
58
|
+
readonly defaultWindowId?: string | undefined;
|
|
49
59
|
/**
|
|
50
60
|
* The lane-label gutter's width in pixels, which strips stacked in a column pass the same from `eventStripGutter`
|
|
51
61
|
* over all their lanes so their time axes line up. A label longer than the gutter is cut with an ellipsis and keeps
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { EventStripItem, EventStripLane, EventStripMarker, EventStripProps, EventStripTime, } from './event-strip.tsx';
|
|
1
|
+
export type { EventStripItem, EventStripLane, EventStripMarker, EventStripProps, EventStripTime, EventStripWindow, } from './event-strip.tsx';
|
|
2
2
|
export { EventStrip, eventStripGutter, eventStripLimits } from './event-strip.tsx';
|
|
3
3
|
export type { WaterfallGeometry, WaterfallItem, WaterfallProps, WaterfallSelectDetails, WaterfallTone, } from './waterfall.tsx';
|
|
4
4
|
export { Waterfall } from './waterfall.tsx';
|
|
@@ -63,17 +63,11 @@ export type MetricProps = Omit<ComponentProps<'div'>, 'children' | 'dangerouslyS
|
|
|
63
63
|
readonly change?: MetricChange | undefined;
|
|
64
64
|
/** Optional target or ceiling reference shown quietly below the detail line. */
|
|
65
65
|
readonly target?: string | undefined;
|
|
66
|
-
|
|
67
|
-
readonly
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
70
|
-
|
|
71
|
-
} | {
|
|
72
|
-
readonly isLoading: true;
|
|
73
|
-
readonly value?: never;
|
|
74
|
-
readonly detail?: never;
|
|
75
|
-
readonly hasDetail?: boolean;
|
|
76
|
-
});
|
|
66
|
+
readonly isLoading?: boolean | undefined;
|
|
67
|
+
readonly value?: string | undefined;
|
|
68
|
+
readonly detail?: string | undefined;
|
|
69
|
+
readonly hasDetail?: boolean | undefined;
|
|
70
|
+
};
|
|
77
71
|
export declare function MetricGrid({ layout, ...props }: MetricGridProps): ReactNode;
|
|
78
72
|
export declare function Metric({ label, value, detail, change, target, isLoading, hasDetail, variant, trend, ...props }: MetricProps): ReactNode;
|
|
79
73
|
export {};
|
|
@@ -2,6 +2,12 @@ import type { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
import type { DataTableColumn, DataTableRowAction, DataTableSort, DataTableSortDetails, TableFilterDimension, TableQueryException } from '../../../collections/src/index.ts';
|
|
3
3
|
import { PageLayout } from '../../../layout/src/index.ts';
|
|
4
4
|
export type CollectionStatus = 'loading' | 'ready' | 'failed';
|
|
5
|
+
/** A named scope partition shown as a segmented switcher in the collection header with live item counts. */
|
|
6
|
+
export type CollectionScope<Row> = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly match: (row: Row) => boolean;
|
|
10
|
+
};
|
|
5
11
|
type SortableColumns<Row> = {
|
|
6
12
|
readonly columns: ReadonlyArray<DataTableColumn<Row>>;
|
|
7
13
|
readonly sort: DataTableSort | undefined;
|
|
@@ -24,6 +30,9 @@ type SharedCollectionProps<Row extends object> = SortableColumns<Row> & {
|
|
|
24
30
|
readonly filters: ReadonlyArray<TableFilterDimension<Row>> | TableQueryException;
|
|
25
31
|
/** Optional custom row transformer (e.g. sorting) applied after local search and filtering. */
|
|
26
32
|
readonly transformRows?: (rows: ReadonlyArray<Row>) => ReadonlyArray<Row>;
|
|
33
|
+
/** Optional segmented scopes (e.g. Active / All) that partition rows before local search and filtering. */
|
|
34
|
+
readonly scopes?: ReadonlyArray<CollectionScope<Row>> | undefined;
|
|
35
|
+
readonly defaultScopeId?: string | undefined;
|
|
27
36
|
readonly actions?: ReactNode;
|
|
28
37
|
readonly notice?: ReactNode;
|
|
29
38
|
readonly rowAction?: DataTableRowAction<Row> | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export type { CollectionPageProps, CollectionSectionProps, CollectionStatus } from './collection-page.tsx';
|
|
1
|
+
export type { CollectionPageProps, CollectionScope, CollectionSectionProps, CollectionStatus, } from './collection-page.tsx';
|
|
2
2
|
export { CollectionPage, CollectionSection } from './collection-page.tsx';
|
|
3
3
|
export type { FindingCardLabels, FindingCardProps, FindingMetric, FindingSource, FindingStatus, } from './finding-card.tsx';
|
|
4
4
|
export { FindingCard } from './finding-card.tsx';
|
|
5
|
+
export type { LineageGraphLabels, LineageGraphProps, LineageNode, LineageNodeKind } from './lineage-graph.tsx';
|
|
6
|
+
export { LineageGraph } from './lineage-graph.tsx';
|
|
5
7
|
export type { MilestoneKind, MilestonePathLabels, MilestonePathProps, ResearchMilestone } from './milestone-path.tsx';
|
|
6
8
|
export { MilestonePath } from './milestone-path.tsx';
|
|
7
9
|
export type { SpecimenDiffLabels, SpecimenDiffProps, SpecimenDiffRow, SpecimenFilter, SpecimenOutcome, } from './specimen-diff.tsx';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureProps, FigureSelectionProps, ValueFormat } from '../../../charts/src/index.ts';
|
|
3
|
+
export type LineageNodeKind = 'baseline' | 'milestone' | 'branch' | 'merge' | 'killed';
|
|
4
|
+
export type LineageNode = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly parentIds: ReadonlyArray<string>;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly kind: LineageNodeKind;
|
|
9
|
+
readonly lane?: string | undefined;
|
|
10
|
+
readonly metric?: number | null | undefined;
|
|
11
|
+
readonly delta?: number | null | undefined;
|
|
12
|
+
readonly summary?: string | undefined;
|
|
13
|
+
readonly detail?: string | undefined;
|
|
14
|
+
readonly source?: string | undefined;
|
|
15
|
+
readonly timestamp?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type LineageGraphLabels = {
|
|
18
|
+
readonly frontier: string;
|
|
19
|
+
readonly all: string;
|
|
20
|
+
readonly metric: string;
|
|
21
|
+
readonly delta: string;
|
|
22
|
+
readonly lane: string;
|
|
23
|
+
readonly parents: string;
|
|
24
|
+
readonly source: string;
|
|
25
|
+
readonly empty: string;
|
|
26
|
+
readonly kinds: Readonly<Record<LineageNodeKind, string>>;
|
|
27
|
+
};
|
|
28
|
+
export type LineageGraphProps = Pick<FigureProps, 'title' | 'description' | 'locale' | 'status' | 'source' | 'transforms' | 'actions'> & FigureSelectionProps & {
|
|
29
|
+
readonly nodes: ReadonlyArray<LineageNode>;
|
|
30
|
+
readonly valueLabel?: string | undefined;
|
|
31
|
+
readonly valueFormat?: ValueFormat | undefined;
|
|
32
|
+
readonly deltaFormat?: ValueFormat | undefined;
|
|
33
|
+
readonly defaultScope?: 'frontier' | 'all' | undefined;
|
|
34
|
+
readonly labels?: Partial<LineageGraphLabels> | undefined;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Multi-parent research lineage DAG with automatic topological layout, optional agent swimlanes, and a Frontier / All
|
|
38
|
+
* scope switcher. Composes `RelationGraph` with a flat inline evidence readout for the selected node.
|
|
39
|
+
*/
|
|
40
|
+
export declare function LineageGraph({ nodes, valueLabel, valueFormat, deltaFormat, defaultScope, selected, onSelectedChange, labels: given, actions, ...figure }: LineageGraphProps): ReactNode;
|
|
@@ -444,12 +444,12 @@ function Ce({ children: e }) {
|
|
|
444
444
|
children: e
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function we() {
|
|
448
448
|
return g(F);
|
|
449
449
|
}
|
|
450
450
|
// packages/charts/src/chart-frame.tsx
|
|
451
|
-
function
|
|
452
|
-
let f = _(), h =
|
|
451
|
+
function Te({ title: t, description: n, children: r, actions: i, footer: a, report: o, series: s = [], figure: c = {}, seriesLegend: l, scaleLegend: u }) {
|
|
452
|
+
let f = _(), h = we() && i === void 0, g = /* @__PURE__ */ D(T, { children: [
|
|
453
453
|
l !== void 0 && /* @__PURE__ */ E("div", {
|
|
454
454
|
className: "xeuugli x1jfksii",
|
|
455
455
|
children: l
|
|
@@ -516,7 +516,7 @@ function we({ title: t, description: n, children: r, actions: i, footer: a, repo
|
|
|
516
516
|
}), g]
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ee({ items: e, label: t = "Legend", isScrollable: n = !1 }) {
|
|
520
520
|
return /* @__PURE__ */ E("ul", {
|
|
521
521
|
"aria-label": t,
|
|
522
522
|
...{
|
|
@@ -535,7 +535,7 @@ function Te({ items: e, label: t = "Legend", isScrollable: n = !1 }) {
|
|
|
535
535
|
}, e.id))
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function De({ children: e, id: t }) {
|
|
539
539
|
return /* @__PURE__ */ E("p", {
|
|
540
540
|
id: t,
|
|
541
541
|
className: "x1ghz6dp xeuugli x1mqbd49 xbixft xy8obcc xas2l8k xss6m8b xj0a0fe",
|
|
@@ -543,42 +543,42 @@ function Ee({ children: e, id: t }) {
|
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
// packages/charts/src/plot/ticks.ts
|
|
546
|
-
var
|
|
546
|
+
var I = 10, Oe = 5, L = 2, ke = 200, Ae = 3, je = Math.sqrt(50), Me = Math.sqrt(10), Ne = Math.sqrt(L), Pe = [
|
|
547
547
|
1,
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
L,
|
|
549
|
+
Oe
|
|
550
550
|
];
|
|
551
|
-
function
|
|
552
|
-
return e >=
|
|
551
|
+
function Fe(e) {
|
|
552
|
+
return e >= je ? I : e >= Me ? Oe : e >= Ne ? L : 1;
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function R(e, t) {
|
|
555
555
|
let [n, r] = e;
|
|
556
556
|
if (!(t > 0) || !(r > n)) return [];
|
|
557
|
-
let i = (r - n) / t, a = Math.floor(Math.log10(i)), o =
|
|
557
|
+
let i = (r - n) / t, a = Math.floor(Math.log10(i)), o = Fe(i / I ** a), s = a < 0, c = s ? I ** -a / o : I ** a * o, l = s ? n * c : n / c, u = s ? r * c : r / c, d = Math.ceil(l - 2 ** -52 * Math.abs(l)), f = Math.floor(u + 2 ** -52 * Math.abs(u)), p = Math.max(0, Math.min(ke, f - d + 1));
|
|
558
558
|
return Array.from({ length: p }, (e, t) => s ? (d + t) / c : (d + t) * c);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function z(e, t) {
|
|
561
561
|
let [n, r] = e;
|
|
562
562
|
if (!(n > 0) || !(r > n)) return [];
|
|
563
|
-
let i = Math.floor(Math.log10(n)), a = Math.ceil(Math.log10(r)), o = Array.from({ length: a - i + 1 }, (e, t) => i + t), s = o.filter((e) =>
|
|
564
|
-
if (s.length >= Math.min(t,
|
|
563
|
+
let i = Math.floor(Math.log10(n)), a = Math.ceil(Math.log10(r)), o = Array.from({ length: a - i + 1 }, (e, t) => i + t), s = o.filter((e) => I ** e >= n && I ** e <= r);
|
|
564
|
+
if (s.length >= Math.min(t, Ae)) {
|
|
565
565
|
let e = Math.max(1, Math.ceil(s.length / Math.max(1, t)));
|
|
566
|
-
return s.filter((t, n) => n % e === 0).map((e) =>
|
|
566
|
+
return s.filter((t, n) => n % e === 0).map((e) => I ** e);
|
|
567
567
|
}
|
|
568
|
-
return o.flatMap((e) =>
|
|
568
|
+
return o.flatMap((e) => Pe.map((t) => t * I ** e)).filter((e) => e >= n && e <= r);
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
let [n, r] = e, i = Math.max(1, Math.floor(t /
|
|
570
|
+
function Ie(e, t) {
|
|
571
|
+
let [n, r] = e, i = Math.max(1, Math.floor(t / L)), a = r > 1 ? z([1, r], i).filter((e) => Number.isInteger(Math.log10(e))) : [];
|
|
572
572
|
return [
|
|
573
|
-
...(n < -1 ?
|
|
573
|
+
...(n < -1 ? z([1, -n], i).filter((e) => Number.isInteger(Math.log10(e))) : []).map((e) => -e).toReversed(),
|
|
574
574
|
...n <= 0 && r >= 0 ? [0] : [],
|
|
575
575
|
...a
|
|
576
576
|
].filter((e) => e >= n && e <= r);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
return t === "log" ?
|
|
578
|
+
function Le({ domain: e, type: t = "linear", count: n }) {
|
|
579
|
+
return t === "log" ? z(e, n) : t === "symlog" ? Ie(e, n) : R(e, n);
|
|
580
580
|
}
|
|
581
|
-
var
|
|
581
|
+
var B = 1e3, V = {
|
|
582
582
|
second: 1,
|
|
583
583
|
fiveSeconds: 5,
|
|
584
584
|
quarterMinute: 15,
|
|
@@ -600,50 +600,50 @@ var H = 1e3, U = {
|
|
|
600
600
|
twoYears: 63072e3,
|
|
601
601
|
fiveYears: 15768e4,
|
|
602
602
|
decade: 31536e4
|
|
603
|
-
},
|
|
604
|
-
function
|
|
603
|
+
}, Re = V.day * B, ze = V.week * B;
|
|
604
|
+
function Be({ domain: e, count: t, zoneOffset: n }) {
|
|
605
605
|
let [r, i] = e;
|
|
606
606
|
if (!(t > 0) || !(i > r)) return [];
|
|
607
|
-
let a = (i - r) / t, o = Object.values(
|
|
607
|
+
let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = o > ze ? Math.ceil((r + n) / Re) * Re : 0, c = s + Math.ceil((r + n - s) / o) * o, l = Math.max(0, Math.min(ke, Math.floor((i + n - c) / o) + 1));
|
|
608
608
|
return Array.from({ length: l }, (e, t) => c + t * o - n);
|
|
609
609
|
}
|
|
610
610
|
// packages/charts/src/plot/plot-layout.ts
|
|
611
|
-
var
|
|
611
|
+
var Ve = {
|
|
612
612
|
compact: 160,
|
|
613
613
|
regular: 260,
|
|
614
614
|
tall: 380
|
|
615
|
-
},
|
|
615
|
+
}, H = 7, He = 12, Ue = 44, We = 20, Ge = 28, Ke = 24, qe = 12, Je = 20, U = .4, Ye = .5, Xe = 2, Ze = 3, Qe = 120, $e = 6, et = .4, tt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, nt = 3, rt = .2, it = 16, at = 14, ot = "\n", st = {
|
|
616
616
|
linear: void 0,
|
|
617
617
|
log: "log scale",
|
|
618
618
|
symlog: "symmetric log scale"
|
|
619
619
|
};
|
|
620
|
-
function
|
|
621
|
-
let t =
|
|
620
|
+
function ct(e) {
|
|
621
|
+
let t = st[e.scale ?? "linear"];
|
|
622
622
|
return t === void 0 ? e.label : `${e.label} (${t})`;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
|
|
625
625
|
let r = e.flatMap((e) => e !== null && Number.isFinite(e) ? [e] : []), i = t && n !== "log" ? [...r, 0] : r;
|
|
626
|
-
if (i.length === 0) return n === "log" ? [1,
|
|
626
|
+
if (i.length === 0) return n === "log" ? [1, W] : [0, 1];
|
|
627
627
|
let a = Math.min(...i), o = Math.max(...i);
|
|
628
628
|
if (n === "log") {
|
|
629
|
-
let e =
|
|
630
|
-
return [e, t > e ? t : e *
|
|
629
|
+
let e = W ** Math.floor(Math.log10(Math.max(a, Number.MIN_VALUE))), t = W ** Math.ceil(Math.log10(Math.max(o, Number.MIN_VALUE)));
|
|
630
|
+
return [e, t > e ? t : e * W];
|
|
631
631
|
}
|
|
632
632
|
if (a === o) return [a - 1, o + 1];
|
|
633
633
|
if (n === "symlog") return [a, o];
|
|
634
|
-
let [s, c] =
|
|
634
|
+
let [s, c] = R([a, o], nt), l = s === void 0 || c === void 0 ? o - a : c - s;
|
|
635
635
|
return [Math.floor(a / l) * l, Math.ceil(o / l) * l];
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
let a = Math.max(0, ...t.map((e) => e.length)) *
|
|
637
|
+
function q({ width: e, valueLabels: t, hasXTitle: n, hasYTitle: r, leftShare: i = U }) {
|
|
638
|
+
let a = Math.max(0, ...t.map((e) => e.length)) * H + He + (r ? Ge : 0);
|
|
639
639
|
return {
|
|
640
|
-
top:
|
|
641
|
-
right:
|
|
642
|
-
bottom:
|
|
643
|
-
left: Math.min(Math.max(
|
|
640
|
+
top: qe,
|
|
641
|
+
right: Je,
|
|
642
|
+
bottom: Ke + (n ? We : 0),
|
|
643
|
+
left: Math.min(Math.max(Ue, a), e * i)
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function J({ width: e, height: t, margins: n }) {
|
|
647
647
|
let r = Math.max(n.left, e - n.right), i = Math.max(n.top, t - n.bottom);
|
|
648
648
|
return {
|
|
649
649
|
width: e,
|
|
@@ -656,10 +656,10 @@ function X({ width: e, height: t, margins: n }) {
|
|
|
656
656
|
innerHeight: i - n.top
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function ut(e) {
|
|
660
660
|
return new Set(e).size === e.length;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Y(e, t) {
|
|
663
663
|
return {
|
|
664
664
|
...e,
|
|
665
665
|
minimumSignificantDigits: void 0,
|
|
@@ -668,7 +668,7 @@ function lt(e, t) {
|
|
|
668
668
|
maximumFractionDigits: Math.max(e.maximumFractionDigits ?? 0, t)
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function dt(e, t) {
|
|
672
672
|
return !t || typeof e == "function" || e.style !== "unit" ? e : {
|
|
673
673
|
...e,
|
|
674
674
|
style: "decimal",
|
|
@@ -676,30 +676,46 @@ function ut(e, t) {
|
|
|
676
676
|
unitDisplay: void 0
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
let i =
|
|
679
|
+
function X({ values: e, axis: t, locale: n, hasTitle: r }) {
|
|
680
|
+
let i = dt(t.tickFormat ?? o(t.format), r), a = dt(t.format, r), s = (typeof i == "function" ? [i] : [
|
|
681
681
|
i,
|
|
682
|
-
|
|
683
|
-
...typeof a == "function" ? [] :
|
|
682
|
+
...tt.map((e) => Y(i, e)),
|
|
683
|
+
...typeof a == "function" ? [] : tt.map((e) => Y(a, e))
|
|
684
684
|
]).map((t) => e.map((e) => c({
|
|
685
685
|
value: e,
|
|
686
686
|
locale: n,
|
|
687
687
|
format: t
|
|
688
688
|
})));
|
|
689
|
-
return s.find(
|
|
689
|
+
return s.find(ut) ?? s.at(-1) ?? [];
|
|
690
690
|
}
|
|
691
691
|
function Z(e) {
|
|
692
|
-
return e >
|
|
692
|
+
return e > Qe ? Ze : Xe;
|
|
693
|
+
}
|
|
694
|
+
function ft(e) {
|
|
695
|
+
let t = e.tickFormat ?? e.format;
|
|
696
|
+
return typeof t == "function" || e.scale === "log" ? !1 : t.maximumFractionDigits === 0 && t.style !== "percent";
|
|
693
697
|
}
|
|
694
698
|
function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
|
|
695
|
-
let o = Z(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length:
|
|
699
|
+
let o = Z(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: $e }, (n, r) => Le({
|
|
696
700
|
domain: t,
|
|
697
701
|
type: e.scale,
|
|
698
702
|
count: s + r
|
|
699
|
-
})).filter((e, t) => t === 0 || e.length * r *
|
|
703
|
+
})).filter((e, t) => t === 0 || e.length * r * et <= 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;
|
|
704
|
+
if (ft(e)) {
|
|
705
|
+
let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Xe ? t : f;
|
|
706
|
+
return {
|
|
707
|
+
values: n,
|
|
708
|
+
labels: X({
|
|
709
|
+
values: n,
|
|
710
|
+
axis: e,
|
|
711
|
+
locale: i,
|
|
712
|
+
hasTitle: a
|
|
713
|
+
})
|
|
714
|
+
};
|
|
715
|
+
}
|
|
700
716
|
return {
|
|
701
717
|
values: f,
|
|
702
|
-
labels:
|
|
718
|
+
labels: X({
|
|
703
719
|
values: f,
|
|
704
720
|
axis: e,
|
|
705
721
|
locale: i,
|
|
@@ -714,17 +730,17 @@ function $(e, t) {
|
|
|
714
730
|
label: t.labels[r] ?? ""
|
|
715
731
|
}));
|
|
716
732
|
}
|
|
717
|
-
function
|
|
733
|
+
function pt(e) {
|
|
718
734
|
let t = e.split(" ");
|
|
719
735
|
return t.slice(1).map((e, n) => {
|
|
720
736
|
let r = t.slice(0, n + 1).join(" "), i = t.slice(n + 1).join(" ");
|
|
721
737
|
return {
|
|
722
|
-
text: `${r}${
|
|
738
|
+
text: `${r}${ot}${i}`,
|
|
723
739
|
longest: Math.max(r.length, i.length)
|
|
724
740
|
};
|
|
725
741
|
}).toSorted((e, t) => e.longest - t.longest)[0]?.text ?? e;
|
|
726
742
|
}
|
|
727
|
-
function
|
|
743
|
+
function mt(e, t) {
|
|
728
744
|
return t.flatMap((t) => {
|
|
729
745
|
let n = e.center(t.id);
|
|
730
746
|
return n === void 0 ? [] : [{
|
|
@@ -734,20 +750,20 @@ function pt(e, t) {
|
|
|
734
750
|
}];
|
|
735
751
|
});
|
|
736
752
|
}
|
|
737
|
-
function
|
|
753
|
+
function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
|
|
738
754
|
let c = Q({
|
|
739
755
|
axis: r,
|
|
740
756
|
domain: a,
|
|
741
757
|
length: t,
|
|
742
|
-
spacing:
|
|
758
|
+
spacing: K,
|
|
743
759
|
locale: o,
|
|
744
760
|
hasTitle: !0
|
|
745
|
-
}), u =
|
|
761
|
+
}), u = q({
|
|
746
762
|
width: e,
|
|
747
763
|
valueLabels: c.labels,
|
|
748
764
|
hasXTitle: !0,
|
|
749
765
|
hasYTitle: !0
|
|
750
|
-
}), d =
|
|
766
|
+
}), d = J({
|
|
751
767
|
width: e,
|
|
752
768
|
height: t,
|
|
753
769
|
margins: {
|
|
@@ -758,7 +774,7 @@ function mt({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
|
|
|
758
774
|
axis: n,
|
|
759
775
|
domain: i,
|
|
760
776
|
length: d.innerWidth,
|
|
761
|
-
spacing:
|
|
777
|
+
spacing: G,
|
|
762
778
|
locale: o,
|
|
763
779
|
hasTitle: !0
|
|
764
780
|
}), p = l({
|
|
@@ -778,25 +794,25 @@ function mt({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
|
|
|
778
794
|
yTicks: $(m, c)
|
|
779
795
|
};
|
|
780
796
|
}
|
|
781
|
-
function
|
|
797
|
+
function gt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = rt, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
|
|
782
798
|
let p = r.map((e) => e.id), m = n === "columns", h = Q({
|
|
783
799
|
axis: i,
|
|
784
800
|
domain: a,
|
|
785
801
|
length: m ? t : e,
|
|
786
|
-
spacing: m ?
|
|
802
|
+
spacing: m ? K : G,
|
|
787
803
|
locale: o,
|
|
788
804
|
hasTitle: f
|
|
789
|
-
}), g =
|
|
805
|
+
}), g = q({
|
|
790
806
|
width: e,
|
|
791
807
|
valueLabels: m ? h.labels : r.map((e) => e.label),
|
|
792
808
|
hasXTitle: !m && f,
|
|
793
809
|
hasYTitle: m && f,
|
|
794
|
-
leftShare: m ?
|
|
810
|
+
leftShare: m ? U : Ye
|
|
795
811
|
}), _ = {
|
|
796
812
|
...g,
|
|
797
813
|
top: g.top + c,
|
|
798
814
|
right: g.right + d
|
|
799
|
-
}, v =
|
|
815
|
+
}, v = J({
|
|
800
816
|
width: e,
|
|
801
817
|
height: t,
|
|
802
818
|
margins: _
|
|
@@ -804,15 +820,15 @@ function ht({ width: e, height: t, direction: n, categories: r, value: i, valueD
|
|
|
804
820
|
ids: p,
|
|
805
821
|
range: [v.left, v.right],
|
|
806
822
|
padding: s
|
|
807
|
-
}).step -
|
|
823
|
+
}).step - it, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
|
|
808
824
|
...e,
|
|
809
|
-
label:
|
|
810
|
-
})), x = m && ee && b.every((e) => e.label.split(
|
|
825
|
+
label: pt(e.label)
|
|
826
|
+
})), x = m && ee && b.every((e) => e.label.split(ot).every((e) => e.length * H <= y)), S = x ? J({
|
|
811
827
|
width: e,
|
|
812
828
|
height: t,
|
|
813
829
|
margins: {
|
|
814
830
|
..._,
|
|
815
|
-
bottom: _.bottom +
|
|
831
|
+
bottom: _.bottom + at
|
|
816
832
|
}
|
|
817
833
|
}) : v, C = u({
|
|
818
834
|
ids: p,
|
|
@@ -827,18 +843,18 @@ function ht({ width: e, height: t, direction: n, categories: r, value: i, valueD
|
|
|
827
843
|
box: S,
|
|
828
844
|
band: C,
|
|
829
845
|
value: w,
|
|
830
|
-
bandTicks:
|
|
846
|
+
bandTicks: mt(C, x ? b : r),
|
|
831
847
|
valueTicks: $(w, h)
|
|
832
848
|
};
|
|
833
849
|
}
|
|
834
|
-
function
|
|
835
|
-
return
|
|
850
|
+
function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
|
|
851
|
+
return q({
|
|
836
852
|
width: Infinity,
|
|
837
853
|
valueLabels: t.flatMap(({ axis: t, domain: i }) => Q({
|
|
838
854
|
axis: t,
|
|
839
855
|
domain: i,
|
|
840
856
|
length: e,
|
|
841
|
-
spacing:
|
|
857
|
+
spacing: K,
|
|
842
858
|
locale: n,
|
|
843
859
|
hasTitle: r
|
|
844
860
|
}).labels),
|
|
@@ -846,20 +862,20 @@ function gt({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
|
|
|
846
862
|
hasYTitle: r
|
|
847
863
|
}).left;
|
|
848
864
|
}
|
|
849
|
-
function
|
|
865
|
+
function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
|
|
850
866
|
let d = Q({
|
|
851
867
|
axis: n,
|
|
852
868
|
domain: r,
|
|
853
869
|
length: t,
|
|
854
|
-
spacing:
|
|
870
|
+
spacing: K,
|
|
855
871
|
locale: o,
|
|
856
872
|
hasTitle: u
|
|
857
|
-
}), f =
|
|
873
|
+
}), f = q({
|
|
858
874
|
width: e,
|
|
859
875
|
valueLabels: d.labels,
|
|
860
876
|
hasXTitle: !1,
|
|
861
877
|
hasYTitle: u
|
|
862
|
-
}), p = Math.min(Math.max(f.left, c), e *
|
|
878
|
+
}), p = Math.min(Math.max(f.left, c), e * U), m = J({
|
|
863
879
|
width: e,
|
|
864
880
|
height: t,
|
|
865
881
|
margins: {
|
|
@@ -879,7 +895,7 @@ function _t({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, time
|
|
|
879
895
|
box: m,
|
|
880
896
|
x: h,
|
|
881
897
|
y: g,
|
|
882
|
-
xTicks: $(h,
|
|
898
|
+
xTicks: $(h, bt({
|
|
883
899
|
domain: i,
|
|
884
900
|
length: m.innerWidth,
|
|
885
901
|
timeFormat: a,
|
|
@@ -888,7 +904,7 @@ function _t({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, time
|
|
|
888
904
|
yTicks: $(g, d)
|
|
889
905
|
};
|
|
890
906
|
}
|
|
891
|
-
var
|
|
907
|
+
var yt = [
|
|
892
908
|
{
|
|
893
909
|
month: "short",
|
|
894
910
|
day: "numeric"
|
|
@@ -905,12 +921,12 @@ var vt = [
|
|
|
905
921
|
second: "2-digit"
|
|
906
922
|
}
|
|
907
923
|
];
|
|
908
|
-
function
|
|
909
|
-
let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : a(e[0], o), l = Z(t), u = Math.max(l, Math.round(t /
|
|
924
|
+
function bt({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
|
|
925
|
+
let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : a(e[0], o), l = Z(t), u = Math.max(l, Math.round(t / G)), d = Array.from({ length: $e }, (t, n) => Be({
|
|
910
926
|
domain: e,
|
|
911
927
|
count: u + n,
|
|
912
928
|
zoneOffset: c
|
|
913
|
-
})), f = d.find((e) => e.length >= l) ?? d[0] ?? [], p = (typeof n == "function" ? [n] : [n, ...
|
|
929
|
+
})), f = d.find((e) => e.length >= l) ?? d[0] ?? [], p = (typeof n == "function" ? [n] : [n, ...yt.map((e) => ({
|
|
914
930
|
...e,
|
|
915
931
|
...n
|
|
916
932
|
}))]).map((e) => f.map((t) => s({
|
|
@@ -920,7 +936,7 @@ function yt({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
|
|
|
920
936
|
})));
|
|
921
937
|
return {
|
|
922
938
|
values: f,
|
|
923
|
-
labels: p.find(
|
|
939
|
+
labels: p.find(ut) ?? p.at(-1) ?? []
|
|
924
940
|
};
|
|
925
941
|
}
|
|
926
|
-
export { he as A, Ce as C, me as D, ue as E, re as M, fe as O,
|
|
942
|
+
export { he as A, Ce as C, me as D, ue as E, re as M, fe as O, De as S, P as T, Le as _, lt as a, Te as b, Ve as c, Z as d, bt as f, z as g, R as h, gt as i, ge as j, pe as k, q as l, _t as m, ct as n, ht as o, vt as p, mt as r, J as s, Q as t, X 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-D8j-ozGR.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-D8j-ozGR.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-FVsbFkUs.js";
|