@mechane-ai/elements 0.47.0 → 0.49.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 +288 -5
- package/bin/mechane-elements-catalog.mjs +104 -12
- package/dist/ai.js +5 -5
- package/dist/article-yyNPg6VU.js +1904 -0
- package/dist/article.js +1 -0
- package/dist/catalog.json +1691 -163
- package/dist/{categorical-values-DdfGIowV.js → categorical-values-DCznViFp.js} +1 -1
- package/dist/{cells--Bd1fQFR.js → cells-CNZE4us2.js} +2 -2
- 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 +3 -2
- package/dist/charts/plot.js +6 -6
- 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/clock-DSm5lkNE.js +16 -0
- package/dist/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +1 -1
- package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
- package/dist/describe-lesson-BmREzDpt.js +175 -0
- package/dist/{dumbbell-plot-B2ZTgQaI.js → dumbbell-plot-CMv9llfd.js} +9 -7
- package/dist/{embedding-map-CGM_k6lC.js → embedding-map-DC-lgzCq.js} +8 -8
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-wRkIEAwe.js → figure-frame-BjFzbl3m.js} +3 -3
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +3 -3
- package/dist/{image-grid-CVA4SOy_.js → image-grid-DHqtj_zs.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +320 -302
- package/dist/kits/operations.js +6 -6
- package/dist/kits/research.js +558 -0
- package/dist/kits/training.js +6 -6
- package/dist/layout.js +205 -110
- package/dist/lesson/agent.js +811 -0
- package/dist/lesson/spec.js +661 -0
- package/dist/lesson.js +5 -0
- package/dist/mdx.js +227 -0
- package/dist/navigation.js +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -1
- package/dist/packages/charts/src/matrix/index.d.ts +1 -0
- package/dist/packages/charts/src/plot/plot-marks.d.ts +7 -3
- package/dist/packages/charts/src/plot/plot-surface.d.ts +3 -1
- package/dist/packages/collections/src/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +9 -1
- package/dist/packages/content/src/index.d.ts +2 -0
- package/dist/packages/content/src/text-match.d.ts +22 -0
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/surfaces.d.ts +12 -2
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/token-input.d.ts +24 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
- package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
- package/dist/packages/kits/src/research/index.d.ts +8 -0
- package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
- package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
- package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
- package/dist/packages/layout/src/figure-grid.d.ts +8 -0
- package/dist/packages/layout/src/index.d.ts +4 -1
- package/dist/packages/layout/src/sidebar.d.ts +7 -0
- package/dist/packages/layout/src/workbench.d.ts +4 -1
- package/dist/packages/teaching/src/agent/index.d.ts +11 -0
- package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
- package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
- package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
- package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
- package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
- package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
- package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
- package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
- package/dist/packages/teaching/src/article/article.d.ts +42 -0
- package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
- package/dist/packages/teaching/src/article/beat.d.ts +16 -0
- package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
- package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
- package/dist/packages/teaching/src/article/figure.d.ts +51 -0
- package/dist/packages/teaching/src/article/index.d.ts +31 -0
- package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
- package/dist/packages/teaching/src/article/notes.d.ts +36 -0
- package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
- package/dist/packages/teaching/src/article/predict.d.ts +58 -0
- package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
- package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
- package/dist/packages/{kits/src/explainers → teaching/src/article}/term.d.ts +8 -2
- package/dist/packages/teaching/src/article/tex.d.ts +12 -0
- package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
- package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
- package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
- package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
- package/dist/packages/teaching/src/article/walk.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
- package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
- package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
- package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
- package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
- package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
- package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
- package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
- package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
- package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
- package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
- package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
- package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
- package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
- package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
- package/dist/packages/teaching/src/scene/index.d.ts +77 -0
- package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
- package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
- package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
- package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
- package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
- package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
- package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
- package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
- package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
- package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
- package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
- package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
- package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
- package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
- package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
- package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
- package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
- package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
- package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
- package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
- package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
- package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
- package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
- package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
- package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
- package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
- package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
- package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
- package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
- package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
- package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
- package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
- package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
- package/dist/packages/teaching/src/spec/index.d.ts +14 -0
- package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
- package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
- package/dist/packages/teaching/src/time/clock.d.ts +7 -0
- package/dist/packages/teaching/src/time/tween.d.ts +19 -0
- package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
- package/dist/param-BE3VMSkH.js +450 -0
- package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
- package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
- package/dist/{plot-layout-BEuoOHbs.js → plot-layout-Bqe4-0qZ.js} +4 -3
- package/dist/{plot-marks-A64v7aTw.js → plot-marks-FVsbFkUs.js} +18 -15
- package/dist/{plot-surface-CJTIqtck.js → plot-surface-DON6WUmk.js} +11 -11
- package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
- package/dist/{reference-lines-CWA8VeUR.js → reference-lines-hjuD1rRZ.js} +2 -2
- package/dist/scene-BP0Ue0R5.js +4938 -0
- package/dist/scene.js +1 -0
- package/dist/{slope-chart-DT22h_ym.js → slope-chart-C8eeSgL4.js} +7 -7
- package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
- package/dist/{src-D5NXRJZe.js → src-B2rgpWap.js} +48 -14
- package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
- package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
- package/dist/{src-1EHkSFS-.js → src-Dxs3Buo_.js} +205 -139
- package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
- package/dist/styles2.css +542 -21
- package/dist/{time-series-IB3CB93O.js → time-series-BL933QyA.js} +787 -715
- package/dist/{token-heatmap-C00DnoNO.js → token-heatmap-BB65awva.js} +4 -4
- package/dist/{token-predictions-Cxx29iDr.js → token-predictions-Pa8eUGan.js} +6 -6
- package/dist/transport-DzyxVXbL.js +715 -0
- package/dist/{tree-diagram-DsckNKaW.js → tree-diagram-DJhKBiia.js} +6 -6
- package/dist/{treemap-9_DpLCW9.js → treemap-CxxgABUg.js} +5 -5
- package/dist/use-tween-5HZ55_9d.js +72 -0
- package/dist/{violin-plot-BhPHKXsN.js → violin-plot-CoAEF_7Z.js} +7 -6
- package/dist/{waterfall-CGksuTy5.js → waterfall-DdoEXEkT.js} +7 -7
- package/package.json +30 -5
- package/recipes/counting-cards.tsx +656 -0
- package/recipes/explorable-essay.tsx +172 -0
- package/skills/extend-elements/SKILL.md +21 -0
- package/skills/plan-lesson/SKILL.md +86 -0
- package/skills/plan-lesson/references/plan-format.md +114 -0
- package/skills/plan-lesson/references/worked-plan.md +171 -0
- package/skills/review-elements/SKILL.md +4 -2
- package/skills/review-explainer/SKILL.md +97 -0
- package/skills/upgrade-elements/references/releases.md +65 -0
- package/skills/use-elements/SKILL.md +18 -16
- package/skills/use-elements/references/kits.md +9 -26
- package/skills/use-elements/references/teaching.md +36 -0
- package/skills/write-explainer/SKILL.md +112 -0
- package/skills/write-explainer/references/article.md +164 -0
- package/skills/write-explainer/references/lesson.md +148 -0
- package/skills/write-explainer/references/mdx.md +78 -0
- package/skills/write-explainer/references/scene-parts.md +273 -0
- package/skills/write-explainer/references/scene.md +168 -0
- package/skills/write-explainer/references/tutor.md +104 -0
- package/skills/write-explainer/references/worked-essay.md +459 -0
- package/templates/essay/AGENTS.md +14 -0
- package/templates/essay/README.md +59 -0
- package/templates/essay/index.html +17 -0
- package/templates/essay/package.template.json +21 -0
- package/templates/essay/plan.json +96 -0
- package/templates/essay/src/essay.mdx +97 -0
- package/templates/essay/src/figures.tsx +92 -0
- package/templates/essay/src/lesson.ts +83 -0
- package/templates/essay/src/main.tsx +53 -0
- package/templates/essay/src/mdx.d.ts +7 -0
- package/templates/essay/tsconfig.template.json +15 -0
- package/templates/essay/vite.config.template.txt +8 -0
- package/dist/kits/explainers.js +0 -452
- package/dist/packages/kits/src/explainers/figures.d.ts +0 -31
- package/dist/packages/kits/src/explainers/index.d.ts +0 -8
- package/dist/packages/kits/src/explainers/story-steps.d.ts +0 -46
- /package/dist/packages/{kits/src/explainers → teaching/src/article}/linked-target.d.ts +0 -0
- /package/dist/packages/{kits/src/explainers → teaching/src/lesson}/bound-value.d.ts +0 -0
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { k as e } from "./src-
|
|
2
|
-
import {
|
|
3
|
-
import { d as n, u as r } from "./src-
|
|
1
|
+
import { k as e } from "./src-9EJskqB_.js";
|
|
2
|
+
import { x as t } from "./src-Dxs3Buo_.js";
|
|
3
|
+
import { d as n, u as r } from "./src-npqwq3Sa.js";
|
|
4
4
|
import { n as i, t as a } from "./chart-tones-ei3BC2AL.js";
|
|
5
|
-
import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-
|
|
6
|
-
import { i as y, n as b, r as x, t as S } from "./categorical-values-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-Bqe4-0qZ.js";
|
|
6
|
+
import { i as y, n as b, r as x, t as S } from "./categorical-values-DCznViFp.js";
|
|
7
|
+
import { i as C } from "./chart-link-AE_xuxiP.js";
|
|
8
|
+
import { a as te } from "./tone-scope-DKiSw-JR.js";
|
|
9
|
+
import { n as w, r as ne, t as T } from "./figure-format-B8kRZMlo.js";
|
|
9
10
|
import { a as E, i as D, o as O, r as k, t as A } from "./scale-C2xgZyZN.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import { c as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { a as
|
|
15
|
-
import { n as
|
|
16
|
-
import { n as
|
|
17
|
-
import { n as
|
|
18
|
-
import { t as
|
|
11
|
+
import { t as re } from "./chart-cursor-1mFd48Jc.js";
|
|
12
|
+
import { c as ie, i as ae, l as oe, n as j, o as se, r as ce, s as M, t as le } from "./figure-frame-BjFzbl3m.js";
|
|
13
|
+
import { n as N, t as P } from "./plot-width-D3hTycYX.js";
|
|
14
|
+
import { t as ue } from "./plot-axes-D5S9BnBa.js";
|
|
15
|
+
import { a as de, c as F, d as I, f as fe, i as L, l as pe, n as R, o as z, r as me, s as B, t as he } from "./plot-marks-FVsbFkUs.js";
|
|
16
|
+
import { n as ge, r as _e, t as ve } from "./plot-surface-DON6WUmk.js";
|
|
17
|
+
import { n as ye, t as be } from "./reference-lines-hjuD1rRZ.js";
|
|
18
|
+
import { n as xe, r as Se, t as Ce } from "./path-BglsXpnO.js";
|
|
19
|
+
import { t as V } from "./locate-Bcg3QcP4.js";
|
|
19
20
|
import * as H from "@stylexjs/stylex";
|
|
20
|
-
import { createParts as
|
|
21
|
-
import { useEffect as
|
|
22
|
-
import { bindDrag as K, createChange as
|
|
23
|
-
import { Fragment as
|
|
21
|
+
import { createParts as we } from "@ui-sdk/react/primitive";
|
|
22
|
+
import { useEffect as Te, useId as U, useRef as W, useState as G } from "react";
|
|
23
|
+
import { bindDrag as K, createChange as Ee, createSpans as De, definePrimitive as Oe, dispatch as ke } from "@ui-sdk/core";
|
|
24
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
24
25
|
// packages/charts/src/cartesian/bar-data.ts
|
|
25
|
-
function
|
|
26
|
+
function X({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
26
27
|
if (e === void 0) return;
|
|
27
28
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
28
29
|
let i = e.annotation;
|
|
@@ -39,26 +40,26 @@ function ke({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
var
|
|
43
|
-
function
|
|
43
|
+
var Z = 6;
|
|
44
|
+
function Q(e, t) {
|
|
44
45
|
return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function Ae({ marker: e, categoryCount: t, domain: n }) {
|
|
47
48
|
let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
|
|
48
49
|
if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
|
|
49
|
-
if (r.some((e) => e.some((e) => !
|
|
50
|
+
if (r.some((e) => e.some((e) => !Q(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
|
|
50
51
|
if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
|
|
51
52
|
let r = e.upper[t] ?? null;
|
|
52
53
|
if (n === null != (r === null) || n !== null && r !== null && n > r) return "A range marker needs both bounds, with the lower bound at most the upper bound, or neither.";
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
if (e.length >
|
|
56
|
+
function je({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
|
|
57
|
+
if (e.length > Z) return `Supply at most ${Z} bar markers.`;
|
|
57
58
|
let o = [...e, ...t];
|
|
58
59
|
if (new Set(o.map((e) => e.id)).size !== o.length || r.some((e) => o.some((t) => t.id === e))) return "Bar series, markers, and annotations require distinct identifiers.";
|
|
59
60
|
for (let t of e) {
|
|
60
61
|
if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
|
|
61
|
-
let e =
|
|
62
|
+
let e = Ae({
|
|
62
63
|
marker: t,
|
|
63
64
|
categoryCount: i.length,
|
|
64
65
|
domain: a
|
|
@@ -72,25 +73,25 @@ function Ae({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r
|
|
|
72
73
|
if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
|
|
73
74
|
if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function Me({ marker: e, index: t, valueText: n }) {
|
|
76
77
|
if (e.kind === "tick") return n(e.values[t] ?? null);
|
|
77
78
|
let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
|
|
78
79
|
return r === null || i === null ? n(null) : `${n(r)} – ${n(i)}`;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function Ne(e, t) {
|
|
81
82
|
return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
|
|
82
83
|
}
|
|
83
84
|
// packages/charts/src/cartesian/value-labels.ts
|
|
84
|
-
var
|
|
85
|
-
function
|
|
86
|
-
let n = (e.text.length + t.text.length) *
|
|
87
|
-
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) <
|
|
85
|
+
var Pe = 6.5, Fe = 14, Ie = 6, Le = .5;
|
|
86
|
+
function Re(e, t) {
|
|
87
|
+
let n = (e.text.length + t.text.length) * Pe * Le + Ie;
|
|
88
|
+
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < Fe;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
return e.filter((t, n) => e.slice(0, n).every((e) => !
|
|
90
|
+
function ze(e) {
|
|
91
|
+
return e.filter((t, n) => e.slice(0, n).every((e) => !Re(t, e)));
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let i = t.length *
|
|
93
|
+
function Be({ x: e, text: t, left: n, right: r }) {
|
|
94
|
+
let i = t.length * Pe * Le;
|
|
94
95
|
return e - i < n ? {
|
|
95
96
|
x: n,
|
|
96
97
|
anchor: "start"
|
|
@@ -103,16 +104,16 @@ function ze({ x: e, text: t, left: n, right: r }) {
|
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
// packages/charts/src/cartesian/bar-overlays.tsx
|
|
106
|
-
var
|
|
107
|
-
function
|
|
108
|
-
let a = n.x + n.width *
|
|
107
|
+
var Ve = 3, He = 14, Ue = .6, We = .5;
|
|
108
|
+
function Ge({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
109
|
+
let a = n.x + n.width * We;
|
|
109
110
|
if (e.kind === "tick") {
|
|
110
111
|
let o = e.values[t] ?? null;
|
|
111
112
|
if (o === null) return [];
|
|
112
113
|
let s = {
|
|
113
114
|
key: "tick",
|
|
114
|
-
x1: n.x -
|
|
115
|
-
x2: n.x + n.width +
|
|
115
|
+
x1: n.x - Ve,
|
|
116
|
+
x2: n.x + n.width + Ve,
|
|
116
117
|
y1: i(o),
|
|
117
118
|
y2: i(o)
|
|
118
119
|
};
|
|
@@ -126,7 +127,7 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
126
127
|
}
|
|
127
128
|
let o = e.lower[t] ?? null, s = e.upper[t] ?? null;
|
|
128
129
|
if (o === null || s === null) return [];
|
|
129
|
-
let c = Math.min(
|
|
130
|
+
let c = Math.min(He, n.width * Ue) * We;
|
|
130
131
|
return [
|
|
131
132
|
{
|
|
132
133
|
key: "whisker",
|
|
@@ -151,9 +152,9 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
151
152
|
}
|
|
152
153
|
];
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function Ke({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a }) {
|
|
155
156
|
return /* @__PURE__ */ J("g", { children: e.map((e) => /* @__PURE__ */ J("g", { children: t.map((t, o) => {
|
|
156
|
-
let s =
|
|
157
|
+
let s = Ge({
|
|
157
158
|
marker: e,
|
|
158
159
|
index: o,
|
|
159
160
|
span: n(t, e.seriesId),
|
|
@@ -161,27 +162,27 @@ function Ge({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a
|
|
|
161
162
|
y: i
|
|
162
163
|
});
|
|
163
164
|
return /* @__PURE__ */ J("g", {
|
|
164
|
-
...H.props(
|
|
165
|
-
children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(
|
|
165
|
+
...H.props(N.emphasis, a(t) && N.receded),
|
|
166
|
+
children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(B, {
|
|
166
167
|
...n,
|
|
167
168
|
tone: e.tone ?? "neutral"
|
|
168
169
|
}, t))
|
|
169
170
|
}, t);
|
|
170
171
|
}) }, e.id)) });
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function qe({ annotations: e, left: t, right: n }) {
|
|
173
174
|
return /* @__PURE__ */ J("g", {
|
|
174
175
|
"aria-hidden": !0,
|
|
175
|
-
children:
|
|
176
|
-
let r =
|
|
176
|
+
children: ze(e).map((e) => {
|
|
177
|
+
let r = Be({
|
|
177
178
|
x: e.x,
|
|
178
179
|
text: e.text,
|
|
179
180
|
left: t,
|
|
180
181
|
right: n
|
|
181
182
|
});
|
|
182
183
|
return /* @__PURE__ */ J("g", {
|
|
183
|
-
...H.props(
|
|
184
|
-
children: /* @__PURE__ */ J(
|
|
184
|
+
...H.props(N.emphasis, e.isReceded && N.receded),
|
|
185
|
+
children: /* @__PURE__ */ J(F, {
|
|
185
186
|
x: r.x,
|
|
186
187
|
y: e.y,
|
|
187
188
|
anchor: r.anchor,
|
|
@@ -192,7 +193,7 @@ function Ke({ annotations: e, left: t, right: n }) {
|
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
195
|
-
var
|
|
196
|
+
var Je = {
|
|
196
197
|
mark: {
|
|
197
198
|
k3nNDw: "x1hj3fc7",
|
|
198
199
|
k1ekBW: "xwcsmn1",
|
|
@@ -208,17 +209,17 @@ var qe = {
|
|
|
208
209
|
"--x-transform": e ?? void 0,
|
|
209
210
|
"--x-opacity": t ?? void 0
|
|
210
211
|
}]
|
|
211
|
-
},
|
|
212
|
-
function
|
|
212
|
+
}, Ye = .18, Xe = .3;
|
|
213
|
+
function Ze({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a, y: o, isSelected: s, isInspected: c, highlighted: l, toneOf: u }) {
|
|
213
214
|
let d = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
|
|
214
215
|
function p(e, t) {
|
|
215
216
|
let n = o(t), r = o(t + e);
|
|
216
|
-
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
|
|
217
|
+
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0 && t === 0), Math.abs(r - n))})`;
|
|
217
218
|
}
|
|
218
|
-
let m = d ?
|
|
219
|
-
return /* @__PURE__ */ Y(
|
|
220
|
-
...H.props(
|
|
221
|
-
children: /* @__PURE__ */ J(
|
|
219
|
+
let m = d ? Ye : +(e.kind === "total");
|
|
220
|
+
return /* @__PURE__ */ Y(q, { children: [e.kind !== "gap" && /* @__PURE__ */ J("g", {
|
|
221
|
+
...H.props(Je.mark, Je.geometry(p(e.total, 0), m)),
|
|
222
|
+
children: /* @__PURE__ */ J(me, {
|
|
222
223
|
x: i,
|
|
223
224
|
y: 0,
|
|
224
225
|
width: a,
|
|
@@ -230,10 +231,10 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
230
231
|
}), f.map((o, f) => {
|
|
231
232
|
let m = o.values[r];
|
|
232
233
|
if (m == null) return null;
|
|
233
|
-
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ?
|
|
234
|
+
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ? Xe : 1 : 0;
|
|
234
235
|
return /* @__PURE__ */ J("g", {
|
|
235
|
-
...H.props(
|
|
236
|
-
children: /* @__PURE__ */ J(
|
|
236
|
+
...H.props(Je.mark, Je.geometry(p(m, h), v)),
|
|
237
|
+
children: /* @__PURE__ */ J(me, {
|
|
237
238
|
x: i,
|
|
238
239
|
y: 0,
|
|
239
240
|
width: a,
|
|
@@ -246,16 +247,16 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
246
247
|
})] });
|
|
247
248
|
}
|
|
248
249
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
249
|
-
var
|
|
250
|
+
var Qe = { placeholder: {
|
|
250
251
|
kqGvvJ: "x1we84gm",
|
|
251
252
|
$$css: !0
|
|
252
|
-
} },
|
|
253
|
-
function
|
|
253
|
+
} }, $e = 18, et = 8, tt = 14, nt = .08, rt = 8, it = 8, at = .5;
|
|
254
|
+
function ot({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i, label: a, summary: o, rows: s = [], x: c = 0, width: l = 0, offset: u, data: d, isLoading: f = !1, ...p }) {
|
|
254
255
|
let m = f && e.length === 0 && p.report?.seriesValues === void 0;
|
|
255
256
|
return /* @__PURE__ */ Y(j, {
|
|
256
257
|
...p,
|
|
257
258
|
series: e,
|
|
258
|
-
seriesLegend: m ? /* @__PURE__ */ J(
|
|
259
|
+
seriesLegend: m ? /* @__PURE__ */ J(M, {}) : /* @__PURE__ */ J(se, {
|
|
259
260
|
id: i,
|
|
260
261
|
label: a,
|
|
261
262
|
summary: o,
|
|
@@ -268,11 +269,11 @@ function at({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i
|
|
|
268
269
|
width: l,
|
|
269
270
|
offset: u
|
|
270
271
|
}),
|
|
271
|
-
children: [d !== void 0 && /* @__PURE__ */ J(
|
|
272
|
+
children: [d !== void 0 && /* @__PURE__ */ J(oe, { ...d }), r]
|
|
272
273
|
});
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
-
let e =
|
|
275
|
+
function st() {
|
|
276
|
+
let e = te();
|
|
276
277
|
return (t) => t.map((t, n) => ({
|
|
277
278
|
id: t.id,
|
|
278
279
|
label: t.label,
|
|
@@ -283,12 +284,12 @@ function ot() {
|
|
|
283
284
|
})
|
|
284
285
|
}));
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
-
let a =
|
|
287
|
+
function ct({ title: e = "Loading chart", series: t = [], height: n = "compact", ...i }) {
|
|
288
|
+
let a = U(), o = st()(t);
|
|
288
289
|
return /* @__PURE__ */ J("div", {
|
|
289
290
|
"aria-hidden": !0,
|
|
290
291
|
inert: !0,
|
|
291
|
-
children: /* @__PURE__ */ J(
|
|
292
|
+
children: /* @__PURE__ */ J(ot, {
|
|
292
293
|
...i,
|
|
293
294
|
title: e,
|
|
294
295
|
status: "loading",
|
|
@@ -296,16 +297,16 @@ function st({ title: e = "Loading chart", series: t = [], height: n = "compact",
|
|
|
296
297
|
inspectionId: a,
|
|
297
298
|
isLoading: !0,
|
|
298
299
|
children: /* @__PURE__ */ J("div", {
|
|
299
|
-
...H.props(
|
|
300
|
+
...H.props(N.plot, Qe.placeholder),
|
|
300
301
|
children: /* @__PURE__ */ J(r, { height: f[n] })
|
|
301
302
|
})
|
|
302
303
|
})
|
|
303
304
|
});
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function lt(e, t) {
|
|
306
307
|
return Array.from({ length: t }, (t, n) => e.reduce((e, t) => e + Math.max(0, t.values[n] ?? 0), 0));
|
|
307
308
|
}
|
|
308
|
-
function
|
|
309
|
+
function ut({ categories: e, series: t, domain: n, mode: r }) {
|
|
309
310
|
if (e.length > x.items || t.length > x.series) return `Choose a window with at most ${x.items} categories and ${x.series} series.`;
|
|
310
311
|
if (O(n) !== void 0 || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
311
312
|
if (!o(e) || !o(t)) return "Bar categories and series require unique identifiers.";
|
|
@@ -314,10 +315,10 @@ function lt({ categories: e, series: t, domain: n, mode: r }) {
|
|
|
314
315
|
if (i.values.some((e) => e !== null && E(e, n))) return "Bar values must be finite and within the supplied domain.";
|
|
315
316
|
if (r === "stacked" && i.values.some((e) => e === null || e < 0)) return "Stacked bars require present nonnegative values.";
|
|
316
317
|
}
|
|
317
|
-
if (r === "stacked" &&
|
|
318
|
+
if (r === "stacked" && lt(t, e.length).some((e) => e > n[1])) return "Stacked bar totals must fit the supplied domain.";
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
-
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ?
|
|
320
|
+
function dt({ categories: e, series: t, mode: n, composition: r, referenceLines: i, markers: a }) {
|
|
321
|
+
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ? lt(t, e.length) : [], l = r?.focusedSeries?.values ?? [], u = r?.buckets.map((e) => e.kind === "gap" ? null : e.total) ?? [], d = a.flatMap((e) => e.kind === "tick" ? e.values : [...e.lower, ...e.upper]);
|
|
321
322
|
return [
|
|
322
323
|
...s,
|
|
323
324
|
...c,
|
|
@@ -328,15 +329,15 @@ function ut({ categories: e, series: t, mode: n, composition: r, referenceLines:
|
|
|
328
329
|
...r?.annotation === void 0 ? [] : [r.annotation.value]
|
|
329
330
|
];
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
-
let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title:
|
|
333
|
-
if (x.status === "loading") return /* @__PURE__ */ J(
|
|
332
|
+
function ft({ categories: e, series: t, domain: n, mode: r = "grouped", valueFormat: i, tickFormat: a, valueLabel: o, highlighted: s, selected: c, onSelectedChange: l, height: d = "compact", composition: f, referenceLines: h = [], markers: g = [], annotations: _ = [], emphasizedCategoryIds: v = [], ...y }) {
|
|
333
|
+
let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title: C } = x, w = f?.focusedSeries, T = U(), E = U(), { ref: D, width: O, height: k } = _e(d), ae = te(), oe = st();
|
|
334
|
+
if (x.status === "loading") return /* @__PURE__ */ J(ct, {
|
|
334
335
|
...x,
|
|
335
336
|
series: t,
|
|
336
337
|
height: d
|
|
337
338
|
});
|
|
338
|
-
let
|
|
339
|
-
values:
|
|
339
|
+
let j = n ?? u({
|
|
340
|
+
values: dt({
|
|
340
341
|
categories: e,
|
|
341
342
|
series: t,
|
|
342
343
|
mode: r,
|
|
@@ -345,88 +346,88 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
345
346
|
markers: g
|
|
346
347
|
}),
|
|
347
348
|
isZeroBased: !0
|
|
348
|
-
}),
|
|
349
|
+
}), se = w === void 0 ? void 0 : ut({
|
|
349
350
|
categories: e,
|
|
350
|
-
series: [
|
|
351
|
-
domain:
|
|
351
|
+
series: [w],
|
|
352
|
+
domain: j,
|
|
352
353
|
mode: "grouped"
|
|
353
|
-
}),
|
|
354
|
+
}), M = ut({
|
|
354
355
|
categories: e,
|
|
355
356
|
series: t,
|
|
356
|
-
domain:
|
|
357
|
+
domain: j,
|
|
357
358
|
mode: r
|
|
358
|
-
}) ??
|
|
359
|
+
}) ?? se, P = e.map((e) => e.id), de = je({
|
|
359
360
|
markers: g,
|
|
360
361
|
annotations: _,
|
|
361
362
|
emphasizedCategoryIds: v,
|
|
362
|
-
seriesIds: [...t, ...
|
|
363
|
-
categoryIds:
|
|
364
|
-
domain:
|
|
365
|
-
}) ??
|
|
363
|
+
seriesIds: [...t, ...w === void 0 ? [] : [w]].map((e) => e.id),
|
|
364
|
+
categoryIds: P,
|
|
365
|
+
domain: j
|
|
366
|
+
}) ?? ye({
|
|
366
367
|
lines: h,
|
|
367
|
-
domain:
|
|
368
|
-
}),
|
|
368
|
+
domain: j
|
|
369
|
+
}), F = M ?? X({
|
|
369
370
|
composition: f,
|
|
370
371
|
series: t,
|
|
371
|
-
categoryIds:
|
|
372
|
-
domain:
|
|
373
|
-
}) ??
|
|
374
|
-
if (
|
|
372
|
+
categoryIds: P,
|
|
373
|
+
domain: j
|
|
374
|
+
}) ?? de;
|
|
375
|
+
if (F !== void 0) return /* @__PURE__ */ J(ce, {
|
|
375
376
|
...x,
|
|
376
|
-
message:
|
|
377
|
+
message: F
|
|
377
378
|
});
|
|
378
|
-
function
|
|
379
|
-
return
|
|
379
|
+
function I(e) {
|
|
380
|
+
return ne({
|
|
380
381
|
value: e,
|
|
381
382
|
locale: S,
|
|
382
383
|
format: i
|
|
383
384
|
});
|
|
384
385
|
}
|
|
385
|
-
let
|
|
386
|
+
let L = w !== void 0 && !t.some((e) => e.id === w.id), pe = [...t, ...L ? [w] : []], R = new Map(pe.map((e, t) => [e.id, ae({
|
|
386
387
|
id: e.id,
|
|
387
388
|
tone: e.tone,
|
|
388
389
|
index: t
|
|
389
390
|
})]));
|
|
390
|
-
function
|
|
391
|
-
return
|
|
391
|
+
function z(e) {
|
|
392
|
+
return R.get(e) ?? "neutral";
|
|
392
393
|
}
|
|
393
|
-
let
|
|
394
|
-
id:
|
|
394
|
+
let B = f === void 0 ? void 0 : {
|
|
395
|
+
id: T,
|
|
395
396
|
label: f.contextLabel,
|
|
396
397
|
tone: "neutral",
|
|
397
398
|
values: f.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
398
|
-
},
|
|
399
|
+
}, he = B === void 0 ? t : [B, ...pe], xe = (w !== void 0 && B !== void 0 ? [w, B] : t).map((e) => ({
|
|
399
400
|
id: e.id,
|
|
400
401
|
label: e.label,
|
|
401
|
-
tone: e.id ===
|
|
402
|
-
})),
|
|
402
|
+
tone: e.id === T ? "neutral" : z(e.id)
|
|
403
|
+
})), Se = g.map((e) => ({
|
|
403
404
|
id: e.id,
|
|
404
405
|
label: e.label,
|
|
405
406
|
tone: e.tone ?? "neutral",
|
|
406
407
|
shape: e.kind
|
|
407
408
|
}));
|
|
408
|
-
function
|
|
409
|
-
let r = e[n], i = f?.buckets[n], a =
|
|
409
|
+
function Ce(n) {
|
|
410
|
+
let r = e[n], i = f?.buckets[n], a = w !== void 0 && B !== void 0 ? [w, B] : B === void 0 || i?.kind === "parts" ? t : [], o = i === void 0 ? void 0 : i.kind === "gap" ? "No reported value" : I(i.total), s = a.map((e) => ({
|
|
410
411
|
id: e.id,
|
|
411
412
|
label: e.label,
|
|
412
|
-
tone: e.id ===
|
|
413
|
-
value:
|
|
413
|
+
tone: e.id === T ? "neutral" : z(e.id),
|
|
414
|
+
value: I(e.values[n] ?? null)
|
|
414
415
|
})), c = g.map((e) => ({
|
|
415
416
|
id: e.id,
|
|
416
417
|
label: e.label,
|
|
417
418
|
tone: e.tone ?? "neutral",
|
|
418
419
|
shape: e.kind,
|
|
419
|
-
value:
|
|
420
|
+
value: Me({
|
|
420
421
|
marker: e,
|
|
421
422
|
index: n,
|
|
422
|
-
valueText:
|
|
423
|
+
valueText: I
|
|
423
424
|
})
|
|
424
425
|
})), l = h.map((e) => ({
|
|
425
426
|
id: e.id,
|
|
426
427
|
label: e.label,
|
|
427
428
|
tone: e.tone ?? "neutral",
|
|
428
429
|
shape: "dashed",
|
|
429
|
-
value:
|
|
430
|
+
value: I(e.value)
|
|
430
431
|
}));
|
|
431
432
|
return {
|
|
432
433
|
category: r,
|
|
@@ -440,9 +441,9 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
440
441
|
notes: _.filter((e) => e.categoryId === r?.id).map((e) => e.label)
|
|
441
442
|
};
|
|
442
443
|
}
|
|
443
|
-
let
|
|
444
|
-
width:
|
|
445
|
-
height:
|
|
444
|
+
let V = f?.annotation, we = _.length > 0 || V !== void 0, Te = p({
|
|
445
|
+
width: O,
|
|
446
|
+
height: k,
|
|
446
447
|
direction: "columns",
|
|
447
448
|
categories: e.map((e) => ({
|
|
448
449
|
id: e.id,
|
|
@@ -453,45 +454,45 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
453
454
|
format: i,
|
|
454
455
|
tickFormat: a
|
|
455
456
|
},
|
|
456
|
-
valueDomain:
|
|
457
|
+
valueDomain: j,
|
|
457
458
|
locale: S,
|
|
458
|
-
topInset:
|
|
459
|
+
topInset: we ? $e : 0,
|
|
459
460
|
hasValueTitle: o !== void 0
|
|
460
|
-
}), { box:
|
|
461
|
+
}), { box: W, band: G } = Te, K = Te.value.position, Ee = A({
|
|
461
462
|
ids: t.map((e) => e.id),
|
|
462
|
-
range: [0,
|
|
463
|
-
padding:
|
|
464
|
-
}),
|
|
465
|
-
function De(e) {
|
|
466
|
-
return K.start(e) ?? G.left;
|
|
467
|
-
}
|
|
463
|
+
range: [0, G.bandwidth],
|
|
464
|
+
padding: nt
|
|
465
|
+
}), De = r === "stacked" || f !== void 0;
|
|
468
466
|
function Oe(e) {
|
|
469
|
-
return
|
|
467
|
+
return G.start(e) ?? W.left;
|
|
468
|
+
}
|
|
469
|
+
function ke(e) {
|
|
470
|
+
return Oe(e) + G.bandwidth * at;
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
-
let n =
|
|
473
|
-
return
|
|
472
|
+
function q(e, t) {
|
|
473
|
+
let n = Oe(e);
|
|
474
|
+
return De ? {
|
|
474
475
|
x: n,
|
|
475
|
-
width:
|
|
476
|
+
width: G.bandwidth
|
|
476
477
|
} : {
|
|
477
|
-
x: n + (
|
|
478
|
-
width:
|
|
478
|
+
x: n + (Ee.start(t) ?? 0),
|
|
479
|
+
width: Ee.bandwidth
|
|
479
480
|
};
|
|
480
481
|
}
|
|
481
482
|
function Z(e, n) {
|
|
482
|
-
if (!
|
|
483
|
+
if (!De) return t.find((e) => e.id === n)?.values[e] ?? null;
|
|
483
484
|
let r = t.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
|
|
484
485
|
return r.length === 0 ? null : r.reduce((e, t) => e + t, 0);
|
|
485
486
|
}
|
|
486
487
|
function Q(e, n) {
|
|
487
|
-
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i =
|
|
488
|
+
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = De ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = f?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [Ne(t, e)].filter((e) => e !== null));
|
|
488
489
|
return Math.max(0, i, o, ...s);
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
-
return Math.max(
|
|
491
|
+
function Ae(e) {
|
|
492
|
+
return Math.max(tt, K(e) - et);
|
|
492
493
|
}
|
|
493
494
|
let Pe = {
|
|
494
|
-
label: `${
|
|
495
|
+
label: `${C} observations`,
|
|
495
496
|
columns: [{
|
|
496
497
|
id: "category",
|
|
497
498
|
label: "Category"
|
|
@@ -502,83 +503,83 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
502
503
|
rows: [...e.map((e, t) => ({
|
|
503
504
|
id: e.id,
|
|
504
505
|
values: [e.label, [
|
|
505
|
-
...
|
|
506
|
-
...g.map((e) => `${e.label}: ${
|
|
506
|
+
...he.map((e) => `${e.label}: ${I(e.values[t] ?? null)}`),
|
|
507
|
+
...g.map((e) => `${e.label}: ${Me({
|
|
507
508
|
marker: e,
|
|
508
509
|
index: t,
|
|
509
|
-
valueText:
|
|
510
|
+
valueText: I
|
|
510
511
|
})}`),
|
|
511
512
|
..._.filter((t) => t.categoryId === e.id).map((e) => e.label)
|
|
512
513
|
].join(" · ")]
|
|
513
514
|
})), ...h.map((e) => ({
|
|
514
515
|
id: `reference:${e.id}`,
|
|
515
|
-
values: [e.label,
|
|
516
|
+
values: [e.label, I(e.value)]
|
|
516
517
|
}))]
|
|
517
518
|
};
|
|
518
519
|
return /* @__PURE__ */ J(ee, {
|
|
519
520
|
items: e,
|
|
520
|
-
readout: (e) =>
|
|
521
|
-
locate: (e) =>
|
|
521
|
+
readout: (e) => ie(Ce(P.indexOf(e))),
|
|
522
|
+
locate: (e) => G.idAt(e.x / e.width * W.width),
|
|
522
523
|
selected: c ?? null,
|
|
523
524
|
onSelect: l,
|
|
524
525
|
render: (n, { inspected: i, cursor: a }) => {
|
|
525
|
-
let u =
|
|
526
|
+
let u = Ce(P.indexOf(i ?? ""));
|
|
526
527
|
function d(e) {
|
|
527
528
|
let t = v.includes(e);
|
|
528
529
|
return v.length > 0 && !t && i !== e;
|
|
529
530
|
}
|
|
530
|
-
let p =
|
|
531
|
-
id: `composition:${
|
|
532
|
-
text:
|
|
533
|
-
x:
|
|
534
|
-
y:
|
|
535
|
-
isReceded: d(
|
|
531
|
+
let p = V === void 0 || !P.includes(V.categoryId) ? [] : [{
|
|
532
|
+
id: `composition:${V.categoryId}`,
|
|
533
|
+
text: V.label,
|
|
534
|
+
x: ke(V.categoryId),
|
|
535
|
+
y: Ae(V.value),
|
|
536
|
+
isReceded: d(V.categoryId)
|
|
536
537
|
}], ee = _.map((e) => {
|
|
537
538
|
let t = e.seriesId === void 0 ? {
|
|
538
|
-
x:
|
|
539
|
-
width:
|
|
540
|
-
} :
|
|
539
|
+
x: Oe(e.categoryId),
|
|
540
|
+
width: G.bandwidth
|
|
541
|
+
} : q(e.categoryId, e.seriesId);
|
|
541
542
|
return {
|
|
542
543
|
id: e.id,
|
|
543
544
|
text: e.label,
|
|
544
|
-
x: t.x + t.width *
|
|
545
|
-
y:
|
|
545
|
+
x: t.x + t.width * at,
|
|
546
|
+
y: Ae(Q(P.indexOf(e.categoryId), e.seriesId)),
|
|
546
547
|
isReceded: d(e.categoryId)
|
|
547
548
|
};
|
|
548
549
|
}), y = [...p, ...ee];
|
|
549
|
-
return /* @__PURE__ */ J(
|
|
550
|
+
return /* @__PURE__ */ J(ot, {
|
|
550
551
|
...x,
|
|
551
552
|
figure: n,
|
|
552
|
-
legend: [...
|
|
553
|
-
layoutLegend: [...
|
|
553
|
+
legend: [...xe, ...Se],
|
|
554
|
+
layoutLegend: [...oe(t), ...Se],
|
|
554
555
|
notes: u.notes,
|
|
555
|
-
inspectionId:
|
|
556
|
+
inspectionId: E,
|
|
556
557
|
label: u.label,
|
|
557
558
|
titleDetail: u.category === void 0 ? void 0 : [u.category.axisLabel ?? u.category.label, u.summary].filter(Boolean).join(" · "),
|
|
558
559
|
summary: u.summary,
|
|
559
560
|
rows: u.rows,
|
|
560
|
-
x:
|
|
561
|
-
width:
|
|
562
|
-
offset:
|
|
561
|
+
x: ke(i ?? ""),
|
|
562
|
+
width: O,
|
|
563
|
+
offset: G.bandwidth * at + it,
|
|
563
564
|
data: Pe,
|
|
564
|
-
children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(
|
|
565
|
-
plotRef:
|
|
566
|
-
box:
|
|
565
|
+
children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(le, { children: b }) : /* @__PURE__ */ Y(ge, {
|
|
566
|
+
plotRef: D,
|
|
567
|
+
box: W,
|
|
567
568
|
label: m({
|
|
568
|
-
title:
|
|
569
|
+
title: C,
|
|
569
570
|
marks: "categories",
|
|
570
571
|
isSelectable: l !== void 0
|
|
571
572
|
}),
|
|
572
|
-
readoutId:
|
|
573
|
+
readoutId: E,
|
|
573
574
|
children: [
|
|
574
|
-
/* @__PURE__ */ J(
|
|
575
|
-
box:
|
|
576
|
-
xTicks:
|
|
577
|
-
yTicks:
|
|
575
|
+
/* @__PURE__ */ J(ue, {
|
|
576
|
+
box: W,
|
|
577
|
+
xTicks: Te.bandTicks,
|
|
578
|
+
yTicks: Te.valueTicks,
|
|
578
579
|
yTitle: o
|
|
579
580
|
}),
|
|
580
|
-
/* @__PURE__ */ Y(
|
|
581
|
-
box:
|
|
581
|
+
/* @__PURE__ */ Y(ve, {
|
|
582
|
+
box: W,
|
|
582
583
|
children: [
|
|
583
584
|
e.map((e, n) => {
|
|
584
585
|
let a = f?.buckets[n], o = {
|
|
@@ -587,66 +588,67 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
587
588
|
};
|
|
588
589
|
return a === void 0 ? t.map((i, a) => {
|
|
589
590
|
let c = i.values[n];
|
|
590
|
-
if (c == null) return null;
|
|
591
|
-
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u =
|
|
592
|
-
return /* @__PURE__ */ J(
|
|
591
|
+
if (c == null || r === "stacked" && c === 0) return null;
|
|
592
|
+
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = K(l), f = K(l + c), p = s != null && s !== i.id, m = q(e.id, i.id);
|
|
593
|
+
return /* @__PURE__ */ J(me, {
|
|
593
594
|
...o,
|
|
594
595
|
x: m.x,
|
|
595
596
|
y: Math.min(u, f),
|
|
596
597
|
width: m.width,
|
|
597
598
|
height: Math.max(+(c === 0), Math.abs(f - u)),
|
|
598
|
-
tone:
|
|
599
|
-
emphasis: p || d(e.id) ? "receded" : "normal"
|
|
599
|
+
tone: z(i.id),
|
|
600
|
+
emphasis: p || d(e.id) ? "receded" : "normal",
|
|
601
|
+
mark: t.length === 1 ? e.id : `${e.id}:${i.id}`
|
|
600
602
|
}, `${e.id}:${i.id}`);
|
|
601
603
|
}) : /* @__PURE__ */ J("g", {
|
|
602
|
-
...H.props(
|
|
603
|
-
children: /* @__PURE__ */ J(
|
|
604
|
+
...H.props(N.emphasis, d(e.id) && N.receded),
|
|
605
|
+
children: /* @__PURE__ */ J(Ze, {
|
|
604
606
|
...o,
|
|
605
607
|
bucket: a,
|
|
606
608
|
series: t,
|
|
607
|
-
focusedSeries:
|
|
609
|
+
focusedSeries: w,
|
|
608
610
|
index: n,
|
|
609
|
-
x:
|
|
610
|
-
width:
|
|
611
|
-
y:
|
|
611
|
+
x: Oe(e.id),
|
|
612
|
+
width: G.bandwidth,
|
|
613
|
+
y: K,
|
|
612
614
|
highlighted: s,
|
|
613
|
-
toneOf:
|
|
615
|
+
toneOf: z
|
|
614
616
|
})
|
|
615
617
|
}, e.id);
|
|
616
618
|
}),
|
|
617
|
-
/* @__PURE__ */ J(
|
|
618
|
-
x1:
|
|
619
|
-
x2:
|
|
620
|
-
y1:
|
|
621
|
-
y2:
|
|
619
|
+
/* @__PURE__ */ J(fe, {
|
|
620
|
+
x1: W.left,
|
|
621
|
+
x2: W.right,
|
|
622
|
+
y1: K(0),
|
|
623
|
+
y2: K(0)
|
|
622
624
|
}),
|
|
623
|
-
/* @__PURE__ */ J(
|
|
625
|
+
/* @__PURE__ */ J(Ke, {
|
|
624
626
|
markers: g,
|
|
625
|
-
categoryIds:
|
|
626
|
-
span:
|
|
627
|
+
categoryIds: P,
|
|
628
|
+
span: q,
|
|
627
629
|
barTop: Z,
|
|
628
|
-
y:
|
|
630
|
+
y: K,
|
|
629
631
|
isReceded: d
|
|
630
632
|
})
|
|
631
633
|
]
|
|
632
634
|
}),
|
|
633
|
-
/* @__PURE__ */ J(
|
|
635
|
+
/* @__PURE__ */ J(be, {
|
|
634
636
|
lines: h,
|
|
635
|
-
box:
|
|
636
|
-
position:
|
|
637
|
-
valueText:
|
|
638
|
-
avoid:
|
|
637
|
+
box: W,
|
|
638
|
+
position: K,
|
|
639
|
+
valueText: I,
|
|
640
|
+
avoid: ze(y)
|
|
639
641
|
}),
|
|
640
|
-
/* @__PURE__ */ J(
|
|
642
|
+
/* @__PURE__ */ J(qe, {
|
|
641
643
|
annotations: y,
|
|
642
|
-
left:
|
|
643
|
-
right:
|
|
644
|
+
left: W.left,
|
|
645
|
+
right: W.right
|
|
644
646
|
}),
|
|
645
|
-
a !== null && /* @__PURE__ */ J(
|
|
646
|
-
x:
|
|
647
|
-
top:
|
|
648
|
-
bottom:
|
|
649
|
-
width: Math.max(
|
|
647
|
+
a !== null && /* @__PURE__ */ J(re, {
|
|
648
|
+
x: ke(a),
|
|
649
|
+
top: W.top,
|
|
650
|
+
bottom: W.bottom,
|
|
651
|
+
width: Math.max(rt, G.bandwidth)
|
|
650
652
|
})
|
|
651
653
|
]
|
|
652
654
|
})
|
|
@@ -655,13 +657,13 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
655
657
|
});
|
|
656
658
|
}
|
|
657
659
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
658
|
-
var
|
|
660
|
+
var pt = {
|
|
659
661
|
kzqmXN: "x5lhr3w",
|
|
660
662
|
kGVxlE: "x1iotiob",
|
|
661
663
|
kZKoxP: "x5yr21d",
|
|
662
664
|
$$css: !0
|
|
663
|
-
},
|
|
664
|
-
|
|
665
|
+
}, mt = { segment: (e, t, n) => [
|
|
666
|
+
pt,
|
|
665
667
|
{
|
|
666
668
|
kWkggS: t == null ? t : "xl8spv7",
|
|
667
669
|
$$css: !0
|
|
@@ -671,24 +673,24 @@ var ft = {
|
|
|
671
673
|
"--x-backgroundColor": t ?? void 0,
|
|
672
674
|
"--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
|
|
673
675
|
}
|
|
674
|
-
] },
|
|
675
|
-
function
|
|
676
|
-
let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f =
|
|
677
|
-
if (l.status === "loading") return /* @__PURE__ */ J(
|
|
676
|
+
] }, ht = 100;
|
|
677
|
+
function gt({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange: o, ...s }) {
|
|
678
|
+
let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f = te();
|
|
679
|
+
if (l.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
678
680
|
...l,
|
|
679
681
|
height: "compact"
|
|
680
682
|
});
|
|
681
683
|
let p = y(e), m = e.reduce((e, t) => e + (t.value ?? 0), 0), h = 2 ** -52 * Math.max(m, t, 1) * e.length;
|
|
682
|
-
if (p !== void 0) return /* @__PURE__ */ J(
|
|
684
|
+
if (p !== void 0) return /* @__PURE__ */ J(ce, {
|
|
683
685
|
...l,
|
|
684
686
|
message: p
|
|
685
687
|
});
|
|
686
|
-
if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(
|
|
688
|
+
if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(ce, {
|
|
687
689
|
...l,
|
|
688
690
|
message: "The total must be finite and at least the sum of recorded values."
|
|
689
691
|
});
|
|
690
692
|
function g(e) {
|
|
691
|
-
return
|
|
693
|
+
return ne({
|
|
692
694
|
value: e,
|
|
693
695
|
locale: u,
|
|
694
696
|
format: n
|
|
@@ -712,13 +714,13 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
712
714
|
render: (n, r) => /* @__PURE__ */ J(j, {
|
|
713
715
|
...l,
|
|
714
716
|
figure: n,
|
|
715
|
-
children: e.length === 0 ? /* @__PURE__ */ J(
|
|
717
|
+
children: e.length === 0 ? /* @__PURE__ */ J(le, { children: c }) : /* @__PURE__ */ Y(q, { children: [
|
|
716
718
|
/* @__PURE__ */ J("div", {
|
|
717
719
|
"aria-hidden": !0,
|
|
718
720
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
719
721
|
children: e.map((e, n) => {
|
|
720
722
|
let r = _[n]?.tone ?? "neutral";
|
|
721
|
-
return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(
|
|
723
|
+
return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(mt.segment(t === 0 ? 0 : e.value / t * ht, a[r], i[r])) }, e.id);
|
|
722
724
|
})
|
|
723
725
|
}),
|
|
724
726
|
/* @__PURE__ */ J(S, {
|
|
@@ -740,15 +742,15 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
740
742
|
});
|
|
741
743
|
}
|
|
742
744
|
// packages/charts/src/cartesian/bridge-data.ts
|
|
743
|
-
function
|
|
745
|
+
function _t(e) {
|
|
744
746
|
return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
745
747
|
}
|
|
746
|
-
function
|
|
748
|
+
function vt(e) {
|
|
747
749
|
let t = e.map((e) => e.kind === "total" ? 0 : e.value);
|
|
748
750
|
return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
|
|
749
751
|
}
|
|
750
|
-
function
|
|
751
|
-
let r = e.tone ??
|
|
752
|
+
function yt({ step: e, before: t, after: n }) {
|
|
753
|
+
let r = e.tone ?? _t(e);
|
|
752
754
|
switch (e.kind) {
|
|
753
755
|
case "start": return {
|
|
754
756
|
step: e,
|
|
@@ -770,18 +772,18 @@ function vt({ step: e, before: t, after: n }) {
|
|
|
770
772
|
};
|
|
771
773
|
}
|
|
772
774
|
}
|
|
773
|
-
function
|
|
774
|
-
return e.map((t, n) =>
|
|
775
|
+
function bt(e) {
|
|
776
|
+
return e.map((t, n) => yt({
|
|
775
777
|
step: t,
|
|
776
|
-
before:
|
|
777
|
-
after:
|
|
778
|
+
before: vt(e.slice(0, n)),
|
|
779
|
+
after: vt(e.slice(0, n + 1))
|
|
778
780
|
}));
|
|
779
781
|
}
|
|
780
|
-
function
|
|
782
|
+
function xt(e) {
|
|
781
783
|
let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
|
|
782
784
|
return n === r ? [n, n + 1] : [n, r];
|
|
783
785
|
}
|
|
784
|
-
function
|
|
786
|
+
function St({ steps: e, domain: t }) {
|
|
785
787
|
if (e.length > x.items) return `Choose a bridge with at most ${x.items} steps.`;
|
|
786
788
|
if (!o(e)) return "Bridge steps require unique identifiers.";
|
|
787
789
|
if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
|
|
@@ -790,36 +792,36 @@ function xt({ steps: e, domain: t }) {
|
|
|
790
792
|
let t = e.kind === "total" ? null : e.value;
|
|
791
793
|
return t !== null && !Number.isFinite(t);
|
|
792
794
|
})) return "Bridge values must be finite numbers or explicit missing changes.";
|
|
793
|
-
let n = bt(
|
|
795
|
+
let n = xt(bt(e));
|
|
794
796
|
if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
|
|
795
797
|
let r = t[0] <= n[0] && t[1] >= n[1];
|
|
796
798
|
if (!D(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
|
|
797
799
|
}
|
|
798
800
|
// packages/charts/src/cartesian/bridge-chart.tsx
|
|
799
|
-
var
|
|
800
|
-
function
|
|
801
|
+
var Ct = 12, wt = 6, Tt = 14, Et = 12, Dt = 8, Ot = 8, kt = .5;
|
|
802
|
+
function At(e) {
|
|
801
803
|
return typeof e == "function" ? (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}` : {
|
|
802
804
|
...e,
|
|
803
805
|
signDisplay: "exceptZero"
|
|
804
806
|
};
|
|
805
807
|
}
|
|
806
|
-
function
|
|
808
|
+
function jt({ level: e, valueText: t, changeText: n }) {
|
|
807
809
|
return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
|
|
808
810
|
}
|
|
809
|
-
function
|
|
811
|
+
function Mt({ level: e, valueText: t, changeText: n }) {
|
|
810
812
|
return e.step.kind === "change" ? e.step.value === null ? T : n(e.step.value) : e.to === null ? T : t(e.to);
|
|
811
813
|
}
|
|
812
|
-
function
|
|
814
|
+
function Nt({ level: e, valueText: t }) {
|
|
813
815
|
return e.from === null || e.to === null ? T : `${t(e.from)} → ${t(e.to)}`;
|
|
814
816
|
}
|
|
815
|
-
function
|
|
817
|
+
function Pt(e, t, n) {
|
|
816
818
|
if (e.from === null || e.to === null) {
|
|
817
|
-
let r = Math.min(n -
|
|
819
|
+
let r = Math.min(n - Et, t(e.from ?? 0) - Et * kt);
|
|
818
820
|
return {
|
|
819
821
|
isKnown: !1,
|
|
820
822
|
top: r,
|
|
821
|
-
height:
|
|
822
|
-
labelY: r -
|
|
823
|
+
height: Et,
|
|
824
|
+
labelY: r - wt
|
|
823
825
|
};
|
|
824
826
|
}
|
|
825
827
|
let r = Math.max(e.from, e.to), i = Math.min(e.from, e.to), a = t(r), o = r <= 0 && i < 0;
|
|
@@ -827,41 +829,41 @@ function Nt(e, t, n) {
|
|
|
827
829
|
isKnown: !0,
|
|
828
830
|
top: a,
|
|
829
831
|
height: Math.max(1, t(i) - a),
|
|
830
|
-
labelY: o ? t(i) +
|
|
832
|
+
labelY: o ? t(i) + Tt : a - wt
|
|
831
833
|
};
|
|
832
834
|
}
|
|
833
|
-
function
|
|
834
|
-
let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v =
|
|
835
|
-
if (h.status === "loading") return /* @__PURE__ */ J(
|
|
835
|
+
function Ft({ steps: e, valueFormat: t, changeFormat: n = At(t), tickFormat: r, valueLabel: i, domain: a, referenceLines: o = [], selected: s, onSelectedChange: c, height: l = "regular", ...d }) {
|
|
836
|
+
let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v = _e(l), y = U();
|
|
837
|
+
if (h.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
836
838
|
...h,
|
|
837
839
|
height: l
|
|
838
840
|
});
|
|
839
|
-
let b =
|
|
841
|
+
let b = bt(e), x = xt(b), S = a ?? u({ values: [...x, ...o.map((e) => e.value)] }), C = St({
|
|
840
842
|
steps: e,
|
|
841
843
|
domain: a
|
|
842
|
-
}) ??
|
|
844
|
+
}) ?? ye({
|
|
843
845
|
lines: o,
|
|
844
846
|
domain: S
|
|
845
847
|
});
|
|
846
|
-
if (C !== void 0) return /* @__PURE__ */ J(
|
|
848
|
+
if (C !== void 0) return /* @__PURE__ */ J(ce, {
|
|
847
849
|
...h,
|
|
848
850
|
message: C
|
|
849
851
|
});
|
|
850
|
-
function
|
|
851
|
-
return (t) =>
|
|
852
|
+
function te(e) {
|
|
853
|
+
return (t) => ne({
|
|
852
854
|
value: t,
|
|
853
855
|
locale: g,
|
|
854
856
|
format: e
|
|
855
857
|
});
|
|
856
858
|
}
|
|
857
|
-
let
|
|
859
|
+
let w = te(t), T = te(n), E = o.map((e) => ({
|
|
858
860
|
id: e.id,
|
|
859
861
|
label: e.label,
|
|
860
862
|
tone: e.tone ?? "neutral",
|
|
861
863
|
shape: "dashed",
|
|
862
|
-
value:
|
|
864
|
+
value: w(e.value)
|
|
863
865
|
}));
|
|
864
|
-
function
|
|
866
|
+
function D(e) {
|
|
865
867
|
let t = b.find((t) => t.step.id === e);
|
|
866
868
|
if (t === void 0) return {
|
|
867
869
|
level: t,
|
|
@@ -873,23 +875,23 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
873
875
|
id: "running",
|
|
874
876
|
label: "Running total",
|
|
875
877
|
tone: "neutral",
|
|
876
|
-
value:
|
|
878
|
+
value: Nt({
|
|
877
879
|
level: t,
|
|
878
|
-
valueText:
|
|
880
|
+
valueText: w
|
|
879
881
|
})
|
|
880
882
|
}] : [];
|
|
881
883
|
return {
|
|
882
884
|
level: t,
|
|
883
885
|
label: t.step.label,
|
|
884
|
-
summary:
|
|
886
|
+
summary: Mt({
|
|
885
887
|
level: t,
|
|
886
|
-
valueText:
|
|
887
|
-
changeText:
|
|
888
|
+
valueText: w,
|
|
889
|
+
changeText: T
|
|
888
890
|
}),
|
|
889
|
-
rows: [...n, ...
|
|
891
|
+
rows: [...n, ...E]
|
|
890
892
|
};
|
|
891
893
|
}
|
|
892
|
-
let
|
|
894
|
+
let O = p({
|
|
893
895
|
width: v.width,
|
|
894
896
|
height: v.height,
|
|
895
897
|
direction: "columns",
|
|
@@ -904,43 +906,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
904
906
|
},
|
|
905
907
|
valueDomain: S,
|
|
906
908
|
locale: g,
|
|
907
|
-
topInset:
|
|
909
|
+
topInset: Ct,
|
|
908
910
|
hasValueTitle: i !== void 0
|
|
909
|
-
}), { box:
|
|
911
|
+
}), { box: k, band: A } = O, M = O.value.position, N = b.map((e) => ({
|
|
910
912
|
id: e.step.id,
|
|
911
913
|
label: e.step.label
|
|
912
914
|
}));
|
|
913
|
-
function
|
|
914
|
-
return
|
|
915
|
+
function P(e) {
|
|
916
|
+
return A.start(e) ?? k.left;
|
|
915
917
|
}
|
|
916
|
-
function
|
|
917
|
-
return
|
|
918
|
+
function de(e) {
|
|
919
|
+
return P(e) + A.bandwidth * kt;
|
|
918
920
|
}
|
|
919
|
-
let
|
|
921
|
+
let I = ze([...b.filter((e) => e.step.kind !== "change"), ...b.filter((e) => e.step.kind === "change")].map((e) => ({
|
|
920
922
|
id: e.step.id,
|
|
921
923
|
isTotal: e.step.kind !== "change",
|
|
922
|
-
text:
|
|
924
|
+
text: jt({
|
|
923
925
|
level: e,
|
|
924
|
-
valueText:
|
|
925
|
-
changeText:
|
|
926
|
+
valueText: w,
|
|
927
|
+
changeText: T
|
|
926
928
|
}),
|
|
927
|
-
x:
|
|
928
|
-
y:
|
|
929
|
+
x: de(e.step.id),
|
|
930
|
+
y: Pt(e, M, k.bottom).labelY
|
|
929
931
|
})));
|
|
930
932
|
return /* @__PURE__ */ J(ee, {
|
|
931
|
-
items:
|
|
932
|
-
readout: (e) =>
|
|
933
|
-
locate: (e) =>
|
|
933
|
+
items: N,
|
|
934
|
+
readout: (e) => ie(D(e)),
|
|
935
|
+
locate: (e) => A.idAt(e.x / e.width * k.width),
|
|
934
936
|
selected: s ?? null,
|
|
935
937
|
onSelect: c,
|
|
936
938
|
render: (e, { inspected: t, cursor: n }) => {
|
|
937
|
-
let r =
|
|
939
|
+
let r = D(t);
|
|
938
940
|
return /* @__PURE__ */ Y(j, {
|
|
939
941
|
...h,
|
|
940
942
|
figure: e,
|
|
941
943
|
titleDetail: r.level === void 0 ? void 0 : `${r.label} · ${r.summary}`,
|
|
942
944
|
children: [
|
|
943
|
-
/* @__PURE__ */ J(
|
|
945
|
+
/* @__PURE__ */ J(oe, {
|
|
944
946
|
label: `${_} steps`,
|
|
945
947
|
columns: [
|
|
946
948
|
{
|
|
@@ -960,43 +962,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
960
962
|
id: e.step.id,
|
|
961
963
|
values: [
|
|
962
964
|
e.step.label,
|
|
963
|
-
|
|
965
|
+
Mt({
|
|
964
966
|
level: e,
|
|
965
|
-
valueText:
|
|
966
|
-
changeText:
|
|
967
|
+
valueText: w,
|
|
968
|
+
changeText: T
|
|
967
969
|
}),
|
|
968
|
-
e.step.kind === "change" ?
|
|
970
|
+
e.step.kind === "change" ? Nt({
|
|
969
971
|
level: e,
|
|
970
|
-
valueText:
|
|
971
|
-
}) :
|
|
972
|
+
valueText: w
|
|
973
|
+
}) : Mt({
|
|
972
974
|
level: e,
|
|
973
|
-
valueText:
|
|
974
|
-
changeText:
|
|
975
|
+
valueText: w,
|
|
976
|
+
changeText: T
|
|
975
977
|
})
|
|
976
978
|
]
|
|
977
979
|
})), ...o.map((e) => ({
|
|
978
980
|
id: `reference:${e.id}`,
|
|
979
981
|
values: [
|
|
980
982
|
e.label,
|
|
981
|
-
|
|
983
|
+
w(e.value),
|
|
982
984
|
""
|
|
983
985
|
]
|
|
984
986
|
}))]
|
|
985
987
|
}),
|
|
986
|
-
/* @__PURE__ */ J(
|
|
988
|
+
/* @__PURE__ */ J(se, {
|
|
987
989
|
id: y,
|
|
988
990
|
label: r.label,
|
|
989
991
|
summary: r.summary,
|
|
990
992
|
legend: [],
|
|
991
993
|
hasLegend: !1,
|
|
992
994
|
rows: r.rows,
|
|
993
|
-
x:
|
|
995
|
+
x: de(t ?? ""),
|
|
994
996
|
width: v.width,
|
|
995
|
-
offset:
|
|
997
|
+
offset: A.bandwidth * kt + Ot
|
|
996
998
|
}),
|
|
997
|
-
b.length === 0 ? /* @__PURE__ */ J(
|
|
999
|
+
b.length === 0 ? /* @__PURE__ */ J(le, { children: f }) : /* @__PURE__ */ Y(ge, {
|
|
998
1000
|
plotRef: v.ref,
|
|
999
|
-
box:
|
|
1001
|
+
box: k,
|
|
1000
1002
|
label: m({
|
|
1001
1003
|
title: _,
|
|
1002
1004
|
marks: "steps",
|
|
@@ -1004,30 +1006,30 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1004
1006
|
}),
|
|
1005
1007
|
readoutId: y,
|
|
1006
1008
|
children: [
|
|
1007
|
-
/* @__PURE__ */ J(
|
|
1008
|
-
box:
|
|
1009
|
-
xTicks:
|
|
1010
|
-
yTicks:
|
|
1009
|
+
/* @__PURE__ */ J(ue, {
|
|
1010
|
+
box: k,
|
|
1011
|
+
xTicks: O.bandTicks,
|
|
1012
|
+
yTicks: O.valueTicks,
|
|
1011
1013
|
yTitle: i
|
|
1012
1014
|
}),
|
|
1013
|
-
/* @__PURE__ */ Y(
|
|
1014
|
-
box:
|
|
1015
|
+
/* @__PURE__ */ Y(ve, {
|
|
1016
|
+
box: k,
|
|
1015
1017
|
children: [
|
|
1016
1018
|
b.map((e, t) => {
|
|
1017
1019
|
let n = b[t + 1];
|
|
1018
|
-
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(
|
|
1019
|
-
x1:
|
|
1020
|
-
x2:
|
|
1021
|
-
y1:
|
|
1022
|
-
y2:
|
|
1020
|
+
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(L, {
|
|
1021
|
+
x1: P(e.step.id) + A.bandwidth,
|
|
1022
|
+
x2: P(n.step.id),
|
|
1023
|
+
y1: M(e.to),
|
|
1024
|
+
y2: M(e.to)
|
|
1023
1025
|
}, `connector:${e.step.id}`);
|
|
1024
1026
|
}),
|
|
1025
1027
|
b.map((e) => {
|
|
1026
|
-
let n =
|
|
1027
|
-
return /* @__PURE__ */ J(
|
|
1028
|
-
x:
|
|
1028
|
+
let n = Pt(e, M, k.bottom);
|
|
1029
|
+
return /* @__PURE__ */ J(me, {
|
|
1030
|
+
x: P(e.step.id),
|
|
1029
1031
|
y: n.top,
|
|
1030
|
-
width:
|
|
1032
|
+
width: A.bandwidth,
|
|
1031
1033
|
height: n.height,
|
|
1032
1034
|
tone: n.isKnown ? e.tone : "neutral",
|
|
1033
1035
|
isHollow: !n.isKnown,
|
|
@@ -1035,25 +1037,25 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1035
1037
|
isInspected: t === e.step.id
|
|
1036
1038
|
}, e.step.id);
|
|
1037
1039
|
}),
|
|
1038
|
-
/* @__PURE__ */ J(
|
|
1039
|
-
x1:
|
|
1040
|
-
x2:
|
|
1041
|
-
y1:
|
|
1042
|
-
y2:
|
|
1040
|
+
/* @__PURE__ */ J(fe, {
|
|
1041
|
+
x1: k.left,
|
|
1042
|
+
x2: k.right,
|
|
1043
|
+
y1: M(0),
|
|
1044
|
+
y2: M(0)
|
|
1043
1045
|
})
|
|
1044
1046
|
]
|
|
1045
1047
|
}),
|
|
1046
|
-
/* @__PURE__ */ J(
|
|
1048
|
+
/* @__PURE__ */ J(be, {
|
|
1047
1049
|
lines: o,
|
|
1048
|
-
box:
|
|
1049
|
-
position:
|
|
1050
|
-
valueText:
|
|
1051
|
-
avoid:
|
|
1050
|
+
box: k,
|
|
1051
|
+
position: M,
|
|
1052
|
+
valueText: w,
|
|
1053
|
+
avoid: I,
|
|
1052
1054
|
marks: b.map((e) => {
|
|
1053
|
-
let t =
|
|
1055
|
+
let t = Pt(e, M, k.bottom);
|
|
1054
1056
|
return {
|
|
1055
|
-
left:
|
|
1056
|
-
right:
|
|
1057
|
+
left: P(e.step.id),
|
|
1058
|
+
right: P(e.step.id) + A.bandwidth,
|
|
1057
1059
|
top: t.top,
|
|
1058
1060
|
bottom: t.top + t.height
|
|
1059
1061
|
};
|
|
@@ -1061,7 +1063,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1061
1063
|
}),
|
|
1062
1064
|
/* @__PURE__ */ J("g", {
|
|
1063
1065
|
"aria-hidden": !0,
|
|
1064
|
-
children:
|
|
1066
|
+
children: I.map((e) => /* @__PURE__ */ J(F, {
|
|
1065
1067
|
x: e.x,
|
|
1066
1068
|
y: e.y,
|
|
1067
1069
|
anchor: "middle",
|
|
@@ -1069,11 +1071,11 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1069
1071
|
children: e.text
|
|
1070
1072
|
}, e.id))
|
|
1071
1073
|
}),
|
|
1072
|
-
n !== null && /* @__PURE__ */ J(
|
|
1073
|
-
x:
|
|
1074
|
-
top:
|
|
1075
|
-
bottom:
|
|
1076
|
-
width: Math.max(
|
|
1074
|
+
n !== null && /* @__PURE__ */ J(re, {
|
|
1075
|
+
x: de(n),
|
|
1076
|
+
top: k.top,
|
|
1077
|
+
bottom: k.bottom,
|
|
1078
|
+
width: Math.max(Dt, A.bandwidth)
|
|
1077
1079
|
})
|
|
1078
1080
|
]
|
|
1079
1081
|
})
|
|
@@ -1083,7 +1085,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1083
1085
|
});
|
|
1084
1086
|
}
|
|
1085
1087
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
1086
|
-
var
|
|
1088
|
+
var It = { points: 1e3 }, Lt = {
|
|
1087
1089
|
target: {
|
|
1088
1090
|
kVAEAm: "x10l6tqk",
|
|
1089
1091
|
k1xSpc: "xrvj5dj",
|
|
@@ -1122,211 +1124,250 @@ var Ft = { points: 1e3 }, It = {
|
|
|
1122
1124
|
$$css: !0
|
|
1123
1125
|
}
|
|
1124
1126
|
};
|
|
1125
|
-
function
|
|
1127
|
+
function Rt(e, t) {
|
|
1126
1128
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
1127
1129
|
}
|
|
1128
|
-
function
|
|
1130
|
+
function zt(e, t) {
|
|
1129
1131
|
return Number.isFinite(e) && e > 0 && e <= t[1] - t[0];
|
|
1130
1132
|
}
|
|
1131
|
-
function
|
|
1133
|
+
function Bt({ points: e, x: t, y: n, xDomain: r, yDomain: i, range: a, onRangeChange: s, rangeStep: c }) {
|
|
1132
1134
|
let l = O(r, t.scale) ?? O(i, n.scale);
|
|
1133
1135
|
if (l !== void 0) return l;
|
|
1134
|
-
if (e.length >
|
|
1136
|
+
if (e.length > It.points) return `This plot exceeds the ${It.points}-point render limit. Supply a smaller, labelled sample.`;
|
|
1135
1137
|
if (!o(e)) return "Scatter points must have unique identifiers.";
|
|
1136
1138
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
1137
1139
|
if (e.some((e) => E(e.x, r) || E(e.y, i))) return "Scatter coordinates fall outside the declared domain. Widen the domain or supply a labelled window of points.";
|
|
1138
1140
|
if (s !== void 0) {
|
|
1139
|
-
if (c === void 0 || !
|
|
1140
|
-
if (a != null && (!
|
|
1141
|
+
if (c === void 0 || !zt(c.x, r) || !zt(c.y, i)) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
1142
|
+
if (a != null && (!Rt(a.x, r) || !Rt(a.y, i))) return "The selected range must have finite, ordered bounds inside the declared domain.";
|
|
1141
1143
|
}
|
|
1142
1144
|
}
|
|
1143
|
-
function
|
|
1145
|
+
function Vt(e, t) {
|
|
1144
1146
|
return [Math.min(e, t), Math.max(e, t)];
|
|
1145
1147
|
}
|
|
1146
|
-
function
|
|
1147
|
-
let { points: t, x: n, y: r,
|
|
1148
|
-
if (
|
|
1149
|
-
...
|
|
1150
|
-
height:
|
|
1148
|
+
function Ht(e) {
|
|
1149
|
+
let { points: t, x: n, y: r, referenceDiagonal: i, referenceLines: a = [], frontier: o = [], labeledIds: d = [], range: f, onRangeChange: p, rangeStep: h, selected: v, onSelectedChange: y, height: b = "regular", ...x } = e, { emptyLabel: S = "No points were supplied.", ...w } = x, { locale: T, title: E } = w, D = U(), O = _e(b), k = te(), A = C(), [re, ie] = G(null), se = W(null);
|
|
1150
|
+
if (Te(() => () => se.current?.(), []), w.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
1151
|
+
...w,
|
|
1152
|
+
height: b
|
|
1151
1153
|
});
|
|
1152
|
-
let
|
|
1154
|
+
let M = n.domain ?? u({
|
|
1153
1155
|
values: t.map((e) => e.x),
|
|
1154
1156
|
scale: n.scale
|
|
1155
|
-
}),
|
|
1157
|
+
}), P = r.domain ?? u({
|
|
1156
1158
|
values: t.map((e) => e.y),
|
|
1157
1159
|
scale: r.scale
|
|
1158
|
-
}),
|
|
1160
|
+
}), I = Bt({
|
|
1159
1161
|
points: t,
|
|
1160
1162
|
x: n,
|
|
1161
1163
|
y: r,
|
|
1162
|
-
xDomain:
|
|
1163
|
-
yDomain:
|
|
1164
|
-
range:
|
|
1165
|
-
onRangeChange:
|
|
1166
|
-
rangeStep:
|
|
1167
|
-
})
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1164
|
+
xDomain: M,
|
|
1165
|
+
yDomain: P,
|
|
1166
|
+
range: f,
|
|
1167
|
+
onRangeChange: p,
|
|
1168
|
+
rangeStep: h
|
|
1169
|
+
}) ?? (a.length > 0 ? ye({
|
|
1170
|
+
lines: a,
|
|
1171
|
+
domain: P
|
|
1172
|
+
}) : void 0), fe = f ?? null;
|
|
1173
|
+
if (I !== void 0) return /* @__PURE__ */ J(ce, {
|
|
1174
|
+
...w,
|
|
1175
|
+
message: I
|
|
1171
1176
|
});
|
|
1172
|
-
let
|
|
1173
|
-
width:
|
|
1174
|
-
height:
|
|
1177
|
+
let L = _({
|
|
1178
|
+
width: O.width,
|
|
1179
|
+
height: O.height,
|
|
1175
1180
|
x: n,
|
|
1176
1181
|
y: r,
|
|
1177
|
-
xDomain:
|
|
1178
|
-
yDomain:
|
|
1179
|
-
locale:
|
|
1180
|
-
}), { box:
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1182
|
+
xDomain: M,
|
|
1183
|
+
yDomain: P,
|
|
1184
|
+
locale: T
|
|
1185
|
+
}), { box: R } = L;
|
|
1186
|
+
function z(e) {
|
|
1187
|
+
return ne({
|
|
1183
1188
|
value: e,
|
|
1184
|
-
locale:
|
|
1189
|
+
locale: T,
|
|
1185
1190
|
format: n.format
|
|
1186
1191
|
});
|
|
1187
1192
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1193
|
+
function me(e) {
|
|
1194
|
+
return ne({
|
|
1190
1195
|
value: e,
|
|
1191
|
-
locale:
|
|
1196
|
+
locale: T,
|
|
1192
1197
|
format: r.format
|
|
1193
1198
|
});
|
|
1194
1199
|
}
|
|
1195
|
-
let
|
|
1200
|
+
let B = t.map((e) => ({
|
|
1196
1201
|
id: e.id,
|
|
1197
|
-
label: `${e.label}, ${n.label}: ${
|
|
1198
|
-
})),
|
|
1202
|
+
label: `${e.label}, ${n.label}: ${z(e.x)}, ${r.label}: ${me(e.y)}`
|
|
1203
|
+
})), he = t.map((e, t) => ({
|
|
1199
1204
|
...e,
|
|
1200
|
-
tone:
|
|
1205
|
+
tone: k({
|
|
1201
1206
|
id: e.id,
|
|
1202
1207
|
tone: e.tone,
|
|
1203
1208
|
index: t
|
|
1204
1209
|
}),
|
|
1205
|
-
left:
|
|
1206
|
-
top:
|
|
1207
|
-
})),
|
|
1210
|
+
left: L.x.position(e.x),
|
|
1211
|
+
top: L.y.position(e.y)
|
|
1212
|
+
})), xe = new Map(he.map((e) => [e.id, {
|
|
1208
1213
|
left: e.left,
|
|
1209
1214
|
top: e.top,
|
|
1210
1215
|
right: e.left,
|
|
1211
1216
|
bottom: e.top
|
|
1212
|
-
}])),
|
|
1213
|
-
x:
|
|
1214
|
-
y:
|
|
1217
|
+
}])), Ce = re === null ? f : {
|
|
1218
|
+
x: Vt(re.start.x, re.end.x),
|
|
1219
|
+
y: Vt(re.start.y, re.end.y)
|
|
1215
1220
|
};
|
|
1216
|
-
function
|
|
1217
|
-
let r = e.getBoundingClientRect(), i = (t - r.left) / r.width *
|
|
1221
|
+
function V(e, t, n) {
|
|
1222
|
+
let r = e.getBoundingClientRect(), i = (t - r.left) / r.width * R.width, a = (n - r.top) / r.height * R.height;
|
|
1218
1223
|
return {
|
|
1219
|
-
x:
|
|
1220
|
-
y:
|
|
1224
|
+
x: L.x.valueAt(Math.min(R.right, Math.max(R.left, i))),
|
|
1225
|
+
y: L.y.valueAt(Math.min(R.bottom, Math.max(R.top, a)))
|
|
1221
1226
|
};
|
|
1222
1227
|
}
|
|
1223
|
-
function
|
|
1224
|
-
let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement,
|
|
1225
|
-
if (
|
|
1226
|
-
let
|
|
1227
|
-
|
|
1228
|
-
start:
|
|
1229
|
-
end:
|
|
1230
|
-
}),
|
|
1228
|
+
function we(t) {
|
|
1229
|
+
let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement, a = t.target instanceof Element && t.target.closest("[data-brush]") !== null, o = n && a;
|
|
1230
|
+
if (p === void 0 || se.current !== null || !o || i === null) return;
|
|
1231
|
+
let s = V(r, t.clientX, t.clientY);
|
|
1232
|
+
ie({
|
|
1233
|
+
start: s,
|
|
1234
|
+
end: s
|
|
1235
|
+
}), se.current = K(i, t.nativeEvent, {
|
|
1231
1236
|
cancelOnEscape: !0,
|
|
1232
|
-
onMove: ({ x: e, y: t }) =>
|
|
1233
|
-
start:
|
|
1234
|
-
end:
|
|
1237
|
+
onMove: ({ x: e, y: t }) => ie({
|
|
1238
|
+
start: s,
|
|
1239
|
+
end: V(r, e, t)
|
|
1235
1240
|
}),
|
|
1236
1241
|
onEnd: (t, n) => {
|
|
1237
|
-
if (
|
|
1238
|
-
let i =
|
|
1239
|
-
x:
|
|
1240
|
-
y:
|
|
1242
|
+
if (se.current = null, ie(null), n) return;
|
|
1243
|
+
let i = V(r, t.clientX, t.clientY), a = {
|
|
1244
|
+
x: Vt(s.x, i.x),
|
|
1245
|
+
y: Vt(s.y, i.y)
|
|
1241
1246
|
};
|
|
1242
|
-
|
|
1247
|
+
ke({ options: () => e }, "onRangeChange", a, {
|
|
1243
1248
|
reason: "drag",
|
|
1244
1249
|
event: t
|
|
1245
1250
|
});
|
|
1246
1251
|
}
|
|
1247
1252
|
});
|
|
1248
1253
|
}
|
|
1254
|
+
let Ee = new Map(he.map((e) => [e.id, e])), De = o.map((e) => Ee.get(e)).filter((e) => e !== void 0), Oe = De.length >= 2 ? Se(De.map((e) => ({
|
|
1255
|
+
x: e.left,
|
|
1256
|
+
y: e.top
|
|
1257
|
+
}))) : "", q = new Set(d), X = i === !0 ? { label: "y = x" } : i === !1 || i === void 0 ? null : i, Z = Math.max(M[0], P[0]), Q = Math.min(M[1], P[1]), Ae = X !== null && Q > Z;
|
|
1249
1258
|
return /* @__PURE__ */ J(ee, {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1259
|
+
...A,
|
|
1260
|
+
items: B,
|
|
1261
|
+
place: (e) => xe.get(e),
|
|
1262
|
+
selected: v ?? null,
|
|
1263
|
+
onSelect: y,
|
|
1264
|
+
render: (e, { inspected: i, cursor: o }) => /* @__PURE__ */ Y(j, {
|
|
1265
|
+
...w,
|
|
1256
1266
|
figure: e,
|
|
1257
1267
|
footer: /* @__PURE__ */ J(c, {
|
|
1258
|
-
id:
|
|
1259
|
-
children: s(
|
|
1268
|
+
id: D,
|
|
1269
|
+
children: s(B, i)
|
|
1260
1270
|
}),
|
|
1261
1271
|
children: [
|
|
1262
|
-
t.length === 0 ? /* @__PURE__ */ J(
|
|
1263
|
-
plotRef:
|
|
1264
|
-
box:
|
|
1272
|
+
t.length === 0 ? /* @__PURE__ */ J(le, { children: S }) : /* @__PURE__ */ Y(ge, {
|
|
1273
|
+
plotRef: O.ref,
|
|
1274
|
+
box: R,
|
|
1265
1275
|
label: m({
|
|
1266
|
-
title:
|
|
1267
|
-
isSelectable:
|
|
1276
|
+
title: E,
|
|
1277
|
+
isSelectable: y !== void 0
|
|
1268
1278
|
}),
|
|
1269
|
-
readoutId:
|
|
1270
|
-
onPointerDown:
|
|
1271
|
-
overlay:
|
|
1279
|
+
readoutId: D,
|
|
1280
|
+
onPointerDown: we,
|
|
1281
|
+
overlay: he.map((e, t) => /* @__PURE__ */ J(l, {
|
|
1272
1282
|
value: e.id,
|
|
1273
1283
|
render: /* @__PURE__ */ J("button", {
|
|
1274
1284
|
type: "button",
|
|
1275
1285
|
tabIndex: -1,
|
|
1276
1286
|
title: e.label,
|
|
1277
|
-
"aria-label":
|
|
1278
|
-
"aria-pressed":
|
|
1287
|
+
"aria-label": B[t]?.label,
|
|
1288
|
+
"aria-pressed": y === void 0 ? void 0 : v === e.id
|
|
1279
1289
|
}),
|
|
1280
|
-
...H.props(
|
|
1290
|
+
...H.props(Lt.target, Lt.location(e.left, e.top)),
|
|
1281
1291
|
children: /* @__PURE__ */ J("span", {
|
|
1282
1292
|
"aria-hidden": !0,
|
|
1283
|
-
...H.props(
|
|
1293
|
+
...H.props(Lt.ring, o === e.id && N.cursor)
|
|
1284
1294
|
})
|
|
1285
1295
|
}, e.id)),
|
|
1286
1296
|
children: [
|
|
1287
|
-
/* @__PURE__ */ J(
|
|
1288
|
-
box:
|
|
1289
|
-
xTicks:
|
|
1290
|
-
yTicks:
|
|
1297
|
+
/* @__PURE__ */ J(ue, {
|
|
1298
|
+
box: R,
|
|
1299
|
+
xTicks: L.xTicks,
|
|
1300
|
+
yTicks: L.yTicks,
|
|
1291
1301
|
xTitle: g(n),
|
|
1292
1302
|
yTitle: g(r),
|
|
1293
1303
|
grid: "both"
|
|
1294
1304
|
}),
|
|
1295
|
-
|
|
1305
|
+
p !== void 0 && /* @__PURE__ */ J("rect", {
|
|
1296
1306
|
"data-brush": "",
|
|
1297
|
-
x:
|
|
1298
|
-
y:
|
|
1299
|
-
width:
|
|
1300
|
-
height:
|
|
1307
|
+
x: R.left,
|
|
1308
|
+
y: R.top,
|
|
1309
|
+
width: R.innerWidth,
|
|
1310
|
+
height: R.innerHeight,
|
|
1301
1311
|
className: "xsid9ct xy6m8k3"
|
|
1302
1312
|
}),
|
|
1303
|
-
/* @__PURE__ */ Y(
|
|
1304
|
-
box:
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1313
|
+
/* @__PURE__ */ Y(ve, {
|
|
1314
|
+
box: R,
|
|
1315
|
+
pad: 6,
|
|
1316
|
+
children: [
|
|
1317
|
+
Ae && /* @__PURE__ */ J(Ut, {
|
|
1318
|
+
spec: X,
|
|
1319
|
+
low: Z,
|
|
1320
|
+
high: Q,
|
|
1321
|
+
plot: L
|
|
1322
|
+
}),
|
|
1323
|
+
a.length > 0 && /* @__PURE__ */ J(be, {
|
|
1324
|
+
lines: a,
|
|
1325
|
+
box: R,
|
|
1326
|
+
position: L.y.position,
|
|
1327
|
+
valueText: me
|
|
1328
|
+
}),
|
|
1329
|
+
Oe !== "" && /* @__PURE__ */ J(pe, {
|
|
1330
|
+
d: Oe,
|
|
1331
|
+
tone: "series1",
|
|
1332
|
+
stroke: "dashed"
|
|
1333
|
+
}),
|
|
1334
|
+
Ce != null && /* @__PURE__ */ J(Wt, {
|
|
1335
|
+
range: Ce,
|
|
1336
|
+
plot: L
|
|
1337
|
+
}),
|
|
1338
|
+
he.map((e) => /* @__PURE__ */ J(de, {
|
|
1339
|
+
mark: e.id,
|
|
1340
|
+
x: e.left,
|
|
1341
|
+
y: e.top,
|
|
1342
|
+
tone: e.tone,
|
|
1343
|
+
isInspected: i === e.id,
|
|
1344
|
+
isSelected: v === e.id
|
|
1345
|
+
}, e.id)),
|
|
1346
|
+
he.filter((e) => q.has(e.id)).map((e) => {
|
|
1347
|
+
let t = e.left > R.right - 90, n = e.top < R.top + 18;
|
|
1348
|
+
return /* @__PURE__ */ J(F, {
|
|
1349
|
+
x: e.left + (t ? -8 : 8),
|
|
1350
|
+
y: e.top + (n ? 14 : -6),
|
|
1351
|
+
anchor: t ? "end" : "start",
|
|
1352
|
+
children: e.label
|
|
1353
|
+
}, `label-${e.id}`);
|
|
1354
|
+
})
|
|
1355
|
+
]
|
|
1315
1356
|
})
|
|
1316
1357
|
]
|
|
1317
1358
|
}),
|
|
1318
|
-
|
|
1359
|
+
p !== void 0 && h !== void 0 && /* @__PURE__ */ J(Kt, {
|
|
1319
1360
|
x: n,
|
|
1320
1361
|
y: r,
|
|
1321
|
-
xDomain:
|
|
1322
|
-
yDomain:
|
|
1323
|
-
range:
|
|
1324
|
-
rangeStep:
|
|
1325
|
-
locale:
|
|
1326
|
-
onRangeChange:
|
|
1362
|
+
xDomain: M,
|
|
1363
|
+
yDomain: P,
|
|
1364
|
+
range: fe,
|
|
1365
|
+
rangeStep: h,
|
|
1366
|
+
locale: T,
|
|
1367
|
+
onRangeChange: p
|
|
1327
1368
|
}),
|
|
1328
|
-
/* @__PURE__ */ J(
|
|
1329
|
-
label: `${
|
|
1369
|
+
/* @__PURE__ */ J(oe, {
|
|
1370
|
+
label: `${E} points`,
|
|
1330
1371
|
columns: [
|
|
1331
1372
|
{
|
|
1332
1373
|
id: "point",
|
|
@@ -1345,8 +1386,8 @@ function Vt(e) {
|
|
|
1345
1386
|
id: e.id,
|
|
1346
1387
|
values: [
|
|
1347
1388
|
e.label,
|
|
1348
|
-
|
|
1349
|
-
|
|
1389
|
+
z(e.x),
|
|
1390
|
+
me(e.y)
|
|
1350
1391
|
]
|
|
1351
1392
|
}))
|
|
1352
1393
|
})
|
|
@@ -1354,7 +1395,38 @@ function Vt(e) {
|
|
|
1354
1395
|
})
|
|
1355
1396
|
});
|
|
1356
1397
|
}
|
|
1357
|
-
function
|
|
1398
|
+
function Ut({ spec: e, low: t, high: n, plot: r }) {
|
|
1399
|
+
let { box: i } = r, a = r.x.position(n), o = r.y.position(n);
|
|
1400
|
+
return /* @__PURE__ */ Y("g", { children: [
|
|
1401
|
+
/* @__PURE__ */ J("line", {
|
|
1402
|
+
x1: r.x.position(t),
|
|
1403
|
+
y1: r.y.position(t),
|
|
1404
|
+
x2: a,
|
|
1405
|
+
y2: o,
|
|
1406
|
+
className: "xhq4mlf xnpr05h xlz5em3 x47corl x13efnbd"
|
|
1407
|
+
}),
|
|
1408
|
+
e.label !== void 0 && /* @__PURE__ */ J(F, {
|
|
1409
|
+
x: a - 6,
|
|
1410
|
+
y: o + 14,
|
|
1411
|
+
anchor: "end",
|
|
1412
|
+
children: e.label
|
|
1413
|
+
}),
|
|
1414
|
+
e.aboveLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1415
|
+
x: i.left + 8,
|
|
1416
|
+
y: i.top + 14,
|
|
1417
|
+
className: "x1q7gtio x1hz01jw xy8obcc x47corl",
|
|
1418
|
+
children: e.aboveLabel
|
|
1419
|
+
}),
|
|
1420
|
+
e.belowLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1421
|
+
x: i.right - 8,
|
|
1422
|
+
y: i.bottom - 8,
|
|
1423
|
+
textAnchor: "end",
|
|
1424
|
+
className: "x1q7gtio x1hz01jw xy8obcc x47corl",
|
|
1425
|
+
children: e.belowLabel
|
|
1426
|
+
})
|
|
1427
|
+
] });
|
|
1428
|
+
}
|
|
1429
|
+
function Wt({ range: e, plot: t }) {
|
|
1358
1430
|
let n = t.x.position(e.x[0]), r = t.y.position(e.y[1]);
|
|
1359
1431
|
return /* @__PURE__ */ J("rect", {
|
|
1360
1432
|
x: n,
|
|
@@ -1364,9 +1436,9 @@ function Ht({ range: e, plot: t }) {
|
|
|
1364
1436
|
className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
|
|
1365
1437
|
});
|
|
1366
1438
|
}
|
|
1367
|
-
function
|
|
1439
|
+
function Gt({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
|
|
1368
1440
|
function s(t) {
|
|
1369
|
-
return
|
|
1441
|
+
return ne({
|
|
1370
1442
|
value: t,
|
|
1371
1443
|
locale: a,
|
|
1372
1444
|
format: e.format
|
|
@@ -1400,7 +1472,7 @@ function Ut({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
|
|
|
1400
1472
|
] }) })]
|
|
1401
1473
|
});
|
|
1402
1474
|
}
|
|
1403
|
-
function
|
|
1475
|
+
function Kt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale: s, onRangeChange: c }) {
|
|
1404
1476
|
let l = a ?? {
|
|
1405
1477
|
x: r,
|
|
1406
1478
|
y: i
|
|
@@ -1412,7 +1484,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1412
1484
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
1413
1485
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
1414
1486
|
}),
|
|
1415
|
-
/* @__PURE__ */ J(
|
|
1487
|
+
/* @__PURE__ */ J(Gt, {
|
|
1416
1488
|
axis: t,
|
|
1417
1489
|
domain: r,
|
|
1418
1490
|
value: l.x,
|
|
@@ -1423,7 +1495,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1423
1495
|
y: l.y
|
|
1424
1496
|
}, t)
|
|
1425
1497
|
}),
|
|
1426
|
-
/* @__PURE__ */ J(
|
|
1498
|
+
/* @__PURE__ */ J(Gt, {
|
|
1427
1499
|
axis: n,
|
|
1428
1500
|
domain: i,
|
|
1429
1501
|
value: l.y,
|
|
@@ -1438,7 +1510,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1438
1510
|
type: "button",
|
|
1439
1511
|
disabled: a === null,
|
|
1440
1512
|
onClick: (e) => {
|
|
1441
|
-
|
|
1513
|
+
ke({ options: () => ({ onRangeChange: c }) }, "onRangeChange", null, {
|
|
1442
1514
|
reason: "clear-press",
|
|
1443
1515
|
event: e.nativeEvent
|
|
1444
1516
|
});
|
|
@@ -1454,14 +1526,14 @@ var $ = {
|
|
|
1454
1526
|
pointsPerSeries: 2e3,
|
|
1455
1527
|
markers: 200,
|
|
1456
1528
|
panels: 12
|
|
1457
|
-
},
|
|
1458
|
-
function
|
|
1529
|
+
}, qt = .01;
|
|
1530
|
+
function Jt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
1459
1531
|
let i = e[0]?.points.map((e) => e.timestamp) ?? r;
|
|
1460
1532
|
if (e.length > $.series || i.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
|
|
1461
1533
|
if (!o(e) || !o(n)) return "Series and markers require unique identifiers.";
|
|
1462
1534
|
for (let n of e) {
|
|
1463
1535
|
if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
|
|
1464
|
-
let e =
|
|
1536
|
+
let e = $t({
|
|
1465
1537
|
points: n.points,
|
|
1466
1538
|
timestamps: i,
|
|
1467
1539
|
isStacked: t
|
|
@@ -1469,7 +1541,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1469
1541
|
if (e !== void 0) return e;
|
|
1470
1542
|
}
|
|
1471
1543
|
for (let t of n) {
|
|
1472
|
-
let n =
|
|
1544
|
+
let n = Yt({
|
|
1473
1545
|
marker: t,
|
|
1474
1546
|
series: e,
|
|
1475
1547
|
timestamps: i
|
|
@@ -1480,7 +1552,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1480
1552
|
if (!Number.isFinite(s) || !Number.isFinite(c)) return "The elapsed-time and value ranges must be finite.";
|
|
1481
1553
|
if (t && i.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
|
|
1482
1554
|
}
|
|
1483
|
-
function
|
|
1555
|
+
function Yt({ marker: e, series: t, timestamps: n }) {
|
|
1484
1556
|
if (e.kind === "event") {
|
|
1485
1557
|
let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
|
|
1486
1558
|
return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
|
|
@@ -1488,7 +1560,7 @@ function qt({ marker: e, series: t, timestamps: n }) {
|
|
|
1488
1560
|
if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
|
|
1489
1561
|
if (e.kind !== "time") return t.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.value === e.value ? void 0 : "Point markers must reference the recorded series value.";
|
|
1490
1562
|
}
|
|
1491
|
-
function
|
|
1563
|
+
function Xt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1492
1564
|
return JSON.stringify([
|
|
1493
1565
|
n,
|
|
1494
1566
|
r,
|
|
@@ -1508,12 +1580,12 @@ function Jt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1508
1580
|
])
|
|
1509
1581
|
]);
|
|
1510
1582
|
}
|
|
1511
|
-
function
|
|
1583
|
+
function Zt(e, t) {
|
|
1512
1584
|
if (e !== t) return [e, t];
|
|
1513
|
-
let n = Math.max(1, Math.abs(e) *
|
|
1585
|
+
let n = Math.max(1, Math.abs(e) * qt), r = e - n, i = t + n;
|
|
1514
1586
|
return [Number.isFinite(r) ? r : e, Number.isFinite(i) ? i : t];
|
|
1515
1587
|
}
|
|
1516
|
-
function
|
|
1588
|
+
function Qt({ series: e, isStacked: t, tones: n }) {
|
|
1517
1589
|
let r = e.filter((e) => e.tone === void 0);
|
|
1518
1590
|
return e.map((i, a) => {
|
|
1519
1591
|
let o = r.findIndex((e) => e.id === i.id), s = n({
|
|
@@ -1535,7 +1607,7 @@ function Xt({ series: e, isStacked: t, tones: n }) {
|
|
|
1535
1607
|
};
|
|
1536
1608
|
});
|
|
1537
1609
|
}
|
|
1538
|
-
function
|
|
1610
|
+
function $t({ points: e, timestamps: t, isStacked: n }) {
|
|
1539
1611
|
for (let [r, i] of e.entries()) {
|
|
1540
1612
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1541
1613
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1544,16 +1616,16 @@ function Zt({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1544
1616
|
}
|
|
1545
1617
|
}
|
|
1546
1618
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1547
|
-
function
|
|
1619
|
+
function en({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
1548
1620
|
let i = e.points.findLastIndex((e) => e.value !== null);
|
|
1549
|
-
return /* @__PURE__ */ Y(
|
|
1550
|
-
d:
|
|
1621
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("path", {
|
|
1622
|
+
d: Se(e.points.map((e) => ({
|
|
1551
1623
|
x: t(e.timestamp),
|
|
1552
1624
|
y: e.value === null ? null : n(e.value + e.base)
|
|
1553
1625
|
}))),
|
|
1554
1626
|
fill: "none",
|
|
1555
1627
|
stroke: a[e.tone],
|
|
1556
|
-
...H.props(
|
|
1628
|
+
...H.props(N.mark)
|
|
1557
1629
|
}), e.points.filter((t, n) => {
|
|
1558
1630
|
if (t.value === null) return !1;
|
|
1559
1631
|
let r = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
|
|
@@ -1566,18 +1638,18 @@ function Qt({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
|
1566
1638
|
}, i.timestamp))] });
|
|
1567
1639
|
}
|
|
1568
1640
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1569
|
-
var
|
|
1641
|
+
var tn = {
|
|
1570
1642
|
minimum: "Lowest",
|
|
1571
1643
|
maximum: "Highest",
|
|
1572
1644
|
last: "Latest"
|
|
1573
|
-
},
|
|
1645
|
+
}, nn = 2.5, rn = 3, an = {
|
|
1574
1646
|
inline: {
|
|
1575
1647
|
width: 128,
|
|
1576
1648
|
height: 32
|
|
1577
1649
|
},
|
|
1578
1650
|
figure: { height: 48 }
|
|
1579
1651
|
};
|
|
1580
|
-
function
|
|
1652
|
+
function on({ points: e, marked: t }) {
|
|
1581
1653
|
let n = e.flatMap((e) => e.value === null ? [] : [{
|
|
1582
1654
|
...e,
|
|
1583
1655
|
value: e.value
|
|
@@ -1594,8 +1666,8 @@ function rn({ points: e, marked: t }) {
|
|
|
1594
1666
|
}];
|
|
1595
1667
|
});
|
|
1596
1668
|
}
|
|
1597
|
-
function
|
|
1598
|
-
let u =
|
|
1669
|
+
function sn({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: o, markedPoints: s = [], baseline: c, layout: l = "inline" }) {
|
|
1670
|
+
let u = U(), f = P(), p = l === "figure", m = p ? f.width : an.inline.width, h = p ? an.figure.height : an.inline.height, g = U(), _ = te(), v = cn({
|
|
1599
1671
|
title: e,
|
|
1600
1672
|
summary: t,
|
|
1601
1673
|
unit: n,
|
|
@@ -1612,19 +1684,19 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1612
1684
|
children: v === void 0 ? "No data" : "Invalid trend"
|
|
1613
1685
|
});
|
|
1614
1686
|
let y = i.points[0]?.timestamp ?? 0, b = i.points.at(-1)?.timestamp ?? y, x = k({
|
|
1615
|
-
domain:
|
|
1616
|
-
range: [
|
|
1687
|
+
domain: Zt(y, b),
|
|
1688
|
+
range: [rn, m - rn]
|
|
1617
1689
|
}).position, S = k({
|
|
1618
1690
|
domain: o,
|
|
1619
|
-
range: [h -
|
|
1620
|
-
}).position,
|
|
1691
|
+
range: [h - rn, rn]
|
|
1692
|
+
}).position, C = Qt({
|
|
1621
1693
|
series: [i],
|
|
1622
1694
|
isStacked: !1,
|
|
1623
1695
|
tones: _
|
|
1624
|
-
})[0],
|
|
1696
|
+
})[0], w = a[C?.tone ?? "series1"], ne = on({
|
|
1625
1697
|
points: i.points,
|
|
1626
1698
|
marked: s
|
|
1627
|
-
}),
|
|
1699
|
+
}), T = ne.map(({ kind: e, point: t }) => `${tn[e]}: ${t.value} ${n}.`).join(" "), E = c === void 0 ? "" : `Reference: ${c} ${n}.`, D = /* @__PURE__ */ Y("svg", {
|
|
1628
1700
|
role: "img",
|
|
1629
1701
|
"aria-labelledby": u,
|
|
1630
1702
|
"aria-describedby": g,
|
|
@@ -1657,34 +1729,34 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1657
1729
|
" ",
|
|
1658
1730
|
n,
|
|
1659
1731
|
". ",
|
|
1660
|
-
|
|
1732
|
+
T,
|
|
1661
1733
|
" ",
|
|
1662
|
-
|
|
1734
|
+
E
|
|
1663
1735
|
]
|
|
1664
1736
|
}),
|
|
1665
1737
|
c !== void 0 && /* @__PURE__ */ J("line", {
|
|
1666
|
-
x1:
|
|
1667
|
-
x2: m -
|
|
1738
|
+
x1: rn,
|
|
1739
|
+
x2: m - rn,
|
|
1668
1740
|
y1: S(c),
|
|
1669
1741
|
y2: S(c),
|
|
1670
1742
|
className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
|
|
1671
1743
|
}),
|
|
1672
|
-
|
|
1673
|
-
series:
|
|
1744
|
+
C !== void 0 && /* @__PURE__ */ J(en, {
|
|
1745
|
+
series: C,
|
|
1674
1746
|
x,
|
|
1675
1747
|
y: S,
|
|
1676
1748
|
pointRadius: 2
|
|
1677
1749
|
}),
|
|
1678
|
-
|
|
1750
|
+
ne.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ J("circle", {
|
|
1679
1751
|
cx: x(t.timestamp),
|
|
1680
1752
|
cy: S(t.value),
|
|
1681
|
-
r:
|
|
1682
|
-
fill:
|
|
1753
|
+
r: nn,
|
|
1754
|
+
fill: w
|
|
1683
1755
|
}, e) : /* @__PURE__ */ J("circle", {
|
|
1684
1756
|
cx: x(t.timestamp),
|
|
1685
1757
|
cy: S(t.value),
|
|
1686
|
-
r:
|
|
1687
|
-
stroke:
|
|
1758
|
+
r: nn,
|
|
1759
|
+
stroke: w,
|
|
1688
1760
|
className: "x1fytgo2 x1r6sdyr x13efnbd"
|
|
1689
1761
|
}, e))
|
|
1690
1762
|
]
|
|
@@ -1695,14 +1767,14 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1695
1767
|
children: /* @__PURE__ */ J("div", {
|
|
1696
1768
|
ref: f.ref,
|
|
1697
1769
|
className: "x1lliihq xeuugli",
|
|
1698
|
-
children:
|
|
1770
|
+
children: D
|
|
1699
1771
|
})
|
|
1700
|
-
}) :
|
|
1772
|
+
}) : D;
|
|
1701
1773
|
}
|
|
1702
|
-
function
|
|
1774
|
+
function cn({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
|
|
1703
1775
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1704
1776
|
if (!D(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1705
|
-
let s =
|
|
1777
|
+
let s = Jt({
|
|
1706
1778
|
series: [r],
|
|
1707
1779
|
isStacked: !1,
|
|
1708
1780
|
markers: []
|
|
@@ -1713,11 +1785,11 @@ function on({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPo
|
|
|
1713
1785
|
if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
|
|
1714
1786
|
}
|
|
1715
1787
|
// packages/charts/src/cartesian/time-series-bands.ts
|
|
1716
|
-
var
|
|
1788
|
+
var ln = {
|
|
1717
1789
|
bands: 4,
|
|
1718
1790
|
crossings: 4
|
|
1719
1791
|
};
|
|
1720
|
-
function
|
|
1792
|
+
function un(e) {
|
|
1721
1793
|
let t = [
|
|
1722
1794
|
e.lower,
|
|
1723
1795
|
e.center,
|
|
@@ -1725,18 +1797,18 @@ function cn(e) {
|
|
|
1725
1797
|
].filter((e) => e !== null);
|
|
1726
1798
|
return t.some((e) => !Number.isFinite(e)) ? "Band values must be finite numbers or explicit missing values." : e.lower === null == (e.upper === null) ? t.every((e, n) => n === 0 || (t[n - 1] ?? e) <= e) ? void 0 : "Band values must satisfy lower ≤ center ≤ upper." : "A band observation needs both bounds or neither.";
|
|
1727
1799
|
}
|
|
1728
|
-
function
|
|
1729
|
-
if (e.length >
|
|
1800
|
+
function dn({ bands: e, crossings: t, series: n, timestamps: r }) {
|
|
1801
|
+
if (e.length > ln.bands || t.length > ln.crossings) return `Supply at most ${ln.bands} bands and ${ln.crossings} crossings.`;
|
|
1730
1802
|
if (!o([...n, ...e]) || !o(t)) return "Series, bands, and crossings require unique identifiers.";
|
|
1731
1803
|
for (let t of e) {
|
|
1732
1804
|
if (t.points.length !== r.length || t.points.some((e, t) => e.timestamp !== r[t])) return "Every band must supply the same observation timestamps as the series.";
|
|
1733
|
-
let e = t.points.map(
|
|
1805
|
+
let e = t.points.map(un).find((e) => e !== void 0);
|
|
1734
1806
|
if (e !== void 0) return e;
|
|
1735
1807
|
}
|
|
1736
1808
|
let i = new Set([...n, ...e].map((e) => e.id));
|
|
1737
1809
|
for (let e of t) if (!(i.has(e.seriesId) && e.label.trim() !== "") || !Number.isFinite(e.value)) return "Each crossing needs a label, a finite value, and a supplied series or band.";
|
|
1738
1810
|
}
|
|
1739
|
-
function
|
|
1811
|
+
function fn({ series: e, bands: t, tones: n }) {
|
|
1740
1812
|
let r = e.filter((e) => e.tone === void 0).length, i = t.filter((e) => e.tone === void 0);
|
|
1741
1813
|
return t.map((e) => {
|
|
1742
1814
|
let t = r + i.findIndex((t) => t.id === e.id);
|
|
@@ -1750,7 +1822,7 @@ function un({ series: e, bands: t, tones: n }) {
|
|
|
1750
1822
|
};
|
|
1751
1823
|
});
|
|
1752
1824
|
}
|
|
1753
|
-
function
|
|
1825
|
+
function pn({ start: e, end: t, value: n, direction: r }) {
|
|
1754
1826
|
let i = e > n && t <= n, a = e < n && t >= n;
|
|
1755
1827
|
switch (r) {
|
|
1756
1828
|
case "falling": return i;
|
|
@@ -1758,7 +1830,7 @@ function dn({ start: e, end: t, value: n, direction: r }) {
|
|
|
1758
1830
|
case void 0: return i || a;
|
|
1759
1831
|
}
|
|
1760
1832
|
}
|
|
1761
|
-
function
|
|
1833
|
+
function mn({ points: e, crossing: t }) {
|
|
1762
1834
|
let n = e.flatMap((t, n) => {
|
|
1763
1835
|
let r = e[n + 1];
|
|
1764
1836
|
return t.value === null || r === void 0 || r.value === null ? [] : [{
|
|
@@ -1767,7 +1839,7 @@ function fn({ points: e, crossing: t }) {
|
|
|
1767
1839
|
from: t.value,
|
|
1768
1840
|
to: r.value
|
|
1769
1841
|
}];
|
|
1770
|
-
}).find(({ from: e, to: n }) =>
|
|
1842
|
+
}).find(({ from: e, to: n }) => pn({
|
|
1771
1843
|
start: e,
|
|
1772
1844
|
end: n,
|
|
1773
1845
|
value: t.value,
|
|
@@ -1777,10 +1849,10 @@ function fn({ points: e, crossing: t }) {
|
|
|
1777
1849
|
let r = (t.value - n.from) / (n.to - n.from);
|
|
1778
1850
|
return n.start + r * (n.end - n.start);
|
|
1779
1851
|
}
|
|
1780
|
-
function
|
|
1852
|
+
function hn({ crossings: e, series: t, bands: n }) {
|
|
1781
1853
|
return e.map((e) => ({
|
|
1782
1854
|
crossing: e,
|
|
1783
|
-
timestamp:
|
|
1855
|
+
timestamp: mn({
|
|
1784
1856
|
points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
|
|
1785
1857
|
timestamp: e.timestamp,
|
|
1786
1858
|
value: e.center
|
|
@@ -1789,11 +1861,11 @@ function pn({ crossings: e, series: t, bands: n }) {
|
|
|
1789
1861
|
})
|
|
1790
1862
|
}));
|
|
1791
1863
|
}
|
|
1792
|
-
function
|
|
1864
|
+
function gn(e, t) {
|
|
1793
1865
|
let n = Math.min(...e.map((e) => Math.abs(e - t)));
|
|
1794
1866
|
return e.find((e) => Math.abs(e - t) === n);
|
|
1795
1867
|
}
|
|
1796
|
-
function
|
|
1868
|
+
function _n(e) {
|
|
1797
1869
|
return e.flatMap((e) => e.points.flatMap((e) => [
|
|
1798
1870
|
e.lower,
|
|
1799
1871
|
e.center,
|
|
@@ -1801,23 +1873,23 @@ function hn(e) {
|
|
|
1801
1873
|
].filter((e) => e !== null)));
|
|
1802
1874
|
}
|
|
1803
1875
|
// packages/charts/src/chart-range.tsx
|
|
1804
|
-
var
|
|
1805
|
-
function
|
|
1876
|
+
var vn = "axis", yn = "selected", bn = "drawn";
|
|
1877
|
+
function xn({ value: e }) {
|
|
1806
1878
|
return {
|
|
1807
1879
|
value: e,
|
|
1808
1880
|
spans: e === null ? [] : [{
|
|
1809
|
-
id:
|
|
1810
|
-
track:
|
|
1881
|
+
id: yn,
|
|
1882
|
+
track: vn,
|
|
1811
1883
|
start: e[0],
|
|
1812
1884
|
end: e[1]
|
|
1813
1885
|
}]
|
|
1814
1886
|
};
|
|
1815
1887
|
}
|
|
1816
|
-
function
|
|
1888
|
+
function Sn(e, t) {
|
|
1817
1889
|
let { draft: n } = e;
|
|
1818
1890
|
return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
|
|
1819
1891
|
}
|
|
1820
|
-
var
|
|
1892
|
+
var Cn = Oe({
|
|
1821
1893
|
name: "chart-range",
|
|
1822
1894
|
options: {
|
|
1823
1895
|
value: "value",
|
|
@@ -1829,12 +1901,12 @@ var xn = Ee({
|
|
|
1829
1901
|
},
|
|
1830
1902
|
controlled: ["value"],
|
|
1831
1903
|
state: (e) => ({
|
|
1832
|
-
...
|
|
1904
|
+
...xn(e),
|
|
1833
1905
|
draft: null
|
|
1834
1906
|
}),
|
|
1835
|
-
sync:
|
|
1907
|
+
sync: xn,
|
|
1836
1908
|
api: (e) => {
|
|
1837
|
-
let t =
|
|
1909
|
+
let t = Ee(e);
|
|
1838
1910
|
function n(n, { id: r, action: i, reason: a, event: o }) {
|
|
1839
1911
|
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 } : {
|
|
1840
1912
|
reason: a,
|
|
@@ -1842,7 +1914,7 @@ var xn = Ee({
|
|
|
1842
1914
|
});
|
|
1843
1915
|
return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
|
|
1844
1916
|
}
|
|
1845
|
-
let r =
|
|
1917
|
+
let r = De(e, {
|
|
1846
1918
|
key: "spans",
|
|
1847
1919
|
draft: "draft",
|
|
1848
1920
|
axis: "x",
|
|
@@ -1851,7 +1923,7 @@ var xn = Ee({
|
|
|
1851
1923
|
step: () => e.options().step,
|
|
1852
1924
|
create: (e) => ({
|
|
1853
1925
|
...e,
|
|
1854
|
-
id:
|
|
1926
|
+
id: bn
|
|
1855
1927
|
}),
|
|
1856
1928
|
label: (t) => e.options().describe([t.start, t.end]),
|
|
1857
1929
|
createAutoScroll: !1,
|
|
@@ -1860,13 +1932,13 @@ var xn = Ee({
|
|
|
1860
1932
|
return {
|
|
1861
1933
|
spans: r,
|
|
1862
1934
|
shown(t) {
|
|
1863
|
-
return
|
|
1935
|
+
return Sn(t, r.spans(t)).map((t) => ({
|
|
1864
1936
|
id: t.id,
|
|
1865
1937
|
label: e.options().describe([t.start, t.end])
|
|
1866
1938
|
}));
|
|
1867
1939
|
},
|
|
1868
1940
|
draw(e) {
|
|
1869
|
-
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e,
|
|
1941
|
+
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, vn);
|
|
1870
1942
|
},
|
|
1871
1943
|
setRange(n, r) {
|
|
1872
1944
|
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));
|
|
@@ -1884,7 +1956,7 @@ var xn = Ee({
|
|
|
1884
1956
|
state: (e, { api: t }) => ({ spans: t.shown(e) }),
|
|
1885
1957
|
on: { pointerdown: (e, { api: t }) => t.draw(e) }
|
|
1886
1958
|
}),
|
|
1887
|
-
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e,
|
|
1959
|
+
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, vn) }),
|
|
1888
1960
|
span: e({
|
|
1889
1961
|
role: "group",
|
|
1890
1962
|
props: { value: "string" },
|
|
@@ -1906,17 +1978,17 @@ var xn = Ee({
|
|
|
1906
1978
|
})
|
|
1907
1979
|
}),
|
|
1908
1980
|
agent: { actions: ["setRange", "clear"] }
|
|
1909
|
-
}),
|
|
1981
|
+
}), wn = we(Cn, {
|
|
1910
1982
|
root: "div",
|
|
1911
1983
|
track: "div",
|
|
1912
1984
|
span: "div"
|
|
1913
|
-
}),
|
|
1985
|
+
}), Tn = wn.Root, En = wn.Track, Dn = wn.Span, On = {
|
|
1914
1986
|
kVAEAm: "x10l6tqk",
|
|
1915
1987
|
k87sOh: "x13vifvy",
|
|
1916
1988
|
kfzvcC: "x47corl",
|
|
1917
1989
|
$$css: !0
|
|
1918
|
-
},
|
|
1919
|
-
|
|
1990
|
+
}, kn = { track: (e, t, n) => [
|
|
1991
|
+
On,
|
|
1920
1992
|
{
|
|
1921
1993
|
kbCHJM: e == null ? e : "xgq9j65",
|
|
1922
1994
|
kzqmXN: t == null ? t : "x5lhr3w",
|
|
@@ -1929,16 +2001,16 @@ var xn = Ee({
|
|
|
1929
2001
|
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
|
|
1930
2002
|
}
|
|
1931
2003
|
] };
|
|
1932
|
-
function
|
|
1933
|
-
return /* @__PURE__ */ J(
|
|
2004
|
+
function An({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
2005
|
+
return /* @__PURE__ */ J(Tn, {
|
|
1934
2006
|
...a,
|
|
1935
2007
|
"aria-label": r,
|
|
1936
2008
|
className: "x1n2onr6 xeuugli",
|
|
1937
2009
|
render: (r, { spans: a }) => /* @__PURE__ */ Y("div", {
|
|
1938
2010
|
...r,
|
|
1939
|
-
children: [i, /* @__PURE__ */ J(
|
|
1940
|
-
...H.props(
|
|
1941
|
-
children: a.map((e) => /* @__PURE__ */ Y(
|
|
2011
|
+
children: [i, /* @__PURE__ */ J(En, {
|
|
2012
|
+
...H.props(kn.track(e, t, n)),
|
|
2013
|
+
children: a.map((e) => /* @__PURE__ */ Y(Dn, {
|
|
1942
2014
|
value: e.id,
|
|
1943
2015
|
"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.`,
|
|
1944
2016
|
className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
@@ -1959,11 +2031,11 @@ function On({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
|
1959
2031
|
});
|
|
1960
2032
|
}
|
|
1961
2033
|
// packages/charts/src/cartesian/time-series-overlays.tsx
|
|
1962
|
-
var
|
|
1963
|
-
function
|
|
2034
|
+
var jn = 16, Mn = 6, Nn = 6.5, Pn = 4;
|
|
2035
|
+
function Fn({ instants: e, x: t, right: n, ends: r }) {
|
|
1964
2036
|
let [i, ...a] = e;
|
|
1965
2037
|
if (i === void 0) return [];
|
|
1966
|
-
let o = t(i.timestamp), s = i.label.length *
|
|
2038
|
+
let o = t(i.timestamp), s = i.label.length * Nn + Mn, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
|
|
1967
2039
|
...r.slice(0, f),
|
|
1968
2040
|
Math.max(u, r[f] ?? u),
|
|
1969
2041
|
...r.slice(f + 1)
|
|
@@ -1972,25 +2044,25 @@ function Nn({ instants: e, x: t, right: n, ends: r }) {
|
|
|
1972
2044
|
...i,
|
|
1973
2045
|
lane: f,
|
|
1974
2046
|
anchor: c
|
|
1975
|
-
}, ...
|
|
2047
|
+
}, ...Fn({
|
|
1976
2048
|
instants: a,
|
|
1977
2049
|
x: t,
|
|
1978
2050
|
right: n,
|
|
1979
2051
|
ends: p
|
|
1980
2052
|
})];
|
|
1981
2053
|
}
|
|
1982
|
-
function
|
|
1983
|
-
return
|
|
2054
|
+
function In({ instants: e, x: t, right: n }) {
|
|
2055
|
+
return Fn({
|
|
1984
2056
|
instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
|
|
1985
2057
|
x: t,
|
|
1986
2058
|
right: n,
|
|
1987
2059
|
ends: []
|
|
1988
2060
|
});
|
|
1989
2061
|
}
|
|
1990
|
-
function
|
|
1991
|
-
return Math.max(0, ...e.map((e) => e.lane + 1)) *
|
|
2062
|
+
function Ln(e) {
|
|
2063
|
+
return Math.max(0, ...e.map((e) => e.lane + 1)) * jn;
|
|
1992
2064
|
}
|
|
1993
|
-
function
|
|
2065
|
+
function Rn({ bands: e, x: t, y: n }) {
|
|
1994
2066
|
return /* @__PURE__ */ J("g", { children: e.map((e) => {
|
|
1995
2067
|
function r(t) {
|
|
1996
2068
|
return e.points.map((e) => {
|
|
@@ -1999,15 +2071,15 @@ function In({ bands: e, x: t, y: n }) {
|
|
|
1999
2071
|
});
|
|
2000
2072
|
}
|
|
2001
2073
|
let i = r((e) => e.lower), a = r((e) => e.upper), o = r((e) => e.center), s = e.points.map((e) => t(e.timestamp));
|
|
2002
|
-
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(
|
|
2003
|
-
d:
|
|
2074
|
+
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(R, {
|
|
2075
|
+
d: Ce(s.map((e, t) => ({
|
|
2004
2076
|
x: e,
|
|
2005
2077
|
y0: i[t] ?? null,
|
|
2006
2078
|
y1: a[t] ?? null
|
|
2007
2079
|
}))),
|
|
2008
2080
|
tone: e.tone
|
|
2009
|
-
}), /* @__PURE__ */ J(
|
|
2010
|
-
d:
|
|
2081
|
+
}), /* @__PURE__ */ J(pe, {
|
|
2082
|
+
d: Se(s.map((e, t) => ({
|
|
2011
2083
|
x: e,
|
|
2012
2084
|
y: o[t] ?? null
|
|
2013
2085
|
}))),
|
|
@@ -2015,25 +2087,25 @@ function In({ bands: e, x: t, y: n }) {
|
|
|
2015
2087
|
})] }, e.id);
|
|
2016
2088
|
}) });
|
|
2017
2089
|
}
|
|
2018
|
-
function
|
|
2019
|
-
let a = r -
|
|
2090
|
+
function zn({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
2091
|
+
let a = r - Ln(e);
|
|
2020
2092
|
return /* @__PURE__ */ J("g", {
|
|
2021
2093
|
"aria-hidden": !0,
|
|
2022
2094
|
children: e.map((e) => {
|
|
2023
|
-
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) *
|
|
2095
|
+
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) * jn, s = e.anchor === "start" ? r + Mn : r - Mn;
|
|
2024
2096
|
return /* @__PURE__ */ Y("g", { children: [
|
|
2025
|
-
/* @__PURE__ */ J(
|
|
2097
|
+
/* @__PURE__ */ J(z, {
|
|
2026
2098
|
x: r,
|
|
2027
2099
|
top: o,
|
|
2028
2100
|
bottom: i
|
|
2029
2101
|
}),
|
|
2030
|
-
/* @__PURE__ */ J(
|
|
2102
|
+
/* @__PURE__ */ J(F, {
|
|
2031
2103
|
x: s,
|
|
2032
|
-
y: o +
|
|
2104
|
+
y: o + Pn,
|
|
2033
2105
|
anchor: e.anchor,
|
|
2034
2106
|
children: e.label
|
|
2035
2107
|
}),
|
|
2036
|
-
e.value !== void 0 && /* @__PURE__ */ J(
|
|
2108
|
+
e.value !== void 0 && /* @__PURE__ */ J(I, {
|
|
2037
2109
|
x: r,
|
|
2038
2110
|
y: n(e.value)
|
|
2039
2111
|
})
|
|
@@ -2042,35 +2114,35 @@ function Ln({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
|
2042
2114
|
});
|
|
2043
2115
|
}
|
|
2044
2116
|
// packages/charts/src/cartesian/time-series.tsx
|
|
2045
|
-
var
|
|
2117
|
+
var Bn = {
|
|
2046
2118
|
seconds: 1e3,
|
|
2047
2119
|
milliseconds: 1
|
|
2048
|
-
},
|
|
2120
|
+
}, Vn = 24, Hn = 12, Un = 2.5, Wn = 4, Gn = {
|
|
2049
2121
|
line: "line",
|
|
2050
2122
|
area: "swatch"
|
|
2051
2123
|
};
|
|
2052
|
-
function
|
|
2053
|
-
return e *
|
|
2124
|
+
function Kn(e, t) {
|
|
2125
|
+
return e * Bn[t];
|
|
2054
2126
|
}
|
|
2055
|
-
function
|
|
2127
|
+
function qn({ format: e, tickFormat: t, label: n = "" }) {
|
|
2056
2128
|
return {
|
|
2057
2129
|
label: n,
|
|
2058
2130
|
format: e,
|
|
2059
2131
|
tickFormat: t
|
|
2060
2132
|
};
|
|
2061
2133
|
}
|
|
2062
|
-
function
|
|
2134
|
+
function Jn({ series: e, isStacked: t, isZeroBased: n, bands: r, crossings: i }) {
|
|
2063
2135
|
let a = (e[0]?.points ?? []).map((t, n) => e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)), o = t ? a : e.flatMap((e) => e.points.map((e) => e.value));
|
|
2064
2136
|
return u({
|
|
2065
2137
|
values: [
|
|
2066
2138
|
...o,
|
|
2067
|
-
...
|
|
2139
|
+
..._n(r),
|
|
2068
2140
|
...i.map((e) => e.value)
|
|
2069
2141
|
],
|
|
2070
2142
|
isZeroBased: n
|
|
2071
2143
|
});
|
|
2072
2144
|
}
|
|
2073
|
-
function
|
|
2145
|
+
function Yn({ bands: e, crossings: t }) {
|
|
2074
2146
|
return JSON.stringify([e.map((e) => [
|
|
2075
2147
|
e.id,
|
|
2076
2148
|
e.label,
|
|
@@ -2090,7 +2162,7 @@ function qn({ bands: e, crossings: t }) {
|
|
|
2090
2162
|
e.direction
|
|
2091
2163
|
])]);
|
|
2092
2164
|
}
|
|
2093
|
-
function
|
|
2165
|
+
function Xn({ bands: e, timestamp: t, valueText: n }) {
|
|
2094
2166
|
return e.flatMap((e) => {
|
|
2095
2167
|
let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
|
|
2096
2168
|
return [{
|
|
@@ -2108,28 +2180,28 @@ function Jn({ bands: e, timestamp: t, valueText: n }) {
|
|
|
2108
2180
|
}];
|
|
2109
2181
|
});
|
|
2110
2182
|
}
|
|
2111
|
-
function
|
|
2183
|
+
function Zn({ found: e, timeText: t }) {
|
|
2112
2184
|
return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
|
|
2113
2185
|
}
|
|
2114
|
-
function
|
|
2115
|
-
return /* @__PURE__ */ J(
|
|
2186
|
+
function Qn(e) {
|
|
2187
|
+
return /* @__PURE__ */ J(ir, {
|
|
2116
2188
|
...e,
|
|
2117
2189
|
kind: "line",
|
|
2118
2190
|
isStacked: !1
|
|
2119
2191
|
});
|
|
2120
2192
|
}
|
|
2121
|
-
function
|
|
2122
|
-
return /* @__PURE__ */ J(
|
|
2193
|
+
function $n({ isStacked: e = !1, ...t }) {
|
|
2194
|
+
return /* @__PURE__ */ J(ir, {
|
|
2123
2195
|
...t,
|
|
2124
2196
|
kind: "area",
|
|
2125
2197
|
isStacked: e
|
|
2126
2198
|
});
|
|
2127
2199
|
}
|
|
2128
|
-
function
|
|
2129
|
-
return /* @__PURE__ */ J(
|
|
2200
|
+
function er(e) {
|
|
2201
|
+
return /* @__PURE__ */ J(tr, { ...e });
|
|
2130
2202
|
}
|
|
2131
|
-
function
|
|
2132
|
-
let o =
|
|
2203
|
+
function tr({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
2204
|
+
let o = U(), s = te(), c = Qt({
|
|
2133
2205
|
series: e.map((e) => ({
|
|
2134
2206
|
...e,
|
|
2135
2207
|
points: []
|
|
@@ -2145,7 +2217,7 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
|
2145
2217
|
...a,
|
|
2146
2218
|
status: "loading",
|
|
2147
2219
|
series: c,
|
|
2148
|
-
seriesLegend: /* @__PURE__ */ J(
|
|
2220
|
+
seriesLegend: /* @__PURE__ */ J(se, {
|
|
2149
2221
|
id: o,
|
|
2150
2222
|
label: void 0,
|
|
2151
2223
|
legend: c,
|
|
@@ -2158,37 +2230,37 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
|
2158
2230
|
className: "xrvj5dj x1n8ia3y",
|
|
2159
2231
|
children: /* @__PURE__ */ Y("div", {
|
|
2160
2232
|
className: "xeuugli",
|
|
2161
|
-
children: [/* @__PURE__ */ J(r, { height: f[t] -
|
|
2233
|
+
children: [/* @__PURE__ */ J(r, { height: f[t] - Vn }), /* @__PURE__ */ J("div", {
|
|
2162
2234
|
className: "x78zum5 x6s0dn4 x1qughib x8zbtdt xxk0z11",
|
|
2163
|
-
children: i && /* @__PURE__ */ Y(
|
|
2235
|
+
children: i && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(n, { width: "8ch" }), /* @__PURE__ */ J(n, { width: "8ch" })] })
|
|
2164
2236
|
})]
|
|
2165
2237
|
})
|
|
2166
2238
|
})
|
|
2167
2239
|
})
|
|
2168
2240
|
});
|
|
2169
2241
|
}
|
|
2170
|
-
function
|
|
2171
|
-
let s =
|
|
2242
|
+
function nr({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact", locale: i, status: a }) {
|
|
2243
|
+
let s = W(null), [c, l] = G(), u = JSON.stringify(e.map((e) => [
|
|
2172
2244
|
e.id,
|
|
2173
2245
|
e.title,
|
|
2174
|
-
|
|
2246
|
+
Xt({
|
|
2175
2247
|
series: e.series,
|
|
2176
2248
|
markers: e.markers ?? [],
|
|
2177
2249
|
timestampUnit: t,
|
|
2178
2250
|
isStacked: !1
|
|
2179
2251
|
})
|
|
2180
2252
|
])), d = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), p = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === d);
|
|
2181
|
-
if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(
|
|
2253
|
+
if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(rr, {
|
|
2182
2254
|
charts: e,
|
|
2183
2255
|
height: r,
|
|
2184
2256
|
locale: i
|
|
2185
2257
|
});
|
|
2186
|
-
if (!p || !o(e)) return /* @__PURE__ */ J(
|
|
2258
|
+
if (!p || !o(e)) return /* @__PURE__ */ J(ce, {
|
|
2187
2259
|
title: "Small multiples",
|
|
2188
2260
|
locale: i,
|
|
2189
2261
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
2190
2262
|
});
|
|
2191
|
-
if (e.length > $.panels) return /* @__PURE__ */ J(
|
|
2263
|
+
if (e.length > $.panels) return /* @__PURE__ */ J(ce, {
|
|
2192
2264
|
title: "Small multiples",
|
|
2193
2265
|
locale: i,
|
|
2194
2266
|
message: `Choose at most ${$.panels} panels.`
|
|
@@ -2196,19 +2268,19 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2196
2268
|
if (e.length === 0) return /* @__PURE__ */ J(j, {
|
|
2197
2269
|
title: "Small multiples",
|
|
2198
2270
|
locale: i,
|
|
2199
|
-
children: /* @__PURE__ */ J(
|
|
2271
|
+
children: /* @__PURE__ */ J(le, { children: "No charts" })
|
|
2200
2272
|
});
|
|
2201
2273
|
let m = h({
|
|
2202
2274
|
height: f[r],
|
|
2203
2275
|
locale: i,
|
|
2204
2276
|
hasValueTitle: e.some((e) => e.valueLabel !== void 0),
|
|
2205
2277
|
axes: e.map((e) => ({
|
|
2206
|
-
axis:
|
|
2278
|
+
axis: qn({
|
|
2207
2279
|
format: e.valueFormat,
|
|
2208
2280
|
tickFormat: e.tickFormat,
|
|
2209
2281
|
label: e.valueLabel
|
|
2210
2282
|
}),
|
|
2211
|
-
domain:
|
|
2283
|
+
domain: Jn({
|
|
2212
2284
|
series: e.series,
|
|
2213
2285
|
isStacked: !1,
|
|
2214
2286
|
isZeroBased: !1,
|
|
@@ -2228,7 +2300,7 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2228
2300
|
0: {},
|
|
2229
2301
|
1: { className: "x1y332i5" }
|
|
2230
2302
|
}[!!(g && f > 0) | 0],
|
|
2231
|
-
children: /* @__PURE__ */ J(
|
|
2303
|
+
children: /* @__PURE__ */ J(ir, {
|
|
2232
2304
|
...d,
|
|
2233
2305
|
locale: i,
|
|
2234
2306
|
status: a,
|
|
@@ -2253,8 +2325,8 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2253
2325
|
}, o))
|
|
2254
2326
|
});
|
|
2255
2327
|
}
|
|
2256
|
-
function
|
|
2257
|
-
if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(
|
|
2328
|
+
function rr({ charts: e, height: t, locale: n }) {
|
|
2329
|
+
if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(ce, {
|
|
2258
2330
|
title: "Small multiples",
|
|
2259
2331
|
locale: n,
|
|
2260
2332
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
@@ -2272,7 +2344,7 @@ function tr({ charts: e, height: t, locale: n }) {
|
|
|
2272
2344
|
0: {},
|
|
2273
2345
|
1: { className: "x1y332i5" }
|
|
2274
2346
|
}[!!(r && o > 0) | 0],
|
|
2275
|
-
children: /* @__PURE__ */ J(
|
|
2347
|
+
children: /* @__PURE__ */ J(tr, {
|
|
2276
2348
|
...a,
|
|
2277
2349
|
locale: n,
|
|
2278
2350
|
height: t,
|
|
@@ -2281,150 +2353,150 @@ function tr({ charts: e, height: t, locale: n }) {
|
|
|
2281
2353
|
}, i))
|
|
2282
2354
|
});
|
|
2283
2355
|
}
|
|
2284
|
-
function
|
|
2285
|
-
let { title:
|
|
2356
|
+
function ir({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFormat: a, valueLabel: o, markers: s = [], height: c = "compact", kind: l, isStacked: u, sharedInspection: d, gutter: f, showTimeAxis: p = !0, bands: h = [], crossings: g = [], range: _ = null, onRangeChange: y, rangeStep: b, emptyLabel: x = "No observations", ...S }) {
|
|
2357
|
+
let { title: C, locale: T, report: E } = S, D = te(), O = _e(c), k = U(), A = h[0]?.points.map((e) => e.timestamp) ?? [], ae = t[0]?.points.map((e) => e.timestamp) ?? A, M = Jt({
|
|
2286
2358
|
series: t,
|
|
2287
2359
|
isStacked: u,
|
|
2288
2360
|
markers: s,
|
|
2289
|
-
timeline:
|
|
2290
|
-
}) ??
|
|
2361
|
+
timeline: A
|
|
2362
|
+
}) ?? dn({
|
|
2291
2363
|
bands: h,
|
|
2292
2364
|
crossings: g,
|
|
2293
2365
|
series: t,
|
|
2294
|
-
timestamps:
|
|
2295
|
-
}) ??
|
|
2366
|
+
timestamps: ae
|
|
2367
|
+
}) ?? ar({
|
|
2296
2368
|
range: _,
|
|
2297
2369
|
rangeStep: b,
|
|
2298
2370
|
isSelectable: y !== void 0,
|
|
2299
|
-
timeline:
|
|
2300
|
-
}),
|
|
2371
|
+
timeline: ae
|
|
2372
|
+
}), N = M === void 0 ? Qt({
|
|
2301
2373
|
series: t,
|
|
2302
2374
|
isStacked: u,
|
|
2303
|
-
tones:
|
|
2304
|
-
}) : [],
|
|
2375
|
+
tones: D
|
|
2376
|
+
}) : [], P = M === void 0 ? fn({
|
|
2305
2377
|
series: t,
|
|
2306
2378
|
bands: h,
|
|
2307
|
-
tones:
|
|
2308
|
-
}) : [],
|
|
2309
|
-
function
|
|
2379
|
+
tones: D
|
|
2380
|
+
}) : [], F = N[0]?.points ?? P[0]?.points ?? [];
|
|
2381
|
+
function L(e) {
|
|
2310
2382
|
return w({
|
|
2311
|
-
timestamp:
|
|
2312
|
-
locale:
|
|
2383
|
+
timestamp: Kn(e, n),
|
|
2384
|
+
locale: T,
|
|
2313
2385
|
format: r
|
|
2314
2386
|
});
|
|
2315
2387
|
}
|
|
2316
|
-
function
|
|
2317
|
-
return
|
|
2388
|
+
function R(e) {
|
|
2389
|
+
return ne({
|
|
2318
2390
|
value: e,
|
|
2319
|
-
locale:
|
|
2391
|
+
locale: T,
|
|
2320
2392
|
format: i
|
|
2321
2393
|
});
|
|
2322
2394
|
}
|
|
2323
|
-
let
|
|
2395
|
+
let me = F.map(({ timestamp: e }) => ({
|
|
2324
2396
|
id: String(e),
|
|
2325
|
-
label:
|
|
2326
|
-
})),
|
|
2397
|
+
label: L(e)
|
|
2398
|
+
})), B = `${Xt({
|
|
2327
2399
|
series: t,
|
|
2328
2400
|
markers: s,
|
|
2329
2401
|
timestampUnit: n,
|
|
2330
2402
|
isStacked: u
|
|
2331
|
-
})}${
|
|
2403
|
+
})}${Yn({
|
|
2332
2404
|
bands: h,
|
|
2333
2405
|
crossings: g
|
|
2334
|
-
})}`,
|
|
2406
|
+
})}`, ye = [...N.map(({ id: e, label: t, tone: n }) => ({
|
|
2335
2407
|
id: e,
|
|
2336
2408
|
label: t,
|
|
2337
2409
|
tone: n,
|
|
2338
|
-
shape:
|
|
2339
|
-
})), ...
|
|
2410
|
+
shape: Gn[l]
|
|
2411
|
+
})), ...P.map(({ id: e, label: t, tone: n }) => ({
|
|
2340
2412
|
id: e,
|
|
2341
2413
|
label: t,
|
|
2342
2414
|
tone: n,
|
|
2343
2415
|
shape: "band"
|
|
2344
|
-
}))],
|
|
2345
|
-
if (S.status === "loading") return /* @__PURE__ */ J(
|
|
2416
|
+
}))], be = E?.seriesValues !== void 0;
|
|
2417
|
+
if (S.status === "loading") return /* @__PURE__ */ J(tr, {
|
|
2346
2418
|
...S,
|
|
2347
2419
|
series: t,
|
|
2348
2420
|
height: c,
|
|
2349
2421
|
showTimeAxis: p
|
|
2350
2422
|
});
|
|
2351
|
-
if (
|
|
2423
|
+
if (M !== void 0) return /* @__PURE__ */ J(ce, {
|
|
2352
2424
|
...S,
|
|
2353
|
-
message:
|
|
2425
|
+
message: M
|
|
2354
2426
|
});
|
|
2355
|
-
if (
|
|
2427
|
+
if (F.length === 0) return /* @__PURE__ */ J(j, {
|
|
2356
2428
|
...S,
|
|
2357
|
-
series:
|
|
2358
|
-
children: /* @__PURE__ */ J(
|
|
2429
|
+
series: ye,
|
|
2430
|
+
children: /* @__PURE__ */ J(le, { children: x })
|
|
2359
2431
|
});
|
|
2360
|
-
let
|
|
2432
|
+
let H = F.map((e) => e.timestamp), we = hn({
|
|
2361
2433
|
crossings: g,
|
|
2362
2434
|
series: t,
|
|
2363
2435
|
bands: h
|
|
2364
|
-
}),
|
|
2436
|
+
}), Te = [...s.flatMap((e) => e.kind === "event" ? [e] : []), ...we.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
|
|
2365
2437
|
id: e.id,
|
|
2366
2438
|
timestamp: t,
|
|
2367
2439
|
label: e.label,
|
|
2368
2440
|
value: e.value
|
|
2369
2441
|
}])];
|
|
2370
|
-
function
|
|
2442
|
+
function W(e) {
|
|
2371
2443
|
return {
|
|
2372
|
-
label: e === void 0 ? void 0 :
|
|
2373
|
-
rows: [...
|
|
2444
|
+
label: e === void 0 ? void 0 : L(e),
|
|
2445
|
+
rows: [...N.map((t) => {
|
|
2374
2446
|
let n = t.points.find((t) => t.timestamp === e);
|
|
2375
2447
|
return {
|
|
2376
2448
|
id: t.id,
|
|
2377
2449
|
label: t.label,
|
|
2378
2450
|
tone: t.tone,
|
|
2379
|
-
value:
|
|
2451
|
+
value: R(n?.value ?? null)
|
|
2380
2452
|
};
|
|
2381
|
-
}), ...
|
|
2382
|
-
bands:
|
|
2453
|
+
}), ...Xn({
|
|
2454
|
+
bands: P,
|
|
2383
2455
|
timestamp: e,
|
|
2384
|
-
valueText:
|
|
2456
|
+
valueText: R
|
|
2385
2457
|
})],
|
|
2386
|
-
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...
|
|
2458
|
+
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...Te.filter((t) => gn(H, t.timestamp) === e).map((e) => `${e.label} · ${L(e.timestamp)}`)]
|
|
2387
2459
|
};
|
|
2388
2460
|
}
|
|
2389
|
-
let
|
|
2390
|
-
width:
|
|
2391
|
-
height:
|
|
2392
|
-
value:
|
|
2461
|
+
let G = H[0] ?? 0, K = H.at(-1) ?? G, Ee = {
|
|
2462
|
+
width: O.width,
|
|
2463
|
+
height: O.height,
|
|
2464
|
+
value: qn({
|
|
2393
2465
|
format: i,
|
|
2394
2466
|
tickFormat: a,
|
|
2395
2467
|
label: o
|
|
2396
2468
|
}),
|
|
2397
|
-
valueDomain:
|
|
2469
|
+
valueDomain: Jn({
|
|
2398
2470
|
series: t,
|
|
2399
2471
|
isStacked: u,
|
|
2400
2472
|
isZeroBased: l === "area",
|
|
2401
2473
|
bands: h,
|
|
2402
2474
|
crossings: g
|
|
2403
2475
|
}),
|
|
2404
|
-
timeDomain:
|
|
2476
|
+
timeDomain: Zt(Kn(G, n), Kn(K, n)),
|
|
2405
2477
|
timeFormat: r,
|
|
2406
|
-
locale:
|
|
2478
|
+
locale: T,
|
|
2407
2479
|
gutter: f,
|
|
2408
2480
|
hasValueTitle: o !== void 0
|
|
2409
|
-
},
|
|
2410
|
-
instants:
|
|
2411
|
-
x: (e) =>
|
|
2412
|
-
right:
|
|
2413
|
-
}),
|
|
2414
|
-
...
|
|
2415
|
-
topInset:
|
|
2416
|
-
}), { box: X } =
|
|
2481
|
+
}, De = v(Ee), Oe = In({
|
|
2482
|
+
instants: Te,
|
|
2483
|
+
x: (e) => De.x.position(Kn(e, n)),
|
|
2484
|
+
right: De.box.right
|
|
2485
|
+
}), q = v({
|
|
2486
|
+
...Ee,
|
|
2487
|
+
topInset: Ln(Oe)
|
|
2488
|
+
}), { box: X } = q;
|
|
2417
2489
|
function Z(e) {
|
|
2418
|
-
return
|
|
2490
|
+
return q.x.position(Kn(e, n));
|
|
2419
2491
|
}
|
|
2420
|
-
let Q =
|
|
2492
|
+
let Q = q.y.position;
|
|
2421
2493
|
function Ae(e) {
|
|
2422
|
-
return `${
|
|
2494
|
+
return `${L(e[0])} to ${L(e[1])}`;
|
|
2423
2495
|
}
|
|
2424
|
-
let je = y !== void 0 && b !== void 0 &&
|
|
2496
|
+
let je = y !== void 0 && b !== void 0 && K !== G ? {
|
|
2425
2497
|
onRangeChange: y,
|
|
2426
2498
|
rangeStep: b
|
|
2427
|
-
} : void 0, Me =
|
|
2499
|
+
} : void 0, Me = H.map((e) => ({
|
|
2428
2500
|
id: String(e),
|
|
2429
2501
|
x: Z(e),
|
|
2430
2502
|
y: 0
|
|
@@ -2432,44 +2504,44 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2432
2504
|
return /* @__PURE__ */ J("div", {
|
|
2433
2505
|
className: "xeuugli",
|
|
2434
2506
|
children: /* @__PURE__ */ J(ee, {
|
|
2435
|
-
items:
|
|
2436
|
-
readout: (e) =>
|
|
2437
|
-
locate:
|
|
2507
|
+
items: me,
|
|
2508
|
+
readout: (e) => ie(W(Number(e))),
|
|
2509
|
+
locate: V({
|
|
2438
2510
|
marks: Me,
|
|
2439
2511
|
width: X.width,
|
|
2440
2512
|
height: X.height,
|
|
2441
2513
|
axis: "x"
|
|
2442
2514
|
}),
|
|
2443
|
-
revision:
|
|
2515
|
+
revision: B,
|
|
2444
2516
|
inspected: d?.id,
|
|
2445
2517
|
onInspectedChange: d?.onChange,
|
|
2446
2518
|
within: d?.within,
|
|
2447
2519
|
render: (t, { inspected: r, cursor: i }) => {
|
|
2448
|
-
let a = r === null ? void 0 : Number(r), c =
|
|
2449
|
-
plotRef:
|
|
2520
|
+
let a = r === null ? void 0 : Number(r), c = W(d === void 0 || d.isSource ? a : void 0), f = /* @__PURE__ */ Y(ge, {
|
|
2521
|
+
plotRef: O.ref,
|
|
2450
2522
|
box: X,
|
|
2451
2523
|
label: m({
|
|
2452
|
-
title:
|
|
2524
|
+
title: C,
|
|
2453
2525
|
marks: "observations",
|
|
2454
2526
|
isSelectable: !1
|
|
2455
2527
|
}),
|
|
2456
|
-
readoutId:
|
|
2528
|
+
readoutId: k,
|
|
2457
2529
|
children: [
|
|
2458
|
-
/* @__PURE__ */ J(
|
|
2530
|
+
/* @__PURE__ */ J(ue, {
|
|
2459
2531
|
box: X,
|
|
2460
|
-
xTicks: p ?
|
|
2461
|
-
yTicks:
|
|
2532
|
+
xTicks: p ? q.xTicks : [],
|
|
2533
|
+
yTicks: q.yTicks,
|
|
2462
2534
|
yTitle: o
|
|
2463
2535
|
}),
|
|
2464
|
-
/* @__PURE__ */ Y(
|
|
2536
|
+
/* @__PURE__ */ Y(ve, {
|
|
2465
2537
|
box: X,
|
|
2466
2538
|
children: [
|
|
2467
|
-
/* @__PURE__ */ J(
|
|
2468
|
-
bands:
|
|
2539
|
+
/* @__PURE__ */ J(Rn, {
|
|
2540
|
+
bands: P,
|
|
2469
2541
|
x: Z,
|
|
2470
2542
|
y: Q
|
|
2471
2543
|
}),
|
|
2472
|
-
|
|
2544
|
+
N.map((e) => {
|
|
2473
2545
|
let t = e.points.map((e) => ({
|
|
2474
2546
|
x: Z(e.timestamp),
|
|
2475
2547
|
y: e.value === null ? null : Q(e.value + e.base)
|
|
@@ -2479,49 +2551,49 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2479
2551
|
y1: e.value === null ? null : Q(e.value + e.base)
|
|
2480
2552
|
}));
|
|
2481
2553
|
return /* @__PURE__ */ Y("g", { children: [
|
|
2482
|
-
l === "area" && /* @__PURE__ */ J(
|
|
2483
|
-
d:
|
|
2554
|
+
l === "area" && /* @__PURE__ */ J(he, {
|
|
2555
|
+
d: Ce(n),
|
|
2484
2556
|
tone: e.tone,
|
|
2485
2557
|
isPale: !u
|
|
2486
2558
|
}),
|
|
2487
|
-
/* @__PURE__ */ J(
|
|
2488
|
-
d:
|
|
2559
|
+
/* @__PURE__ */ J(pe, {
|
|
2560
|
+
d: Se(t),
|
|
2489
2561
|
tone: e.tone
|
|
2490
2562
|
}),
|
|
2491
|
-
|
|
2563
|
+
xe(t).map((t) => /* @__PURE__ */ J(de, {
|
|
2492
2564
|
x: t.x,
|
|
2493
2565
|
y: t.y,
|
|
2494
2566
|
tone: e.tone,
|
|
2495
|
-
radius:
|
|
2567
|
+
radius: Un
|
|
2496
2568
|
}, t.x))
|
|
2497
2569
|
] }, e.id);
|
|
2498
2570
|
}),
|
|
2499
|
-
g.map((e) => /* @__PURE__ */ J(
|
|
2571
|
+
g.map((e) => /* @__PURE__ */ J(fe, {
|
|
2500
2572
|
x1: X.left,
|
|
2501
2573
|
x2: X.right,
|
|
2502
2574
|
y1: Q(e.value),
|
|
2503
2575
|
y2: Q(e.value)
|
|
2504
2576
|
}, e.id)),
|
|
2505
2577
|
s.map((e) => {
|
|
2506
|
-
if (e.kind === "time") return /* @__PURE__ */ J(
|
|
2578
|
+
if (e.kind === "time") return /* @__PURE__ */ J(z, {
|
|
2507
2579
|
x: Z(e.timestamp),
|
|
2508
2580
|
top: X.top,
|
|
2509
2581
|
bottom: X.bottom
|
|
2510
2582
|
}, e.id);
|
|
2511
|
-
let t =
|
|
2512
|
-
return e.kind === "point" ? /* @__PURE__ */ J(
|
|
2583
|
+
let t = N.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base;
|
|
2584
|
+
return e.kind === "point" ? /* @__PURE__ */ J(I, {
|
|
2513
2585
|
x: Z(e.timestamp),
|
|
2514
2586
|
y: Q(e.value + (t ?? 0))
|
|
2515
2587
|
}, e.id) : void 0;
|
|
2516
2588
|
}),
|
|
2517
|
-
a !== void 0 && /* @__PURE__ */ J(
|
|
2589
|
+
a !== void 0 && /* @__PURE__ */ J(z, {
|
|
2518
2590
|
x: Z(a),
|
|
2519
2591
|
top: X.top,
|
|
2520
2592
|
bottom: X.bottom
|
|
2521
2593
|
}),
|
|
2522
|
-
a !== void 0 &&
|
|
2594
|
+
a !== void 0 && N.flatMap((e) => {
|
|
2523
2595
|
let t = e.points.find((e) => e.timestamp === a);
|
|
2524
|
-
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(
|
|
2596
|
+
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(de, {
|
|
2525
2597
|
x: Z(t.timestamp),
|
|
2526
2598
|
y: Q(t.value + t.base),
|
|
2527
2599
|
tone: e.tone,
|
|
@@ -2530,48 +2602,48 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2530
2602
|
})
|
|
2531
2603
|
]
|
|
2532
2604
|
}),
|
|
2533
|
-
/* @__PURE__ */ J(
|
|
2605
|
+
/* @__PURE__ */ J(zn, {
|
|
2534
2606
|
placed: Oe,
|
|
2535
2607
|
x: Z,
|
|
2536
2608
|
y: Q,
|
|
2537
2609
|
top: X.top,
|
|
2538
2610
|
bottom: X.bottom
|
|
2539
2611
|
}),
|
|
2540
|
-
i !== null && /* @__PURE__ */ J(
|
|
2612
|
+
i !== null && /* @__PURE__ */ J(re, {
|
|
2541
2613
|
x: Z(Number(i)),
|
|
2542
2614
|
top: X.top,
|
|
2543
2615
|
bottom: X.bottom,
|
|
2544
|
-
width:
|
|
2616
|
+
width: Hn
|
|
2545
2617
|
})
|
|
2546
2618
|
]
|
|
2547
2619
|
});
|
|
2548
2620
|
return /* @__PURE__ */ Y(j, {
|
|
2549
2621
|
...S,
|
|
2550
2622
|
figure: t,
|
|
2551
|
-
titleDetail:
|
|
2552
|
-
series:
|
|
2553
|
-
seriesLegend: /* @__PURE__ */ J(
|
|
2554
|
-
id:
|
|
2623
|
+
titleDetail: be ? void 0 : c.label,
|
|
2624
|
+
series: ye,
|
|
2625
|
+
seriesLegend: /* @__PURE__ */ J(se, {
|
|
2626
|
+
id: k,
|
|
2555
2627
|
label: c.label,
|
|
2556
|
-
legend:
|
|
2628
|
+
legend: ye,
|
|
2557
2629
|
rows: c.rows,
|
|
2558
|
-
x: Z(a ??
|
|
2630
|
+
x: Z(a ?? G),
|
|
2559
2631
|
width: X.width,
|
|
2560
2632
|
notes: c.notes,
|
|
2561
|
-
hasSeriesSummary:
|
|
2633
|
+
hasSeriesSummary: be
|
|
2562
2634
|
}),
|
|
2563
|
-
children: [/* @__PURE__ */ J(
|
|
2564
|
-
label: `${
|
|
2635
|
+
children: [/* @__PURE__ */ J(oe, {
|
|
2636
|
+
label: `${C} observations`,
|
|
2565
2637
|
columns: [
|
|
2566
2638
|
{
|
|
2567
2639
|
id: "time",
|
|
2568
2640
|
label: `Time (${n})`
|
|
2569
2641
|
},
|
|
2570
|
-
...
|
|
2642
|
+
...N.map((e) => ({
|
|
2571
2643
|
id: `series:${e.id}`,
|
|
2572
2644
|
label: e.label
|
|
2573
2645
|
})),
|
|
2574
|
-
...
|
|
2646
|
+
...P.flatMap((e) => [{
|
|
2575
2647
|
id: `band:${e.id}`,
|
|
2576
2648
|
label: e.label
|
|
2577
2649
|
}, {
|
|
@@ -2579,31 +2651,31 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2579
2651
|
label: `${e.label}: ${e.rangeLabel}`
|
|
2580
2652
|
}])
|
|
2581
2653
|
],
|
|
2582
|
-
rows:
|
|
2654
|
+
rows: F.map((e, t) => ({
|
|
2583
2655
|
id: e.timestamp,
|
|
2584
2656
|
values: [
|
|
2585
|
-
|
|
2586
|
-
...
|
|
2587
|
-
...
|
|
2588
|
-
bands:
|
|
2657
|
+
L(e.timestamp),
|
|
2658
|
+
...N.map((e) => R(e.points[t]?.value ?? null)),
|
|
2659
|
+
...Xn({
|
|
2660
|
+
bands: P,
|
|
2589
2661
|
timestamp: e.timestamp,
|
|
2590
|
-
valueText:
|
|
2662
|
+
valueText: R
|
|
2591
2663
|
}).map((e) => e.value)
|
|
2592
2664
|
]
|
|
2593
2665
|
}))
|
|
2594
2666
|
}), /* @__PURE__ */ Y("div", {
|
|
2595
2667
|
className: "xrvj5dj x1n8ia3y",
|
|
2596
2668
|
children: [
|
|
2597
|
-
je === void 0 ? f : /* @__PURE__ */ J(
|
|
2669
|
+
je === void 0 ? f : /* @__PURE__ */ J(An, {
|
|
2598
2670
|
value: _,
|
|
2599
2671
|
onValueChange: je.onRangeChange,
|
|
2600
|
-
min:
|
|
2601
|
-
max:
|
|
2672
|
+
min: G,
|
|
2673
|
+
max: K,
|
|
2602
2674
|
step: je.rangeStep,
|
|
2603
2675
|
describe: Ae,
|
|
2604
|
-
label: `${
|
|
2605
|
-
left: Z(
|
|
2606
|
-
width: Z(
|
|
2676
|
+
label: `${C} time range`,
|
|
2677
|
+
left: Z(G),
|
|
2678
|
+
width: Z(K) - Z(G),
|
|
2607
2679
|
height: X.bottom,
|
|
2608
2680
|
children: f
|
|
2609
2681
|
}),
|
|
@@ -2612,9 +2684,9 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2612
2684
|
children: [/* @__PURE__ */ J("span", { children: _ === null ? "Drag on the plot with a mouse to select a range of time." : `Selected range: ${Ae(_)}` }), _ === null ? /* @__PURE__ */ J(e, {
|
|
2613
2685
|
type: "button",
|
|
2614
2686
|
onClick: (e) => {
|
|
2615
|
-
|
|
2616
|
-
first:
|
|
2617
|
-
last:
|
|
2687
|
+
ke({ options: () => je }, "onRangeChange", or({
|
|
2688
|
+
first: G,
|
|
2689
|
+
last: K,
|
|
2618
2690
|
step: je.rangeStep
|
|
2619
2691
|
}), {
|
|
2620
2692
|
reason: "trigger-press",
|
|
@@ -2625,7 +2697,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2625
2697
|
}) : /* @__PURE__ */ J(e, {
|
|
2626
2698
|
type: "button",
|
|
2627
2699
|
onClick: (e) => {
|
|
2628
|
-
|
|
2700
|
+
ke({ options: () => je }, "onRangeChange", null, {
|
|
2629
2701
|
reason: "clear-press",
|
|
2630
2702
|
event: e.nativeEvent
|
|
2631
2703
|
});
|
|
@@ -2633,16 +2705,16 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2633
2705
|
children: "Clear range"
|
|
2634
2706
|
})]
|
|
2635
2707
|
}),
|
|
2636
|
-
s.length +
|
|
2708
|
+
s.length + we.length > 0 && /* @__PURE__ */ Y("ul", {
|
|
2637
2709
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
2638
2710
|
children: [s.map((e) => /* @__PURE__ */ Y("li", { children: [
|
|
2639
|
-
|
|
2711
|
+
L(e.timestamp),
|
|
2640
2712
|
" · ",
|
|
2641
2713
|
e.label,
|
|
2642
|
-
e.kind === "point" && ` · ${
|
|
2643
|
-
] }, e.id)),
|
|
2714
|
+
e.kind === "point" && ` · ${R(e.value)}`
|
|
2715
|
+
] }, e.id)), we.map((e) => /* @__PURE__ */ J("li", { children: Zn({
|
|
2644
2716
|
found: e,
|
|
2645
|
-
timeText:
|
|
2717
|
+
timeText: L
|
|
2646
2718
|
}) }, e.crossing.id))]
|
|
2647
2719
|
})
|
|
2648
2720
|
]
|
|
@@ -2652,7 +2724,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2652
2724
|
})
|
|
2653
2725
|
});
|
|
2654
2726
|
}
|
|
2655
|
-
function
|
|
2727
|
+
function ar({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
2656
2728
|
let i = r[0], a = r.at(-1);
|
|
2657
2729
|
if (!n || i === void 0 || a === void 0) return;
|
|
2658
2730
|
let o = a - i;
|
|
@@ -2661,8 +2733,8 @@ function rr({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
|
2661
2733
|
if (e !== null && (!(e[0] >= i && e[1] <= a) || e[0] >= e[1])) return "The selected range must have ordered ends inside the observed time.";
|
|
2662
2734
|
}
|
|
2663
2735
|
}
|
|
2664
|
-
function
|
|
2665
|
-
let r = Math.max(1, Math.round((t - e) /
|
|
2736
|
+
function or({ first: e, last: t, step: n }) {
|
|
2737
|
+
let r = Math.max(1, Math.round((t - e) / Wn / n)) * n, i = Math.min(e + r, t - n);
|
|
2666
2738
|
return [i, Math.min(t, Math.max(i + n, t - r))];
|
|
2667
2739
|
}
|
|
2668
|
-
export {
|
|
2740
|
+
export { er as a, $ as c, Ft as d, gt as f, rr as i, Ht as l, ct as m, Qn as n, ln as o, ft as p, nr as r, sn as s, $n as t, It as u };
|