@carto/ps-react-ui 6.3.0 → 6.4.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.
Files changed (46) hide show
  1. package/dist/actions-DyWNwvLu.js +1272 -0
  2. package/dist/actions-DyWNwvLu.js.map +1 -0
  3. package/dist/{category-DULnoxvk.js → category-BHBd5Pcc.js} +262 -245
  4. package/dist/category-BHBd5Pcc.js.map +1 -0
  5. package/dist/scale-Bhx8HKEB.js +29 -0
  6. package/dist/scale-Bhx8HKEB.js.map +1 -0
  7. package/dist/types/widgets/actions/index.d.ts +1 -1
  8. package/dist/types/widgets/actions/relative-data/index.d.ts +1 -0
  9. package/dist/types/widgets/actions/relative-data/labels.d.ts +3 -0
  10. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +16 -2
  11. package/dist/types/widgets/actions/relative-data/scale.d.ts +26 -0
  12. package/dist/types/widgets/actions/relative-data/style.d.ts +12 -0
  13. package/dist/types/widgets/category/category.d.ts +2 -1
  14. package/dist/types/widgets/index.d.ts +1 -1
  15. package/dist/widgets/actions.js +1 -1
  16. package/dist/widgets/bar.js +80 -79
  17. package/dist/widgets/bar.js.map +1 -1
  18. package/dist/widgets/category.js +1 -1
  19. package/dist/widgets/histogram.js +104 -103
  20. package/dist/widgets/histogram.js.map +1 -1
  21. package/dist/widgets/scatterplot.js +116 -115
  22. package/dist/widgets/scatterplot.js.map +1 -1
  23. package/dist/widgets/timeseries.js +86 -85
  24. package/dist/widgets/timeseries.js.map +1 -1
  25. package/dist/widgets.js +2 -2
  26. package/dist/widgets.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/widgets/actions/index.ts +1 -0
  29. package/src/widgets/actions/relative-data/index.ts +1 -0
  30. package/src/widgets/actions/relative-data/labels.ts +6 -0
  31. package/src/widgets/actions/relative-data/relative-data.test.tsx +78 -1
  32. package/src/widgets/actions/relative-data/relative-data.tsx +137 -20
  33. package/src/widgets/actions/relative-data/scale.ts +48 -0
  34. package/src/widgets/actions/relative-data/style.ts +10 -0
  35. package/src/widgets/bar/options.test.ts +16 -0
  36. package/src/widgets/bar/options.ts +6 -2
  37. package/src/widgets/category/category.relative-data.test.tsx +51 -63
  38. package/src/widgets/category/category.tsx +25 -11
  39. package/src/widgets/histogram/options.ts +6 -2
  40. package/src/widgets/index.ts +1 -0
  41. package/src/widgets/scatterplot/options.test.ts +12 -0
  42. package/src/widgets/scatterplot/options.ts +18 -4
  43. package/src/widgets/timeseries/options.ts +6 -2
  44. package/dist/actions-CkxKe8-J.js +0 -1160
  45. package/dist/actions-CkxKe8-J.js.map +0 -1
  46. package/dist/category-DULnoxvk.js.map +0 -1
@@ -1,20 +1,21 @@
1
1
  import { r as e } from "../zoom-toggle-MmLjMTEw.js";
2
- import { n as t, t as n } from "../download-B4sykOFm.js";
3
- import { n as r, r as i, t as a } from "../utils-C-eWwOhE.js";
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";
2
+ import { n as t } from "../scale-Bhx8HKEB.js";
3
+ import { n, t as r } from "../download-B4sykOFm.js";
4
+ import { n as i, r as a, t as o } from "../utils-C-eWwOhE.js";
5
+ import { c as s, i as c, n as l, o as u, r as d, s as f, t as p } from "../item-color-B7xkIpDZ.js";
6
+ import { c as m } from "react/compiler-runtime";
7
+ import { Box as h, Skeleton as g } from "@mui/material";
8
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
9
+ import * as y from "echarts";
9
10
  //#region src/widgets/bar/options.ts
10
- function y({ theme: e, formatter: t, labelFormatter: n }) {
11
+ function b({ theme: e, formatter: t, labelFormatter: n }) {
11
12
  let r = 0, i = 1;
12
13
  return {
13
14
  grid: {
14
15
  left: parseInt(e.spacing(1)),
15
16
  top: parseInt(e.spacing(3)),
16
17
  right: parseInt(e.spacing(1)),
17
- ...u(!1, e),
18
+ ...d(!1, e),
18
19
  containLabel: !0
19
20
  },
20
21
  tooltip: {
@@ -28,10 +29,10 @@ function y({ theme: e, formatter: t, labelFormatter: n }) {
28
29
  fontFamily: e.typography.caption.fontFamily
29
30
  },
30
31
  axisPointer: { type: "line" },
31
- position: d(e),
32
- formatter: x(t, n)
32
+ position: f(e),
33
+ formatter: S(t, n)
33
34
  },
34
- legend: { ...s({
35
+ legend: { ...c({
35
36
  hasLegend: !1,
36
37
  labelFormatter: n
37
38
  }) },
@@ -42,7 +43,7 @@ function y({ theme: e, formatter: t, labelFormatter: n }) {
42
43
  axisLine: { show: !1 },
43
44
  axisTick: { show: !1 },
44
45
  axisLabel: {
45
- ...c(e),
46
+ ...l(e),
46
47
  padding: [
47
48
  parseInt(e.spacing(.5)),
48
49
  0,
@@ -57,8 +58,8 @@ function y({ theme: e, formatter: t, labelFormatter: n }) {
57
58
  },
58
59
  yAxis: {
59
60
  type: "value",
60
- min: (e) => (r = e.min < 0 ? o(e.min) : 0, r),
61
- max: (e) => (i = e.max <= 0 ? 1 : o(e.max), i),
61
+ min: (e) => (r = e.min < 0 ? s(e.min) : 0, r),
62
+ max: (e) => (i = e.max <= 0 ? 1 : s(e.max), i),
62
63
  axisLine: { show: !1 },
63
64
  axisTick: { show: !1 },
64
65
  splitLine: {
@@ -66,7 +67,7 @@ function y({ theme: e, formatter: t, labelFormatter: n }) {
66
67
  lineStyle: { color: e.palette.black?.[4] ?? e.palette.divider }
67
68
  },
68
69
  axisLabel: {
69
- ...c(e),
70
+ ...l(e),
70
71
  margin: parseInt(e.spacing(1)),
71
72
  show: !0,
72
73
  showMaxLabel: !0,
@@ -78,84 +79,84 @@ function y({ theme: e, formatter: t, labelFormatter: n }) {
78
79
  }
79
80
  };
80
81
  }
81
- function b(t) {
82
- let { theme: n, formatter: s, labelFormatter: c, optionsOverride: l } = t, u = t.series, d = t.selection, p = d && d.length > 0 ? new Set(d) : null;
83
- return (t, d, m) => {
84
- if (t == null) {
85
- let e = y({
86
- theme: n,
87
- formatter: s,
88
- labelFormatter: c
82
+ function x(n) {
83
+ let { theme: r, formatter: c, labelFormatter: l, optionsOverride: u } = n, d = n.series, f = n.selection, m = f && f.length > 0 ? new Set(f) : null;
84
+ return (n, f, h) => {
85
+ if (n == null) {
86
+ let e = b({
87
+ theme: r,
88
+ formatter: c,
89
+ labelFormatter: l
89
90
  });
90
- return l ? i(e, l) : e;
91
+ return u ? a(e, u) : e;
91
92
  }
92
- let h = Array.isArray(d) ? d : [];
93
- if (h.length === 0) return {
94
- ...t,
93
+ let g = Array.isArray(f) ? f : [];
94
+ if (g.length === 0) return {
95
+ ...n,
95
96
  dataset: [],
96
97
  series: []
97
98
  };
98
- let g = h.length > 1, _ = typeof t.legend == "object" && !Array.isArray(t.legend) ? t.legend : {}, b = typeof t.grid == "object" && !Array.isArray(t.grid) ? t.grid : {}, S = typeof t.tooltip == "object" && !Array.isArray(t.tooltip) ? t.tooltip : {}, C = typeof t.yAxis == "object" && !Array.isArray(t.yAxis) ? t.yAxis : {}, w = Array.isArray(t.series) ? t.series : [], T = w[0] ?? {}, E = m?.formatter, D = m?.labelFormatter, O = 0, k = 1, A = r(t.dataZoom, g), j = typeof b.bottom == "number" ? b.bottom : 24, M = g ? 56 : j, N = A ? M + e.sliderHeight + e.sliderGap : M, P = (e, t) => {
99
- let r = f({
100
- theme: n,
99
+ let _ = g.length > 1, v = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, x = typeof n.grid == "object" && !Array.isArray(n.grid) ? n.grid : {}, C = typeof n.tooltip == "object" && !Array.isArray(n.tooltip) ? n.tooltip : {}, w = typeof n.yAxis == "object" && !Array.isArray(n.yAxis) ? n.yAxis : {}, T = t(w), E = Array.isArray(n.series) ? n.series : [], D = E[0] ?? {}, O = h?.formatter, k = h?.labelFormatter, A = 0, j = 1, M = i(n.dataZoom, _), N = typeof x.bottom == "number" ? x.bottom : 24, P = _ ? 56 : N, F = M ? P + e.sliderHeight + e.sliderGap : P, I = (e, t) => {
100
+ let n = p({
101
+ theme: r,
101
102
  datums: e,
102
103
  template: t,
103
104
  fallback: (e) => e.color
104
105
  });
105
106
  return { color: (e) => {
106
- let t = r(e);
107
- if (!p) return t;
108
- let n = e.value?.name ?? e.name;
109
- return n != null && p.has(n) ? t : v.color.modifyAlpha(t, .15);
107
+ let t = n(e);
108
+ if (!m) return t;
109
+ let r = e.value?.name ?? e.name;
110
+ return r != null && m.has(r) ? t : y.color.modifyAlpha(t, .15);
110
111
  } };
111
112
  };
112
113
  return {
113
- ...t,
114
- dataset: h.map((e) => ({ source: e })),
115
- series: h.map((e, t) => {
116
- let r = w[t] ?? T, i = a(n, u?.[t]?.color);
114
+ ...n,
115
+ dataset: g.map((e) => ({ source: e })),
116
+ series: g.map((e, t) => {
117
+ let n = E[t] ?? D, i = o(r, d?.[t]?.color);
117
118
  return {
118
- ...typeof r == "object" ? r : {},
119
+ ...typeof n == "object" ? n : {},
119
120
  type: "bar",
120
121
  datasetIndex: t,
121
- name: u?.[t]?.name ?? `Series ${t + 1}`,
122
+ name: d?.[t]?.name ?? `Series ${t + 1}`,
122
123
  encode: {
123
124
  x: "name",
124
125
  y: "value"
125
126
  },
126
127
  barMaxWidth: 100,
127
128
  emphasis: { focus: "series" },
128
- itemStyle: P(e, r),
129
+ itemStyle: I(e, n),
129
130
  ...i ? { color: i } : {}
130
131
  };
131
132
  }),
132
133
  legend: {
133
- ..._,
134
- show: g
134
+ ...v,
135
+ show: _
135
136
  },
136
137
  grid: {
137
- ...b,
138
- bottom: N
138
+ ...x,
139
+ bottom: F
139
140
  },
140
- ...A ? { dataZoom: A } : {},
141
+ ...M ? { dataZoom: M } : {},
141
142
  yAxis: {
142
- ...C,
143
- min: (e) => (O = e.min < 0 ? o(e.min) : 0, O),
144
- max: (e) => (k = e.max <= 0 ? 1 : o(e.max), k),
143
+ ...w,
144
+ min: (e) => (A = e.min < 0 ? T.min ?? s(e.min) : 0, A),
145
+ max: (e) => (j = e.max <= 0 ? 1 : T.max ?? s(e.max), j),
145
146
  axisLabel: {
146
- ...C.axisLabel ?? {},
147
- formatter: (e) => e !== k && e !== O || e === 0 ? "" : E ? E(e) : String(e)
147
+ ...w.axisLabel ?? {},
148
+ formatter: (e) => e !== j && e !== A || e === 0 ? "" : O ? O(e) : String(e)
148
149
  }
149
150
  },
150
151
  tooltip: {
151
- ...S,
152
- formatter: x(E, D)
152
+ ...C,
153
+ formatter: S(O, k)
153
154
  }
154
155
  };
155
156
  };
156
157
  }
157
- function x(e, t) {
158
- return l((n) => {
158
+ function S(e, t) {
159
+ return u((n) => {
159
160
  let r = n.value?.value, i = typeof r == "number" && e ? e(r) : r ?? "", a = typeof n.marker == "string" ? n.marker : "", o = n.seriesName ? `${n.seriesName}: ` : "", s = t ? String(t(n.name ?? "")) : n.name ?? "";
160
161
  return {
161
162
  name: String(s),
@@ -167,7 +168,7 @@ function x(e, t) {
167
168
  }
168
169
  //#endregion
169
170
  //#region src/widgets/bar/skeleton.tsx
170
- var S = {
171
+ var C = {
171
172
  container: {
172
173
  display: "flex",
173
174
  alignItems: "center",
@@ -199,52 +200,52 @@ var S = {
199
200
  alignItems: "center",
200
201
  gap: ({ spacing: e }) => e(1.5)
201
202
  }
202
- }, C = [
203
+ }, w = [
203
204
  "20%",
204
205
  "40%",
205
206
  "60%",
206
207
  "20%",
207
208
  "80%"
208
209
  ];
209
- function w() {
210
- let e = p(2), t;
211
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ g(m, {
212
- sx: S.grid,
213
- children: C.map(E)
210
+ function T() {
211
+ let e = m(2), t;
212
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ _(h, {
213
+ sx: C.grid,
214
+ children: w.map(D)
214
215
  }), e[0] = t) : t = e[0];
215
216
  let n;
216
- return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ _(m, {
217
- sx: S.container,
218
- children: [t, /* @__PURE__ */ g(m, {
219
- sx: S.legend,
220
- children: [0, 1].map(T)
217
+ return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ v(h, {
218
+ sx: C.container,
219
+ children: [t, /* @__PURE__ */ _(h, {
220
+ sx: C.legend,
221
+ children: [0, 1].map(E)
221
222
  })]
222
223
  }), e[1] = n) : n = e[1], n;
223
224
  }
224
- function T(e) {
225
- return /* @__PURE__ */ _(m, {
226
- sx: S.legendItem,
227
- children: [/* @__PURE__ */ g(h, {
225
+ function E(e) {
226
+ return /* @__PURE__ */ v(h, {
227
+ sx: C.legendItem,
228
+ children: [/* @__PURE__ */ _(g, {
228
229
  variant: "circular",
229
230
  width: 8,
230
231
  height: 8
231
- }), /* @__PURE__ */ g(h, {
232
+ }), /* @__PURE__ */ _(g, {
232
233
  width: 48,
233
234
  height: 8
234
235
  })]
235
236
  }, `legend-${e}`);
236
237
  }
237
- function E(e, t) {
238
- return /* @__PURE__ */ g(h, {
239
- sx: S.bar,
238
+ function D(e, t) {
239
+ return /* @__PURE__ */ _(g, {
240
+ sx: C.bar,
240
241
  variant: "rectangular",
241
242
  height: e
242
243
  }, `bar-${t}`);
243
244
  }
244
245
  //#endregion
245
246
  //#region src/widgets/bar/download.tsx
246
- function D(e) {
247
- return n(e, t({
247
+ function O(e) {
248
+ return r(e, n({
248
249
  filename: e.filename,
249
250
  getRows: (t) => {
250
251
  let n = e.getData(t), r = [];
@@ -257,6 +258,6 @@ function D(e) {
257
258
  }));
258
259
  }
259
260
  //#endregion
260
- export { w as BarSkeleton, y as barOptions, D as createBarDownloadConfig, b as createBarOptionFactory };
261
+ export { T as BarSkeleton, b as barOptions, O as createBarDownloadConfig, x as createBarOptionFactory };
261
262
 
262
263
  //# sourceMappingURL=bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.js","names":["<Box sx={styles.grid}>\n {BAR_HEIGHTS.map((height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\n </Box>","(height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n )","<Box sx={styles.container}>\n <Box sx={styles.grid}>\n {BAR_HEIGHTS.map((height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\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 )","i","_c","ZOOM_LAYOUT","buildCsvDownloadItem","withPngItem","positionDataZoomForLegend","mergeOptions","resolveThemeColor","niceNum","buildLegendConfig","buildAxisLabelStyle","createTooltipFormatter","buildGridConfig","createTooltipPositioner","createItemColorResolver","echarts","barOptions","niceMin","niceMax","theme","buildBarTooltipFormatter","formatter","labelFormatter","v","extent","value","createBarOptionFactory","options","series","selection","selectionSet","option","structural","optionsOverride","seriesArr","data","hasLegend","baseLegend","baseGrid","baseTooltip","baseYAxis","seriesTemplates","broadcastTemplate","liveFormatter","ctx","liveLabelFormatter","dataZoomLayout","fallbackBottom","baseBottom","gridBottom","makeDimItemStyle","baseColor","params","base","name","s","template","i","overrideColor","raw","item","formattedValue","marker","seriesName","styles","spacing","BAR_HEIGHTS","BarSkeleton","$","c","t0","Box","_temp","t1","_temp2","Skeleton","i_0","createBarDownloadConfig","args","rows","d"],"sources":["../../src/widgets/bar/options.ts","../../src/widgets/bar/skeleton.tsx","../../src/widgets/bar/download.tsx"],"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 BarEChartsOption,\n BarOptionFactoryInput,\n BarOptionsInput,\n BarWidgetData,\n} from './types'\n\n/**\n * Builds the **structural** ECharts option for a bar widget — axes, grid,\n * tooltip styling, themed legend. Intentionally data-agnostic: no series,\n * no dataset, no `legend.show` (those depend on data and are added by the\n * option factory's merge phase). This separation is what lets data-side\n * pipeline transforms (Searcher, RelativeData) drive the rendered chart —\n * the merge happens at render time inside the Echart bridge.\n *\n * Styling matches the v1 `barConfig` look-and-feel: minimal axes (only\n * min/max y-labels rendered inside the plot via `niceNum`), themed tooltip,\n * scroll legend, and CARTO color palette. The y-axis min/max + label\n * formatter and the tooltip formatter are wired here for the no-data case;\n * {@link createBarOptionFactory} re-derives them at fusion time so reactive\n * formatter changes (RelativeData) and stack templates (StackToggle) flow\n * through to the chart.\n */\nexport function barOptions({\n theme,\n formatter,\n labelFormatter,\n}: BarOptionsInput): BarEChartsOption {\n // Closure shared between yAxis min/max callbacks and the label formatter,\n // so only the rounded extents are labelled (matches v1).\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: buildBarTooltipFormatter(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, labelFormatter }),\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: 'category',\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 // `interval: 0` makes every category label a candidate so `hideOverlap`\n // can pack the maximum number that physically fit; the category-axis\n // default (`'auto'`) sub-samples first and shows fewer than fit.\n interval: 0,\n hideOverlap: true,\n ...(labelFormatter && {\n formatter: (v: string | number) => String(labelFormatter(v)),\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 BarEChartsOption\n}\n\n/**\n * Returns the bar widget's {@link OptionFactory} — a single closure that\n * handles BOTH option-construction phases:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link barOptions}, optionally merging the\n * consumer-supplied `optionsOverride` on top. Called once by Provider\n * to seed `rawOptions` in the store; configTransforms (StackToggle /\n * ZoomToggle / BrushToggle) then mutate it via the pipeline middleware.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`BarWidgetData`) into the option via the dataset API: one dataset\n * per series, each series referencing its dataset by index, encoded\n * by `name` (x) and `value` (y). Spreads any series-template fields\n * already on the incoming option (e.g. `{ stack: 'total' }` from\n * `addStack`) into every emitted series so configTransforms compose\n * end-to-end. Reactive `ctx.formatter` / `ctx.labelFormatter` drive\n * the y-axis min/max-only label and the tooltip formatter at fusion\n * time so RelativeData's percent formatter flows through without a\n * structural rebuild.\n *\n * Stable identity when the inputs don't change (consumers should wrap the\n * call in `useMemo` keyed on the same inputs).\n */\nexport function createBarOptionFactory(\n options: BarOptionFactoryInput,\n): OptionFactory {\n const { theme, formatter, labelFormatter, optionsOverride } = options\n const series = options.series\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0\n ? new Set<string | number>(selection)\n : null\n return (option, data, ctx) => {\n // Structural phase: Provider seeds rawOptions with this branch. No data\n // is read; we just emit the theme-aware base (optionally with override).\n if (option == null) {\n const structural = barOptions({ 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 BarWidgetData) : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\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 baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n\n const seriesTemplates = Array.isArray(option.series) ? option.series : []\n const broadcastTemplate = seriesTemplates[0] ?? {}\n\n // Reactive (live store) formatters from ctx — distinct from the\n // closure-time `formatter` / `labelFormatter` captured for the\n // structural-build branch above. RelativeData can install a percent\n // formatter on the store after the factory was constructed; the merge\n // phase reads `ctx` to pick that up.\n const liveFormatter = ctx?.formatter\n const liveLabelFormatter = ctx?.labelFormatter\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 // Delegating the extent to ECharts (rather than precomputing scalars\n // from the raw data) is what keeps stacked bars 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 instead of\n // a single series.\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 // When a selection is active, dim non-selected bars by routing the\n // item's base colour through `modifyAlpha`. Per-row `itemStyle` on\n // dataset object-rows is silently ignored when `series.encode` is in\n // play — the callback approach is the standard ECharts pattern for\n // per-data styling derived from a dataset. The base colour is the\n // datum's `color`, else the template's `itemStyle.color`, else the\n // series colour / palette (`params.color`).\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 bars would stay dimmed forever after an external clear. Always\n // emitting lets normal merge swap the callback in place, no\n // `replaceMerge` and no entry-animation flash on selection on/off.\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 base = baseColor(params)\n if (!selectionSet) return base\n const datum = params.value as { name?: string | number } | undefined\n const name = datum?.name ?? params.name\n return name != null && selectionSet.has(name)\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n },\n }\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 // Per-series `color` override: ECharts sets `params.color` from\n // `series[i].color` when resolving styles, so the dim callback\n // above keeps working — it just dims the user's colour rather\n // than the palette default.\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n ...(typeof template === 'object' ? template : {}),\n type: 'bar' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 'name', y: 'value' },\n barMaxWidth: 100,\n emphasis: { focus: 'series' },\n itemStyle: makeDimItemStyle(s, template),\n ...(overrideColor ? { color: overrideColor } : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: {\n ...baseGrid,\n bottom: gridBottom,\n },\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: buildBarTooltipFormatter(liveFormatter, liveLabelFormatter),\n },\n } as EChartsOption\n }\n}\n\nfunction buildBarTooltipFormatter(\n formatter: ((value: number) => string) | undefined,\n labelFormatter: ((value: string | number) => string | number) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const row = item.value as { name?: string | number; value?: number }\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 name = labelFormatter\n ? String(labelFormatter(item.name ?? ''))\n : (item.name ?? '')\n return { name: String(name), seriesName, marker, value: formattedValue }\n })\n}\n","import { Box, Skeleton, type SxProps, type Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n grid: {\n display: 'flex',\n justifyContent: 'space-between',\n flex: '1 1 auto',\n alignItems: 'flex-end',\n width: '100%',\n },\n bar: {\n flex: 1,\n maxWidth: ({ spacing }) => spacing(12),\n '& + &': {\n marginLeft: ({ spacing }) => spacing(1),\n },\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\nconst BAR_HEIGHTS = ['20%', '40%', '60%', '20%', '80%'] as const\n\n/**\n * Loading state for the Bar widget. Mirrors a bar chart's silhouette — five\n * vertical bars at staggered heights anchored to the bottom, plus a legend\n * stub — so the skeleton reads as \"a bar chart\" rather than a generic list.\n */\nexport function BarSkeleton() {\n return (\n <Box sx={styles.container}>\n <Box sx={styles.grid}>\n {BAR_HEIGHTS.map((height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\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 { BarWidgetData } from './types'\n\nexport type BarDownloadConfigArgs = WidgetDownloadArgs<BarWidgetData>\n\n/**\n * Builds download items for the Bar widget. Always includes a CSV item with\n * one `name,value` block per series, separated by an empty row when there\n * are multiple. When `getCaptureEl` is given, also prepends a PNG item that\n * rasterises the captured element via `html2canvas`.\n */\nexport function createBarDownloadConfig(\n args: BarDownloadConfigArgs,\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const rows: unknown[][] = []\n for (const [i, series] of data.entries()) {\n if (i > 0) rows.push([])\n rows.push(['name', 'value'])\n for (const d of series) rows.push([d.name, d.value])\n }\n return rows\n },\n }),\n )\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgBoB,EAAW,EACzB,UACA,cACA,qBACoC;CAGpC,IAAIC,IAAU,GACVC,IAAU;CAEd,OAAO;EACL,MAAM;GACJ,MAAM,SAASC,EAAM,QAAQ,CAAC,CAAC;GAC/B,KAAK,SAASA,EAAM,QAAQ,CAAC,CAAC;GAC9B,OAAO,SAASA,EAAM,QAAQ,CAAC,CAAC;GAEhC,GAAGP,EAAgB,IAAOO,CAAK;GAC/B,cAAc;EAChB;EACA,SAAS;GACP,SAAS;GACT,iBAAiBA,EAAM,QAAQ,KAAK;GACpC,aAAa;GACb,SAAS,CAAC,SAASA,EAAM,QAAQ,CAAC,CAAC,GAAG,SAASA,EAAM,QAAQ,CAAC,CAAC,CAAC;GAChE,WAAW;IACT,OAAOA,EAAM,QAAQ,OAAO;IAC5B,UAAU;IACV,YAAYA,EAAM,WAAW,QAAQ;GACvC;GACA,aAAa,EAAE,MAAM,OAAO;GAC5B,UAAUN,EAAwBM,CAAK;GACvC,WAAWC,EAAyBC,GAAWC,CAAc;EAC/D;EAGA,QAAQ,EACN,GAAGb,EAAkB;GAAE,WAAW;GAAO;EAAe,CA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}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\n </Box>","(height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n )","<Box sx={styles.container}>\n <Box sx={styles.grid}>\n {BAR_HEIGHTS.map((height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\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 )","i","_c","ZOOM_LAYOUT","fixedAxisBounds","withPngItem","positionDataZoomForLegend","mergeOptions","resolveThemeColor","niceNum","buildLegendConfig","buildAxisLabelStyle","createTooltipFormatter","buildGridConfig","createTooltipPositioner","createItemColorResolver","echarts","barOptions","niceMin","niceMax","theme","buildBarTooltipFormatter","formatter","labelFormatter","v","extent","value","createBarOptionFactory","options","series","selection","selectionSet","option","structural","optionsOverride","seriesArr","data","hasLegend","baseLegend","baseGrid","baseTooltip","baseYAxis","fixedY","seriesTemplates","broadcastTemplate","liveFormatter","ctx","liveLabelFormatter","dataZoomLayout","fallbackBottom","baseBottom","gridBottom","makeDimItemStyle","baseColor","params","base","name","s","template","i","overrideColor","raw","item","formattedValue","marker","seriesName","styles","spacing","BAR_HEIGHTS","BarSkeleton","$","c","t0","Box","_temp","t1","_temp2","Skeleton","i_0","createBarDownloadConfig","args","buildCsvDownloadItem","rows","d"],"sources":["../../src/widgets/bar/options.ts","../../src/widgets/bar/skeleton.tsx","../../src/widgets/bar/download.tsx"],"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 BarEChartsOption,\n BarOptionFactoryInput,\n BarOptionsInput,\n BarWidgetData,\n} from './types'\nimport { fixedAxisBounds } from '../actions/relative-data/scale'\n\n/**\n * Builds the **structural** ECharts option for a bar widget — axes, grid,\n * tooltip styling, themed legend. Intentionally data-agnostic: no series,\n * no dataset, no `legend.show` (those depend on data and are added by the\n * option factory's merge phase). This separation is what lets data-side\n * pipeline transforms (Searcher, RelativeData) drive the rendered chart —\n * the merge happens at render time inside the Echart bridge.\n *\n * Styling matches the v1 `barConfig` look-and-feel: minimal axes (only\n * min/max y-labels rendered inside the plot via `niceNum`), themed tooltip,\n * scroll legend, and CARTO color palette. The y-axis min/max + label\n * formatter and the tooltip formatter are wired here for the no-data case;\n * {@link createBarOptionFactory} re-derives them at fusion time so reactive\n * formatter changes (RelativeData) and stack templates (StackToggle) flow\n * through to the chart.\n */\nexport function barOptions({\n theme,\n formatter,\n labelFormatter,\n}: BarOptionsInput): BarEChartsOption {\n // Closure shared between yAxis min/max callbacks and the label formatter,\n // so only the rounded extents are labelled (matches v1).\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: buildBarTooltipFormatter(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, labelFormatter }),\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: 'category',\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 // `interval: 0` makes every category label a candidate so `hideOverlap`\n // can pack the maximum number that physically fit; the category-axis\n // default (`'auto'`) sub-samples first and shows fewer than fit.\n interval: 0,\n hideOverlap: true,\n ...(labelFormatter && {\n formatter: (v: string | number) => String(labelFormatter(v)),\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 BarEChartsOption\n}\n\n/**\n * Returns the bar widget's {@link OptionFactory} — a single closure that\n * handles BOTH option-construction phases:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link barOptions}, optionally merging the\n * consumer-supplied `optionsOverride` on top. Called once by Provider\n * to seed `rawOptions` in the store; configTransforms (StackToggle /\n * ZoomToggle / BrushToggle) then mutate it via the pipeline middleware.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`BarWidgetData`) into the option via the dataset API: one dataset\n * per series, each series referencing its dataset by index, encoded\n * by `name` (x) and `value` (y). Spreads any series-template fields\n * already on the incoming option (e.g. `{ stack: 'total' }` from\n * `addStack`) into every emitted series so configTransforms compose\n * end-to-end. Reactive `ctx.formatter` / `ctx.labelFormatter` drive\n * the y-axis min/max-only label and the tooltip formatter at fusion\n * time so RelativeData's percent formatter flows through without a\n * structural rebuild.\n *\n * Stable identity when the inputs don't change (consumers should wrap the\n * call in `useMemo` keyed on the same inputs).\n */\nexport function createBarOptionFactory(\n options: BarOptionFactoryInput,\n): OptionFactory {\n const { theme, formatter, labelFormatter, optionsOverride } = options\n const series = options.series\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0\n ? new Set<string | number>(selection)\n : null\n return (option, data, ctx) => {\n // Structural phase: Provider seeds rawOptions with this branch. No data\n // is read; we just emit the theme-aware base (optionally with override).\n if (option == null) {\n const structural = barOptions({ 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 BarWidgetData) : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\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 baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n const fixedY = fixedAxisBounds(baseYAxis)\n\n const seriesTemplates = Array.isArray(option.series) ? option.series : []\n const broadcastTemplate = seriesTemplates[0] ?? {}\n\n // Reactive (live store) formatters from ctx — distinct from the\n // closure-time `formatter` / `labelFormatter` captured for the\n // structural-build branch above. RelativeData can install a percent\n // formatter on the store after the factory was constructed; the merge\n // phase reads `ctx` to pick that up.\n const liveFormatter = ctx?.formatter\n const liveLabelFormatter = ctx?.labelFormatter\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 // Delegating the extent to ECharts (rather than precomputing scalars\n // from the raw data) is what keeps stacked bars 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 instead of\n // a single series.\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 // When a selection is active, dim non-selected bars by routing the\n // item's base colour through `modifyAlpha`. Per-row `itemStyle` on\n // dataset object-rows is silently ignored when `series.encode` is in\n // play — the callback approach is the standard ECharts pattern for\n // per-data styling derived from a dataset. The base colour is the\n // datum's `color`, else the template's `itemStyle.color`, else the\n // series colour / palette (`params.color`).\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 bars would stay dimmed forever after an external clear. Always\n // emitting lets normal merge swap the callback in place, no\n // `replaceMerge` and no entry-animation flash on selection on/off.\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 base = baseColor(params)\n if (!selectionSet) return base\n const datum = params.value as { name?: string | number } | undefined\n const name = datum?.name ?? params.name\n return name != null && selectionSet.has(name)\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n },\n }\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 // Per-series `color` override: ECharts sets `params.color` from\n // `series[i].color` when resolving styles, so the dim callback\n // above keeps working — it just dims the user's colour rather\n // than the palette default.\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n ...(typeof template === 'object' ? template : {}),\n type: 'bar' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 'name', y: 'value' },\n barMaxWidth: 100,\n emphasis: { focus: 'series' },\n itemStyle: makeDimItemStyle(s, template),\n ...(overrideColor ? { color: overrideColor } : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: {\n ...baseGrid,\n bottom: gridBottom,\n },\n ...(dataZoomLayout ? { dataZoom: dataZoomLayout } : {}),\n yAxis: {\n ...baseYAxis,\n // A config transform (RelativeData's `'total'` scale) may pin the\n // ends; each applies only on the side the data reaches.\n min: (extent: { min: number }) => {\n niceMin = extent.min < 0 ? (fixedY.min ?? niceNum(extent.min)) : 0\n return niceMin\n },\n max: (extent: { min: number; max: number }) => {\n niceMax = extent.max <= 0 ? 1 : (fixedY.max ?? 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: buildBarTooltipFormatter(liveFormatter, liveLabelFormatter),\n },\n } as EChartsOption\n }\n}\n\nfunction buildBarTooltipFormatter(\n formatter: ((value: number) => string) | undefined,\n labelFormatter: ((value: string | number) => string | number) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const row = item.value as { name?: string | number; value?: number }\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 name = labelFormatter\n ? String(labelFormatter(item.name ?? ''))\n : (item.name ?? '')\n return { name: String(name), seriesName, marker, value: formattedValue }\n })\n}\n","import { Box, Skeleton, type SxProps, type Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n grid: {\n display: 'flex',\n justifyContent: 'space-between',\n flex: '1 1 auto',\n alignItems: 'flex-end',\n width: '100%',\n },\n bar: {\n flex: 1,\n maxWidth: ({ spacing }) => spacing(12),\n '& + &': {\n marginLeft: ({ spacing }) => spacing(1),\n },\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\nconst BAR_HEIGHTS = ['20%', '40%', '60%', '20%', '80%'] as const\n\n/**\n * Loading state for the Bar widget. Mirrors a bar chart's silhouette — five\n * vertical bars at staggered heights anchored to the bottom, plus a legend\n * stub — so the skeleton reads as \"a bar chart\" rather than a generic list.\n */\nexport function BarSkeleton() {\n return (\n <Box sx={styles.container}>\n <Box sx={styles.grid}>\n {BAR_HEIGHTS.map((height, i) => (\n <Skeleton\n key={`bar-${i}`}\n sx={styles.bar}\n variant='rectangular'\n height={height}\n />\n ))}\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 { BarWidgetData } from './types'\n\nexport type BarDownloadConfigArgs = WidgetDownloadArgs<BarWidgetData>\n\n/**\n * Builds download items for the Bar widget. Always includes a CSV item with\n * one `name,value` block per series, separated by an empty row when there\n * are multiple. When `getCaptureEl` is given, also prepends a PNG item that\n * rasterises the captured element via `html2canvas`.\n */\nexport function createBarDownloadConfig(\n args: BarDownloadConfigArgs,\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const rows: unknown[][] = []\n for (const [i, series] of data.entries()) {\n if (i > 0) rows.push([])\n rows.push(['name', 'value'])\n for (const d of series) rows.push([d.name, d.value])\n }\n return rows\n },\n }),\n )\n}\n"],"mappings":";;;;;;;;;;AAwCA,SAAgBoB,EAAW,EACzB,UACA,cACA,qBACoC;CAGpC,IAAIC,IAAU,GACVC,IAAU;CAEd,OAAO;EACL,MAAM;GACJ,MAAM,SAASC,EAAM,QAAQ,CAAC,CAAC;GAC/B,KAAK,SAASA,EAAM,QAAQ,CAAC,CAAC;GAC9B,OAAO,SAASA,EAAM,QAAQ,CAAC,CAAC;GAEhC,GAAGP,EAAgB,IAAOO,CAAK;GAC/B,cAAc;EAChB;EACA,SAAS;GACP,SAAS;GACT,iBAAiBA,EAAM,QAAQ,KAAK;GACpC,aAAa;GACb,SAAS,CAAC,SAASA,EAAM,QAAQ,CAAC,CAAC,GAAG,SAASA,EAAM,QAAQ,CAAC,CAAC,CAAC;GAChE,WAAW;IACT,OAAOA,EAAM,QAAQ,OAAO;IAC5B,UAAU;IACV,YAAYA,EAA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AO,CAAC;IAC3B,KAAK,IAAMC,KAAKtD,GAAQ,EAAK,KAAK,CAACsD,EAAE,MAAMA,EAAE,KAAK,CAAC;GACrD;GACA,OAAOD;EACT;CACF,CAAC,CACH;AACF"}
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../category-DULnoxvk.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../category-BHBd5Pcc.js";
2
2
  export { o as Category, r as CategoryBar, e as CategoryLegend, s as CategoryRowMulti, a as CategoryRowOther, t as CategoryRowSingle, i as CategorySkeleton, n as CategoryUI, c as createCategoryDownloadConfig };