@carto/ps-react-ui 4.22.0 → 4.23.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 (103) hide show
  1. package/dist/actions-D7LB9DvT.js +1161 -0
  2. package/dist/actions-D7LB9DvT.js.map +1 -0
  3. package/dist/category-Ca5XDx0N.js +839 -0
  4. package/dist/category-Ca5XDx0N.js.map +1 -0
  5. package/dist/{download-C7he8mSh.js → download--wRRnf19.js} +81 -80
  6. package/dist/download--wRRnf19.js.map +1 -0
  7. package/dist/{echart-BnJYXH7H.js → echart-CgOQw9XB.js} +3 -2
  8. package/dist/echart-CgOQw9XB.js.map +1 -0
  9. package/dist/{formula-Cqj84ZGX.js → formula-DRuMIVo8.js} +6 -6
  10. package/dist/formula-DRuMIVo8.js.map +1 -0
  11. package/dist/{markdown-CV_KP-at.js → markdown-C3OX9jyy.js} +6 -6
  12. package/dist/markdown-C3OX9jyy.js.map +1 -0
  13. package/dist/{spread-C8T12Nfh.js → spread-BT07rCJw.js} +7 -7
  14. package/dist/spread-BT07rCJw.js.map +1 -0
  15. package/dist/{table-CNQijNNB.js → table-CRG9eOs9.js} +3 -3
  16. package/dist/table-CRG9eOs9.js.map +1 -0
  17. package/dist/types/widgets-v2/actions/download/csv-item.d.ts +3 -3
  18. package/dist/types/widgets-v2/actions/download/index.d.ts +1 -1
  19. package/dist/types/widgets-v2/actions/download/png-item.d.ts +2 -2
  20. package/dist/types/widgets-v2/actions/download/types.d.ts +12 -1
  21. package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +20 -13
  22. package/dist/types/widgets-v2/actions/index.d.ts +1 -1
  23. package/dist/types/widgets-v2/bar/download.d.ts +3 -3
  24. package/dist/types/widgets-v2/category/category-ui.d.ts +9 -1
  25. package/dist/types/widgets-v2/category/download.d.ts +3 -3
  26. package/dist/types/widgets-v2/echart/style.d.ts +1 -0
  27. package/dist/types/widgets-v2/formula/download.d.ts +3 -3
  28. package/dist/types/widgets-v2/histogram/download.d.ts +3 -3
  29. package/dist/types/widgets-v2/index.d.ts +1 -1
  30. package/dist/types/widgets-v2/markdown/download.d.ts +3 -3
  31. package/dist/types/widgets-v2/pie/download.d.ts +3 -3
  32. package/dist/types/widgets-v2/scatterplot/download.d.ts +3 -3
  33. package/dist/types/widgets-v2/spread/download.d.ts +3 -3
  34. package/dist/types/widgets-v2/table/download.d.ts +3 -3
  35. package/dist/types/widgets-v2/timeseries/download.d.ts +3 -3
  36. package/dist/types/widgets-v2/toolbox/toolbox.d.ts +1 -1
  37. package/dist/widgets-v2/actions.js +2 -2
  38. package/dist/widgets-v2/bar.js +7 -7
  39. package/dist/widgets-v2/bar.js.map +1 -1
  40. package/dist/widgets-v2/category.js +1 -1
  41. package/dist/widgets-v2/echart.js +1 -1
  42. package/dist/widgets-v2/formula.js +1 -1
  43. package/dist/widgets-v2/histogram.js +10 -10
  44. package/dist/widgets-v2/histogram.js.map +1 -1
  45. package/dist/widgets-v2/markdown.js +1 -1
  46. package/dist/widgets-v2/pie.js +10 -10
  47. package/dist/widgets-v2/pie.js.map +1 -1
  48. package/dist/widgets-v2/scatterplot.js +9 -9
  49. package/dist/widgets-v2/scatterplot.js.map +1 -1
  50. package/dist/widgets-v2/spread.js +1 -1
  51. package/dist/widgets-v2/table.js +1 -1
  52. package/dist/widgets-v2/timeseries.js +12 -12
  53. package/dist/widgets-v2/timeseries.js.map +1 -1
  54. package/dist/widgets-v2.js +274 -333
  55. package/dist/widgets-v2.js.map +1 -1
  56. package/package.json +3 -3
  57. package/src/widgets-v2/actions/download/csv-item.test.tsx +3 -3
  58. package/src/widgets-v2/actions/download/csv-item.tsx +6 -6
  59. package/src/widgets-v2/actions/download/download.tsx +5 -3
  60. package/src/widgets-v2/actions/download/index.ts +1 -1
  61. package/src/widgets-v2/actions/download/png-item.test.tsx +5 -3
  62. package/src/widgets-v2/actions/download/png-item.tsx +4 -4
  63. package/src/widgets-v2/actions/download/types.ts +15 -1
  64. package/src/widgets-v2/actions/fullscreen/fullscreen-store.test.tsx +155 -0
  65. package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +39 -41
  66. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +211 -96
  67. package/src/widgets-v2/actions/index.ts +1 -0
  68. package/src/widgets-v2/actions/searcher/searcher.tsx +17 -2
  69. package/src/widgets-v2/bar/download.test.tsx +5 -3
  70. package/src/widgets-v2/bar/download.tsx +5 -4
  71. package/src/widgets-v2/category/category-ui.tsx +20 -9
  72. package/src/widgets-v2/category/category.tsx +37 -2
  73. package/src/widgets-v2/category/download.test.ts +4 -2
  74. package/src/widgets-v2/category/download.ts +5 -4
  75. package/src/widgets-v2/echart/style.ts +6 -0
  76. package/src/widgets-v2/formula/download.test.tsx +3 -1
  77. package/src/widgets-v2/formula/download.tsx +5 -4
  78. package/src/widgets-v2/histogram/download.test.ts +6 -4
  79. package/src/widgets-v2/histogram/download.ts +5 -4
  80. package/src/widgets-v2/index.ts +1 -0
  81. package/src/widgets-v2/markdown/download.test.ts +2 -2
  82. package/src/widgets-v2/markdown/download.tsx +5 -4
  83. package/src/widgets-v2/pie/download.test.ts +7 -3
  84. package/src/widgets-v2/pie/download.ts +5 -4
  85. package/src/widgets-v2/scatterplot/download.test.ts +4 -2
  86. package/src/widgets-v2/scatterplot/download.ts +5 -4
  87. package/src/widgets-v2/spread/download.test.ts +3 -1
  88. package/src/widgets-v2/spread/download.ts +5 -4
  89. package/src/widgets-v2/table/download.test.ts +5 -3
  90. package/src/widgets-v2/table/download.ts +4 -3
  91. package/src/widgets-v2/timeseries/download.test.ts +6 -4
  92. package/src/widgets-v2/timeseries/download.ts +5 -4
  93. package/src/widgets-v2/toolbox/toolbox.tsx +1 -1
  94. package/dist/actions-iN1jwyxA.js +0 -1024
  95. package/dist/actions-iN1jwyxA.js.map +0 -1
  96. package/dist/category-DZt6yiST.js +0 -826
  97. package/dist/category-DZt6yiST.js.map +0 -1
  98. package/dist/download-C7he8mSh.js.map +0 -1
  99. package/dist/echart-BnJYXH7H.js.map +0 -1
  100. package/dist/formula-Cqj84ZGX.js.map +0 -1
  101. package/dist/markdown-CV_KP-at.js.map +0 -1
  102. package/dist/spread-C8T12Nfh.js.map +0 -1
  103. package/dist/table-CNQijNNB.js.map +0 -1
@@ -1,4 +1,15 @@
1
1
  import { ReactElement } from 'react';
2
+ /**
3
+ * Passed to {@link DownloadItem.resolve} by `<Widget.Download>`.
4
+ */
5
+ export interface DownloadContext {
6
+ /**
7
+ * Id of the widget store the menu was opened from — the dialog's own
8
+ * store when opened from `FullScreen.Slot`'s header, so an export matches
9
+ * what the user is looking at. `null` outside a `<Widget.Provider>`.
10
+ */
11
+ id: string | null;
12
+ }
2
13
  export interface DownloadItem {
3
14
  /** Unique key (also used as menu label key). */
4
15
  id: string;
@@ -27,7 +38,7 @@ export interface DownloadItem {
27
38
  * Resolves to a Blob URL the trigger will click. Optional `revoke` is
28
39
  * called after the click is dispatched.
29
40
  */
30
- resolve: () => Promise<{
41
+ resolve: (ctx: DownloadContext) => Promise<{
31
42
  url: string;
32
43
  filename: string;
33
44
  revoke?: () => void;
@@ -9,11 +9,18 @@ export interface FullScreenTriggerProps {
9
9
  }
10
10
  export interface FullScreenSlotProps {
11
11
  /**
12
- * Render-prop body. Receives the live `isFullScreen` flag so the consumer
13
- * can branch per-mode props (e.g., `Widget.Toolbox visibleCount`) without
14
- * duplicating the JSX.
12
+ * The widget body. Rendered twice, identically: in the card, and again in
13
+ * the dialog while it's open. The components inside don't know which copy
14
+ * they are; the dialog's just runs on a widget store of its own — a copy
15
+ * of the card's taken on open, handed back to the card on close — so read
16
+ * the widget id with `useWidgetId()` inside the body rather than closing
17
+ * over the card's `id`.
18
+ *
19
+ * @deprecated The function form `(isFullScreen) => ReactNode` still works
20
+ * (`false` for the card, `true` for the dialog copy) but will be removed
21
+ * in the next major: pass the body as plain children.
15
22
  */
16
- children: (isFullScreen: boolean) => ReactNode;
23
+ children: ReactNode | ((isFullScreen: boolean) => ReactNode);
17
24
  /** Header text rendered above the body when the modal is open. */
18
25
  title?: ReactNode;
19
26
  /**
@@ -46,15 +53,15 @@ export interface FullScreenSlotProps {
46
53
  * `<Widget.Content>`).
47
54
  */
48
55
  declare function FullScreenTrigger({ labels, enterIcon: EnterIcon, exitIcon: ExitIcon, iconProps, }: FullScreenTriggerProps): import("react").JSX.Element;
56
+ /** Id of the widget store the dialog copy runs on. */
57
+ export declare function fullScreenStoreId(id: string): string;
49
58
  /**
50
- * Body wrapper. Renders its render-prop children once, via a single
51
- * `createPortal` call whose container is a stable `<div>` we hold as a ref.
52
- * That div is moved imperatively between an inline placeholder and the
53
- * `<DialogContent>` of an MUI `<Dialog keepMounted>`. Because both the
54
- * React parent (the portal call site) AND the portal container are
55
- * identical across the toggle, the subtree keeps its fiber identity and
56
- * ECharts (or any other heavy child) stays mounted while only its DOM
57
- * parent changes.
59
+ * Body wrapper. The card keeps its copy of the body while the dialog is
60
+ * open, and the dialog mounts a second one on a store of its own: a copy
61
+ * of the card's UI state taken on open, and handed back to the card when
62
+ * the dialog closes. While open the two don't affect each other. MUI
63
+ * mounts the dialog copy on open and unmounts it after the close
64
+ * transition, which drops its store.
58
65
  */
59
66
  declare function FullScreenSlot({ children, title, actions, paperSx, labels, closeIcon: CloseSvg, iconProps, }: FullScreenSlotProps): import("react").JSX.Element;
60
67
  /**
@@ -66,7 +73,7 @@ declare function FullScreenSlot({ children, title, actions, paperSx, labels, clo
66
73
  * </Widget.Actions>
67
74
  * <Widget.Content>
68
75
  * <Widget.FullScreen.Slot title={title} actions={<Widget.Download items={items} />}>
69
- * {(isFullScreen) => <Body visibleCount={isFullScreen ? undefined : 2} />}
76
+ * <Body />
70
77
  * </Widget.FullScreen.Slot>
71
78
  * </Widget.Content>
72
79
  * ```
@@ -4,7 +4,7 @@ export { ShowAllToggle, setShowAll, SHOW_ALL_ID, DEFAULT_SHOW_ALL_LABELS, type S
4
4
  export { ZoomToggle, addZoom, createAddZoom, ZOOM_LAYOUT, DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleProps, type ZoomToggleLabels, } from './zoom-toggle/index.js';
5
5
  export { BrushToggle, addBrush, DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleProps, type BrushToggleLabels, } from './brush-toggle/index.js';
6
6
  export { RelativeData, toRelativeData, createPercentFormatter, DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataProps, type RelativeDataLabels, } from './relative-data/index.js';
7
- export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type DownloadLabels, } from './download/index.js';
7
+ export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadContext, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type DownloadLabels, } from './download/index.js';
8
8
  export { FullScreen, DEFAULT_FULLSCREEN_LABELS, type FullScreenTriggerProps, type FullScreenSlotProps, type FullScreenLabels, type FullScreenWidgetState, } from './fullscreen/index.js';
9
9
  export { LockSelection, filterByLockedItems, DEFAULT_LOCK_SELECTION_LABELS, type LockSelectionProps, type LockSelectionKey, type LockSelectionLabels, } from './lock-selection/index.js';
10
10
  export { ChangeColumn, DEFAULT_CHANGE_COLUMN_LABELS, type ChangeColumnProps, type ChangeColumnItem, type ChangeColumnLabels, type ChangeColumnWidgetState, } from './change-column/index.js';
@@ -1,15 +1,15 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { BarWidgetData } from './types.js';
3
3
  export interface BarDownloadConfigArgs {
4
4
  filename: string;
5
- getData: () => BarWidgetData;
5
+ getData: (ctx: DownloadContext) => BarWidgetData;
6
6
  /**
7
7
  * Optional getter for the widget's capture element (registered by
8
8
  * `Widget.State` on its success path). When provided, a PNG item is
9
9
  * prepended to the returned list. Wire it to
10
10
  * `() => getCaptureEl(id)`.
11
11
  */
12
- getCaptureEl?: () => HTMLElement | null;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  /** PNG `pixelRatio` (default 2). */
14
14
  pngPixelRatio?: number;
15
15
  /** PNG `backgroundColor` (default transparent). */
@@ -69,6 +69,14 @@ export interface CategoryUIProps {
69
69
  * No-op for single-series data — same convention as the legend.
70
70
  */
71
71
  stacked?: boolean;
72
+ /**
73
+ * Series indices hidden via the legend. Leave both this and
74
+ * `onHiddenSeriesChange` unset and CategoryUI keeps the set itself; pass
75
+ * them to own it — `Category` does, so the card and the fullscreen copy
76
+ * share it through the widget store.
77
+ */
78
+ hiddenSeries?: ReadonlySet<number>;
79
+ onHiddenSeriesChange?: (next: ReadonlySet<number>) => void;
72
80
  }
73
81
  /**
74
82
  * Pure presentational component for the Category widget. Renders
@@ -85,4 +93,4 @@ export interface CategoryUIProps {
85
93
  * Returns `null` when there's nothing to render — `Widget.State` is the
86
94
  * empty-state authority in the canonical compositor.
87
95
  */
88
- export declare function CategoryUI({ data, selection, onSelectionChange, formatter, labelFormatter, series, maxItems, labels, onShowAll, maxOverride, size, stacked, }: CategoryUIProps): import("react").JSX.Element | null;
96
+ export declare function CategoryUI({ data, selection, onSelectionChange, formatter, labelFormatter, series, maxItems, labels, onShowAll, maxOverride, size, stacked, hiddenSeries: hiddenSeriesProp, onHiddenSeriesChange, }: CategoryUIProps): import("react").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { CategoryWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Category widget. Always includes a CSV item
@@ -8,9 +8,9 @@ import { CategoryWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createCategoryDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => CategoryWidgetData;
11
+ getData: (ctx: DownloadContext) => CategoryWidgetData;
12
12
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
13
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
14
14
  pngPixelRatio?: number;
15
15
  pngBackgroundColor?: string | null;
16
16
  }): DownloadItem[];
@@ -3,5 +3,6 @@ export declare const styles: {
3
3
  width: string;
4
4
  flex: number;
5
5
  minHeight: number;
6
+ isolation: "isolate";
6
7
  };
7
8
  };
@@ -1,13 +1,13 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { FormulaWidgetData } from './types.js';
3
3
  export interface FormulaDownloadConfigArgs {
4
4
  filename: string;
5
- getData: () => FormulaWidgetData;
5
+ getData: (ctx: DownloadContext) => FormulaWidgetData;
6
6
  /**
7
7
  * Optional getter for the widget's capture element (registered by
8
8
  * `Widget.State`). When provided, a PNG item is prepended.
9
9
  */
10
- getCaptureEl?: () => HTMLElement | null;
10
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
11
11
  pngPixelRatio?: number;
12
12
  pngBackgroundColor?: string | null;
13
13
  }
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { HistogramWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for histograms. Always includes a CSV item with
@@ -8,10 +8,10 @@ import { HistogramWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createHistogramDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => HistogramWidgetData;
11
+ getData: (ctx: DownloadContext) => HistogramWidgetData;
12
12
  getTicks: () => readonly number[];
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -96,7 +96,7 @@ export type { ToolboxLabels } from './toolbox/labels.js';
96
96
  export type { EchartProps, EchartUIProps, EchartsEventHandler } from './echart/index.js';
97
97
  export type { NoteProps, NoteMarkdownProps } from './note/widget-note.js';
98
98
  export type { NoteLabels } from './note/labels.js';
99
- export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions/index.js';
99
+ export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, DownloadContext, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions/index.js';
100
100
  export type { FormulaUIProps, FormulaDataItem, FormulaWidgetData, } from './formula/index.js';
101
101
  export type { MarkdownUIProps, MarkdownWidgetData } from './markdown/index.js';
102
102
  export type { PieDatum, PieWidgetData } from './pie/index.js';
@@ -1,4 +1,4 @@
1
- import { toCsvString, triggerLinkDownload, DownloadItem } from '../actions/download/index.js';
1
+ import { toCsvString, triggerLinkDownload, DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { MarkdownWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Markdown widget. Always includes a `.md`
@@ -8,8 +8,8 @@ import { MarkdownWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createMarkdownDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => MarkdownWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
11
+ getData: (ctx: DownloadContext) => MarkdownWidgetData;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  pngPixelRatio?: number;
14
14
  pngBackgroundColor?: string | null;
15
15
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { PieWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Pie widget. Always includes a CSV item with
@@ -9,9 +9,9 @@ import { PieWidgetData } from './types.js';
9
9
  */
10
10
  export declare function createPieDownloadConfig(args: {
11
11
  filename: string;
12
- getData: () => PieWidgetData;
12
+ getData: (ctx: DownloadContext) => PieWidgetData;
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { ScatterplotWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Scatterplot widget. Always includes a CSV
@@ -8,9 +8,9 @@ import { ScatterplotWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createScatterplotDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => ScatterplotWidgetData;
11
+ getData: (ctx: DownloadContext) => ScatterplotWidgetData;
12
12
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
13
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
14
14
  pngPixelRatio?: number;
15
15
  pngBackgroundColor?: string | null;
16
16
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { SpreadWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Spread widget. Always includes a CSV item
@@ -8,8 +8,8 @@ import { SpreadWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createSpreadDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => SpreadWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
11
+ getData: (ctx: DownloadContext) => SpreadWidgetData;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  pngPixelRatio?: number;
14
14
  pngBackgroundColor?: string | null;
15
15
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { TableColumn, TableWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Table widget. Always includes a CSV item
@@ -10,9 +10,9 @@ import { TableColumn, TableWidgetData } from './types.js';
10
10
  */
11
11
  export declare function createTableDownloadConfig(opts: {
12
12
  filename: string;
13
- getData: () => TableWidgetData;
13
+ getData: (ctx: DownloadContext) => TableWidgetData;
14
14
  columns: readonly TableColumn[];
15
- getCaptureEl?: () => HTMLElement | null;
15
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
16
16
  pngPixelRatio?: number;
17
17
  pngBackgroundColor?: string | null;
18
18
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { TimeseriesWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Timeseries widget. Always includes a CSV
@@ -9,9 +9,9 @@ import { TimeseriesWidgetData } from './types.js';
9
9
  */
10
10
  export declare function createTimeseriesDownloadConfig(args: {
11
11
  filename: string;
12
- getData: () => TimeseriesWidgetData;
12
+ getData: (ctx: DownloadContext) => TimeseriesWidgetData;
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -28,7 +28,7 @@ export interface ToolboxProps {
28
28
  * Smart overflow toolbar with **single-mount** items. Children mount once
29
29
  * into a stable, hidden host element and are *physically reparented* via
30
30
  * `appendChild` between the inline preview area and the overflow `<Paper>`
31
- * as the popper opens / closes — same pattern as `Widget.FullScreen.Slot`.
31
+ * as the popper opens / closes.
32
32
  * Items with no inline space when closed are kept mounted but visually
33
33
  * hidden via `display: none`.
34
34
  *
@@ -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-iN1jwyxA.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-D7LB9DvT.js";
2
2
  import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-KA63b6-J.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, r as z, s as B, t as V, u as H } from "../download-C7he8mSh.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, r as z, s as B, t as V, u as H } from "../download--wRRnf19.js";
4
4
  export { l as BrushToggle, F as CSVIcon, b as ChangeColumn, _ as DEFAULT_BRUSH_TOGGLE_LABELS, h as DEFAULT_CHANGE_COLUMN_LABELS, M 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, z as DOWNLOAD_ITEM_IDS, B as Download, g as FullScreen, v as LockSelection, j as MarkdownIcon, R 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, V as buildCsvDownloadItem, L as buildPngDownloadItem, E as createAddZoom, x as createPercentFormatter, I as downloadDOMToPNG, H as downloadToCSV, a as filterByLockedItems, t as filterBySearchText, C as setSearcherText, i as setShowAll, N as toCsvString, c as toRelativeData, P as triggerLinkDownload };
@@ -1,5 +1,5 @@
1
1
  import { r as e } from "../zoom-toggle-KA63b6-J.js";
2
- import { n as t, t as n } from "../download-C7he8mSh.js";
2
+ import { n as t, t as n } from "../download--wRRnf19.js";
3
3
  import { n as r, r as i, t as a } from "../utils-ClB6nn4w.js";
4
4
  import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-BWxjodlt.js";
5
5
  import { c as f } from "react/compiler-runtime";
@@ -244,13 +244,13 @@ function E(e) {
244
244
  backgroundColor: e.pngBackgroundColor
245
245
  })), r.push(n({
246
246
  filename: e.filename,
247
- getRows: () => {
248
- let t = e.getData(), n = [];
249
- for (let [e, r] of t.entries()) {
250
- e > 0 && n.push([]), n.push(["name", "value"]);
251
- for (let e of r) n.push([e.name, e.value]);
247
+ getRows: (t) => {
248
+ let n = e.getData(t), r = [];
249
+ for (let [e, t] of n.entries()) {
250
+ e > 0 && r.push([]), r.push(["name", "value"]);
251
+ for (let e of t) r.push([e.name, e.value]);
252
252
  }
253
- return n;
253
+ return r;
254
254
  }
255
255
  })), r;
256
256
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bar.js","names":["EChartsOption","echarts","CallbackDataParams","buildAxisLabelStyle","buildGridConfig","buildLegendConfig","createTooltipFormatter","createTooltipPositioner","niceNum","ZOOM_LAYOUT","OptionFactory","mergeOptions","resolveThemeColor","positionDataZoomForLegend","BarEChartsOption","BarOptionFactoryInput","BarOptionsInput","BarWidgetData","barOptions","theme","formatter","labelFormatter","niceMin","niceMax","grid","left","parseInt","spacing","top","right","containLabel","tooltip","trigger","backgroundColor","palette","grey","borderWidth","padding","textStyle","color","common","white","fontSize","fontFamily","typography","caption","axisPointer","type","position","buildBarTooltipFormatter","legend","hasLegend","lineStyle","secondary","main","Object","values","qualitative","bold","Record","xAxis","axisLine","show","axisTick","axisLabel","margin","interval","hideOverlap","v","String","yAxis","min","extent","max","splitLine","black","divider","showMaxLabel","showMinLabel","verticalAlign","inside","value","createBarOptionFactory","options","optionsOverride","series","selection","selectionSet","length","Set","option","data","ctx","structural","Partial","seriesArr","Array","isArray","dataset","baseLegend","baseGrid","baseTooltip","baseYAxis","seriesTemplates","broadcastTemplate","liveFormatter","liveLabelFormatter","dataZoomLayout","dataZoom","fallbackBottom","bottom","baseBottom","gridBottom","sliderHeight","sliderGap","dimItemStyle","params","base","datum","name","has","modifyAlpha","map","s","source","_","i","template","overrideColor","const","datasetIndex","encode","x","y","barMaxWidth","emphasis","focus","itemStyle","item","row","raw","formattedValue","marker","seriesName","Box","Skeleton","SxProps","Theme","styles","container","display","alignItems","justifyContent","flexDirection","gap","spacing","height","grid","flex","width","bar","maxWidth","marginLeft","legend","legendItem","Record","BAR_HEIGHTS","const","BarSkeleton","$","_c","t0","Symbol","for","map","_temp","t1","_temp2","i_0","i","buildCsvDownloadItem","buildPngDownloadItem","DownloadItem","BarWidgetData","BarDownloadConfigArgs","filename","getData","getCaptureEl","HTMLElement","pngPixelRatio","pngBackgroundColor","createBarDownloadConfig","args","items","push","pixelRatio","backgroundColor","getRows","data","rows","i","series","entries","d","name","value"],"sources":["../../src/widgets-v2/bar/options.ts","../../src/widgets-v2/bar/skeleton.tsx","../../src/widgets-v2/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 '../../widgets/utils/chart-config'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport { positionDataZoomForLegend } from '../utils/data-zoom-layout'\nimport type {\n 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 // resolved palette color 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.\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 dimItemStyle = {\n color: (params: CallbackDataParams) => {\n const base = params.color as string\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 return {\n ...option,\n dataset: seriesArr.map((s) => ({ source: s as readonly object[] })),\n series: seriesArr.map((_, i) => {\n const template =\n (seriesTemplates[i] as object | undefined) ??\n (broadcastTemplate as object)\n // 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: dimItemStyle,\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 buildPngDownloadItem,\n type DownloadItem,\n} from '../actions/download'\nimport type { BarWidgetData } from './types'\n\nexport interface BarDownloadConfigArgs {\n filename: string\n getData: () => BarWidgetData\n /**\n * Optional getter for the widget's capture element (registered by\n * `Widget.State` on its success path). When provided, a PNG item is\n * prepended to the returned list. Wire it to\n * `() => getCaptureEl(id)`.\n */\n getCaptureEl?: () => HTMLElement | null\n /** PNG `pixelRatio` (default 2). */\n pngPixelRatio?: number\n /** PNG `backgroundColor` (default transparent). */\n pngBackgroundColor?: string | null\n}\n\n/**\n * Builds download items for the Bar widget. Always includes a CSV item\n * with one `name,value` block per series, separated by an empty row when\n * there are multiple. When `getCaptureEl` is supplied, also prepends a PNG\n * item that rasterises the captured element via `html2canvas`.\n */\nexport function createBarDownloadConfig(\n args: BarDownloadConfigArgs,\n): DownloadItem[] {\n const items: DownloadItem[] = []\n if (args.getCaptureEl) {\n items.push(\n buildPngDownloadItem({\n filename: args.filename,\n getCaptureEl: args.getCaptureEl,\n pixelRatio: args.pngPixelRatio,\n backgroundColor: args.pngBackgroundColor,\n }),\n )\n }\n items.push(\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: () => {\n const data = args.getData()\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 return items\n}\n"],"mappings":";;;;;;;;;AAsCA,SAAgBkB,EAAW,EACzBC,UACAC,cACAC,qBACoC;CAGpC,IAAIC,IAAU,GACVC,IAAU;CAEd,OAAO;EACLC,MAAM;GACJC,MAAMC,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAC/BC,KAAKF,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAC9BE,OAAOH,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAEhC,GAAGvB,EAAgB,IAAOe,CAAK;GAC/BW,cAAc;EAChB;EACAC,SAAS;GACPC,SAAS;GACTC,iBAAiBd,EAAMe,QAAQC,KAAK;GACpCC,aAAa;GACbC,SAAS,CAACX,SAASP,EAAMQ,QAAQ,CAAC,CAAC,GAAGD,SAASP,EAAMQ,QAAQ,CAAC,CAAC,CAAC;GAChEW,WAAW;IACTC,OAA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C,CAAA,CAF5B;CAAM,GAAA,UAAUe,GAAhB;AAGE;AAlBT,SAAAJ,EAAAnB,GAAAuB,GAAA;CAAA,OAKG,kBAAC,GAAD;EAEM,IAAA/B,EAAMY;EACF,SAAA;EACAJ;CAAM,GAHT,OAAOuB,GAGE;AACd;;;AC1BZ,SAAgBY,EACdC,GACgB;CAChB,IAAMC,IAAwB,CAAA;CA0B9B,OAzBID,EAAKL,gBACPM,EAAMC,KACJb,EAAqB;EACnBI,UAAUO,EAAKP;EACfE,cAAcK,EAAKL;EACnBQ,YAAYH,EAAKH;EACjBO,iBAAiBJ,EAAKF;CACxB,CAAC,CACH,GAEFG,EAAMC,KACJd,EAAqB;EACnBK,UAAUO,EAAKP;EACfY,eAAe;GACb,IAAMC,IAAON,EAAKN,QAAQ,GACpBa,IAAoB,CAAA;GAC1B,KAAK,IAAM,CAACC,GAAGC,MAAWH,EAAKI,QAAQ,GAAG;IAExCH,AADIC,IAAI,KAAGD,EAAKL,KAAK,CAAA,CAAE,GACvBK,EAAKL,KAAK,CAAC,QAAQ,OAAO,CAAC;IAC3B,KAAK,IAAMS,KAAKF,GAAQF,EAAKL,KAAK,CAACS,EAAEC,MAAMD,EAAEE,KAAK,CAAC;GACrD;GACA,OAAON;EACT;CACF,CAAC,CACH,GACON;AACT"}
1
+ {"version":3,"file":"bar.js","names":["EChartsOption","echarts","CallbackDataParams","buildAxisLabelStyle","buildGridConfig","buildLegendConfig","createTooltipFormatter","createTooltipPositioner","niceNum","ZOOM_LAYOUT","OptionFactory","mergeOptions","resolveThemeColor","positionDataZoomForLegend","BarEChartsOption","BarOptionFactoryInput","BarOptionsInput","BarWidgetData","barOptions","theme","formatter","labelFormatter","niceMin","niceMax","grid","left","parseInt","spacing","top","right","containLabel","tooltip","trigger","backgroundColor","palette","grey","borderWidth","padding","textStyle","color","common","white","fontSize","fontFamily","typography","caption","axisPointer","type","position","buildBarTooltipFormatter","legend","hasLegend","lineStyle","secondary","main","Object","values","qualitative","bold","Record","xAxis","axisLine","show","axisTick","axisLabel","margin","interval","hideOverlap","v","String","yAxis","min","extent","max","splitLine","black","divider","showMaxLabel","showMinLabel","verticalAlign","inside","value","createBarOptionFactory","options","optionsOverride","series","selection","selectionSet","length","Set","option","data","ctx","structural","Partial","seriesArr","Array","isArray","dataset","baseLegend","baseGrid","baseTooltip","baseYAxis","seriesTemplates","broadcastTemplate","liveFormatter","liveLabelFormatter","dataZoomLayout","dataZoom","fallbackBottom","bottom","baseBottom","gridBottom","sliderHeight","sliderGap","dimItemStyle","params","base","datum","name","has","modifyAlpha","map","s","source","_","i","template","overrideColor","const","datasetIndex","encode","x","y","barMaxWidth","emphasis","focus","itemStyle","item","row","raw","formattedValue","marker","seriesName","Box","Skeleton","SxProps","Theme","styles","container","display","alignItems","justifyContent","flexDirection","gap","spacing","height","grid","flex","width","bar","maxWidth","marginLeft","legend","legendItem","Record","BAR_HEIGHTS","const","BarSkeleton","$","_c","t0","Symbol","for","map","_temp","t1","_temp2","i_0","i","buildCsvDownloadItem","buildPngDownloadItem","DownloadContext","DownloadItem","BarWidgetData","BarDownloadConfigArgs","filename","getData","ctx","getCaptureEl","HTMLElement","pngPixelRatio","pngBackgroundColor","createBarDownloadConfig","args","items","push","pixelRatio","backgroundColor","getRows","data","rows","i","series","entries","d","name","value"],"sources":["../../src/widgets-v2/bar/options.ts","../../src/widgets-v2/bar/skeleton.tsx","../../src/widgets-v2/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 '../../widgets/utils/chart-config'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport { positionDataZoomForLegend } from '../utils/data-zoom-layout'\nimport type {\n 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 // resolved palette color 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.\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 dimItemStyle = {\n color: (params: CallbackDataParams) => {\n const base = params.color as string\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 return {\n ...option,\n dataset: seriesArr.map((s) => ({ source: s as readonly object[] })),\n series: seriesArr.map((_, i) => {\n const template =\n (seriesTemplates[i] as object | undefined) ??\n (broadcastTemplate as object)\n // 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: dimItemStyle,\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 buildPngDownloadItem,\n type DownloadContext,\n type DownloadItem,\n} from '../actions/download'\nimport type { BarWidgetData } from './types'\n\nexport interface BarDownloadConfigArgs {\n filename: string\n getData: (ctx: DownloadContext) => BarWidgetData\n /**\n * Optional getter for the widget's capture element (registered by\n * `Widget.State` on its success path). When provided, a PNG item is\n * prepended to the returned list. Wire it to\n * `() => getCaptureEl(id)`.\n */\n getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null\n /** PNG `pixelRatio` (default 2). */\n pngPixelRatio?: number\n /** PNG `backgroundColor` (default transparent). */\n pngBackgroundColor?: string | null\n}\n\n/**\n * Builds download items for the Bar widget. Always includes a CSV item\n * with one `name,value` block per series, separated by an empty row when\n * there are multiple. When `getCaptureEl` is supplied, also prepends a PNG\n * item that rasterises the captured element via `html2canvas`.\n */\nexport function createBarDownloadConfig(\n args: BarDownloadConfigArgs,\n): DownloadItem[] {\n const items: DownloadItem[] = []\n if (args.getCaptureEl) {\n items.push(\n buildPngDownloadItem({\n filename: args.filename,\n getCaptureEl: args.getCaptureEl,\n pixelRatio: args.pngPixelRatio,\n backgroundColor: args.pngBackgroundColor,\n }),\n )\n }\n items.push(\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 return items\n}\n"],"mappings":";;;;;;;;;AAsCA,SAAgBkB,EAAW,EACzBC,UACAC,cACAC,qBACoC;CAGpC,IAAIC,IAAU,GACVC,IAAU;CAEd,OAAO;EACLC,MAAM;GACJC,MAAMC,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAC/BC,KAAKF,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAC9BE,OAAOH,SAASP,EAAMQ,QAAQ,CAAC,CAAC;GAEhC,GAAGvB,EAAgB,IAAOe,CAAK;GAC/BW,cAAc;EAChB;EACAC,SAAS;GACPC,SAAS;GACTC,iBAAiBd,EAAMe,QAAQC,KAAK;GACpCC,aAAa;GACbC,SAAS,CAACX,SAASP,EAAMQ,QAAQ,CAAC,CAAC,GAAGD,SAASP,EAAMQ,QAAQ,CAAC,CAAC,CAAC;GAChEW,WAAW;IACTC,OAAOpB,EAAMe,QAAQM,OAAOC;IAC5BC,UAAU;IACVC,YAAYxB,EAAMyB,WAAWC,QAAQF;GACvC;GACAG,aAAa,EAAEC,MAAM,OAAO;GAC5BC,UAAUzC,EAAwBY,CAAK;GACvCC,WAAW6B,EAAyB7B,GAAWC,CAAc;EAC/D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,SAAgBc,EACdC,GACgB;CAChB,IAAMC,IAAwB,CAAA;CA0B9B,OAzBID,EAAKL,gBACPM,EAAMC,KACJf,EAAqB;EACnBK,UAAUQ,EAAKR;EACfG,cAAcK,EAAKL;EACnBQ,YAAYH,EAAKH;EACjBO,iBAAiBJ,EAAKF;CACxB,CAAC,CACH,GAEFG,EAAMC,KACJhB,EAAqB;EACnBM,UAAUQ,EAAKR;EACfa,UAAUX,MAAQ;GAChB,IAAMY,IAAON,EAAKP,QAAQC,CAAG,GACvBa,IAAoB,CAAA;GAC1B,KAAK,IAAM,CAACC,GAAGC,MAAWH,EAAKI,QAAQ,GAAG;IAExCH,AADIC,IAAI,KAAGD,EAAKL,KAAK,CAAA,CAAE,GACvBK,EAAKL,KAAK,CAAC,QAAQ,OAAO,CAAC;IAC3B,KAAK,IAAMS,KAAKF,GAAQF,EAAKL,KAAK,CAACS,EAAEC,MAAMD,EAAEE,KAAK,CAAC;GACrD;GACA,OAAON;EACT;CACF,CAAC,CACH,GACON;AACT"}
@@ -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-DZt6yiST.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-Ca5XDx0N.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 { a as e, i as t, n, o as r, r as i, t as a } from "../echart-BnJYXH7H.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../echart-CgOQw9XB.js";
2
2
  export { i as DEFAULT_INIT_OPTS, n as Echart, t as EchartUI, e as __resetSharedResizeObserver, r as observeResize, a as useChartSelection };
@@ -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-Cqj84ZGX.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-DRuMIVo8.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 };
@@ -1,5 +1,5 @@
1
1
  import { r as e } from "../zoom-toggle-KA63b6-J.js";
2
- import { n as t, t as n } from "../download-C7he8mSh.js";
2
+ import { n as t, t as n } from "../download--wRRnf19.js";
3
3
  import { n as r, r as i, t as a } from "../utils-ClB6nn4w.js";
4
4
  import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-BWxjodlt.js";
5
5
  import { c as f } from "react/compiler-runtime";
@@ -263,16 +263,16 @@ function D(e) {
263
263
  backgroundColor: e.pngBackgroundColor
264
264
  })), r.push(n({
265
265
  filename: e.filename,
266
- getRows: () => {
267
- let t = e.getData(), n = e.getTicks(), r = t.length, i = ["bin_low", "bin_high"];
268
- for (let t = 0; t < r; t++) i.push(e.seriesNames?.[t] ?? `series_${t + 1}`);
269
- let a = [i];
270
- for (let e = 0; e < Math.max(0, n.length - 1); e++) {
271
- let i = [n[e], n[e + 1]];
272
- for (let n = 0; n < r; n++) i.push(t[n]?.[e] ?? 0);
273
- a.push(i);
266
+ getRows: (t) => {
267
+ let n = e.getData(t), r = e.getTicks(), i = n.length, a = ["bin_low", "bin_high"];
268
+ for (let t = 0; t < i; t++) a.push(e.seriesNames?.[t] ?? `series_${t + 1}`);
269
+ let o = [a];
270
+ for (let e = 0; e < Math.max(0, r.length - 1); e++) {
271
+ let t = [r[e], r[e + 1]];
272
+ for (let r = 0; r < i; r++) t.push(n[r]?.[e] ?? 0);
273
+ o.push(t);
274
274
  }
275
- return a;
275
+ return o;
276
276
  }
277
277
  })), r;
278
278
  }