@carto/ps-react-ui 6.4.0 → 6.5.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 (88) hide show
  1. package/dist/{actions-DyWNwvLu.js → actions-D_PVFZaM.js} +4 -4
  2. package/dist/{actions-DyWNwvLu.js.map → actions-D_PVFZaM.js.map} +1 -1
  3. package/dist/{category-BHBd5Pcc.js → category-UIGvFN3D.js} +4 -4
  4. package/dist/{category-BHBd5Pcc.js.map → category-UIGvFN3D.js.map} +1 -1
  5. package/dist/chat.js +472 -470
  6. package/dist/chat.js.map +1 -1
  7. package/dist/{components-CTUpdQuj.js → components-DDJU4m0t.js} +8 -8
  8. package/dist/components-DDJU4m0t.js.map +1 -0
  9. package/dist/components.js +2 -2
  10. package/dist/{download-B4sykOFm.js → download-DIj1Iz0t.js} +2 -2
  11. package/dist/{download-B4sykOFm.js.map → download-DIj1Iz0t.js.map} +1 -1
  12. package/dist/{formula-DJS-JLpk.js → formula-CSHhAoyW.js} +4 -4
  13. package/dist/{formula-DJS-JLpk.js.map → formula-CSHhAoyW.js.map} +1 -1
  14. package/dist/{item-color-B7xkIpDZ.js → item-color-7o7pFBR2.js} +26 -18
  15. package/dist/item-color-7o7pFBR2.js.map +1 -0
  16. package/dist/markdown-B8lLR-NY.js +106 -0
  17. package/dist/markdown-B8lLR-NY.js.map +1 -0
  18. package/dist/{spread-CQwFIwuz.js → spread-BRfPPIep.js} +3 -3
  19. package/dist/{spread-CQwFIwuz.js.map → spread-BRfPPIep.js.map} +1 -1
  20. package/dist/style-DTLuIo84.js +87 -0
  21. package/dist/style-DTLuIo84.js.map +1 -0
  22. package/dist/{styles-BCEBm7xh.js → styles-yKcpfyNV.js} +5 -5
  23. package/dist/styles-yKcpfyNV.js.map +1 -0
  24. package/dist/{table-DEdW_fDj.js → table-Col_FRvb.js} +2 -2
  25. package/dist/{table-DEdW_fDj.js.map → table-Col_FRvb.js.map} +1 -1
  26. package/dist/theme/tailwind.css +373 -0
  27. package/dist/theme.js +123 -0
  28. package/dist/theme.js.map +1 -0
  29. package/dist/types/components/lasso-tool/styles.d.ts +4 -4
  30. package/dist/types/theme/create-carto-theme.d.ts +7 -0
  31. package/dist/types/theme/deep-merge.d.ts +6 -0
  32. package/dist/types/theme/generate-tailwind-css.d.ts +8 -0
  33. package/dist/types/theme/index.d.ts +2 -0
  34. package/dist/types/widgets/markdown/style.d.ts +74 -0
  35. package/dist/types/widgets/utils/spacing-px.d.ts +13 -0
  36. package/dist/{utils-C-eWwOhE.js → utils-Dw4y8tiq.js} +2 -2
  37. package/dist/{utils-C-eWwOhE.js.map → utils-Dw4y8tiq.js.map} +1 -1
  38. package/dist/widgets/actions.js +3 -3
  39. package/dist/widgets/bar.js +54 -54
  40. package/dist/widgets/bar.js.map +1 -1
  41. package/dist/widgets/category.js +1 -1
  42. package/dist/widgets/formula.js +1 -1
  43. package/dist/widgets/histogram.js +70 -70
  44. package/dist/widgets/histogram.js.map +1 -1
  45. package/dist/widgets/markdown.js +1 -1
  46. package/dist/widgets/pie.js +78 -78
  47. package/dist/widgets/pie.js.map +1 -1
  48. package/dist/widgets/scatterplot.js +82 -82
  49. package/dist/widgets/scatterplot.js.map +1 -1
  50. package/dist/widgets/spread.js +1 -1
  51. package/dist/widgets/table.js +1 -1
  52. package/dist/widgets/timeseries.js +62 -62
  53. package/dist/widgets/timeseries.js.map +1 -1
  54. package/dist/widgets/utils.js +1 -1
  55. package/dist/widgets.js +283 -279
  56. package/dist/widgets.js.map +1 -1
  57. package/dist/{zoom-toggle-MmLjMTEw.js → zoom-toggle-DqrV_0Ji.js} +2 -2
  58. package/dist/{zoom-toggle-MmLjMTEw.js.map → zoom-toggle-DqrV_0Ji.js.map} +1 -1
  59. package/package.json +8 -1
  60. package/src/chat/bubbles/styles.ts +2 -0
  61. package/src/components/lasso-tool/lasso-tool-inline.test.tsx +4 -4
  62. package/src/components/lasso-tool/lasso-tool-inline.tsx +6 -6
  63. package/src/components/lasso-tool/styles.ts +4 -4
  64. package/src/theme/create-carto-theme.test.ts +53 -0
  65. package/src/theme/create-carto-theme.ts +21 -0
  66. package/src/theme/deep-merge.test.ts +25 -0
  67. package/src/theme/deep-merge.ts +22 -0
  68. package/src/theme/generate-tailwind-css.test.ts +87 -0
  69. package/src/theme/generate-tailwind-css.ts +178 -0
  70. package/src/theme/index.ts +2 -0
  71. package/src/theme/tailwind-compile.test.ts +71 -0
  72. package/src/theme/tailwind.css +373 -0
  73. package/src/widgets/bar/options.ts +7 -6
  74. package/src/widgets/histogram/options.ts +7 -6
  75. package/src/widgets/markdown/style.ts +40 -0
  76. package/src/widgets/note/widget-note.tsx +4 -1
  77. package/src/widgets/pie/options.ts +5 -4
  78. package/src/widgets/scatterplot/options.ts +7 -6
  79. package/src/widgets/timeseries/options.ts +7 -6
  80. package/src/widgets/utils/css-variables-theme.test.ts +32 -0
  81. package/src/widgets/utils/option-builders.ts +4 -6
  82. package/src/widgets/utils/spacing-px.test.ts +42 -0
  83. package/src/widgets/utils/spacing-px.ts +24 -0
  84. package/dist/components-CTUpdQuj.js.map +0 -1
  85. package/dist/item-color-B7xkIpDZ.js.map +0 -1
  86. package/dist/markdown-DmvLi3vx.js +0 -159
  87. package/dist/markdown-DmvLi3vx.js.map +0 -1
  88. package/dist/styles-BCEBm7xh.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Theme spacing as a pixel number, for APIs that need numbers (ECharts).
4
+ *
5
+ * `theme.spacing(n)` returns `"8px"` for a regular theme but
6
+ * `"var(--mui-spacing, 8px)"` / `"calc(...)"` once the theme uses
7
+ * `cssVariables`, which does not parse. Resolution order:
8
+ * 1. `parseFloat` of `theme.spacing(factor)` (regular themes);
9
+ * 2. the px unit MUI writes into `theme.spacing(1)` (`var(--mui-spacing, Npx)`),
10
+ * which honours a `spacing` override such as `createCartoTheme({ spacing: 4 })`;
11
+ * 3. meridian's numeric `spacingValue`, or MUI's default 8px.
12
+ */
13
+ export declare function spacingPx(theme: Theme, factor: number): number;
@@ -1,4 +1,4 @@
1
- import { r as e } from "./zoom-toggle-MmLjMTEw.js";
1
+ import { r as e } from "./zoom-toggle-DqrV_0Ji.js";
2
2
  //#region src/widgets/utils/merge-options.ts
3
3
  function t(e, t) {
4
4
  if (!t) return e;
@@ -55,4 +55,4 @@ function a(e, t) {
55
55
  //#endregion
56
56
  export { i as n, t as r, a as t };
57
57
 
58
- //# sourceMappingURL=utils-C-eWwOhE.js.map
58
+ //# sourceMappingURL=utils-Dw4y8tiq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-C-eWwOhE.js","names":["ZOOM_LAYOUT","mergeOptions","override","base","out","key","b","mergeValue","a","len","result","i","av","bv","isPlainObject","v","proto","positionDataZoomForLegend","dataZoom","entry","dz","hasLegend","resolveThemeColor","raw","parts","cursor","theme","part"],"sources":["../src/widgets/utils/merge-options.ts","../src/widgets/utils/data-zoom-layout.ts","../src/widgets/utils/resolve-theme-color.ts"],"sourcesContent":["/**\n * Shallow-merges two ECharts option objects:\n * - Top-level keys from both are combined.\n * - Arrays are merged by index (element-wise shallow merge, primitive override).\n * - Plain objects are shallow-merged.\n * - Primitives are overridden by the override value.\n *\n * Designed for the two-stage memoization pattern: first build a base option\n * object from data + theme + formatters, then call `mergeOptions(base, override)`\n * inside a second `useMemo` keyed on `[base, override]`.\n */\nexport function mergeOptions<T extends Record<string, unknown>>(\n base: T,\n override?: Partial<T>,\n): T {\n if (!override) return base\n const out: Record<string, unknown> = { ...base }\n for (const key of Object.keys(override) as (keyof T)[]) {\n const a = base[key]\n const b = override[key]\n if (b === undefined) continue\n out[key as string] = mergeValue(a, b)\n }\n return out as T\n}\n\nfunction mergeValue(a: unknown, b: unknown): unknown {\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length)\n const result = new Array<unknown>(len)\n for (let i = 0; i < len; i++) {\n const av: unknown = a[i]\n const bv: unknown = b[i]\n if (bv === undefined) result[i] = av\n else if (av === undefined) result[i] = bv\n else result[i] = mergeValue(av, bv)\n }\n return result\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return { ...a, ...b }\n }\n return b\n}\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false\n const proto = Object.getPrototypeOf(v) as unknown\n return proto === Object.prototype || proto === null\n}\n","import { ZOOM_LAYOUT } from '../actions/zoom-toggle'\n\n/**\n * If the option includes a `dataZoom` array (from ZoomToggle's transform),\n * lift any slider entries above the legend row so they don't overlap.\n * Returns `null` when there is no `dataZoom` — caller skips the layout\n * adjustment entirely.\n *\n * Shared between bar, histogram, and timeseries — every widget with a\n * horizontal x-axis dataZoom slider needs the same offset when a legend\n * is rendered below the plot.\n */\nexport function positionDataZoomForLegend(\n dataZoom: unknown,\n hasLegend: boolean,\n): unknown[] | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n return dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as { type?: string; bottom?: number }\n if (dz.type === 'slider' && hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Resolve a colour string against the MUI theme palette.\n *\n * - `'primary.main'`, `'secondary.dark'`, `'success.contrastText'`, … →\n * walks `theme.palette` along the dot-separated path and returns the\n * resolved string when traversal succeeds.\n * - `'#ff0000'`, `'rgb(255, 0, 0)'`, `'red'` → returned as-is (assumed\n * raw CSS; ECharts consumes them directly).\n * - `undefined` → `undefined` (callers fall back to ECharts' palette).\n *\n * Used by the echart option factories (Bar, Pie, Histogram, Scatterplot,\n * Timeseries) so per-series colours specified as theme paths in the\n * unified `WidgetSeries` shape paint correctly. Category, Formula, and\n * Spread render colours through MUI's `sx` resolver, which already\n * handles theme paths — they don't need this helper.\n */\nexport function resolveThemeColor(\n theme: Theme,\n raw: string | undefined,\n): string | undefined {\n if (raw == null) return undefined\n if (!raw.includes('.')) return raw\n const parts = raw.split('.')\n let cursor: unknown = theme.palette\n for (const part of parts) {\n if (cursor == null || typeof cursor !== 'object') {\n return raw\n }\n cursor = (cursor as Record<string, unknown>)[part]\n }\n return typeof cursor === 'string' ? cursor : raw\n}\n"],"mappings":";;AAWA,SAAgBC,EACd,GACA,GACG;CACH,IAAI,CAACC,GAAU,OAAOC;CACtB,IAAMC,IAA+B,EAAE,GAAGD,EAAK;CAC/C,KAAK,IAAME,KAAO,OAAO,KAAKH,CAAQ,GAAkB;EACtD,IAAM,IAAIC,EAAKE,IACTC,IAAIJ,EAASG;EACnB,AAAIC,MAAM,KAAA,MACV,EAAID,KAAiBE,EAAW,GAAGD,CAAC;CACtC;CACA,OAAOF;AACT;AAEA,SAASG,EAAW,GAAY,GAAqB;CACnD,IAAI,MAAM,QAAQC,CAAC,KAAK,MAAM,QAAQF,CAAC,GAAG;EACxC,IAAMG,IAAM,KAAK,IAAID,EAAE,QAAQF,EAAE,MAAM,GACjCI,IAAa,MAAeD,CAAG;EACrC,KAAK,IAAIE,IAAI,GAAGA,IAAIF,GAAK,KAAK;GAC5B,IAAMG,IAAcJ,EAAEG,IAChBE,IAAcP,EAAEK;GACtB,AAAIE,MAAO,KAAA,IAAW,EAAOF,KAAKC,IACzBA,MAAO,KAAA,IAAW,EAAOD,KAAKE,IAClC,EAAOF,KAAKJ,EAAWK,GAAIC,CAAE;EACpC;EACA,OAAOH;CACT;CAIA,OAHII,EAAcN,CAAC,KAAKM,EAAcR,CAAC,IAC9B;EAAE,GAAGE;EAAG,GAAGF;CAAE,IAEfA;AACT;AAEA,SAASQ,EAAc,GAA0C;CAC/D,IAAkB,OAAOC,KAAM,aAA3BA,GAAqC,OAAO;CAChD,IAAMC,IAAQ,OAAO,eAAeD,CAAC;CACrC,OAAOC,MAAU,OAAO,aAAaA,MAAU;AACjD;;;ACrCA,SAAgBC,EACd,GACA,GACkB;CAElB,OADI,CAAC,MAAM,QAAQC,CAAQ,KAAKA,EAAS,WAAW,IAAU,OACvDA,EAAS,KAAK,MAAmB;EACtC,IAAqB,OAAOC,KAAU,aAAlCA,GAA4C,OAAOA;EACvD,IAAMC,IAAKD;EAIX,OAHIC,EAAG,SAAS,YAAYC,IACnB;GAAE,GAAGD;GAAI,QAAQpB,EAAY;EAAuB,IAEtDoB;CACT,CAAC;AACH;;;ACPA,SAAgBE,EACd,GACA,GACoB;CACpB,IAAIC,KAAO,MAAM;CACjB,IAAI,CAACA,EAAI,SAAS,GAAG,GAAG,OAAOA;CAC/B,IAAMC,IAAQD,EAAI,MAAM,GAAG,GACvBE,IAAkBC,EAAM;CAC5B,KAAK,IAAMC,KAAQH,GAAO;EACxB,IAAsB,OAAOC,KAAW,aAApCA,GACF,OAAOF;EAET,IAAUE,EAAmCE;CAC/C;CACA,OAAO,OAAOF,KAAW,WAAWA,IAASF;AAC/C"}
1
+ {"version":3,"file":"utils-Dw4y8tiq.js","names":["ZOOM_LAYOUT","mergeOptions","override","base","out","key","b","mergeValue","a","len","result","i","av","bv","isPlainObject","v","proto","positionDataZoomForLegend","dataZoom","entry","dz","hasLegend","resolveThemeColor","raw","parts","cursor","theme","part"],"sources":["../src/widgets/utils/merge-options.ts","../src/widgets/utils/data-zoom-layout.ts","../src/widgets/utils/resolve-theme-color.ts"],"sourcesContent":["/**\n * Shallow-merges two ECharts option objects:\n * - Top-level keys from both are combined.\n * - Arrays are merged by index (element-wise shallow merge, primitive override).\n * - Plain objects are shallow-merged.\n * - Primitives are overridden by the override value.\n *\n * Designed for the two-stage memoization pattern: first build a base option\n * object from data + theme + formatters, then call `mergeOptions(base, override)`\n * inside a second `useMemo` keyed on `[base, override]`.\n */\nexport function mergeOptions<T extends Record<string, unknown>>(\n base: T,\n override?: Partial<T>,\n): T {\n if (!override) return base\n const out: Record<string, unknown> = { ...base }\n for (const key of Object.keys(override) as (keyof T)[]) {\n const a = base[key]\n const b = override[key]\n if (b === undefined) continue\n out[key as string] = mergeValue(a, b)\n }\n return out as T\n}\n\nfunction mergeValue(a: unknown, b: unknown): unknown {\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length)\n const result = new Array<unknown>(len)\n for (let i = 0; i < len; i++) {\n const av: unknown = a[i]\n const bv: unknown = b[i]\n if (bv === undefined) result[i] = av\n else if (av === undefined) result[i] = bv\n else result[i] = mergeValue(av, bv)\n }\n return result\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return { ...a, ...b }\n }\n return b\n}\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false\n const proto = Object.getPrototypeOf(v) as unknown\n return proto === Object.prototype || proto === null\n}\n","import { ZOOM_LAYOUT } from '../actions/zoom-toggle'\n\n/**\n * If the option includes a `dataZoom` array (from ZoomToggle's transform),\n * lift any slider entries above the legend row so they don't overlap.\n * Returns `null` when there is no `dataZoom` — caller skips the layout\n * adjustment entirely.\n *\n * Shared between bar, histogram, and timeseries — every widget with a\n * horizontal x-axis dataZoom slider needs the same offset when a legend\n * is rendered below the plot.\n */\nexport function positionDataZoomForLegend(\n dataZoom: unknown,\n hasLegend: boolean,\n): unknown[] | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n return dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as { type?: string; bottom?: number }\n if (dz.type === 'slider' && hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Resolve a colour string against the MUI theme palette.\n *\n * - `'primary.main'`, `'secondary.dark'`, `'success.contrastText'`, … →\n * walks `theme.palette` along the dot-separated path and returns the\n * resolved string when traversal succeeds.\n * - `'#ff0000'`, `'rgb(255, 0, 0)'`, `'red'` → returned as-is (assumed\n * raw CSS; ECharts consumes them directly).\n * - `undefined` → `undefined` (callers fall back to ECharts' palette).\n *\n * Used by the echart option factories (Bar, Pie, Histogram, Scatterplot,\n * Timeseries) so per-series colours specified as theme paths in the\n * unified `WidgetSeries` shape paint correctly. Category, Formula, and\n * Spread render colours through MUI's `sx` resolver, which already\n * handles theme paths — they don't need this helper.\n */\nexport function resolveThemeColor(\n theme: Theme,\n raw: string | undefined,\n): string | undefined {\n if (raw == null) return undefined\n if (!raw.includes('.')) return raw\n const parts = raw.split('.')\n let cursor: unknown = theme.palette\n for (const part of parts) {\n if (cursor == null || typeof cursor !== 'object') {\n return raw\n }\n cursor = (cursor as Record<string, unknown>)[part]\n }\n return typeof cursor === 'string' ? cursor : raw\n}\n"],"mappings":";;AAWA,SAAgBC,EACd,GACA,GACG;CACH,IAAI,CAACC,GAAU,OAAOC;CACtB,IAAMC,IAA+B,EAAE,GAAGD,EAAK;CAC/C,KAAK,IAAME,KAAO,OAAO,KAAKH,CAAQ,GAAkB;EACtD,IAAM,IAAIC,EAAKE,IACTC,IAAIJ,EAASG;EACnB,AAAIC,MAAM,KAAA,MACV,EAAID,KAAiBE,EAAW,GAAGD,CAAC;CACtC;CACA,OAAOF;AACT;AAEA,SAASG,EAAW,GAAY,GAAqB;CACnD,IAAI,MAAM,QAAQC,CAAC,KAAK,MAAM,QAAQF,CAAC,GAAG;EACxC,IAAMG,IAAM,KAAK,IAAID,EAAE,QAAQF,EAAE,MAAM,GACjCI,IAAa,MAAeD,CAAG;EACrC,KAAK,IAAIE,IAAI,GAAGA,IAAIF,GAAK,KAAK;GAC5B,IAAMG,IAAcJ,EAAEG,IAChBE,IAAcP,EAAEK;GACtB,AAAIE,MAAO,KAAA,IAAW,EAAOF,KAAKC,IACzBA,MAAO,KAAA,IAAW,EAAOD,KAAKE,IAClC,EAAOF,KAAKJ,EAAWK,GAAIC,CAAE;EACpC;EACA,OAAOH;CACT;CAIA,OAHII,EAAcN,CAAC,KAAKM,EAAcR,CAAC,IAC9B;EAAE,GAAGE;EAAG,GAAGF;CAAE,IAEfA;AACT;AAEA,SAASQ,EAAc,GAA0C;CAC/D,IAAkB,OAAOC,KAAM,aAA3BA,GAAqC,OAAO;CAChD,IAAMC,IAAQ,OAAO,eAAeD,CAAC;CACrC,OAAOC,MAAU,OAAO,aAAaA,MAAU;AACjD;;;ACrCA,SAAgBC,EACd,GACA,GACkB;CAElB,OADI,CAAC,MAAM,QAAQC,CAAQ,KAAKA,EAAS,WAAW,IAAU,OACvDA,EAAS,KAAK,MAAmB;EACtC,IAAqB,OAAOC,KAAU,aAAlCA,GAA4C,OAAOA;EACvD,IAAMC,IAAKD;EAIX,OAHIC,EAAG,SAAS,YAAYC,IACnB;GAAE,GAAGD;GAAI,QAAQpB,EAAY;EAAuB,IAEtDoB;CACT,CAAC;AACH;;;ACPA,SAAgBE,EACd,GACA,GACoB;CACpB,IAAIC,KAAO,MAAM;CACjB,IAAI,CAACA,EAAI,SAAS,GAAG,GAAG,OAAOA;CAC/B,IAAMC,IAAQD,EAAI,MAAM,GAAG,GACvBE,IAAkBC,EAAM;CAC5B,KAAK,IAAMC,KAAQH,GAAO;EACxB,IAAsB,OAAOC,KAAW,aAApCA,GACF,OAAOF;EAET,IAAUE,EAAmCE;CAC/C;CACA,OAAO,OAAOF,KAAW,WAAWA,IAASF;AAC/C"}
@@ -1,4 +1,4 @@
1
- import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "../actions-DyWNwvLu.js";
2
- import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-MmLjMTEw.js";
3
- import { a as j, c as M, d as N, f as P, i as F, l as I, n as L, o as R, p as z, r as B, s as V, t as H, u as U } from "../download-B4sykOFm.js";
1
+ import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "../actions-D_PVFZaM.js";
2
+ import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-DqrV_0Ji.js";
3
+ import { a as j, c as M, d as N, f as P, i as F, l as I, n as L, o as R, p as z, r as B, s as V, t as H, u as U } from "../download-DIj1Iz0t.js";
4
4
  export { l as BrushToggle, j as CSVIcon, b as ChangeColumn, _ as DEFAULT_BRUSH_TOGGLE_LABELS, h as DEFAULT_CHANGE_COLUMN_LABELS, I as DEFAULT_DOWNLOAD_LABELS, y as DEFAULT_FULLSCREEN_LABELS, f as DEFAULT_LOCK_SELECTION_LABELS, p as DEFAULT_RELATIVE_DATA_LABELS, r as DEFAULT_SEARCHER_LABELS, S as DEFAULT_SHOW_ALL_LABELS, o as DEFAULT_STACK_TOGGLE_LABELS, O as DEFAULT_ZOOM_TOGGLE_LABELS, F as DOWNLOAD_ITEM_IDS, M as Download, g as FullScreen, v as LockSelection, R as MarkdownIcon, V as PNGIcon, s as RelativeData, d as SHOW_ALL_ID, n as Searcher, e as SearcherToggle, u as ShowAllToggle, T as StackToggle, k as ZOOM_LAYOUT, A as ZoomToggle, m as addBrush, w as addStack, D as addZoom, L as buildCsvDownloadItem, B as buildPngDownloadItem, E as createAddZoom, x as createPercentFormatter, U as downloadDOMToPNG, N as downloadToCSV, a as filterByLockedItems, t as filterBySearchText, C as setSearcherText, i as setShowAll, P as toCsvString, c as toRelativeData, z as triggerLinkDownload, H as withPngItem };
@@ -1,36 +1,36 @@
1
- import { r as e } from "../zoom-toggle-MmLjMTEw.js";
1
+ import { r as e } from "../zoom-toggle-DqrV_0Ji.js";
2
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";
3
+ import { n, t as r } from "../download-DIj1Iz0t.js";
4
+ import { n as i, r as a, t as o } from "../utils-Dw4y8tiq.js";
5
+ import { c as s, i as c, l, n as u, o as d, r as f, s as p, t as m } from "../item-color-7o7pFBR2.js";
6
+ import { c as h } from "react/compiler-runtime";
7
+ import { Box as g, Skeleton as _ } from "@mui/material";
8
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
9
+ import * as b from "echarts";
10
10
  //#region src/widgets/bar/options.ts
11
- function b({ theme: e, formatter: t, labelFormatter: n }) {
11
+ function x({ theme: e, formatter: t, labelFormatter: n }) {
12
12
  let r = 0, i = 1;
13
13
  return {
14
14
  grid: {
15
- left: parseInt(e.spacing(1)),
16
- top: parseInt(e.spacing(3)),
17
- right: parseInt(e.spacing(1)),
18
- ...d(!1, e),
15
+ left: l(e, 1),
16
+ top: l(e, 3),
17
+ right: l(e, 1),
18
+ ...f(!1, e),
19
19
  containLabel: !0
20
20
  },
21
21
  tooltip: {
22
22
  trigger: "axis",
23
23
  backgroundColor: e.palette.grey[900],
24
24
  borderWidth: 0,
25
- padding: [parseInt(e.spacing(1)), parseInt(e.spacing(1))],
25
+ padding: [l(e, 1), l(e, 1)],
26
26
  textStyle: {
27
27
  color: e.palette.common.white,
28
28
  fontSize: 11,
29
29
  fontFamily: e.typography.caption.fontFamily
30
30
  },
31
31
  axisPointer: { type: "line" },
32
- position: f(e),
33
- formatter: S(t, n)
32
+ position: p(e),
33
+ formatter: C(t, n)
34
34
  },
35
35
  legend: { ...c({
36
36
  hasLegend: !1,
@@ -43,9 +43,9 @@ function b({ theme: e, formatter: t, labelFormatter: n }) {
43
43
  axisLine: { show: !1 },
44
44
  axisTick: { show: !1 },
45
45
  axisLabel: {
46
- ...l(e),
46
+ ...u(e),
47
47
  padding: [
48
- parseInt(e.spacing(.5)),
48
+ l(e, .5),
49
49
  0,
50
50
  0,
51
51
  0
@@ -67,8 +67,8 @@ function b({ theme: e, formatter: t, labelFormatter: n }) {
67
67
  lineStyle: { color: e.palette.black?.[4] ?? e.palette.divider }
68
68
  },
69
69
  axisLabel: {
70
- ...l(e),
71
- margin: parseInt(e.spacing(1)),
70
+ ...u(e),
71
+ margin: l(e, 1),
72
72
  show: !0,
73
73
  showMaxLabel: !0,
74
74
  showMinLabel: !0,
@@ -79,11 +79,11 @@ function b({ theme: e, formatter: t, labelFormatter: n }) {
79
79
  }
80
80
  };
81
81
  }
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;
82
+ function S(n) {
83
+ let { theme: r, formatter: c, labelFormatter: l, optionsOverride: u } = n, d = n.series, f = n.selection, p = f && f.length > 0 ? new Set(f) : null;
84
84
  return (n, f, h) => {
85
85
  if (n == null) {
86
- let e = b({
86
+ let e = x({
87
87
  theme: r,
88
88
  formatter: c,
89
89
  labelFormatter: l
@@ -96,8 +96,8 @@ function x(n) {
96
96
  dataset: [],
97
97
  series: []
98
98
  };
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({
99
+ let _ = g.length > 1, v = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, y = typeof n.grid == "object" && !Array.isArray(n.grid) ? n.grid : {}, S = 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 y.bottom == "number" ? y.bottom : 24, P = _ ? 56 : N, F = M ? P + e.sliderHeight + e.sliderGap : P, I = (e, t) => {
100
+ let n = m({
101
101
  theme: r,
102
102
  datums: e,
103
103
  template: t,
@@ -105,9 +105,9 @@ function x(n) {
105
105
  });
106
106
  return { color: (e) => {
107
107
  let t = n(e);
108
- if (!m) return t;
108
+ if (!p) return t;
109
109
  let r = e.value?.name ?? e.name;
110
- return r != null && m.has(r) ? t : y.color.modifyAlpha(t, .15);
110
+ return r != null && p.has(r) ? t : b.color.modifyAlpha(t, .15);
111
111
  } };
112
112
  };
113
113
  return {
@@ -135,7 +135,7 @@ function x(n) {
135
135
  show: _
136
136
  },
137
137
  grid: {
138
- ...x,
138
+ ...y,
139
139
  bottom: F
140
140
  },
141
141
  ...M ? { dataZoom: M } : {},
@@ -149,14 +149,14 @@ function x(n) {
149
149
  }
150
150
  },
151
151
  tooltip: {
152
- ...C,
153
- formatter: S(O, k)
152
+ ...S,
153
+ formatter: C(O, k)
154
154
  }
155
155
  };
156
156
  };
157
157
  }
158
- function S(e, t) {
159
- return u((n) => {
158
+ function C(e, t) {
159
+ return d((n) => {
160
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 ?? "";
161
161
  return {
162
162
  name: String(s),
@@ -168,7 +168,7 @@ function S(e, t) {
168
168
  }
169
169
  //#endregion
170
170
  //#region src/widgets/bar/skeleton.tsx
171
- var C = {
171
+ var w = {
172
172
  container: {
173
173
  display: "flex",
174
174
  alignItems: "center",
@@ -200,51 +200,51 @@ var C = {
200
200
  alignItems: "center",
201
201
  gap: ({ spacing: e }) => e(1.5)
202
202
  }
203
- }, w = [
203
+ }, T = [
204
204
  "20%",
205
205
  "40%",
206
206
  "60%",
207
207
  "20%",
208
208
  "80%"
209
209
  ];
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)
210
+ function E() {
211
+ let e = h(2), t;
212
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ v(g, {
213
+ sx: w.grid,
214
+ children: T.map(O)
215
215
  }), e[0] = t) : t = e[0];
216
216
  let n;
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)
217
+ return e[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ y(g, {
218
+ sx: w.container,
219
+ children: [t, /* @__PURE__ */ v(g, {
220
+ sx: w.legend,
221
+ children: [0, 1].map(D)
222
222
  })]
223
223
  }), e[1] = n) : n = e[1], n;
224
224
  }
225
- function E(e) {
226
- return /* @__PURE__ */ v(h, {
227
- sx: C.legendItem,
228
- children: [/* @__PURE__ */ _(g, {
225
+ function D(e) {
226
+ return /* @__PURE__ */ y(g, {
227
+ sx: w.legendItem,
228
+ children: [/* @__PURE__ */ v(_, {
229
229
  variant: "circular",
230
230
  width: 8,
231
231
  height: 8
232
- }), /* @__PURE__ */ _(g, {
232
+ }), /* @__PURE__ */ v(_, {
233
233
  width: 48,
234
234
  height: 8
235
235
  })]
236
236
  }, `legend-${e}`);
237
237
  }
238
- function D(e, t) {
239
- return /* @__PURE__ */ _(g, {
240
- sx: C.bar,
238
+ function O(e, t) {
239
+ return /* @__PURE__ */ v(_, {
240
+ sx: w.bar,
241
241
  variant: "rectangular",
242
242
  height: e
243
243
  }, `bar-${t}`);
244
244
  }
245
245
  //#endregion
246
246
  //#region src/widgets/bar/download.tsx
247
- function O(e) {
247
+ function k(e) {
248
248
  return r(e, n({
249
249
  filename: e.filename,
250
250
  getRows: (t) => {
@@ -258,6 +258,6 @@ function O(e) {
258
258
  }));
259
259
  }
260
260
  //#endregion
261
- export { T as BarSkeleton, b as barOptions, O as createBarDownloadConfig, x as createBarOptionFactory };
261
+ export { E as BarSkeleton, x as barOptions, k as createBarDownloadConfig, S as createBarOptionFactory };
262
262
 
263
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","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,SA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;EACX,SAAQ;EACA;CACT,GAJM,OAAOP,GAIb;;;;ACvCX,SAAgBoB,EACd,GACgB;CAChB,OAAO1E,EACL2E,GACAC,EAAqB;EACnB,UAAUD,EAAK;EACf,UAAU,MAAQ;GAChB,IAAM5C,IAAO4C,EAAK,QAAQlC,CAAG,GACvBoC,IAAoB,CAAC;GAC3B,KAAK,IAAM,CAACvB,GAAG9B,MAAWO,EAAK,QAAQ,GAAG;IAExC,AADIuB,IAAI,KAAGuB,EAAK,KAAK,CAAC,CAAC,GACvBA,EAAK,KAAK,CAAC,QAAQ,OAAO,CAAC;IAC3B,KAAK,IAAMC,KAAKtD,GAAQ,EAAK,KAAK,CAACsD,EAAE,MAAMA,EAAE,KAAK,CAAC;GACrD;GACA,OAAOD;EACT;CACF,CAAC,CACH;AACF"}
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","fixedAxisBounds","withPngItem","positionDataZoomForLegend","mergeOptions","resolveThemeColor","niceNum","buildLegendConfig","buildAxisLabelStyle","createTooltipFormatter","buildGridConfig","createTooltipPositioner","createItemColorResolver","echarts","barOptions","niceMin","niceMax","spacingPx","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 { spacingPx } from '../utils/spacing-px'\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: spacingPx(theme, 1),\n top: spacingPx(theme, 3),\n right: spacingPx(theme, 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: [spacingPx(theme, 1), spacingPx(theme, 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: [spacingPx(theme, 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: spacingPx(theme, 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.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GACnD,kBAACA,GAAD;GAAU,OAAO;GAAI,QAAQ;EAAI,CAAA,CAC9B;CAHK,GAAA,UAAU7E,GAGf;;AAdU,SAAA0E,EAAC,GAAQ,GAAA;CACxB,OAAA,kBAACG,GAAD;EAEE,IAAIX,EAAO;EACX,SAAQ;EACA;CACT,GAJM,OAAOP,GAIb;;;;ACvCX,SAAgBoB,EACd,GACgB;CAChB,OAAO3E,EACL4E,GACAC,EAAqB;EACnB,UAAUD,EAAK;EACf,UAAU,MAAQ;GAChB,IAAM5C,IAAO4C,EAAK,QAAQlC,CAAG,GACvBoC,IAAoB,CAAC;GAC3B,KAAK,IAAM,CAACvB,GAAG9B,MAAWO,EAAK,QAAQ,GAAG;IAExC,AADIuB,IAAI,KAAGuB,EAAK,KAAK,CAAC,CAAC,GACvBA,EAAK,KAAK,CAAC,QAAQ,OAAO,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-BHBd5Pcc.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-UIGvFN3D.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 };
@@ -1,2 +1,2 @@
1
- import { c as e, d as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../formula-DJS-JLpk.js";
1
+ import { c as e, d as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../formula-CSHhAoyW.js";
2
2
  export { t as Delta, o as Formula, i as FormulaSkeleton, n as FormulaUI, l as Note, r as Prefix, e as Series, s as Suffix, a as Value, c as createFormulaDownloadConfig };