@carto/ps-react-ui 6.1.1 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actions-BWlS5tpP.js → actions-CkxKe8-J.js} +57 -47
- package/dist/actions-CkxKe8-J.js.map +1 -0
- package/dist/category-DULnoxvk.js +933 -0
- package/dist/category-DULnoxvk.js.map +1 -0
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/components-CTUpdQuj.js.map +1 -1
- package/dist/download-B4sykOFm.js.map +1 -1
- package/dist/{echart-CV8F50gn.js → echart-ysYFLa_T.js} +2 -2
- package/dist/echart-ysYFLa_T.js.map +1 -0
- package/dist/formula-DJS-JLpk.js.map +1 -1
- package/dist/{option-builders-DQivvvbb.js → item-color-B7xkIpDZ.js} +26 -9
- package/dist/item-color-B7xkIpDZ.js.map +1 -0
- package/dist/legend.js.map +1 -1
- package/dist/{markdown-Bn2nKCbn.js → markdown-DmvLi3vx.js} +2 -2
- package/dist/markdown-DmvLi3vx.js.map +1 -0
- package/dist/{markdown-content-kYNLOX0T.js → markdown-content-BpAH_V6S.js} +5 -4
- package/dist/markdown-content-BpAH_V6S.js.map +1 -0
- package/dist/range-BpU2zBmq.js.map +1 -1
- package/dist/smart-tooltip-Dc_rHhyI.js.map +1 -1
- package/dist/spread-CQwFIwuz.js.map +1 -1
- package/dist/stores-DcBOZlU3.js.map +1 -1
- package/dist/stores-mad-9yFn.js.map +1 -1
- package/dist/styles-BCEBm7xh.js.map +1 -1
- package/dist/table-DEdW_fDj.js.map +1 -1
- package/dist/types/widgets/bar/types.d.ts +6 -0
- package/dist/types/widgets/category/category-ui.d.ts +10 -2
- package/dist/types/widgets/category/category.d.ts +7 -1
- package/dist/types/widgets/category/components/category-bar-stacked.d.ts +8 -1
- package/dist/types/widgets/category/components/category-bar.d.ts +24 -2
- package/dist/types/widgets/category/components/category-row-multi.d.ts +3 -1
- package/dist/types/widgets/category/components/category-row-single.d.ts +3 -1
- package/dist/types/widgets/category/components/category-row-stacked.d.ts +10 -1
- package/dist/types/widgets/category/style.d.ts +33 -6
- package/dist/types/widgets/histogram/bins.d.ts +7 -0
- package/dist/types/widgets/histogram/download.d.ts +2 -2
- package/dist/types/widgets/histogram/index.d.ts +2 -1
- package/dist/types/widgets/histogram/options.d.ts +1 -1
- package/dist/types/widgets/histogram/transforms.d.ts +5 -4
- package/dist/types/widgets/histogram/types.d.ts +22 -5
- package/dist/types/widgets/index.d.ts +1 -1
- package/dist/types/widgets/pie/types.d.ts +6 -0
- package/dist/types/widgets/scatterplot/download.d.ts +2 -2
- package/dist/types/widgets/scatterplot/index.d.ts +2 -1
- package/dist/types/widgets/scatterplot/points.d.ts +7 -0
- package/dist/types/widgets/scatterplot/transforms.d.ts +4 -3
- package/dist/types/widgets/scatterplot/types.d.ts +21 -2
- package/dist/types/widgets/timeseries/types.d.ts +6 -0
- package/dist/types/widgets/utils/item-color.d.ts +26 -0
- package/dist/utils-C-eWwOhE.js.map +1 -1
- package/dist/widgets/actions.js +1 -1
- package/dist/widgets/bar.js +78 -70
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/echart.js +1 -1
- package/dist/widgets/histogram.js +116 -85
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +2 -2
- package/dist/widgets/pie.js +109 -90
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +131 -92
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/timeseries.js +82 -74
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets.js +5 -5
- package/dist/widgets.js.map +1 -1
- package/dist/zoom-toggle-MmLjMTEw.js.map +1 -1
- package/package.json +2 -2
- package/src/widgets/actions/fullscreen/fullscreen-store.test.tsx +77 -13
- package/src/widgets/actions/fullscreen/fullscreen.tsx +48 -5
- package/src/widgets/bar/options.test.ts +106 -0
- package/src/widgets/bar/options.ts +25 -14
- package/src/widgets/bar/types.ts +6 -0
- package/src/widgets/category/category-ui.test.tsx +139 -0
- package/src/widgets/category/category-ui.tsx +64 -11
- package/src/widgets/category/category.test.tsx +67 -0
- package/src/widgets/category/category.tsx +32 -15
- package/src/widgets/category/components/category-bar-stacked.test.tsx +18 -0
- package/src/widgets/category/components/category-bar-stacked.tsx +42 -29
- package/src/widgets/category/components/category-bar.test.tsx +66 -0
- package/src/widgets/category/components/category-bar.tsx +65 -9
- package/src/widgets/category/components/category-row-multi.tsx +21 -0
- package/src/widgets/category/components/category-row-single.tsx +4 -0
- package/src/widgets/category/components/category-row-stacked.tsx +24 -1
- package/src/widgets/category/style.ts +58 -14
- package/src/widgets/histogram/bins.ts +22 -0
- package/src/widgets/histogram/download.test.ts +10 -0
- package/src/widgets/histogram/download.ts +7 -3
- package/src/widgets/histogram/index.ts +3 -0
- package/src/widgets/histogram/options.test.ts +62 -0
- package/src/widgets/histogram/options.ts +38 -17
- package/src/widgets/histogram/transforms.test.ts +21 -7
- package/src/widgets/histogram/transforms.ts +26 -12
- package/src/widgets/histogram/types.ts +25 -5
- package/src/widgets/index.ts +6 -1
- package/src/widgets/pie/options.test.ts +91 -0
- package/src/widgets/pie/options.ts +50 -20
- package/src/widgets/pie/types.ts +6 -0
- package/src/widgets/scatterplot/download.test.ts +9 -0
- package/src/widgets/scatterplot/download.ts +5 -3
- package/src/widgets/scatterplot/index.ts +3 -0
- package/src/widgets/scatterplot/options.test.ts +78 -0
- package/src/widgets/scatterplot/options.ts +35 -11
- package/src/widgets/scatterplot/points.ts +35 -0
- package/src/widgets/scatterplot/transforms.test.ts +19 -0
- package/src/widgets/scatterplot/transforms.ts +23 -18
- package/src/widgets/scatterplot/types.ts +25 -2
- package/src/widgets/timeseries/options.test.ts +65 -0
- package/src/widgets/timeseries/options.ts +31 -14
- package/src/widgets/timeseries/types.ts +6 -0
- package/src/widgets/utils/item-color.test.ts +74 -0
- package/src/widgets/utils/item-color.ts +55 -0
- package/dist/actions-BWlS5tpP.js.map +0 -1
- package/dist/category-alzjKzvQ.js +0 -839
- package/dist/category-alzjKzvQ.js.map +0 -1
- package/dist/echart-CV8F50gn.js.map +0 -1
- package/dist/markdown-Bn2nKCbn.js.map +0 -1
- package/dist/markdown-content-kYNLOX0T.js.map +0 -1
- package/dist/option-builders-DQivvvbb.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { r as e } from "../zoom-toggle-MmLjMTEw.js";
|
|
2
2
|
import { n as t, t as n } from "../download-B4sykOFm.js";
|
|
3
3
|
import { n as r, r as i, t as a } from "../utils-C-eWwOhE.js";
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { Box as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import * as
|
|
4
|
+
import { c as o, i as s, n as c, o as l, r as u, s as d, t as f } from "../item-color-B7xkIpDZ.js";
|
|
5
|
+
import { c as p } from "react/compiler-runtime";
|
|
6
|
+
import { Box as m, Skeleton as h } from "@mui/material";
|
|
7
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
+
import * as v from "echarts";
|
|
9
9
|
//#region src/widgets/timeseries/options.ts
|
|
10
|
-
function
|
|
10
|
+
function y({ theme: e, formatter: t, labelFormatter: n }) {
|
|
11
11
|
let r = 0, i = 1;
|
|
12
12
|
return {
|
|
13
13
|
grid: {
|
|
14
14
|
left: parseInt(e.spacing(1)),
|
|
15
15
|
top: parseInt(e.spacing(3)),
|
|
16
16
|
right: parseInt(e.spacing(1)),
|
|
17
|
-
...
|
|
17
|
+
...u(!1, e),
|
|
18
18
|
containLabel: !0
|
|
19
19
|
},
|
|
20
20
|
tooltip: {
|
|
@@ -28,10 +28,10 @@ function v({ theme: e, formatter: t, labelFormatter: n }) {
|
|
|
28
28
|
fontFamily: e.typography.caption.fontFamily
|
|
29
29
|
},
|
|
30
30
|
axisPointer: { type: "line" },
|
|
31
|
-
position:
|
|
32
|
-
formatter:
|
|
31
|
+
position: d(e),
|
|
32
|
+
formatter: x(t, n)
|
|
33
33
|
},
|
|
34
|
-
legend: { ...
|
|
34
|
+
legend: { ...s({ hasLegend: !1 }) },
|
|
35
35
|
axisPointer: { lineStyle: { color: e.palette.grey[400] } },
|
|
36
36
|
color: [e.palette.secondary.main, ...Object.values(e.palette.qualitative?.bold ?? {})],
|
|
37
37
|
xAxis: {
|
|
@@ -39,7 +39,7 @@ function v({ theme: e, formatter: t, labelFormatter: n }) {
|
|
|
39
39
|
axisLine: { show: !1 },
|
|
40
40
|
axisTick: { show: !1 },
|
|
41
41
|
axisLabel: {
|
|
42
|
-
...
|
|
42
|
+
...c(e),
|
|
43
43
|
padding: [
|
|
44
44
|
parseInt(e.spacing(.5)),
|
|
45
45
|
0,
|
|
@@ -53,8 +53,8 @@ function v({ theme: e, formatter: t, labelFormatter: n }) {
|
|
|
53
53
|
},
|
|
54
54
|
yAxis: {
|
|
55
55
|
type: "value",
|
|
56
|
-
min: (e) => (r = e.min < 0 ?
|
|
57
|
-
max: (e) => (i = e.max <= 0 ? 1 :
|
|
56
|
+
min: (e) => (r = e.min < 0 ? o(e.min) : 0, r),
|
|
57
|
+
max: (e) => (i = e.max <= 0 ? 1 : o(e.max), i),
|
|
58
58
|
axisLine: { show: !1 },
|
|
59
59
|
axisTick: { show: !1 },
|
|
60
60
|
splitLine: {
|
|
@@ -62,7 +62,7 @@ function v({ theme: e, formatter: t, labelFormatter: n }) {
|
|
|
62
62
|
lineStyle: { color: e.palette.black?.[4] ?? e.palette.divider }
|
|
63
63
|
},
|
|
64
64
|
axisLabel: {
|
|
65
|
-
...
|
|
65
|
+
...c(e),
|
|
66
66
|
margin: parseInt(e.spacing(1)),
|
|
67
67
|
show: !0,
|
|
68
68
|
showMaxLabel: !0,
|
|
@@ -74,46 +74,54 @@ function v({ theme: e, formatter: t, labelFormatter: n }) {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let { theme: n, formatter:
|
|
79
|
-
return (t,
|
|
77
|
+
function b(t) {
|
|
78
|
+
let { theme: n, formatter: s, labelFormatter: c, optionsOverride: l } = t, u = t.series, d = t.smooth ?? !0, p = t.area ?? !1, m = t.selection, h = m && m.length > 0 ? new Set(m) : null, g = (e) => e instanceof Date ? e.getTime() : e;
|
|
79
|
+
return (t, m, _) => {
|
|
80
80
|
if (t == null) {
|
|
81
|
-
let e =
|
|
81
|
+
let e = y({
|
|
82
82
|
theme: n,
|
|
83
|
-
formatter:
|
|
84
|
-
labelFormatter:
|
|
83
|
+
formatter: s,
|
|
84
|
+
labelFormatter: c
|
|
85
85
|
});
|
|
86
|
-
return
|
|
86
|
+
return l ? i(e, l) : e;
|
|
87
87
|
}
|
|
88
|
-
let
|
|
89
|
-
if (
|
|
88
|
+
let b = Array.isArray(m) ? m : [];
|
|
89
|
+
if (b.length === 0) return {
|
|
90
90
|
...t,
|
|
91
91
|
dataset: [],
|
|
92
92
|
series: []
|
|
93
93
|
};
|
|
94
|
-
let
|
|
95
|
-
let
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
let S = b.length > 1, C = Array.isArray(t.series) ? t.series : [], w = C[0] ?? {}, T = typeof t.yAxis == "object" && !Array.isArray(t.yAxis) ? t.yAxis : {}, E = typeof t.grid == "object" && !Array.isArray(t.grid) ? t.grid : {}, D = typeof t.tooltip == "object" && !Array.isArray(t.tooltip) ? t.tooltip : {}, O = typeof t.legend == "object" && !Array.isArray(t.legend) ? t.legend : {}, k = _?.formatter, A = 0, j = 1, M = r(t.dataZoom, S), N = typeof E.bottom == "number" ? E.bottom : 24, P = S ? 56 : N, F = M ? P + e.sliderHeight + e.sliderGap : P, I = (e, t) => {
|
|
95
|
+
let r = f({
|
|
96
|
+
theme: n,
|
|
97
|
+
datums: e,
|
|
98
|
+
template: t,
|
|
99
|
+
fallback: (e) => e.color
|
|
100
|
+
});
|
|
101
|
+
return { color: (e) => {
|
|
102
|
+
let t = e.value?.name, n = r(e);
|
|
103
|
+
return !h || t == null || h.has(g(t)) ? n : v.color.modifyAlpha(n, .15);
|
|
104
|
+
} };
|
|
105
|
+
}, L = b.some((e) => e.some((e) => typeof e?.color == "string" && e.color !== ""));
|
|
98
106
|
return {
|
|
99
107
|
...t,
|
|
100
|
-
dataset:
|
|
101
|
-
series:
|
|
102
|
-
let r =
|
|
108
|
+
dataset: b.map((e) => ({ source: e })),
|
|
109
|
+
series: b.map((e, t) => {
|
|
110
|
+
let r = C[t] ?? w, i = a(n, u?.[t]?.color);
|
|
103
111
|
return {
|
|
104
112
|
...typeof r == "object" ? r : {},
|
|
105
113
|
type: "line",
|
|
106
114
|
datasetIndex: t,
|
|
107
|
-
name:
|
|
115
|
+
name: u?.[t]?.name ?? `Series ${t + 1}`,
|
|
108
116
|
encode: {
|
|
109
117
|
x: "name",
|
|
110
118
|
y: "value"
|
|
111
119
|
},
|
|
112
120
|
smooth: d,
|
|
113
|
-
showSymbol:
|
|
114
|
-
...
|
|
121
|
+
showSymbol: h != null || L,
|
|
122
|
+
...p ? { areaStyle: {} } : {},
|
|
115
123
|
emphasis: { focus: "series" },
|
|
116
|
-
itemStyle:
|
|
124
|
+
itemStyle: I(e, r),
|
|
117
125
|
...i ? {
|
|
118
126
|
color: i,
|
|
119
127
|
lineStyle: { color: i }
|
|
@@ -121,32 +129,32 @@ function y(t) {
|
|
|
121
129
|
};
|
|
122
130
|
}),
|
|
123
131
|
legend: {
|
|
124
|
-
...
|
|
125
|
-
show:
|
|
132
|
+
...O,
|
|
133
|
+
show: S
|
|
126
134
|
},
|
|
127
135
|
grid: {
|
|
128
|
-
...
|
|
129
|
-
bottom:
|
|
136
|
+
...E,
|
|
137
|
+
bottom: F
|
|
130
138
|
},
|
|
131
|
-
...
|
|
139
|
+
...M ? { dataZoom: M } : {},
|
|
132
140
|
yAxis: {
|
|
133
|
-
...
|
|
134
|
-
min: (e) => (
|
|
135
|
-
max: (e) => (
|
|
141
|
+
...T,
|
|
142
|
+
min: (e) => (A = e.min < 0 ? o(e.min) : 0, A),
|
|
143
|
+
max: (e) => (j = e.max <= 0 ? 1 : o(e.max), j),
|
|
136
144
|
axisLabel: {
|
|
137
|
-
...
|
|
138
|
-
formatter: (e) => e !==
|
|
145
|
+
...T.axisLabel ?? {},
|
|
146
|
+
formatter: (e) => e !== j && e !== A || e === 0 ? "" : k ? k(e) : String(e)
|
|
139
147
|
}
|
|
140
148
|
},
|
|
141
149
|
tooltip: {
|
|
142
|
-
...
|
|
143
|
-
formatter:
|
|
150
|
+
...D,
|
|
151
|
+
formatter: x(k, c)
|
|
144
152
|
}
|
|
145
153
|
};
|
|
146
154
|
};
|
|
147
155
|
}
|
|
148
|
-
function
|
|
149
|
-
return
|
|
156
|
+
function x(e, t) {
|
|
157
|
+
return l((n) => {
|
|
150
158
|
let r = n.value, i = r?.value, a = typeof i == "number" && e ? e(i) : i ?? "", o = typeof n.marker == "string" ? n.marker : "", s = n.seriesName ? `${n.seriesName}: ` : "", c = r?.name ?? n.name, l = t && c != null ? t(c instanceof Date ? c : new Date(c)) : c ?? "";
|
|
151
159
|
return {
|
|
152
160
|
name: String(l),
|
|
@@ -158,7 +166,7 @@ function b(e, t) {
|
|
|
158
166
|
}
|
|
159
167
|
//#endregion
|
|
160
168
|
//#region src/widgets/timeseries/skeleton.tsx
|
|
161
|
-
var
|
|
169
|
+
var S = {
|
|
162
170
|
container: {
|
|
163
171
|
display: "flex",
|
|
164
172
|
flexDirection: "column",
|
|
@@ -204,42 +212,42 @@ var x = {
|
|
|
204
212
|
gap: ({ spacing: e }) => e(1.5)
|
|
205
213
|
}
|
|
206
214
|
};
|
|
207
|
-
function
|
|
208
|
-
let e =
|
|
209
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */
|
|
210
|
-
sx:
|
|
215
|
+
function C() {
|
|
216
|
+
let e = p(2), t;
|
|
217
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ _(m, {
|
|
218
|
+
sx: S.graph,
|
|
211
219
|
children: [
|
|
212
|
-
/* @__PURE__ */ h
|
|
220
|
+
/* @__PURE__ */ g(h, {
|
|
213
221
|
variant: "rectangular",
|
|
214
|
-
sx:
|
|
222
|
+
sx: S.segmentA
|
|
215
223
|
}),
|
|
216
|
-
/* @__PURE__ */ h
|
|
224
|
+
/* @__PURE__ */ g(h, {
|
|
217
225
|
variant: "rectangular",
|
|
218
|
-
sx:
|
|
226
|
+
sx: S.segmentB
|
|
219
227
|
}),
|
|
220
|
-
/* @__PURE__ */ h
|
|
228
|
+
/* @__PURE__ */ g(h, {
|
|
221
229
|
variant: "rectangular",
|
|
222
|
-
sx:
|
|
230
|
+
sx: S.segmentC
|
|
223
231
|
})
|
|
224
232
|
]
|
|
225
233
|
}), e[0] = t) : t = e[0];
|
|
226
234
|
let n;
|
|
227
|
-
return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
228
|
-
sx:
|
|
229
|
-
children: [t, /* @__PURE__ */
|
|
230
|
-
sx:
|
|
231
|
-
children: [0, 1].map(
|
|
235
|
+
return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ _(m, {
|
|
236
|
+
sx: S.container,
|
|
237
|
+
children: [t, /* @__PURE__ */ g(m, {
|
|
238
|
+
sx: S.legend,
|
|
239
|
+
children: [0, 1].map(w)
|
|
232
240
|
})]
|
|
233
241
|
}), e[1] = n) : n = e[1], n;
|
|
234
242
|
}
|
|
235
|
-
function
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
sx:
|
|
238
|
-
children: [/* @__PURE__ */ h
|
|
243
|
+
function w(e) {
|
|
244
|
+
return /* @__PURE__ */ _(m, {
|
|
245
|
+
sx: S.legendItem,
|
|
246
|
+
children: [/* @__PURE__ */ g(h, {
|
|
239
247
|
variant: "circular",
|
|
240
248
|
width: 8,
|
|
241
249
|
height: 8
|
|
242
|
-
}), /* @__PURE__ */ h
|
|
250
|
+
}), /* @__PURE__ */ g(h, {
|
|
243
251
|
width: 48,
|
|
244
252
|
height: 8
|
|
245
253
|
})]
|
|
@@ -247,7 +255,7 @@ function C(e) {
|
|
|
247
255
|
}
|
|
248
256
|
//#endregion
|
|
249
257
|
//#region src/widgets/timeseries/download.ts
|
|
250
|
-
function
|
|
258
|
+
function T(e) {
|
|
251
259
|
return n(e, t({
|
|
252
260
|
filename: e.filename,
|
|
253
261
|
getRows: (t) => {
|
|
@@ -260,7 +268,7 @@ function w(e) {
|
|
|
260
268
|
for (let t = 0; t < r; t++) s.push(e.seriesNames?.[t] ?? `series_${t + 1}`);
|
|
261
269
|
let c = [s];
|
|
262
270
|
for (let e of i) {
|
|
263
|
-
let t = [
|
|
271
|
+
let t = [E(e)], n = String(e);
|
|
264
272
|
for (let e of o) t.push(e.get(n) ?? "");
|
|
265
273
|
c.push(t);
|
|
266
274
|
}
|
|
@@ -268,12 +276,12 @@ function w(e) {
|
|
|
268
276
|
}
|
|
269
277
|
}));
|
|
270
278
|
}
|
|
271
|
-
function
|
|
279
|
+
function E(e) {
|
|
272
280
|
return e instanceof Date ? e.toISOString() : typeof e == "number" ? new Date(e).toISOString() : e;
|
|
273
281
|
}
|
|
274
282
|
//#endregion
|
|
275
283
|
//#region src/widgets/timeseries/transforms.ts
|
|
276
|
-
function
|
|
284
|
+
function D(e, t) {
|
|
277
285
|
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
278
286
|
let n = new Set(t);
|
|
279
287
|
return e.map((e) => Array.isArray(e) ? e.filter((e) => {
|
|
@@ -283,6 +291,6 @@ function E(e, t) {
|
|
|
283
291
|
}) : e);
|
|
284
292
|
}
|
|
285
293
|
//#endregion
|
|
286
|
-
export {
|
|
294
|
+
export { C as TimeseriesSkeleton, T as createTimeseriesDownloadConfig, b as createTimeseriesOptionFactory, D as filterTimeseriesByLockedItems, y as timeseriesOptions };
|
|
287
295
|
|
|
288
296
|
//# sourceMappingURL=timeseries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseries.js","names":["<Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>","<Box sx={styles.container}>\n <Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>","(i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n )"],"sources":["../../src/widgets/timeseries/options.ts","../../src/widgets/timeseries/skeleton.tsx","../../src/widgets/timeseries/download.ts","../../src/widgets/timeseries/transforms.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildAxisLabelStyle,\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../utils/option-builders'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport { positionDataZoomForLegend } from '../utils/data-zoom-layout'\nimport type {\n TimeseriesEChartsOption,\n TimeseriesOptionFactoryInput,\n TimeseriesOptionsInput,\n TimeseriesWidgetData,\n} from './types'\n\n/**\n * Builds the **structural** ECharts option for a timeseries widget —\n * time x-axis, value y-axis, themed tooltip, themed legend, CARTO color\n * palette. Mirrors {@link import('../bar/options').barOptions} so all\n * four ECharts widgets share v1 look-and-feel.\n *\n * Intentional deviations from bar (timeseries-specific):\n * - **X-axis is `type: 'time'`** (not 'category'). ECharts handles\n * uneven sample spacing and zoom-level-aware label formatting.\n * `labelFormatter` is wrapped so the consumer sees a `Date`, not\n * a numeric timestamp.\n * - **Tooltip body reads `{ name, value }` rows**, same as bar, but\n * the `name` may arrive as `Date | number | string`. The\n * `labelFormatter` receives a `Date` regardless.\n *\n * Intentionally data-agnostic: no series, no dataset, no `legend.show`\n * (those depend on data and are added by the option factory's merge\n * phase via {@link createTimeseriesOptionFactory}).\n */\nexport function timeseriesOptions({\n theme,\n formatter,\n labelFormatter,\n}: TimeseriesOptionsInput): TimeseriesEChartsOption {\n // Closure shared between yAxis min/max callbacks and the label formatter,\n // so only the rounded extents are labelled (matches v1 + bar).\n let niceMin = 0\n let niceMax = 1\n\n return {\n grid: {\n left: parseInt(theme.spacing(1)),\n top: parseInt(theme.spacing(3)),\n right: parseInt(theme.spacing(1)),\n // Default: no legend. Merger bumps this when there are >1 series.\n ...buildGridConfig(false, theme),\n containLabel: true,\n },\n tooltip: {\n trigger: 'axis',\n backgroundColor: theme.palette.grey[900],\n borderWidth: 0,\n padding: [parseInt(theme.spacing(1)), parseInt(theme.spacing(1))],\n textStyle: {\n color: theme.palette.common.white,\n fontSize: 11,\n fontFamily: theme.typography.caption.fontFamily,\n },\n axisPointer: { type: 'line' },\n position: createTooltipPositioner(theme),\n formatter: buildTimeseriesTooltipFormatter(formatter, labelFormatter),\n },\n // Legend styling baked here; `show` is toggled by the merger based on\n // series count.\n legend: {\n ...buildLegendConfig({ hasLegend: false }),\n },\n axisPointer: { lineStyle: { color: theme.palette.grey[400] } },\n color: [\n theme.palette.secondary.main,\n ...Object.values(\n (theme.palette as { qualitative?: { bold?: Record<string, string> } })\n .qualitative?.bold ?? {},\n ),\n ],\n xAxis: {\n type: 'time',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n padding: [parseInt(theme.spacing(0.5)), 0, 0, 0],\n margin: 0,\n hideOverlap: true,\n ...(labelFormatter && {\n formatter: (value: number) => labelFormatter(new Date(value)),\n }),\n },\n },\n yAxis: {\n type: 'value',\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n axisLine: { show: false },\n axisTick: { show: false },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n show: true,\n showMaxLabel: true,\n showMinLabel: true,\n verticalAlign: 'bottom',\n inside: true,\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return formatter ? formatter(value) : String(value)\n },\n },\n },\n } as TimeseriesEChartsOption\n}\n\n/**\n * Returns the timeseries widget's {@link OptionFactory} — one closure\n * that owns BOTH phases of option construction:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link timeseriesOptions}, optionally merging\n * the consumer-supplied `optionsOverride`. Called once by Provider to\n * seed `rawOptions` in the store.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`TimeseriesWidgetData`) into the option via the dataset API: one\n * dataset per series, each series referencing its dataset by index,\n * encoded by `name` (x — time) and `value` (y). Mirrors {@link import('../bar/options').createBarOptionFactory}:\n * series-template merge for `addStack`, reactive formatters from\n * `ctx`, `niceNum`-rounded y-axis bounds at fusion time, and\n * `positionDataZoomForLegend` layout for ZoomToggle sliders.\n */\nexport function createTimeseriesOptionFactory(\n options: TimeseriesOptionFactoryInput,\n): OptionFactory {\n const { theme, formatter, labelFormatter, optionsOverride } = options\n const series = options.series\n const smooth = options.smooth ?? true\n const area = options.area ?? false\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0\n ? new Set<string | number>(selection)\n : null\n // `name` may be Date | number | string. Normalize to the same type the\n // selection is keyed on (Date → ms) so Set lookups match.\n const normalizeName = (n: Date | number | string): string | number =>\n n instanceof Date ? n.getTime() : n\n return (option, data, ctx) => {\n if (option == null) {\n const structural = timeseriesOptions({ theme, formatter, labelFormatter })\n return optionsOverride\n ? (mergeOptions(\n structural as unknown as Record<string, unknown>,\n optionsOverride as Partial<Record<string, unknown>>,\n ) as EChartsOption)\n : structural\n }\n\n const seriesArr = Array.isArray(data) ? (data as TimeseriesWidgetData) : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const seriesTemplates = Array.isArray(option.series) ? option.series : []\n const broadcastTemplate = seriesTemplates[0] ?? {}\n const baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n const baseGrid =\n typeof option.grid === 'object' && !Array.isArray(option.grid)\n ? option.grid\n : {}\n const baseTooltip =\n typeof option.tooltip === 'object' && !Array.isArray(option.tooltip)\n ? option.tooltip\n : {}\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\n : {}\n\n // Reactive (live store) formatter from ctx — distinct from the\n // closure-time `formatter` captured for the structural-build branch\n // above. RelativeData can install a percent formatter on the store\n // after the factory was constructed; the merge phase reads `ctx` to\n // pick that up. `labelFormatter` (Date → string) is structural-only —\n // not relativizable — so the merge branch reads the closure-time value.\n const liveFormatter = ctx?.formatter\n\n // Closure shared between the yAxis min/max callbacks and the label\n // formatter, so only the rounded extents are labelled (matches v1 +\n // bar). Delegating the extent to ECharts (rather than precomputing\n // scalars from the raw data) keeps stacked lines inside the plot: when\n // StackToggle marks the series, ECharts feeds the *post-stack* extent\n // to these callbacks, so `niceNum` rounds the stacked total.\n let niceMin = 0\n let niceMax = 1\n\n // Zoom slider layout: when ZoomToggle has installed `dataZoom`, push the\n // slider above the legend (if any) and reserve room in the grid below.\n const dataZoomLayout = positionDataZoomForLegend(option.dataZoom, hasLegend)\n const fallbackBottom =\n typeof baseGrid.bottom === 'number' ? baseGrid.bottom : 24\n const baseBottom = hasLegend ? 56 : fallbackBottom\n const gridBottom = dataZoomLayout\n ? baseBottom + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : baseBottom\n\n // Dim non-selected points via `series.itemStyle.color`. Per-row\n // `itemStyle` on dataset object-rows is silently ignored when\n // `series.encode` is in play.\n //\n // We *always* emit `itemStyle.color` (a passthrough when nothing is\n // selected), not conditionally — dropping the key between renders\n // would let ECharts' default merge keep the previous callback alive\n // and points would stay dimmed forever after an external clear.\n // Always emitting lets normal merge swap the callback in place, no\n // `replaceMerge` and no entry-animation flash on selection on/off.\n const dimItemStyle = {\n color: (params: CallbackDataParams) => {\n const datum = params.value as\n { name?: Date | number | string } | undefined\n const raw = datum?.name\n const base = params.color as string\n if (!selectionSet || raw == null) return base\n return selectionSet.has(normalizeName(raw))\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n },\n }\n\n return {\n ...option,\n dataset: seriesArr.map((s) => ({ source: s as readonly object[] })),\n series: seriesArr.map((_, i) => {\n const template =\n (seriesTemplates[i] as object | undefined) ??\n (broadcastTemplate as object)\n // For line series, set BOTH `series[i].color` (legend swatch +\n // markers) AND `series[i].lineStyle.color` (the line itself) so\n // the override paints everywhere a series has a colour slot.\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n ...(typeof template === 'object' ? template : {}),\n type: 'line' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 'name', y: 'value' },\n smooth,\n // When a selection is active, surface markers so the per-point\n // color callback has something to dim — a continuous line would\n // hide the visual selection feedback.\n showSymbol: selectionSet != null,\n ...(area ? { areaStyle: {} } : {}),\n emphasis: { focus: 'series' },\n itemStyle: dimItemStyle,\n ...(overrideColor\n ? { color: overrideColor, lineStyle: { color: overrideColor } }\n : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: { ...baseGrid, bottom: gridBottom },\n ...(dataZoomLayout ? { dataZoom: dataZoomLayout } : {}),\n yAxis: {\n ...baseYAxis,\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n axisLabel: {\n ...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return liveFormatter ? liveFormatter(value) : String(value)\n },\n },\n } as EChartsOption['yAxis'],\n tooltip: {\n ...baseTooltip,\n formatter: buildTimeseriesTooltipFormatter(\n liveFormatter,\n labelFormatter,\n ),\n },\n } as EChartsOption\n }\n}\n\n/**\n * Tooltip formatter for the timeseries `{ name, value }` row shape.\n * `name` arrives as `Date | number | string` (the time-axis stores the\n * raw value the consumer supplied). The consumer's `labelFormatter`\n * expects a `Date`, so we coerce non-Date values via `new Date(...)`\n * before invoking it.\n */\nfunction buildTimeseriesTooltipFormatter(\n formatter: ((value: number) => string) | undefined,\n labelFormatter: ((value: Date) => string) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const row = item.value as\n { name?: Date | number | string; value?: number } | undefined\n const raw = row?.value\n const formattedValue =\n typeof raw === 'number' && formatter ? formatter(raw) : (raw ?? '')\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n const rawName = row?.name ?? item.name\n const name =\n labelFormatter && rawName != null\n ? labelFormatter(rawName instanceof Date ? rawName : new Date(rawName))\n : (rawName ?? '')\n return { name: String(name), seriesName, marker, value: formattedValue }\n })\n}\n","import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n graph: {\n position: 'relative',\n flex: '1 1 auto',\n width: '100%',\n },\n segmentA: {\n position: 'absolute',\n left: 0,\n right: '70%',\n top: '60%',\n height: 4,\n },\n segmentB: {\n position: 'absolute',\n left: '25%',\n right: '40%',\n top: '35%',\n height: 4,\n },\n segmentC: {\n position: 'absolute',\n left: '55%',\n right: 0,\n top: '50%',\n height: 4,\n },\n legend: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(2),\n height: ({ spacing }) => spacing(5),\n },\n legendItem: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(1.5),\n },\n} satisfies Record<string, SxProps<Theme>>\n\n/**\n * Loading state for the Timeseries widget. Mirrors a line chart's\n * silhouette — three thin horizontal segments at staggered offsets to\n * suggest a moving line, plus a 2-dot legend stub. Sibling-consistent\n * with Bar / Histogram / Scatter skeletons (column-flex container with\n * legend strip below).\n */\nexport function TimeseriesSkeleton() {\n return (\n <Box sx={styles.container}>\n <Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>\n )\n}\n","import {\n buildCsvDownloadItem,\n withPngItem,\n type DownloadItem,\n type WidgetDownloadArgs,\n} from '../actions/download'\nimport type { TimeseriesWidgetData } from './types'\n\n/**\n * Download menu items for the Timeseries widget. Always includes a CSV item\n * with `time, series_1, series_2, …` columns (one row per unique time across\n * all series; ISO-8601 strings for `Date`/numeric times). When\n * `getCaptureEl` is given, prepends a PNG item that rasterises the captured\n * element via `html2canvas`.\n */\nexport function createTimeseriesDownloadConfig(\n args: WidgetDownloadArgs<TimeseriesWidgetData> & {\n seriesNames?: readonly string[]\n },\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const seriesCount = data.length\n\n // Collect every unique time, preserving insertion order.\n const timeKeys: (Date | number | string)[] = []\n const seenKeys = new Set<string>()\n for (const series of data) {\n for (const point of series) {\n const key = String(point.name)\n if (!seenKeys.has(key)) {\n seenKeys.add(key)\n timeKeys.push(point.name)\n }\n }\n }\n\n // Build a quick lookup per series for O(rows × series) emit.\n const lookups = data.map(\n (series) => new Map(series.map((p) => [String(p.name), p.value])),\n )\n\n const header: unknown[] = ['time']\n for (let i = 0; i < seriesCount; i++) {\n header.push(args.seriesNames?.[i] ?? `series_${i + 1}`)\n }\n const rows: unknown[][] = [header]\n for (const key of timeKeys) {\n const row: unknown[] = [formatTime(key)]\n const lookupKey = String(key)\n for (const lookup of lookups) row.push(lookup.get(lookupKey) ?? '')\n rows.push(row)\n }\n\n return rows\n },\n }),\n )\n}\n\nfunction formatTime(v: Date | number | string): string {\n if (v instanceof Date) return v.toISOString()\n if (typeof v === 'number') return new Date(v).toISOString()\n return v\n}\n","/**\n * `LockSelection` filter for Timeseries. Data is `{name, value}[][]` like\n * Bar/Pie/Category, but `name` may arrive as `Date | number | string` (the\n * time axis stores a `Date`). `lockedItems` is snapshotted from `selection`,\n * whose keys are already normalized to `Date → ms` (see `options.ts`'s\n * `normalizeName`) — so a raw `Date` name must be normalized the same way\n * before the membership check, or every point would compare a `Date` object\n * against a `number` and silently fail to match, filtering everything out.\n */\nexport function filterTimeseriesByLockedItems(\n input: unknown,\n lockedItems: readonly (string | number)[],\n): unknown {\n if (lockedItems.length === 0) return input\n if (!Array.isArray(input)) return input\n const locked = new Set<string | number>(lockedItems)\n return input.map((series: unknown): unknown => {\n if (!Array.isArray(series)) return series\n return series.filter((item: unknown) => {\n if (item == null || typeof item !== 'object' || !('name' in item)) {\n return false\n }\n const raw = (item as { name: unknown }).name\n const name = raw instanceof Date ? raw.getTime() : raw\n return (\n (typeof name === 'string' || typeof name === 'number') &&\n locked.has(name)\n )\n })\n })\n}\n"],"mappings":";;;;;;;;;A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,UAAU,IAC1D,OAAO;EAET,IAAM,IAAO,EAA2B,MAClC,IAAO,aAAe,OAAO,EAAI,QAAQ,IAAI;EACnD,QACG,OAAO,KAAS,YAAY,OAAO,KAAS,aAC7C,EAAO,IAAI,CAAI;CAEnB,CAAC,IAXkC,CAYpC;AACH"}
|
|
1
|
+
{"version":3,"file":"timeseries.js","names":["<Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>","<Box sx={styles.container}>\n <Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>","(i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n )","_c","ZOOM_LAYOUT","buildCsvDownloadItem","withPngItem","positionDataZoomForLegend","mergeOptions","resolveThemeColor","niceNum","buildLegendConfig","buildAxisLabelStyle","createTooltipFormatter","buildGridConfig","createTooltipPositioner","createItemColorResolver","echarts","timeseriesOptions","niceMin","niceMax","theme","buildTimeseriesTooltipFormatter","formatter","labelFormatter","value","extent","createTimeseriesOptionFactory","options","series","smooth","area","selection","selectionSet","normalizeName","n","option","structural","optionsOverride","seriesArr","data","hasLegend","seriesTemplates","broadcastTemplate","baseYAxis","baseGrid","baseTooltip","baseLegend","liveFormatter","ctx","dataZoomLayout","fallbackBottom","baseBottom","gridBottom","makeDimItemStyle","baseColor","params","raw","base","hasDatumColor","s","d","template","i","overrideColor","row","item","formattedValue","marker","seriesName","rawName","name","styles","spacing","TimeseriesSkeleton","$","c","t0","Box","Skeleton","t1","_temp","createTimeseriesDownloadConfig","args","seriesCount","timeKeys","seenKeys","point","key","lookups","p","header","rows","formatTime","lookupKey","lookup","v","filterTimeseriesByLockedItems","lockedItems","input","locked"],"sources":["../../src/widgets/timeseries/options.ts","../../src/widgets/timeseries/skeleton.tsx","../../src/widgets/timeseries/download.ts","../../src/widgets/timeseries/transforms.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildAxisLabelStyle,\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../utils/option-builders'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport { createItemColorResolver } from '../utils/item-color'\nimport { positionDataZoomForLegend } from '../utils/data-zoom-layout'\nimport type {\n TimeseriesEChartsOption,\n TimeseriesOptionFactoryInput,\n TimeseriesOptionsInput,\n TimeseriesWidgetData,\n} from './types'\n\n/**\n * Builds the **structural** ECharts option for a timeseries widget —\n * time x-axis, value y-axis, themed tooltip, themed legend, CARTO color\n * palette. Mirrors {@link import('../bar/options').barOptions} so all\n * four ECharts widgets share v1 look-and-feel.\n *\n * Intentional deviations from bar (timeseries-specific):\n * - **X-axis is `type: 'time'`** (not 'category'). ECharts handles\n * uneven sample spacing and zoom-level-aware label formatting.\n * `labelFormatter` is wrapped so the consumer sees a `Date`, not\n * a numeric timestamp.\n * - **Tooltip body reads `{ name, value }` rows**, same as bar, but\n * the `name` may arrive as `Date | number | string`. The\n * `labelFormatter` receives a `Date` regardless.\n *\n * Intentionally data-agnostic: no series, no dataset, no `legend.show`\n * (those depend on data and are added by the option factory's merge\n * phase via {@link createTimeseriesOptionFactory}).\n */\nexport function timeseriesOptions({\n theme,\n formatter,\n labelFormatter,\n}: TimeseriesOptionsInput): TimeseriesEChartsOption {\n // Closure shared between yAxis min/max callbacks and the label formatter,\n // so only the rounded extents are labelled (matches v1 + bar).\n let niceMin = 0\n let niceMax = 1\n\n return {\n grid: {\n left: parseInt(theme.spacing(1)),\n top: parseInt(theme.spacing(3)),\n right: parseInt(theme.spacing(1)),\n // Default: no legend. Merger bumps this when there are >1 series.\n ...buildGridConfig(false, theme),\n containLabel: true,\n },\n tooltip: {\n trigger: 'axis',\n backgroundColor: theme.palette.grey[900],\n borderWidth: 0,\n padding: [parseInt(theme.spacing(1)), parseInt(theme.spacing(1))],\n textStyle: {\n color: theme.palette.common.white,\n fontSize: 11,\n fontFamily: theme.typography.caption.fontFamily,\n },\n axisPointer: { type: 'line' },\n position: createTooltipPositioner(theme),\n formatter: buildTimeseriesTooltipFormatter(formatter, labelFormatter),\n },\n // Legend styling baked here; `show` is toggled by the merger based on\n // series count.\n legend: {\n ...buildLegendConfig({ hasLegend: false }),\n },\n axisPointer: { lineStyle: { color: theme.palette.grey[400] } },\n color: [\n theme.palette.secondary.main,\n ...Object.values(\n (theme.palette as { qualitative?: { bold?: Record<string, string> } })\n .qualitative?.bold ?? {},\n ),\n ],\n xAxis: {\n type: 'time',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n padding: [parseInt(theme.spacing(0.5)), 0, 0, 0],\n margin: 0,\n hideOverlap: true,\n ...(labelFormatter && {\n formatter: (value: number) => labelFormatter(new Date(value)),\n }),\n },\n },\n yAxis: {\n type: 'value',\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n axisLine: { show: false },\n axisTick: { show: false },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n show: true,\n showMaxLabel: true,\n showMinLabel: true,\n verticalAlign: 'bottom',\n inside: true,\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return formatter ? formatter(value) : String(value)\n },\n },\n },\n } as TimeseriesEChartsOption\n}\n\n/**\n * Returns the timeseries widget's {@link OptionFactory} — one closure\n * that owns BOTH phases of option construction:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link timeseriesOptions}, optionally merging\n * the consumer-supplied `optionsOverride`. Called once by Provider to\n * seed `rawOptions` in the store.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`TimeseriesWidgetData`) into the option via the dataset API: one\n * dataset per series, each series referencing its dataset by index,\n * encoded by `name` (x — time) and `value` (y). Mirrors {@link import('../bar/options').createBarOptionFactory}:\n * series-template merge for `addStack`, reactive formatters from\n * `ctx`, `niceNum`-rounded y-axis bounds at fusion time, and\n * `positionDataZoomForLegend` layout for ZoomToggle sliders.\n */\nexport function createTimeseriesOptionFactory(\n options: TimeseriesOptionFactoryInput,\n): OptionFactory {\n const { theme, formatter, labelFormatter, optionsOverride } = options\n const series = options.series\n const smooth = options.smooth ?? true\n const area = options.area ?? false\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0\n ? new Set<string | number>(selection)\n : null\n // `name` may be Date | number | string. Normalize to the same type the\n // selection is keyed on (Date → ms) so Set lookups match.\n const normalizeName = (n: Date | number | string): string | number =>\n n instanceof Date ? n.getTime() : n\n return (option, data, ctx) => {\n if (option == null) {\n const structural = timeseriesOptions({ theme, formatter, labelFormatter })\n return optionsOverride\n ? (mergeOptions(\n structural as unknown as Record<string, unknown>,\n optionsOverride as Partial<Record<string, unknown>>,\n ) as EChartsOption)\n : structural\n }\n\n const seriesArr = Array.isArray(data) ? (data as TimeseriesWidgetData) : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const seriesTemplates = Array.isArray(option.series) ? option.series : []\n const broadcastTemplate = seriesTemplates[0] ?? {}\n const baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n const baseGrid =\n typeof option.grid === 'object' && !Array.isArray(option.grid)\n ? option.grid\n : {}\n const baseTooltip =\n typeof option.tooltip === 'object' && !Array.isArray(option.tooltip)\n ? option.tooltip\n : {}\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\n : {}\n\n // Reactive (live store) formatter from ctx — distinct from the\n // closure-time `formatter` captured for the structural-build branch\n // above. RelativeData can install a percent formatter on the store\n // after the factory was constructed; the merge phase reads `ctx` to\n // pick that up. `labelFormatter` (Date → string) is structural-only —\n // not relativizable — so the merge branch reads the closure-time value.\n const liveFormatter = ctx?.formatter\n\n // Closure shared between the yAxis min/max callbacks and the label\n // formatter, so only the rounded extents are labelled (matches v1 +\n // bar). Delegating the extent to ECharts (rather than precomputing\n // scalars from the raw data) keeps stacked lines inside the plot: when\n // StackToggle marks the series, ECharts feeds the *post-stack* extent\n // to these callbacks, so `niceNum` rounds the stacked total.\n let niceMin = 0\n let niceMax = 1\n\n // Zoom slider layout: when ZoomToggle has installed `dataZoom`, push the\n // slider above the legend (if any) and reserve room in the grid below.\n const dataZoomLayout = positionDataZoomForLegend(option.dataZoom, hasLegend)\n const fallbackBottom =\n typeof baseGrid.bottom === 'number' ? baseGrid.bottom : 24\n const baseBottom = hasLegend ? 56 : fallbackBottom\n const gridBottom = dataZoomLayout\n ? baseBottom + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : baseBottom\n\n // Dim non-selected points via `series.itemStyle.color`. Per-row\n // `itemStyle` on dataset object-rows is silently ignored when\n // `series.encode` is in play.\n //\n // We *always* emit `itemStyle.color` (a passthrough when nothing is\n // selected), not conditionally — dropping the key between renders\n // would let ECharts' default merge keep the previous callback alive\n // and points would stay dimmed forever after an external clear.\n // Always emitting lets normal merge swap the callback in place, no\n // `replaceMerge` and no entry-animation flash on selection on/off.\n //\n // The base colour is the point's own `color`, else the template's\n // `itemStyle.color`, else the series colour / palette (`params.color`).\n const makeDimItemStyle = (datums: readonly object[], template: unknown) => {\n const baseColor = createItemColorResolver({\n theme,\n datums,\n template,\n fallback: (params) => params.color as string,\n })\n return {\n color: (params: CallbackDataParams) => {\n const datum = params.value as\n { name?: Date | number | string } | undefined\n const raw = datum?.name\n const base = baseColor(params)\n if (!selectionSet || raw == null) return base\n return selectionSet.has(normalizeName(raw))\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n },\n }\n }\n // Per-point colours only show on markers, so surface them whenever a\n // point carries its own `color` (same reason as the selection case).\n const hasDatumColor = seriesArr.some((s) =>\n s.some((d) => typeof d?.color === 'string' && d.color !== ''),\n )\n\n return {\n ...option,\n dataset: seriesArr.map((s) => ({ source: s as readonly object[] })),\n series: seriesArr.map((s, i) => {\n const template =\n (seriesTemplates[i] as object | undefined) ??\n (broadcastTemplate as object)\n // For line series, set BOTH `series[i].color` (legend swatch +\n // markers) AND `series[i].lineStyle.color` (the line itself) so\n // the override paints everywhere a series has a colour slot.\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n ...(typeof template === 'object' ? template : {}),\n type: 'line' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 'name', y: 'value' },\n smooth,\n // When a selection is active, surface markers so the per-point\n // color callback has something to dim — a continuous line would\n // hide the visual selection feedback.\n showSymbol: selectionSet != null || hasDatumColor,\n ...(area ? { areaStyle: {} } : {}),\n emphasis: { focus: 'series' },\n itemStyle: makeDimItemStyle(s, template),\n ...(overrideColor\n ? { color: overrideColor, lineStyle: { color: overrideColor } }\n : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: { ...baseGrid, bottom: gridBottom },\n ...(dataZoomLayout ? { dataZoom: dataZoomLayout } : {}),\n yAxis: {\n ...baseYAxis,\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? niceNum(extent.min) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)\n return niceMax\n },\n axisLabel: {\n ...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),\n formatter: (value: number) => {\n if (value !== niceMax && value !== niceMin) return ''\n if (value === 0) return ''\n return liveFormatter ? liveFormatter(value) : String(value)\n },\n },\n } as EChartsOption['yAxis'],\n tooltip: {\n ...baseTooltip,\n formatter: buildTimeseriesTooltipFormatter(\n liveFormatter,\n labelFormatter,\n ),\n },\n } as EChartsOption\n }\n}\n\n/**\n * Tooltip formatter for the timeseries `{ name, value }` row shape.\n * `name` arrives as `Date | number | string` (the time-axis stores the\n * raw value the consumer supplied). The consumer's `labelFormatter`\n * expects a `Date`, so we coerce non-Date values via `new Date(...)`\n * before invoking it.\n */\nfunction buildTimeseriesTooltipFormatter(\n formatter: ((value: number) => string) | undefined,\n labelFormatter: ((value: Date) => string) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const row = item.value as\n { name?: Date | number | string; value?: number } | undefined\n const raw = row?.value\n const formattedValue =\n typeof raw === 'number' && formatter ? formatter(raw) : (raw ?? '')\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n const rawName = row?.name ?? item.name\n const name =\n labelFormatter && rawName != null\n ? labelFormatter(rawName instanceof Date ? rawName : new Date(rawName))\n : (rawName ?? '')\n return { name: String(name), seriesName, marker, value: formattedValue }\n })\n}\n","import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n graph: {\n position: 'relative',\n flex: '1 1 auto',\n width: '100%',\n },\n segmentA: {\n position: 'absolute',\n left: 0,\n right: '70%',\n top: '60%',\n height: 4,\n },\n segmentB: {\n position: 'absolute',\n left: '25%',\n right: '40%',\n top: '35%',\n height: 4,\n },\n segmentC: {\n position: 'absolute',\n left: '55%',\n right: 0,\n top: '50%',\n height: 4,\n },\n legend: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(2),\n height: ({ spacing }) => spacing(5),\n },\n legendItem: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(1.5),\n },\n} satisfies Record<string, SxProps<Theme>>\n\n/**\n * Loading state for the Timeseries widget. Mirrors a line chart's\n * silhouette — three thin horizontal segments at staggered offsets to\n * suggest a moving line, plus a 2-dot legend stub. Sibling-consistent\n * with Bar / Histogram / Scatter skeletons (column-flex container with\n * legend strip below).\n */\nexport function TimeseriesSkeleton() {\n return (\n <Box sx={styles.container}>\n <Box sx={styles.graph}>\n <Skeleton variant='rectangular' sx={styles.segmentA} />\n <Skeleton variant='rectangular' sx={styles.segmentB} />\n <Skeleton variant='rectangular' sx={styles.segmentC} />\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>\n )\n}\n","import {\n buildCsvDownloadItem,\n withPngItem,\n type DownloadItem,\n type WidgetDownloadArgs,\n} from '../actions/download'\nimport type { TimeseriesWidgetData } from './types'\n\n/**\n * Download menu items for the Timeseries widget. Always includes a CSV item\n * with `time, series_1, series_2, …` columns (one row per unique time across\n * all series; ISO-8601 strings for `Date`/numeric times). When\n * `getCaptureEl` is given, prepends a PNG item that rasterises the captured\n * element via `html2canvas`.\n */\nexport function createTimeseriesDownloadConfig(\n args: WidgetDownloadArgs<TimeseriesWidgetData> & {\n seriesNames?: readonly string[]\n },\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const seriesCount = data.length\n\n // Collect every unique time, preserving insertion order.\n const timeKeys: (Date | number | string)[] = []\n const seenKeys = new Set<string>()\n for (const series of data) {\n for (const point of series) {\n const key = String(point.name)\n if (!seenKeys.has(key)) {\n seenKeys.add(key)\n timeKeys.push(point.name)\n }\n }\n }\n\n // Build a quick lookup per series for O(rows × series) emit.\n const lookups = data.map(\n (series) => new Map(series.map((p) => [String(p.name), p.value])),\n )\n\n const header: unknown[] = ['time']\n for (let i = 0; i < seriesCount; i++) {\n header.push(args.seriesNames?.[i] ?? `series_${i + 1}`)\n }\n const rows: unknown[][] = [header]\n for (const key of timeKeys) {\n const row: unknown[] = [formatTime(key)]\n const lookupKey = String(key)\n for (const lookup of lookups) row.push(lookup.get(lookupKey) ?? '')\n rows.push(row)\n }\n\n return rows\n },\n }),\n )\n}\n\nfunction formatTime(v: Date | number | string): string {\n if (v instanceof Date) return v.toISOString()\n if (typeof v === 'number') return new Date(v).toISOString()\n return v\n}\n","/**\n * `LockSelection` filter for Timeseries. Data is `{name, value}[][]` like\n * Bar/Pie/Category, but `name` may arrive as `Date | number | string` (the\n * time axis stores a `Date`). `lockedItems` is snapshotted from `selection`,\n * whose keys are already normalized to `Date → ms` (see `options.ts`'s\n * `normalizeName`) — so a raw `Date` name must be normalized the same way\n * before the membership check, or every point would compare a `Date` object\n * against a `number` and silently fail to match, filtering everything out.\n */\nexport function filterTimeseriesByLockedItems(\n input: unknown,\n lockedItems: readonly (string | number)[],\n): unknown {\n if (lockedItems.length === 0) return input\n if (!Array.isArray(input)) return input\n const locked = new Set<string | number>(lockedItems)\n return input.map((series: unknown): unknown => {\n if (!Array.isArray(series)) return series\n return series.filter((item: unknown) => {\n if (item == null || typeof item !== 'object' || !('name' in item)) {\n return false\n }\n const raw = (item as { name: unknown }).name\n const name = raw instanceof Date ? raw.getTime() : raw\n return (\n (typeof name === 'string' || typeof name === 'number') &&\n locked.has(name)\n )\n })\n })\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAgBkB,EAAkB,EAChC,UACA,cACA,qBACkD;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,IAAMH,KAAOH,GAAU;IAC1B,IAAMpB,IAAiB,CAAC4B,EAAWL,CAAG,CAAC,GACjCM,IAAY,OAAON,CAAG;IAC5B,KAAK,IAAMO,KAAUN,GAAS,EAAI,KAAKM,EAAO,IAAID,CAAS,KAAK,EAAE;IAClE,EAAK,KAAK7B,CAAG;GACf;GAEA,OAAO2B;EACT;CACF,CAAC,CACH;AACF;AAEA,SAASC,EAAW,GAAmC;CAGrD,OAFIG,aAAa,OAAaA,EAAE,YAAY,IACxC,OAAOA,KAAM,WAAiB,IAAI,KAAKA,CAAC,CAAC,CAAC,YAAY,IACnDA;AACT;;;AC3DA,SAAgBC,EACd,GACA,GACS;CAET,IADIC,EAAY,WAAW,KACvB,CAAC,MAAM,QAAQC,CAAK,GAAG,OAAOA;CAClC,IAAMC,IAAS,IAAI,IAAqBF,CAAW;CACnD,OAAOC,EAAM,KAAK,MACX,MAAM,QAAQtE,CAAM,IAClBA,EAAO,QAAQ,MAAkB;EACtC,IAAoB,OAAOqC,KAAS,aAAhCA,KAA4C,EAAE,UAAUA,IAC1D,OAAO;EAET,IAAMT,IAAOS,EAA2B,MAClCK,IAAOd,aAAe,OAAOA,EAAI,QAAQ,IAAIA;EACnD,QACG,OAAOc,KAAS,YAAY,OAAOA,KAAS,aAC7C6B,EAAO,IAAI7B,CAAI;CAEnB,CAAC,IAXkC1C,CAYpC;AACH"}
|
package/dist/widgets.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./components-CTUpdQuj.js";
|
|
2
2
|
import { n as e, t } from "./smart-tooltip-Dc_rHhyI.js";
|
|
3
3
|
import { C as n, D as r, S as i, _ as a } from "./stores-DcBOZlU3.js";
|
|
4
|
-
import { C as o, D as s, S as c, c as l, f as u, g as d, o as f, r as p, t as m, y as h } from "./actions-
|
|
5
|
-
import { i as g, n as _, o as v, r as y } from "./echart-
|
|
6
|
-
import { t as b } from "./markdown-content-
|
|
4
|
+
import { C as o, D as s, S as c, c as l, f as u, g as d, o as f, r as p, t as m, y as h } from "./actions-CkxKe8-J.js";
|
|
5
|
+
import { i as g, n as _, o as v, r as y } from "./echart-ysYFLa_T.js";
|
|
6
|
+
import { t as b } from "./markdown-content-BpAH_V6S.js";
|
|
7
7
|
import { t as x } from "./zoom-toggle-MmLjMTEw.js";
|
|
8
8
|
import { c as S } from "./download-B4sykOFm.js";
|
|
9
9
|
import { i as ee, r as C } from "./formula-DJS-JLpk.js";
|
|
10
|
-
import { i as w, r as T } from "./markdown-
|
|
10
|
+
import { i as w, r as T } from "./markdown-DmvLi3vx.js";
|
|
11
11
|
import { a as E, i as D } from "./spread-CQwFIwuz.js";
|
|
12
12
|
import { n as O, r as k } from "./range-BpU2zBmq.js";
|
|
13
|
-
import { i as A, r as te } from "./category-
|
|
13
|
+
import { i as A, r as te } from "./category-DULnoxvk.js";
|
|
14
14
|
import { d as j, i as M } from "./table-DEdW_fDj.js";
|
|
15
15
|
import { c as N } from "react/compiler-runtime";
|
|
16
16
|
import { Children as ne, Component as P, isValidElement as F, useEffect as I, useLayoutEffect as re, useRef as L, useState as R } from "react";
|