@carto/ps-react-ui 4.7.1 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/category-DwaeYjpX.js +656 -0
- package/dist/category-DwaeYjpX.js.map +1 -0
- package/dist/change-column-Cidl_M-4.js +1110 -0
- package/dist/change-column-Cidl_M-4.js.map +1 -0
- package/dist/data-zoom-layout-BH0LPwSy.js +28 -0
- package/dist/data-zoom-layout-BH0LPwSy.js.map +1 -0
- package/dist/echart-CU0KmClP.js +176 -0
- package/dist/echart-CU0KmClP.js.map +1 -0
- package/dist/exports-Cx-f6m6U.js +63 -0
- package/dist/exports-Cx-f6m6U.js.map +1 -0
- package/dist/formula-DuC0NQLH.js +79 -0
- package/dist/formula-DuC0NQLH.js.map +1 -0
- package/dist/markdown-BD1jcknS.js +8326 -0
- package/dist/markdown-BD1jcknS.js.map +1 -0
- package/dist/merge-options-DCkkHZIf.js +34 -0
- package/dist/merge-options-DCkkHZIf.js.map +1 -0
- package/dist/{styles-BYTyKQFP.js → option-builders-F-c9ELi1.js} +25 -45
- package/dist/option-builders-F-c9ELi1.js.map +1 -0
- package/dist/png-item-CS4z1iSH.js +45 -0
- package/dist/png-item-CS4z1iSH.js.map +1 -0
- package/dist/range-DsqTjSpg.js +186 -0
- package/dist/range-DsqTjSpg.js.map +1 -0
- package/dist/spread-CTuIXZSM.js +67 -0
- package/dist/spread-CTuIXZSM.js.map +1 -0
- package/dist/style-DVnT6HC1.js +131 -0
- package/dist/style-DVnT6HC1.js.map +1 -0
- package/dist/styles-cohnxh9F.js +23 -0
- package/dist/styles-cohnxh9F.js.map +1 -0
- package/dist/table-HIpXuq4G.js +390 -0
- package/dist/table-HIpXuq4G.js.map +1 -0
- package/dist/transforms-Cdx4fkU5.js +106 -0
- package/dist/transforms-Cdx4fkU5.js.map +1 -0
- package/dist/types/widgets/echart/utils.test.d.ts +1 -0
- package/dist/types/widgets/formula/config.test.d.ts +1 -0
- package/dist/types/widgets/stores/widget-store-branches.test.d.ts +1 -0
- package/dist/types/widgets/table/config.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/brush-toggle/brush-toggle.d.ts +56 -0
- package/dist/types/widgets-v2/actions/brush-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/brush-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/brush-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/brush-toggle/transforms.d.ts +11 -0
- package/dist/types/widgets-v2/actions/brush-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/change-column/change-column-icon.d.ts +2 -0
- package/dist/types/widgets-v2/actions/change-column/change-column.d.ts +29 -0
- package/dist/types/widgets-v2/actions/change-column/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/change-column/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/change-column/sortable-column-item.d.ts +14 -0
- package/dist/types/widgets-v2/actions/change-column/style.d.ts +33 -0
- package/dist/types/widgets-v2/actions/change-column/types.d.ts +10 -0
- package/dist/types/widgets-v2/actions/download/download.d.ts +18 -0
- package/dist/types/widgets-v2/actions/download/exports.d.ts +37 -0
- package/dist/types/widgets-v2/actions/download/icons.d.ts +12 -0
- package/dist/types/widgets-v2/actions/download/index.d.ts +6 -0
- package/dist/types/widgets-v2/actions/download/labels.d.ts +11 -0
- package/dist/types/widgets-v2/actions/download/png-item.d.ts +24 -0
- package/dist/types/widgets-v2/actions/download/style.d.ts +1 -0
- package/dist/types/widgets-v2/actions/download/types.d.ts +35 -0
- package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +59 -0
- package/dist/types/widgets-v2/actions/fullscreen/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/fullscreen/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/fullscreen/style.d.ts +48 -0
- package/dist/types/widgets-v2/actions/fullscreen/types.d.ts +14 -0
- package/dist/types/widgets-v2/actions/index.d.ts +9 -0
- package/dist/types/widgets-v2/actions/lock-selection/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/lock-selection/labels.d.ts +6 -0
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +36 -0
- package/dist/types/widgets-v2/actions/lock-selection/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/lock-selection/transforms.d.ts +6 -0
- package/dist/types/widgets-v2/actions/relative-data/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +39 -0
- package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/relative-data/transforms.d.ts +30 -0
- package/dist/types/widgets-v2/actions/relative-data/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/searcher/filter.d.ts +6 -0
- package/dist/types/widgets-v2/actions/searcher/index.d.ts +4 -0
- package/dist/types/widgets-v2/actions/searcher/labels.d.ts +7 -0
- package/dist/types/widgets-v2/actions/searcher/searcher-toggle.d.ts +23 -0
- package/dist/types/widgets-v2/actions/searcher/searcher.d.ts +11 -0
- package/dist/types/widgets-v2/actions/searcher/style.d.ts +16 -0
- package/dist/types/widgets-v2/actions/stack-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/stack-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/stack-toggle/stack-toggle.d.ts +10 -0
- package/dist/types/widgets-v2/actions/stack-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/stack-toggle/transforms.d.ts +13 -0
- package/dist/types/widgets-v2/actions/stack-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/transforms.d.ts +51 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/zoom-toggle.d.ts +35 -0
- package/dist/types/widgets-v2/bar/download.d.ts +24 -0
- package/dist/types/widgets-v2/bar/index.d.ts +4 -0
- package/dist/types/widgets-v2/bar/options.d.ts +43 -0
- package/dist/types/widgets-v2/bar/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/bar/skeleton.d.ts +6 -0
- package/dist/types/widgets-v2/bar/types.d.ts +41 -0
- package/dist/types/widgets-v2/category/category-ui.d.ts +81 -0
- package/dist/types/widgets-v2/category/category.d.ts +48 -0
- package/dist/types/widgets-v2/category/components/category-bar-stacked.d.ts +28 -0
- package/dist/types/widgets-v2/category/components/category-bar.d.ts +23 -0
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -0
- package/dist/types/widgets-v2/category/components/category-row-multi.d.ts +31 -0
- package/dist/types/widgets-v2/category/components/category-row-other.d.ts +13 -0
- package/dist/types/widgets-v2/category/components/category-row-single.d.ts +28 -0
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +38 -0
- package/dist/types/widgets-v2/category/download.d.ts +16 -0
- package/dist/types/widgets-v2/category/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/category/index.d.ts +10 -0
- package/dist/types/widgets-v2/category/skeleton.d.ts +11 -0
- package/dist/types/widgets-v2/category/style.d.ts +166 -0
- package/dist/types/widgets-v2/category/types.d.ts +49 -0
- package/dist/types/widgets-v2/echart/echart-ui.d.ts +44 -0
- package/dist/types/widgets-v2/echart/echart.d.ts +75 -0
- package/dist/types/widgets-v2/echart/index.d.ts +4 -0
- package/dist/types/widgets-v2/echart/shared-resize-observer.d.ts +5 -0
- package/dist/types/widgets-v2/echart/shared-resize-observer.test.d.ts +1 -0
- package/dist/types/widgets-v2/echart/style.d.ts +6 -0
- package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +51 -0
- package/dist/types/widgets-v2/formula/delta.d.ts +22 -0
- package/dist/types/widgets-v2/formula/download.d.ts +20 -0
- package/dist/types/widgets-v2/formula/formula-ui.d.ts +20 -0
- package/dist/types/widgets-v2/formula/formula.d.ts +8 -0
- package/dist/types/widgets-v2/formula/index.d.ts +11 -0
- package/dist/types/widgets-v2/formula/note.d.ts +11 -0
- package/dist/types/widgets-v2/formula/prefix.d.ts +12 -0
- package/dist/types/widgets-v2/formula/series.d.ts +16 -0
- package/dist/types/widgets-v2/formula/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/formula/style.d.ts +29 -0
- package/dist/types/widgets-v2/formula/suffix.d.ts +12 -0
- package/dist/types/widgets-v2/formula/types.d.ts +40 -0
- package/dist/types/widgets-v2/formula/value.d.ts +14 -0
- package/dist/types/widgets-v2/histogram/download.d.ts +17 -0
- package/dist/types/widgets-v2/histogram/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/index.d.ts +5 -0
- package/dist/types/widgets-v2/histogram/options.d.ts +42 -0
- package/dist/types/widgets-v2/histogram/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/histogram/transforms.d.ts +17 -0
- package/dist/types/widgets-v2/histogram/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/types.d.ts +47 -0
- package/dist/types/widgets-v2/index.d.ts +107 -0
- package/dist/types/widgets-v2/markdown/download.d.ts +16 -0
- package/dist/types/widgets-v2/markdown/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/markdown/index.d.ts +6 -0
- package/dist/types/widgets-v2/markdown/markdown-content.d.ts +34 -0
- package/dist/types/widgets-v2/markdown/markdown-ui.d.ts +12 -0
- package/dist/types/widgets-v2/markdown/markdown.d.ts +6 -0
- package/dist/types/widgets-v2/markdown/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/markdown/style.d.ts +61 -0
- package/dist/types/widgets-v2/markdown/types.d.ts +4 -0
- package/dist/types/widgets-v2/note/labels.d.ts +5 -0
- package/dist/types/widgets-v2/note/style.d.ts +26 -0
- package/dist/types/widgets-v2/note/widget-note.d.ts +46 -0
- package/dist/types/widgets-v2/pie/download.d.ts +17 -0
- package/dist/types/widgets-v2/pie/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/pie/index.d.ts +4 -0
- package/dist/types/widgets-v2/pie/options.d.ts +35 -0
- package/dist/types/widgets-v2/pie/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/pie/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/pie/types.d.ts +50 -0
- package/dist/types/widgets-v2/provider/widget-provider.d.ts +32 -0
- package/dist/types/widgets-v2/range/index.d.ts +4 -0
- package/dist/types/widgets-v2/range/range-ui.d.ts +19 -0
- package/dist/types/widgets-v2/range/range.d.ts +19 -0
- package/dist/types/widgets-v2/range/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/range/style.d.ts +40 -0
- package/dist/types/widgets-v2/range/types.d.ts +37 -0
- package/dist/types/widgets-v2/scatterplot/download.d.ts +16 -0
- package/dist/types/widgets-v2/scatterplot/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/index.d.ts +5 -0
- package/dist/types/widgets-v2/scatterplot/options.d.ts +42 -0
- package/dist/types/widgets-v2/scatterplot/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/skeleton.d.ts +12 -0
- package/dist/types/widgets-v2/scatterplot/transforms.d.ts +17 -0
- package/dist/types/widgets-v2/scatterplot/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/types.d.ts +50 -0
- package/dist/types/widgets-v2/selection-summary/labels.d.ts +6 -0
- package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +22 -0
- package/dist/types/widgets-v2/selection-summary/style.d.ts +23 -0
- package/dist/types/widgets-v2/spread/download.d.ts +15 -0
- package/dist/types/widgets-v2/spread/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/spread/index.d.ts +6 -0
- package/dist/types/widgets-v2/spread/separator.d.ts +7 -0
- package/dist/types/widgets-v2/spread/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/spread/spread-ui.d.ts +18 -0
- package/dist/types/widgets-v2/spread/spread.d.ts +5 -0
- package/dist/types/widgets-v2/spread/types.d.ts +25 -0
- package/dist/types/widgets-v2/state/labels.d.ts +7 -0
- package/dist/types/widgets-v2/state/labels.test.d.ts +1 -0
- package/dist/types/widgets-v2/state/style.d.ts +19 -0
- package/dist/types/widgets-v2/state/widget-state.d.ts +19 -0
- package/dist/types/widgets-v2/stores/index.d.ts +8 -0
- package/dist/types/widgets-v2/stores/pipeline-middleware.d.ts +5 -0
- package/dist/types/widgets-v2/stores/pipeline-middleware.test.d.ts +1 -0
- package/dist/types/widgets-v2/stores/transforms.d.ts +4 -0
- package/dist/types/widgets-v2/stores/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/stores/types.d.ts +55 -0
- package/dist/types/widgets-v2/stores/use-echart-instance.d.ts +15 -0
- package/dist/types/widgets-v2/stores/use-transform-enabled.d.ts +17 -0
- package/dist/types/widgets-v2/stores/use-transform.d.ts +12 -0
- package/dist/types/widgets-v2/stores/widget-context.d.ts +2 -0
- package/dist/types/widgets-v2/stores/widget-store-registry.d.ts +74 -0
- package/dist/types/widgets-v2/stores/widget-store-registry.test.d.ts +1 -0
- package/dist/types/widgets-v2/subheader/style.d.ts +10 -0
- package/dist/types/widgets-v2/subheader/subheader.d.ts +11 -0
- package/dist/types/widgets-v2/table/download.d.ts +18 -0
- package/dist/types/widgets-v2/table/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/table/helpers.d.ts +32 -0
- package/dist/types/widgets-v2/table/helpers.test.d.ts +1 -0
- package/dist/types/widgets-v2/table/index.d.ts +7 -0
- package/dist/types/widgets-v2/table/labels.d.ts +22 -0
- package/dist/types/widgets-v2/table/skeleton.d.ts +22 -0
- package/dist/types/widgets-v2/table/style.d.ts +44 -0
- package/dist/types/widgets-v2/table/table-ui.d.ts +38 -0
- package/dist/types/widgets-v2/table/table.d.ts +50 -0
- package/dist/types/widgets-v2/table/types.d.ts +37 -0
- package/dist/types/widgets-v2/test-utils.d.ts +52 -0
- package/dist/types/widgets-v2/timeseries/download.d.ts +17 -0
- package/dist/types/widgets-v2/timeseries/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/index.d.ts +4 -0
- package/dist/types/widgets-v2/timeseries/options.d.ts +39 -0
- package/dist/types/widgets-v2/timeseries/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/skeleton.d.ts +8 -0
- package/dist/types/widgets-v2/timeseries/types.d.ts +56 -0
- package/dist/types/widgets-v2/toolbox/labels.d.ts +5 -0
- package/dist/types/widgets-v2/toolbox/style.d.ts +30 -0
- package/dist/types/widgets-v2/toolbox/toolbox.d.ts +49 -0
- package/dist/types/widgets-v2/utils/data-zoom-layout.d.ts +11 -0
- package/dist/types/widgets-v2/utils/index.d.ts +2 -0
- package/dist/types/widgets-v2/utils/merge-options.d.ts +12 -0
- package/dist/types/widgets-v2/utils/merge-options.test.d.ts +1 -0
- package/dist/types/widgets-v2/wrapper/index.d.ts +4 -0
- package/dist/types/widgets-v2/wrapper/labels.d.ts +6 -0
- package/dist/types/widgets-v2/wrapper/style.d.ts +111 -0
- package/dist/types/widgets-v2/wrapper/widget-actions.d.ts +22 -0
- package/dist/types/widgets-v2/wrapper/widget-content.d.ts +12 -0
- package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +51 -0
- package/dist/use-transform-DXPN3nY7.js +110 -0
- package/dist/use-transform-DXPN3nY7.js.map +1 -0
- package/dist/widget-context-DTGO0Yta.js +13 -0
- package/dist/widget-context-DTGO0Yta.js.map +1 -0
- package/dist/widget-store-registry-_W4Z4xp-.js +178 -0
- package/dist/widget-store-registry-_W4Z4xp-.js.map +1 -0
- package/dist/widgets/bar.js +14 -13
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/histogram.js +8 -7
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/pie.js +19 -18
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +8 -7
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/timeseries.js +11 -10
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/utils.js +8 -7
- package/dist/widgets/utils.js.map +1 -1
- package/dist/widgets-v2/actions.js +43 -0
- package/dist/widgets-v2/actions.js.map +1 -0
- package/dist/widgets-v2/bar.js +327 -0
- package/dist/widgets-v2/bar.js.map +1 -0
- package/dist/widgets-v2/category.js +104 -0
- package/dist/widgets-v2/category.js.map +1 -0
- package/dist/widgets-v2/echart.js +57 -0
- package/dist/widgets-v2/echart.js.map +1 -0
- package/dist/widgets-v2/formula.js +74 -0
- package/dist/widgets-v2/formula.js.map +1 -0
- package/dist/widgets-v2/histogram.js +350 -0
- package/dist/widgets-v2/histogram.js.map +1 -0
- package/dist/widgets-v2/markdown.js +68 -0
- package/dist/widgets-v2/markdown.js.map +1 -0
- package/dist/widgets-v2/pie.js +381 -0
- package/dist/widgets-v2/pie.js.map +1 -0
- package/dist/widgets-v2/range.js +52 -0
- package/dist/widgets-v2/range.js.map +1 -0
- package/dist/widgets-v2/scatterplot.js +405 -0
- package/dist/widgets-v2/scatterplot.js.map +1 -0
- package/dist/widgets-v2/spread.js +72 -0
- package/dist/widgets-v2/spread.js.map +1 -0
- package/dist/widgets-v2/stores.js +42 -0
- package/dist/widgets-v2/stores.js.map +1 -0
- package/dist/widgets-v2/table.js +78 -0
- package/dist/widgets-v2/table.js.map +1 -0
- package/dist/widgets-v2/timeseries.js +352 -0
- package/dist/widgets-v2/timeseries.js.map +1 -0
- package/dist/widgets-v2/utils.js +7 -0
- package/dist/widgets-v2/utils.js.map +1 -0
- package/dist/widgets-v2.js +953 -0
- package/dist/widgets-v2.js.map +1 -0
- package/package.json +73 -5
- package/src/components/lasso-tool/chip.test.tsx +176 -0
- package/src/components/lasso-tool/lasso-tool-inline.test.tsx +171 -0
- package/src/components/lasso-tool/lasso-tool.test.tsx +198 -0
- package/src/components/list-data/list-data.test.tsx +73 -0
- package/src/components/no-data-alert/no-data-alert.test.tsx +38 -0
- package/src/components/responsive-drawer/responsive-drawer.test.tsx +68 -0
- package/src/widgets/actions/brush-toggle/brush-overlay.test.tsx +465 -0
- package/src/widgets/actions/brush-toggle/brush-toggle.test.tsx +208 -0
- package/src/widgets/actions/change-column/change-column-dnd.test.tsx +193 -0
- package/src/widgets/actions/change-column/sortable-column-item.test.tsx +124 -0
- package/src/widgets/actions/zoom-toggle/zoom-toggle.test.tsx +322 -0
- package/src/widgets/category/components/category-rows.test.tsx +213 -0
- package/src/widgets/echart/utils.test.ts +277 -0
- package/src/widgets/formula/config.test.ts +37 -0
- package/src/widgets/range/components/range-item.test.tsx +243 -0
- package/src/widgets/stores/widget-store-branches.test.ts +275 -0
- package/src/widgets/table/config.test.ts +65 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +188 -0
- package/src/widgets-v2/PERFORMANCE.md +189 -0
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.test.tsx +180 -0
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.tsx +154 -0
- package/src/widgets-v2/actions/brush-toggle/index.ts +3 -0
- package/src/widgets-v2/actions/brush-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/brush-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/brush-toggle/transforms.test.ts +47 -0
- package/src/widgets-v2/actions/brush-toggle/transforms.ts +31 -0
- package/src/widgets-v2/actions/change-column/change-column-icon.tsx +14 -0
- package/src/widgets-v2/actions/change-column/change-column.test.tsx +59 -0
- package/src/widgets-v2/actions/change-column/change-column.tsx +180 -0
- package/src/widgets-v2/actions/change-column/index.ts +7 -0
- package/src/widgets-v2/actions/change-column/labels.ts +9 -0
- package/src/widgets-v2/actions/change-column/sortable-column-item.tsx +56 -0
- package/src/widgets-v2/actions/change-column/style.ts +32 -0
- package/src/widgets-v2/actions/change-column/types.ts +11 -0
- package/src/widgets-v2/actions/download/download.test.tsx +327 -0
- package/src/widgets-v2/actions/download/download.tsx +144 -0
- package/src/widgets-v2/actions/download/exports.test.tsx +198 -0
- package/src/widgets-v2/actions/download/exports.ts +115 -0
- package/src/widgets-v2/actions/download/icons.tsx +26 -0
- package/src/widgets-v2/actions/download/index.ts +13 -0
- package/src/widgets-v2/actions/download/labels.ts +16 -0
- package/src/widgets-v2/actions/download/png-item.test.tsx +72 -0
- package/src/widgets-v2/actions/download/png-item.tsx +52 -0
- package/src/widgets-v2/actions/download/style.ts +3 -0
- package/src/widgets-v2/actions/download/types.ts +32 -0
- package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +150 -0
- package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +230 -0
- package/src/widgets-v2/actions/fullscreen/index.ts +7 -0
- package/src/widgets-v2/actions/fullscreen/labels.ts +9 -0
- package/src/widgets-v2/actions/fullscreen/style.ts +59 -0
- package/src/widgets-v2/actions/fullscreen/types.ts +15 -0
- package/src/widgets-v2/actions/index.ts +82 -0
- package/src/widgets-v2/actions/lock-selection/index.ts +10 -0
- package/src/widgets-v2/actions/lock-selection/labels.ts +11 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +187 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +130 -0
- package/src/widgets-v2/actions/lock-selection/style.ts +11 -0
- package/src/widgets-v2/actions/lock-selection/transforms.ts +27 -0
- package/src/widgets-v2/actions/relative-data/index.ts +3 -0
- package/src/widgets-v2/actions/relative-data/labels.ts +9 -0
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +71 -0
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +107 -0
- package/src/widgets-v2/actions/relative-data/style.ts +11 -0
- package/src/widgets-v2/actions/relative-data/transforms.test.ts +151 -0
- package/src/widgets-v2/actions/relative-data/transforms.ts +70 -0
- package/src/widgets-v2/actions/searcher/filter.ts +28 -0
- package/src/widgets-v2/actions/searcher/index.ts +8 -0
- package/src/widgets-v2/actions/searcher/labels.ts +13 -0
- package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +91 -0
- package/src/widgets-v2/actions/searcher/searcher.test.tsx +92 -0
- package/src/widgets-v2/actions/searcher/searcher.tsx +112 -0
- package/src/widgets-v2/actions/searcher/style.ts +15 -0
- package/src/widgets-v2/actions/stack-toggle/index.ts +3 -0
- package/src/widgets-v2/actions/stack-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.test.tsx +61 -0
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.tsx +54 -0
- package/src/widgets-v2/actions/stack-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/stack-toggle/transforms.test.ts +43 -0
- package/src/widgets-v2/actions/stack-toggle/transforms.ts +25 -0
- package/src/widgets-v2/actions/zoom-toggle/index.ts +9 -0
- package/src/widgets-v2/actions/zoom-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/zoom-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/zoom-toggle/transforms.test.ts +148 -0
- package/src/widgets-v2/actions/zoom-toggle/transforms.ts +171 -0
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.test.tsx +107 -0
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx +106 -0
- package/src/widgets-v2/bar/download.test.tsx +91 -0
- package/src/widgets-v2/bar/download.tsx +66 -0
- package/src/widgets-v2/bar/index.ts +10 -0
- package/src/widgets-v2/bar/options.test.ts +317 -0
- package/src/widgets-v2/bar/options.ts +326 -0
- package/src/widgets-v2/bar/skeleton.test.tsx +19 -0
- package/src/widgets-v2/bar/skeleton.tsx +69 -0
- package/src/widgets-v2/bar/types.ts +46 -0
- package/src/widgets-v2/category/category-ui.test.tsx +746 -0
- package/src/widgets-v2/category/category-ui.tsx +389 -0
- package/src/widgets-v2/category/category.relative-data.test.tsx +107 -0
- package/src/widgets-v2/category/category.stack-toggle.test.tsx +85 -0
- package/src/widgets-v2/category/category.test.tsx +305 -0
- package/src/widgets-v2/category/category.tsx +121 -0
- package/src/widgets-v2/category/components/category-bar-stacked.test.tsx +121 -0
- package/src/widgets-v2/category/components/category-bar-stacked.tsx +73 -0
- package/src/widgets-v2/category/components/category-bar.test.tsx +64 -0
- package/src/widgets-v2/category/components/category-bar.tsx +49 -0
- package/src/widgets-v2/category/components/category-legend.test.tsx +51 -0
- package/src/widgets-v2/category/components/category-legend.tsx +39 -0
- package/src/widgets-v2/category/components/category-row-multi.tsx +86 -0
- package/src/widgets-v2/category/components/category-row-other.test.tsx +28 -0
- package/src/widgets-v2/category/components/category-row-other.tsx +33 -0
- package/src/widgets-v2/category/components/category-row-single.tsx +76 -0
- package/src/widgets-v2/category/components/category-row-stacked.test.tsx +244 -0
- package/src/widgets-v2/category/components/category-row-stacked.tsx +99 -0
- package/src/widgets-v2/category/download.test.ts +71 -0
- package/src/widgets-v2/category/download.ts +54 -0
- package/src/widgets-v2/category/index.ts +32 -0
- package/src/widgets-v2/category/skeleton.test.tsx +26 -0
- package/src/widgets-v2/category/skeleton.tsx +74 -0
- package/src/widgets-v2/category/style.ts +290 -0
- package/src/widgets-v2/category/types.ts +54 -0
- package/src/widgets-v2/echart/echart-ui.test.tsx +232 -0
- package/src/widgets-v2/echart/echart-ui.tsx +184 -0
- package/src/widgets-v2/echart/echart.test.tsx +229 -0
- package/src/widgets-v2/echart/echart.tsx +199 -0
- package/src/widgets-v2/echart/index.ts +22 -0
- package/src/widgets-v2/echart/shared-resize-observer.test.ts +91 -0
- package/src/widgets-v2/echart/shared-resize-observer.ts +56 -0
- package/src/widgets-v2/echart/style.ts +8 -0
- package/src/widgets-v2/echart/use-chart-selection.test.tsx +118 -0
- package/src/widgets-v2/echart/use-chart-selection.ts +115 -0
- package/src/widgets-v2/formula/delta.tsx +61 -0
- package/src/widgets-v2/formula/download.test.tsx +65 -0
- package/src/widgets-v2/formula/download.tsx +69 -0
- package/src/widgets-v2/formula/formula-ui.test.tsx +91 -0
- package/src/widgets-v2/formula/formula-ui.tsx +66 -0
- package/src/widgets-v2/formula/formula.test.tsx +50 -0
- package/src/widgets-v2/formula/formula.tsx +34 -0
- package/src/widgets-v2/formula/index.ts +17 -0
- package/src/widgets-v2/formula/note.tsx +25 -0
- package/src/widgets-v2/formula/prefix.tsx +25 -0
- package/src/widgets-v2/formula/series.tsx +67 -0
- package/src/widgets-v2/formula/skeleton.test.tsx +21 -0
- package/src/widgets-v2/formula/skeleton.tsx +27 -0
- package/src/widgets-v2/formula/style.ts +31 -0
- package/src/widgets-v2/formula/subcomponents.test.tsx +107 -0
- package/src/widgets-v2/formula/suffix.tsx +25 -0
- package/src/widgets-v2/formula/types.ts +44 -0
- package/src/widgets-v2/formula/value.tsx +31 -0
- package/src/widgets-v2/histogram/download.test.ts +94 -0
- package/src/widgets-v2/histogram/download.ts +60 -0
- package/src/widgets-v2/histogram/index.ts +10 -0
- package/src/widgets-v2/histogram/options.test.ts +304 -0
- package/src/widgets-v2/histogram/options.ts +337 -0
- package/src/widgets-v2/histogram/skeleton.test.tsx +16 -0
- package/src/widgets-v2/histogram/skeleton.tsx +70 -0
- package/src/widgets-v2/histogram/transforms.test.ts +46 -0
- package/src/widgets-v2/histogram/transforms.ts +30 -0
- package/src/widgets-v2/histogram/types.ts +51 -0
- package/src/widgets-v2/index.ts +201 -0
- package/src/widgets-v2/markdown/download.test.ts +66 -0
- package/src/widgets-v2/markdown/download.ts +53 -0
- package/src/widgets-v2/markdown/index.ts +6 -0
- package/src/widgets-v2/markdown/markdown-content.test.tsx +155 -0
- package/src/widgets-v2/markdown/markdown-content.tsx +72 -0
- package/src/widgets-v2/markdown/markdown-ui.test.tsx +75 -0
- package/src/widgets-v2/markdown/markdown-ui.tsx +55 -0
- package/src/widgets-v2/markdown/markdown.test.tsx +39 -0
- package/src/widgets-v2/markdown/markdown.tsx +17 -0
- package/src/widgets-v2/markdown/skeleton.test.tsx +15 -0
- package/src/widgets-v2/markdown/skeleton.tsx +32 -0
- package/src/widgets-v2/markdown/style.ts +53 -0
- package/src/widgets-v2/markdown/types.ts +4 -0
- package/src/widgets-v2/note/labels.ts +9 -0
- package/src/widgets-v2/note/style.ts +26 -0
- package/src/widgets-v2/note/widget-note.test.tsx +158 -0
- package/src/widgets-v2/note/widget-note.tsx +172 -0
- package/src/widgets-v2/pie/download.test.ts +78 -0
- package/src/widgets-v2/pie/download.ts +55 -0
- package/src/widgets-v2/pie/index.ts +10 -0
- package/src/widgets-v2/pie/options.test.ts +585 -0
- package/src/widgets-v2/pie/options.ts +509 -0
- package/src/widgets-v2/pie/skeleton.test.tsx +17 -0
- package/src/widgets-v2/pie/skeleton.tsx +32 -0
- package/src/widgets-v2/pie/types.ts +55 -0
- package/src/widgets-v2/provider/widget-provider.test.tsx +119 -0
- package/src/widgets-v2/provider/widget-provider.tsx +111 -0
- package/src/widgets-v2/range/index.ts +4 -0
- package/src/widgets-v2/range/range-ui.test.tsx +130 -0
- package/src/widgets-v2/range/range-ui.tsx +211 -0
- package/src/widgets-v2/range/range.test.tsx +68 -0
- package/src/widgets-v2/range/range.tsx +46 -0
- package/src/widgets-v2/range/skeleton.test.tsx +17 -0
- package/src/widgets-v2/range/skeleton.tsx +47 -0
- package/src/widgets-v2/range/style.ts +41 -0
- package/src/widgets-v2/range/types.ts +37 -0
- package/src/widgets-v2/scatterplot/download.test.ts +71 -0
- package/src/widgets-v2/scatterplot/download.ts +54 -0
- package/src/widgets-v2/scatterplot/index.ts +11 -0
- package/src/widgets-v2/scatterplot/options.test.ts +399 -0
- package/src/widgets-v2/scatterplot/options.ts +421 -0
- package/src/widgets-v2/scatterplot/skeleton.test.tsx +17 -0
- package/src/widgets-v2/scatterplot/skeleton.tsx +84 -0
- package/src/widgets-v2/scatterplot/transforms.test.ts +97 -0
- package/src/widgets-v2/scatterplot/transforms.ts +38 -0
- package/src/widgets-v2/scatterplot/types.ts +55 -0
- package/src/widgets-v2/selection-summary/labels.ts +11 -0
- package/src/widgets-v2/selection-summary/selection-summary.test.tsx +53 -0
- package/src/widgets-v2/selection-summary/selection-summary.tsx +62 -0
- package/src/widgets-v2/selection-summary/style.ts +23 -0
- package/src/widgets-v2/spread/download.test.ts +64 -0
- package/src/widgets-v2/spread/download.ts +59 -0
- package/src/widgets-v2/spread/index.ts +6 -0
- package/src/widgets-v2/spread/separator.tsx +11 -0
- package/src/widgets-v2/spread/skeleton.test.tsx +17 -0
- package/src/widgets-v2/spread/skeleton.tsx +38 -0
- package/src/widgets-v2/spread/spread-ui.test.tsx +108 -0
- package/src/widgets-v2/spread/spread-ui.tsx +52 -0
- package/src/widgets-v2/spread/spread.test.tsx +50 -0
- package/src/widgets-v2/spread/spread.tsx +31 -0
- package/src/widgets-v2/spread/types.ts +27 -0
- package/src/widgets-v2/state/labels.test.ts +33 -0
- package/src/widgets-v2/state/labels.ts +20 -0
- package/src/widgets-v2/state/style.ts +25 -0
- package/src/widgets-v2/state/widget-state.test.tsx +294 -0
- package/src/widgets-v2/state/widget-state.tsx +184 -0
- package/src/widgets-v2/stores/index.ts +49 -0
- package/src/widgets-v2/stores/pipeline-middleware.test.ts +187 -0
- package/src/widgets-v2/stores/pipeline-middleware.ts +91 -0
- package/src/widgets-v2/stores/transforms.test.ts +162 -0
- package/src/widgets-v2/stores/transforms.ts +70 -0
- package/src/widgets-v2/stores/types.ts +64 -0
- package/src/widgets-v2/stores/use-echart-instance.test.tsx +91 -0
- package/src/widgets-v2/stores/use-echart-instance.ts +29 -0
- package/src/widgets-v2/stores/use-transform-enabled.test.tsx +127 -0
- package/src/widgets-v2/stores/use-transform-enabled.ts +25 -0
- package/src/widgets-v2/stores/use-transform.test.tsx +262 -0
- package/src/widgets-v2/stores/use-transform.ts +158 -0
- package/src/widgets-v2/stores/widget-context.test.tsx +58 -0
- package/src/widgets-v2/stores/widget-context.ts +15 -0
- package/src/widgets-v2/stores/widget-store-registry.test.ts +292 -0
- package/src/widgets-v2/stores/widget-store-registry.ts +248 -0
- package/src/widgets-v2/subheader/style.ts +12 -0
- package/src/widgets-v2/subheader/subheader.test.tsx +30 -0
- package/src/widgets-v2/subheader/subheader.tsx +16 -0
- package/src/widgets-v2/table/download.test.ts +75 -0
- package/src/widgets-v2/table/download.ts +47 -0
- package/src/widgets-v2/table/helpers.test.ts +214 -0
- package/src/widgets-v2/table/helpers.ts +136 -0
- package/src/widgets-v2/table/index.ts +23 -0
- package/src/widgets-v2/table/labels.tsx +41 -0
- package/src/widgets-v2/table/skeleton.test.tsx +26 -0
- package/src/widgets-v2/table/skeleton.tsx +65 -0
- package/src/widgets-v2/table/style.ts +46 -0
- package/src/widgets-v2/table/table-ui.test.tsx +200 -0
- package/src/widgets-v2/table/table-ui.tsx +331 -0
- package/src/widgets-v2/table/table.test.tsx +119 -0
- package/src/widgets-v2/table/table.tsx +174 -0
- package/src/widgets-v2/table/types.ts +44 -0
- package/src/widgets-v2/test-utils.ts +107 -0
- package/src/widgets-v2/timeseries/download.test.ts +95 -0
- package/src/widgets-v2/timeseries/download.ts +86 -0
- package/src/widgets-v2/timeseries/index.ts +10 -0
- package/src/widgets-v2/timeseries/options.test.ts +379 -0
- package/src/widgets-v2/timeseries/options.ts +341 -0
- package/src/widgets-v2/timeseries/skeleton.test.tsx +13 -0
- package/src/widgets-v2/timeseries/skeleton.tsx +76 -0
- package/src/widgets-v2/timeseries/types.ts +61 -0
- package/src/widgets-v2/toolbox/labels.ts +9 -0
- package/src/widgets-v2/toolbox/style.ts +33 -0
- package/src/widgets-v2/toolbox/toolbox.test.tsx +200 -0
- package/src/widgets-v2/toolbox/toolbox.tsx +309 -0
- package/src/widgets-v2/utils/data-zoom-layout.ts +26 -0
- package/src/widgets-v2/utils/index.ts +2 -0
- package/src/widgets-v2/utils/merge-options.test.ts +52 -0
- package/src/widgets-v2/utils/merge-options.ts +50 -0
- package/src/widgets-v2/wrapper/index.ts +14 -0
- package/src/widgets-v2/wrapper/labels.ts +11 -0
- package/src/widgets-v2/wrapper/style.ts +134 -0
- package/src/widgets-v2/wrapper/widget-actions.test.tsx +52 -0
- package/src/widgets-v2/wrapper/widget-actions.tsx +43 -0
- package/src/widgets-v2/wrapper/widget-content.test.tsx +27 -0
- package/src/widgets-v2/wrapper/widget-content.tsx +29 -0
- package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +159 -0
- package/src/widgets-v2/wrapper/widget-wrapper.tsx +178 -0
- package/dist/styles-BYTyKQFP.js.map +0 -1
package/dist/widgets/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { d as i, a as n } from "../formatter-B9Bxn1k7.js";
|
|
2
2
|
import { c as f, f as p, s as c } from "../download-config-DNLkypdN.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as d, b as u, c as b, d as x, e as C, f as g, g as F, n as y } from "../option-builders-F-c9ELi1.js";
|
|
4
|
+
import { b as S } from "../styles-cohnxh9F.js";
|
|
4
5
|
function r({
|
|
5
6
|
type: a,
|
|
6
7
|
getOptions: e
|
|
@@ -14,20 +15,20 @@ function r({
|
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
d as applyXAxisFormatter,
|
|
18
19
|
u as applyYAxisFormatter,
|
|
19
|
-
|
|
20
|
+
S as baseSkeletonStyles,
|
|
20
21
|
b as buildGridConfig,
|
|
21
22
|
x as buildLegendConfig,
|
|
22
|
-
|
|
23
|
+
C as createAxisLabelFormatter,
|
|
23
24
|
f as createChartDownloadConfig,
|
|
24
25
|
r as createChartWidgetConfig,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
g as createTooltipFormatter,
|
|
27
|
+
F as createTooltipPositioner,
|
|
27
28
|
i as defaultFormatter,
|
|
28
29
|
n as defaultLabelFormatter,
|
|
29
30
|
p as flattenObjectArrayToCSV,
|
|
30
|
-
|
|
31
|
+
y as niceNum,
|
|
31
32
|
c as scatterplotDataToCSV
|
|
32
33
|
};
|
|
33
34
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/widgets/utils/chart-config/config-factory.ts"],"sourcesContent":["import type { EchartOptionsProps, EchartWidgetData } from '../../echart'\n\n/**\n * Base configuration interface for chart widgets\n */\nexport interface ChartWidgetBaseConfig<TData = EchartWidgetData> {\n data?: TData\n}\n\n/**\n * Parameters for creating a chart widget configuration\n */\nexport interface CreateChartWidgetConfigParams<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n> {\n /** Widget type identifier (e.g., 'bar', 'pie', 'histogram') */\n type: TType\n /** Function to get EChart options from config */\n getOptions: (config: TConfig) => EchartOptionsProps\n}\n\n/**\n * Return type of the chart widget config function\n */\nexport type ChartWidgetConfigResult<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n> = TConfig & {\n type: TType\n}\n\n/**\n * Factory function to create a standardized chart widget config function.\n * This eliminates duplication across chart widgets by providing a common structure.\n *\n * @example\n * ```ts\n * export const barConfig = createChartWidgetConfig({\n * type: 'bar' as const,\n * getOptions: ({ data, theme }) => ({\n * // EChart configuration\n * }),\n * csvModifier: (data) => flattenObjectArrayToCSV(data),\n * })\n * ```\n */\nexport function createChartWidgetConfig<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n>({\n type,\n getOptions,\n}: CreateChartWidgetConfigParams<TData, TConfig, TType>): (\n config: TConfig,\n) => ChartWidgetConfigResult<TData, TConfig, TType> {\n return function (config: TConfig) {\n return {\n ...config,\n option: getOptions(config),\n type: type,\n } as ChartWidgetConfigResult<TData, TConfig, TType>\n }\n}\n"],"names":["createChartWidgetConfig","type","getOptions","config","option"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/widgets/utils/chart-config/config-factory.ts"],"sourcesContent":["import type { EchartOptionsProps, EchartWidgetData } from '../../echart'\n\n/**\n * Base configuration interface for chart widgets\n */\nexport interface ChartWidgetBaseConfig<TData = EchartWidgetData> {\n data?: TData\n}\n\n/**\n * Parameters for creating a chart widget configuration\n */\nexport interface CreateChartWidgetConfigParams<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n> {\n /** Widget type identifier (e.g., 'bar', 'pie', 'histogram') */\n type: TType\n /** Function to get EChart options from config */\n getOptions: (config: TConfig) => EchartOptionsProps\n}\n\n/**\n * Return type of the chart widget config function\n */\nexport type ChartWidgetConfigResult<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n> = TConfig & {\n type: TType\n}\n\n/**\n * Factory function to create a standardized chart widget config function.\n * This eliminates duplication across chart widgets by providing a common structure.\n *\n * @example\n * ```ts\n * export const barConfig = createChartWidgetConfig({\n * type: 'bar' as const,\n * getOptions: ({ data, theme }) => ({\n * // EChart configuration\n * }),\n * csvModifier: (data) => flattenObjectArrayToCSV(data),\n * })\n * ```\n */\nexport function createChartWidgetConfig<\n TData = EchartWidgetData,\n TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>,\n TType extends string = string,\n>({\n type,\n getOptions,\n}: CreateChartWidgetConfigParams<TData, TConfig, TType>): (\n config: TConfig,\n) => ChartWidgetConfigResult<TData, TConfig, TType> {\n return function (config: TConfig) {\n return {\n ...config,\n option: getOptions(config),\n type: type,\n } as ChartWidgetConfigResult<TData, TConfig, TType>\n }\n}\n"],"names":["createChartWidgetConfig","type","getOptions","config","option"],"mappings":";;;;AAiDO,SAASA,EAId;AAAA,EACAC,MAAAA;AAAAA,EACAC,YAAAA;AACoD,GAEF;AAClD,SAAO,SAAUC,GAAiB;AAChC,WAAO;AAAA,MACL,GAAGA;AAAAA,MACHC,QAAQF,EAAWC,CAAM;AAAA,MACzBF,MAAAA;AAAAA,IAAAA;AAAAA,EAEJ;AACF;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { B as L, C as e, D as o, a as E, b as t, c as r, d as A, e as S, f as T, g as _, h as d, i as l, F as D, L as c, R as n, S as B, j as g, k as C, Z as O, l as F, m as U, n as m, o as i, p as G, s as h, t as R } from "../change-column-Cidl_M-4.js";
|
|
2
|
+
import { Z as N, a as Z, c as k } from "../transforms-Cdx4fkU5.js";
|
|
3
|
+
import { d as I, a as p, t as u, b as w } from "../exports-Cx-f6m6U.js";
|
|
4
|
+
import { C as b, P as M, b as v } from "../png-item-CS4z1iSH.js";
|
|
5
|
+
export {
|
|
6
|
+
L as BrushToggle,
|
|
7
|
+
b as CSVIcon,
|
|
8
|
+
e as ChangeColumn,
|
|
9
|
+
o as DEFAULT_BRUSH_TOGGLE_LABELS,
|
|
10
|
+
E as DEFAULT_CHANGE_COLUMN_LABELS,
|
|
11
|
+
t as DEFAULT_DOWNLOAD_LABELS,
|
|
12
|
+
r as DEFAULT_FULLSCREEN_LABELS,
|
|
13
|
+
A as DEFAULT_LOCK_SELECTION_LABELS,
|
|
14
|
+
S as DEFAULT_RELATIVE_DATA_LABELS,
|
|
15
|
+
T as DEFAULT_SEARCHER_LABELS,
|
|
16
|
+
_ as DEFAULT_STACK_TOGGLE_LABELS,
|
|
17
|
+
d as DEFAULT_ZOOM_TOGGLE_LABELS,
|
|
18
|
+
l as Download,
|
|
19
|
+
D as FullScreen,
|
|
20
|
+
c as LockSelection,
|
|
21
|
+
M as PNGIcon,
|
|
22
|
+
n as RelativeData,
|
|
23
|
+
B as Searcher,
|
|
24
|
+
g as SearcherToggle,
|
|
25
|
+
C as StackToggle,
|
|
26
|
+
N as ZOOM_LAYOUT,
|
|
27
|
+
O as ZoomToggle,
|
|
28
|
+
F as addBrush,
|
|
29
|
+
U as addStack,
|
|
30
|
+
Z as addZoom,
|
|
31
|
+
v as buildPngDownloadItem,
|
|
32
|
+
k as createAddZoom,
|
|
33
|
+
m as createPercentFormatter,
|
|
34
|
+
I as downloadDOMToPNG,
|
|
35
|
+
p as downloadToCSV,
|
|
36
|
+
i as filterByLockedItems,
|
|
37
|
+
G as filterBySearchText,
|
|
38
|
+
h as setSearcherText,
|
|
39
|
+
u as toCsvString,
|
|
40
|
+
R as toRelativeData,
|
|
41
|
+
w as triggerLinkDownload
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import * as $ from "echarts";
|
|
2
|
+
import { n as g, d as z, g as E, c as G, f as H } from "../option-builders-F-c9ELi1.js";
|
|
3
|
+
import { jsx as p, jsxs as M } from "react/jsx-runtime";
|
|
4
|
+
import { c as R } from "react/compiler-runtime";
|
|
5
|
+
import { Box as d, Skeleton as v } from "@mui/material";
|
|
6
|
+
import "../widget-store-Bw5zRUGg.js";
|
|
7
|
+
import "zustand/shallow";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import "react";
|
|
10
|
+
import "html2canvas";
|
|
11
|
+
import "../lasso-tool-BYbxrJ-7.js";
|
|
12
|
+
import "../cjs-D4KH3azB.js";
|
|
13
|
+
import "@dnd-kit/core";
|
|
14
|
+
import "@dnd-kit/sortable";
|
|
15
|
+
import "@dnd-kit/utilities";
|
|
16
|
+
import "react-dom";
|
|
17
|
+
import "@mui/icons-material/ZoomIn";
|
|
18
|
+
import "../widget-context-DTGO0Yta.js";
|
|
19
|
+
import "zustand";
|
|
20
|
+
import "zustand/vanilla";
|
|
21
|
+
import "zustand/middleware";
|
|
22
|
+
import "zustand/react/shallow";
|
|
23
|
+
import { Z as j } from "../transforms-Cdx4fkU5.js";
|
|
24
|
+
import { m as W } from "../merge-options-DCkkHZIf.js";
|
|
25
|
+
import { p as Y } from "../data-zoom-layout-BH0LPwSy.js";
|
|
26
|
+
import "@mui/icons-material/FileDownload";
|
|
27
|
+
import { a as q } from "../exports-Cx-f6m6U.js";
|
|
28
|
+
import { b as U, C as J } from "../png-item-CS4z1iSH.js";
|
|
29
|
+
function K({
|
|
30
|
+
theme: e,
|
|
31
|
+
formatter: r,
|
|
32
|
+
labelFormatter: t
|
|
33
|
+
}) {
|
|
34
|
+
let l = 0, a = 1;
|
|
35
|
+
return {
|
|
36
|
+
grid: {
|
|
37
|
+
left: parseInt(e.spacing(1)),
|
|
38
|
+
top: parseInt(e.spacing(3)),
|
|
39
|
+
right: parseInt(e.spacing(1)),
|
|
40
|
+
// Default: no legend. Merger bumps this when there are >1 series.
|
|
41
|
+
...G(!1, e),
|
|
42
|
+
containLabel: !0
|
|
43
|
+
},
|
|
44
|
+
tooltip: {
|
|
45
|
+
trigger: "axis",
|
|
46
|
+
backgroundColor: e.palette.grey[900],
|
|
47
|
+
borderWidth: 0,
|
|
48
|
+
padding: [parseInt(e.spacing(1)), parseInt(e.spacing(1))],
|
|
49
|
+
textStyle: {
|
|
50
|
+
color: e.palette.common.white,
|
|
51
|
+
fontSize: 11,
|
|
52
|
+
fontFamily: e.typography.caption.fontFamily
|
|
53
|
+
},
|
|
54
|
+
axisPointer: {
|
|
55
|
+
type: "line"
|
|
56
|
+
},
|
|
57
|
+
position: E(e),
|
|
58
|
+
formatter: F(r, t)
|
|
59
|
+
},
|
|
60
|
+
// Legend styling baked here; `show` is toggled by the merger based on
|
|
61
|
+
// series count.
|
|
62
|
+
legend: {
|
|
63
|
+
...z({
|
|
64
|
+
hasLegend: !1,
|
|
65
|
+
labelFormatter: t
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
axisPointer: {
|
|
69
|
+
lineStyle: {
|
|
70
|
+
color: e.palette.grey[400]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
color: [e.palette.secondary.main, ...Object.values(e.palette.qualitative?.bold ?? {})],
|
|
74
|
+
xAxis: {
|
|
75
|
+
type: "category",
|
|
76
|
+
axisLine: {
|
|
77
|
+
show: !1
|
|
78
|
+
},
|
|
79
|
+
axisTick: {
|
|
80
|
+
show: !1
|
|
81
|
+
},
|
|
82
|
+
axisLabel: {
|
|
83
|
+
padding: [parseInt(e.spacing(0.5)), 0, 0, 0],
|
|
84
|
+
margin: 0,
|
|
85
|
+
hideOverlap: !0,
|
|
86
|
+
...t && {
|
|
87
|
+
formatter: (o) => String(t(o))
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
yAxis: {
|
|
92
|
+
type: "value",
|
|
93
|
+
min: (o) => (l = o.min < 0 ? g(o.min) : 0, l),
|
|
94
|
+
max: (o) => (a = o.max <= 0 ? 1 : g(o.max), a),
|
|
95
|
+
axisLine: {
|
|
96
|
+
show: !1
|
|
97
|
+
},
|
|
98
|
+
axisTick: {
|
|
99
|
+
show: !1
|
|
100
|
+
},
|
|
101
|
+
splitLine: {
|
|
102
|
+
show: !0,
|
|
103
|
+
lineStyle: {
|
|
104
|
+
color: e.palette.black?.[4] ?? e.palette.divider
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
axisLabel: {
|
|
108
|
+
fontSize: e.typography.overlineDelicate?.fontSize,
|
|
109
|
+
fontFamily: e.typography.overlineDelicate?.fontFamily,
|
|
110
|
+
margin: parseInt(e.spacing(1)),
|
|
111
|
+
show: !0,
|
|
112
|
+
showMaxLabel: !0,
|
|
113
|
+
showMinLabel: !0,
|
|
114
|
+
verticalAlign: "bottom",
|
|
115
|
+
inside: !0,
|
|
116
|
+
formatter: (o) => o !== a && o !== l || o === 0 ? "" : r ? r(o) : String(o)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function Te(e) {
|
|
122
|
+
const {
|
|
123
|
+
theme: r,
|
|
124
|
+
formatter: t,
|
|
125
|
+
labelFormatter: l,
|
|
126
|
+
optionsOverride: a
|
|
127
|
+
} = e, o = e.seriesNames, s = e.selection, m = s && s.length > 0 ? new Set(s) : null;
|
|
128
|
+
return (n, A, w) => {
|
|
129
|
+
if (n == null) {
|
|
130
|
+
const i = K({
|
|
131
|
+
theme: r,
|
|
132
|
+
formatter: t,
|
|
133
|
+
labelFormatter: l
|
|
134
|
+
});
|
|
135
|
+
return a ? W(i, a) : i;
|
|
136
|
+
}
|
|
137
|
+
const f = Array.isArray(A) ? A : [];
|
|
138
|
+
if (f.length === 0)
|
|
139
|
+
return {
|
|
140
|
+
...n,
|
|
141
|
+
dataset: [],
|
|
142
|
+
series: []
|
|
143
|
+
};
|
|
144
|
+
const y = f.length > 1, O = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, b = typeof n.grid == "object" && !Array.isArray(n.grid) ? n.grid : {}, _ = typeof n.tooltip == "object" && !Array.isArray(n.tooltip) ? n.tooltip : {}, I = typeof n.yAxis == "object" && !Array.isArray(n.yAxis) ? n.yAxis : {}, L = Array.isArray(n.series) ? n.series : [], N = L[0] ?? {}, x = w?.formatter, V = w?.labelFormatter, {
|
|
145
|
+
niceMinVal: C,
|
|
146
|
+
niceMaxVal: k
|
|
147
|
+
} = Q(f), h = Y(n.dataZoom, y), D = typeof b.bottom == "number" ? b.bottom : 24, B = y ? 56 : D, P = h ? B + j.sliderHeight + j.sliderGap : B, Z = {
|
|
148
|
+
color: (i) => {
|
|
149
|
+
const c = i.color;
|
|
150
|
+
if (!m) return c;
|
|
151
|
+
const T = i.value?.name ?? i.name;
|
|
152
|
+
return T != null && m.has(T) ? c : $.color.modifyAlpha(c, 0.15);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
return {
|
|
156
|
+
...n,
|
|
157
|
+
dataset: f.map((i) => ({
|
|
158
|
+
source: i
|
|
159
|
+
})),
|
|
160
|
+
series: f.map((i, c) => {
|
|
161
|
+
const S = L[c] ?? N;
|
|
162
|
+
return {
|
|
163
|
+
...typeof S == "object" ? S : {},
|
|
164
|
+
type: "bar",
|
|
165
|
+
datasetIndex: c,
|
|
166
|
+
name: o?.[c] ?? `Series ${c + 1}`,
|
|
167
|
+
encode: {
|
|
168
|
+
x: "name",
|
|
169
|
+
y: "value"
|
|
170
|
+
},
|
|
171
|
+
barMaxWidth: 100,
|
|
172
|
+
emphasis: {
|
|
173
|
+
focus: "series"
|
|
174
|
+
},
|
|
175
|
+
itemStyle: Z
|
|
176
|
+
};
|
|
177
|
+
}),
|
|
178
|
+
legend: {
|
|
179
|
+
...O,
|
|
180
|
+
show: y
|
|
181
|
+
},
|
|
182
|
+
grid: {
|
|
183
|
+
...b,
|
|
184
|
+
bottom: P
|
|
185
|
+
},
|
|
186
|
+
...h ? {
|
|
187
|
+
dataZoom: h
|
|
188
|
+
} : {},
|
|
189
|
+
yAxis: {
|
|
190
|
+
...I,
|
|
191
|
+
min: C,
|
|
192
|
+
max: k,
|
|
193
|
+
axisLabel: {
|
|
194
|
+
...I.axisLabel ?? {},
|
|
195
|
+
formatter: (i) => i !== k && i !== C || i === 0 ? "" : x ? x(i) : String(i)
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
tooltip: {
|
|
199
|
+
..._,
|
|
200
|
+
formatter: F(x, V)
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function F(e, r) {
|
|
206
|
+
return H((t) => {
|
|
207
|
+
const a = t.value?.value, o = typeof a == "number" && e ? e(a) : a ?? "", s = typeof t.marker == "string" ? t.marker : "", m = t.seriesName ? `${t.seriesName}: ` : "", n = r ? String(r(t.name ?? "")) : t.name ?? "";
|
|
208
|
+
return {
|
|
209
|
+
name: String(n),
|
|
210
|
+
seriesName: m,
|
|
211
|
+
marker: s,
|
|
212
|
+
value: o
|
|
213
|
+
};
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function Q(e) {
|
|
217
|
+
let r = 0, t = -1 / 0;
|
|
218
|
+
for (const o of e)
|
|
219
|
+
for (const s of o)
|
|
220
|
+
typeof s?.value != "number" || !Number.isFinite(s.value) || (s.value < r && (r = s.value), s.value > t && (t = s.value));
|
|
221
|
+
const l = r < 0 ? g(r) : 0, a = t <= 0 ? 1 : g(t);
|
|
222
|
+
return {
|
|
223
|
+
niceMinVal: l,
|
|
224
|
+
niceMaxVal: a
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const u = {
|
|
228
|
+
container: {
|
|
229
|
+
display: "flex",
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
justifyContent: "space-between",
|
|
232
|
+
flexDirection: "column",
|
|
233
|
+
gap: ({
|
|
234
|
+
spacing: e
|
|
235
|
+
}) => e(1),
|
|
236
|
+
height: ({
|
|
237
|
+
spacing: e
|
|
238
|
+
}) => e(38)
|
|
239
|
+
},
|
|
240
|
+
grid: {
|
|
241
|
+
display: "flex",
|
|
242
|
+
justifyContent: "space-between",
|
|
243
|
+
flex: "1 1 auto",
|
|
244
|
+
alignItems: "flex-end",
|
|
245
|
+
width: "100%"
|
|
246
|
+
},
|
|
247
|
+
bar: {
|
|
248
|
+
flex: 1,
|
|
249
|
+
maxWidth: ({
|
|
250
|
+
spacing: e
|
|
251
|
+
}) => e(12),
|
|
252
|
+
"& + &": {
|
|
253
|
+
marginLeft: ({
|
|
254
|
+
spacing: e
|
|
255
|
+
}) => e(1)
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
legend: {
|
|
259
|
+
display: "flex",
|
|
260
|
+
alignItems: "center",
|
|
261
|
+
gap: ({
|
|
262
|
+
spacing: e
|
|
263
|
+
}) => e(2),
|
|
264
|
+
height: ({
|
|
265
|
+
spacing: e
|
|
266
|
+
}) => e(5)
|
|
267
|
+
},
|
|
268
|
+
legendItem: {
|
|
269
|
+
display: "flex",
|
|
270
|
+
alignItems: "center",
|
|
271
|
+
gap: ({
|
|
272
|
+
spacing: e
|
|
273
|
+
}) => e(1.5)
|
|
274
|
+
}
|
|
275
|
+
}, X = ["20%", "40%", "60%", "20%", "80%"];
|
|
276
|
+
function je() {
|
|
277
|
+
const e = R(2);
|
|
278
|
+
let r;
|
|
279
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ p(d, { sx: u.grid, children: X.map(te) }), e[0] = r) : r = e[0];
|
|
280
|
+
let t;
|
|
281
|
+
return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(d, { sx: u.container, children: [
|
|
282
|
+
r,
|
|
283
|
+
/* @__PURE__ */ p(d, { sx: u.legend, children: [0, 1].map(ee) })
|
|
284
|
+
] }), e[1] = t) : t = e[1], t;
|
|
285
|
+
}
|
|
286
|
+
function ee(e) {
|
|
287
|
+
return /* @__PURE__ */ M(d, { sx: u.legendItem, children: [
|
|
288
|
+
/* @__PURE__ */ p(v, { variant: "circular", width: 8, height: 8 }),
|
|
289
|
+
/* @__PURE__ */ p(v, { width: 48, height: 8 })
|
|
290
|
+
] }, `legend-${e}`);
|
|
291
|
+
}
|
|
292
|
+
function te(e, r) {
|
|
293
|
+
return /* @__PURE__ */ p(v, { sx: u.bar, variant: "rectangular", height: e }, `bar-${r}`);
|
|
294
|
+
}
|
|
295
|
+
function Me(e) {
|
|
296
|
+
const r = [];
|
|
297
|
+
return e.getCaptureEl && r.push(U({
|
|
298
|
+
filename: e.filename,
|
|
299
|
+
getCaptureEl: e.getCaptureEl,
|
|
300
|
+
pixelRatio: e.pngPixelRatio,
|
|
301
|
+
backgroundColor: e.pngBackgroundColor
|
|
302
|
+
})), r.push({
|
|
303
|
+
id: "csv",
|
|
304
|
+
label: "CSV",
|
|
305
|
+
icon: /* @__PURE__ */ p(J, { fontSize: "small" }),
|
|
306
|
+
resolve: () => {
|
|
307
|
+
const t = e.getData(), l = [];
|
|
308
|
+
for (const [o, s] of t.entries()) {
|
|
309
|
+
o > 0 && l.push([]), l.push(["name", "value"]);
|
|
310
|
+
for (const m of s) l.push([m.name, m.value]);
|
|
311
|
+
}
|
|
312
|
+
const a = q(l);
|
|
313
|
+
return Promise.resolve({
|
|
314
|
+
url: a.url,
|
|
315
|
+
filename: `${e.filename}.csv`,
|
|
316
|
+
revoke: a.revoke
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}), r;
|
|
320
|
+
}
|
|
321
|
+
export {
|
|
322
|
+
je as BarSkeleton,
|
|
323
|
+
K as barOptions,
|
|
324
|
+
Me as createBarDownloadConfig,
|
|
325
|
+
Te as createBarOptionFactory
|
|
326
|
+
};
|
|
327
|
+
//# sourceMappingURL=bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar.js","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 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 } 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 padding: [parseInt(theme.spacing(0.5)), 0, 0, 0],\n margin: 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 fontSize: theme.typography.overlineDelicate?.fontSize,\n fontFamily: theme.typography.overlineDelicate?.fontFamily,\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 seriesNames = options.seriesNames\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 const { niceMinVal, niceMaxVal } = computeNiceBounds(seriesArr)\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 return {\n ...(typeof template === 'object' ? template : {}),\n type: 'bar' as const,\n datasetIndex: i,\n name: seriesNames?.[i] ?? `Series ${i + 1}`,\n encode: { x: 'name', y: 'value' },\n barMaxWidth: 100,\n emphasis: { focus: 'series' },\n itemStyle: dimItemStyle,\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: niceMinVal,\n max: niceMaxVal,\n axisLabel: {\n ...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),\n formatter: (value: number) => {\n if (value !== niceMaxVal && value !== niceMinVal) 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\nfunction computeNiceBounds(seriesArr: BarWidgetData): {\n niceMinVal: number\n niceMaxVal: number\n} {\n let min = 0\n let max = -Infinity\n for (const series of seriesArr) {\n for (const d of series) {\n if (typeof d?.value !== 'number' || !Number.isFinite(d.value)) continue\n if (d.value < min) min = d.value\n if (d.value > max) max = d.value\n }\n }\n const niceMinVal = min < 0 ? niceNum(min) : 0\n const niceMaxVal = max <= 0 ? 1 : niceNum(max)\n return { niceMinVal, niceMaxVal }\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 CSVIcon,\n buildPngDownloadItem,\n downloadToCSV,\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 id: 'csv',\n label: 'CSV',\n icon: <CSVIcon fontSize='small' />,\n resolve: () => {\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 const handle = downloadToCSV(rows)\n return Promise.resolve({\n url: handle.url,\n filename: `${args.filename}.csv`,\n revoke: handle.revoke,\n })\n },\n })\n return items\n}\n"],"names":["barOptions","theme","formatter","labelFormatter","niceMin","niceMax","grid","left","parseInt","spacing","top","right","buildGridConfig","containLabel","tooltip","trigger","backgroundColor","palette","grey","borderWidth","padding","textStyle","color","common","white","fontSize","fontFamily","typography","caption","axisPointer","type","position","createTooltipPositioner","buildBarTooltipFormatter","legend","buildLegendConfig","hasLegend","lineStyle","secondary","main","Object","values","qualitative","bold","xAxis","axisLine","show","axisTick","axisLabel","margin","hideOverlap","v","String","yAxis","min","extent","niceNum","max","splitLine","black","divider","overlineDelicate","showMaxLabel","showMinLabel","verticalAlign","inside","value","createBarOptionFactory","options","optionsOverride","seriesNames","selection","selectionSet","length","Set","option","data","ctx","structural","mergeOptions","seriesArr","Array","isArray","dataset","series","baseLegend","baseGrid","baseTooltip","baseYAxis","seriesTemplates","broadcastTemplate","liveFormatter","liveLabelFormatter","niceMinVal","niceMaxVal","computeNiceBounds","dataZoomLayout","positionDataZoomForLegend","dataZoom","fallbackBottom","bottom","baseBottom","gridBottom","ZOOM_LAYOUT","sliderHeight","sliderGap","dimItemStyle","params","base","name","has","echarts","modifyAlpha","map","s","source","_","i","template","datasetIndex","encode","x","y","barMaxWidth","emphasis","focus","itemStyle","createTooltipFormatter","item","raw","formattedValue","marker","seriesName","d","Number","isFinite","styles","container","display","alignItems","justifyContent","flexDirection","gap","height","flex","width","bar","maxWidth","marginLeft","legendItem","BAR_HEIGHTS","BarSkeleton","$","_c","t0","Symbol","for","jsx","Box","_temp","t1","_temp2","i_0","jsxs","Skeleton","createBarDownloadConfig","args","items","getCaptureEl","push","buildPngDownloadItem","filename","pixelRatio","pngPixelRatio","pngBackgroundColor","id","label","icon","CSVIcon","resolve","getData","rows","entries","handle","downloadToCSV","Promise","url","revoke"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAASA,EAAW;AAAA,EACzBC,OAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,gBAAAA;AACe,GAAqB;AAGpC,MAAIC,IAAU,GACVC,IAAU;AAEd,SAAO;AAAA,IACLC,MAAM;AAAA,MACJC,MAAMC,SAASP,EAAMQ,QAAQ,CAAC,CAAC;AAAA,MAC/BC,KAAKF,SAASP,EAAMQ,QAAQ,CAAC,CAAC;AAAA,MAC9BE,OAAOH,SAASP,EAAMQ,QAAQ,CAAC,CAAC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SAAID,EAAKE,gBACPD,EAAME,KACJC,EAAqB;AAAA,IACnBC,UAAUL,EAAKK;AAAAA,IACfH,cAAcF,EAAKE;AAAAA,IACnBI,YAAYN,EAAKO;AAAAA,IACjB7J,iBAAiBsJ,EAAKQ;AAAAA,EAAAA,CACvB,CACH,GAEFP,EAAME,KAAK;AAAA,IACTM,IAAI;AAAA,IACJC,OAAO;AAAA,IACPC,MAAM,gBAAApB,EAACqB,GAAA,EAAQ,UAAS,QAAA,CAAO;AAAA,IAC/BC,SAASA,MAAM;AACb,YAAMvG,IAAO0F,EAAKc,QAAAA,GACZC,IAAoB,CAAA;AAC1B,iBAAW,CAAChE,GAAGjC,CAAM,KAAKR,EAAK0G,WAAW;AACxC,QAAIjE,IAAI,KAAGgE,EAAKZ,KAAK,CAAA,CAAE,GACvBY,EAAKZ,KAAK,CAAC,QAAQ,OAAO,CAAC;AAC3B,mBAAWpC,KAAKjD,EAAQiG,CAAAA,EAAKZ,KAAK,CAACpC,EAAExB,MAAMwB,EAAEnE,KAAK,CAAC;AAAA,MACrD;AACA,YAAMqH,IAASC,EAAcH,CAAI;AACjC,aAAOI,QAAQN,QAAQ;AAAA,QACrBO,KAAKH,EAAOG;AAAAA,QACZf,UAAU,GAAGL,EAAKK,QAAQ;AAAA,QAC1BgB,QAAQJ,EAAOI;AAAAA,MAAAA,CAChB;AAAA,IACH;AAAA,EAAA,CACD,GACMpB;AACT;"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { C as j, a as A, b as N, c as z, d as V, e as G, f as L } from "../category-DwaeYjpX.js";
|
|
2
|
+
import { jsx as m, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { c as h } from "react/compiler-runtime";
|
|
4
|
+
import { Box as p, Skeleton as f } from "@mui/material";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@mui/icons-material/FileDownload";
|
|
7
|
+
import "../lasso-tool-BYbxrJ-7.js";
|
|
8
|
+
import "../cjs-D4KH3azB.js";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import { a as w } from "../exports-Cx-f6m6U.js";
|
|
11
|
+
import "@mui/icons-material/ImageOutlined";
|
|
12
|
+
import { b as C } from "../png-item-CS4z1iSH.js";
|
|
13
|
+
const s = {
|
|
14
|
+
root: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: 1,
|
|
18
|
+
py: 0.5
|
|
19
|
+
},
|
|
20
|
+
// Mirror the real row layout: label + value on top, bar below.
|
|
21
|
+
row: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
gap: 0.5
|
|
25
|
+
},
|
|
26
|
+
rowHeader: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
justifyContent: "space-between",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
gap: 1
|
|
31
|
+
},
|
|
32
|
+
// Small fixed-width shimmer pills — matches the visual density of the
|
|
33
|
+
// real label / value cells without claiming the full row width.
|
|
34
|
+
name: {
|
|
35
|
+
height: 14,
|
|
36
|
+
width: 80
|
|
37
|
+
},
|
|
38
|
+
value: {
|
|
39
|
+
height: 14,
|
|
40
|
+
width: 48
|
|
41
|
+
}
|
|
42
|
+
}, x = {
|
|
43
|
+
small: 4,
|
|
44
|
+
medium: 12
|
|
45
|
+
}, g = ["95%", "80%", "55%", "75%", "60%"];
|
|
46
|
+
function B(o) {
|
|
47
|
+
const e = h(5), {
|
|
48
|
+
rows: l,
|
|
49
|
+
size: i
|
|
50
|
+
} = o, r = l === void 0 ? 5 : l, a = i === void 0 ? "small" : i;
|
|
51
|
+
let t;
|
|
52
|
+
e[0] !== r ? (t = Array.from({
|
|
53
|
+
length: r
|
|
54
|
+
}), e[0] = r, e[1] = t) : t = e[1];
|
|
55
|
+
let n;
|
|
56
|
+
return e[2] !== a || e[3] !== t ? (n = /* @__PURE__ */ m(p, { sx: s.root, children: t.map((c, u) => /* @__PURE__ */ d(p, { sx: s.row, children: [
|
|
57
|
+
/* @__PURE__ */ d(p, { sx: s.rowHeader, children: [
|
|
58
|
+
/* @__PURE__ */ m(f, { variant: "rectangular", sx: s.name }),
|
|
59
|
+
/* @__PURE__ */ m(f, { variant: "rectangular", sx: s.value })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ m(f, { variant: "rectangular", sx: {
|
|
62
|
+
height: x[a],
|
|
63
|
+
width: g[u % g.length]
|
|
64
|
+
} })
|
|
65
|
+
] }, `row-${u}`)) }), e[2] = a, e[3] = t, e[4] = n) : n = e[4], n;
|
|
66
|
+
}
|
|
67
|
+
function P(o) {
|
|
68
|
+
const e = [];
|
|
69
|
+
return o.getCaptureEl && e.push(C({
|
|
70
|
+
filename: o.filename,
|
|
71
|
+
getCaptureEl: o.getCaptureEl,
|
|
72
|
+
pixelRatio: o.pngPixelRatio,
|
|
73
|
+
backgroundColor: o.pngBackgroundColor
|
|
74
|
+
})), e.push({
|
|
75
|
+
id: "csv",
|
|
76
|
+
label: "Download as CSV",
|
|
77
|
+
resolve: () => {
|
|
78
|
+
const l = o.getData(), i = [["series", "name", "value"]];
|
|
79
|
+
for (const [a, t] of l.entries()) {
|
|
80
|
+
const n = o.seriesNames?.[a] ?? `series_${a + 1}`;
|
|
81
|
+
for (const c of t)
|
|
82
|
+
i.push([n, c.name, c.value]);
|
|
83
|
+
}
|
|
84
|
+
const r = w(i);
|
|
85
|
+
return Promise.resolve({
|
|
86
|
+
url: r.url,
|
|
87
|
+
filename: `${o.filename}.csv`,
|
|
88
|
+
revoke: r.revoke
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}), e;
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
j as Category,
|
|
95
|
+
A as CategoryBar,
|
|
96
|
+
N as CategoryLegend,
|
|
97
|
+
z as CategoryRowMulti,
|
|
98
|
+
V as CategoryRowOther,
|
|
99
|
+
G as CategoryRowSingle,
|
|
100
|
+
B as CategorySkeleton,
|
|
101
|
+
L as CategoryUI,
|
|
102
|
+
P as createCategoryDownloadConfig
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sources":["../../src/widgets-v2/category/skeleton.tsx","../../src/widgets-v2/category/download.ts"],"sourcesContent":["import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\nimport type { CategorySize } from './types'\n\nconst styles = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n py: 0.5,\n },\n // Mirror the real row layout: label + value on top, bar below.\n row: {\n display: 'flex',\n flexDirection: 'column',\n gap: 0.5,\n },\n rowHeader: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 1,\n },\n // Small fixed-width shimmer pills — matches the visual density of the\n // real label / value cells without claiming the full row width.\n name: { height: 14, width: 80 },\n value: { height: 14, width: 48 },\n} satisfies Record<string, SxProps<Theme>>\n\n// Bar shimmer height matches the live bar track for each size variant so\n// the skeleton doesn't visibly resize the row on data settle.\nconst BAR_HEIGHT: Record<CategorySize, number> = {\n small: 4,\n medium: 12,\n}\n\n// Varied widths give the bar shimmer a more realistic, less uniform feel.\n// Cycles when `rows > WIDTH_PATTERNS.length`.\nconst WIDTH_PATTERNS = ['95%', '80%', '55%', '75%', '60%']\n\nexport interface CategorySkeletonProps {\n rows?: number\n /**\n * Visual density. Mirrors the live widget's `size` prop so the loading\n * shimmer's bar height matches what's about to render — no row jump\n * on data settle.\n */\n size?: CategorySize\n}\n\nexport function CategorySkeleton({\n rows = 5,\n size = 'small',\n}: CategorySkeletonProps) {\n return (\n <Box sx={styles.root}>\n {Array.from({ length: rows }).map((_, i) => (\n <Box key={`row-${i}`} sx={styles.row}>\n <Box sx={styles.rowHeader}>\n <Skeleton variant='rectangular' sx={styles.name} />\n <Skeleton variant='rectangular' sx={styles.value} />\n </Box>\n <Skeleton\n variant='rectangular'\n sx={{\n height: BAR_HEIGHT[size],\n width: WIDTH_PATTERNS[i % WIDTH_PATTERNS.length],\n }}\n />\n </Box>\n ))}\n </Box>\n )\n}\n","import {\n buildPngDownloadItem,\n downloadToCSV,\n type DownloadItem,\n} from '../actions/download'\nimport type { CategoryWidgetData } from './types'\n\n/**\n * Download menu items for the Category widget. Always includes a CSV item\n * with `series, name, value` columns (one row per item). When\n * `getCaptureEl` is supplied, prepends a PNG item that rasterises the\n * captured element via `html2canvas`.\n */\nexport function createCategoryDownloadConfig(args: {\n filename: string\n getData: () => CategoryWidgetData\n seriesNames?: readonly string[]\n getCaptureEl?: () => HTMLElement | null\n pngPixelRatio?: number\n pngBackgroundColor?: string | null\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 id: 'csv',\n label: 'Download as CSV',\n resolve: () => {\n const data = args.getData()\n const rows: unknown[][] = [['series', 'name', 'value']]\n for (const [i, series] of data.entries()) {\n const seriesName = args.seriesNames?.[i] ?? `series_${i + 1}`\n for (const item of series) {\n rows.push([seriesName, item.name, item.value])\n }\n }\n const handle = downloadToCSV(rows)\n return Promise.resolve({\n url: handle.url,\n filename: `${args.filename}.csv`,\n revoke: handle.revoke,\n })\n },\n })\n return items\n}\n"],"names":["styles","root","display","flexDirection","gap","py","row","rowHeader","justifyContent","alignItems","name","height","width","value","BAR_HEIGHT","small","medium","WIDTH_PATTERNS","CategorySkeleton","t0","$","_c","rows","t1","size","t2","undefined","t3","Array","from","length","t4","Box","map","_","i","jsxs","jsx","Skeleton","createCategoryDownloadConfig","args","items","getCaptureEl","push","buildPngDownloadItem","filename","pixelRatio","pngPixelRatio","backgroundColor","pngBackgroundColor","id","label","resolve","data","getData","series","entries","seriesName","seriesNames","item","handle","downloadToCSV","Promise","url","revoke"],"mappings":";;;;;;;;;;;;AAIA,MAAMA,IAAS;AAA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,EAAOI;AAAAA,MAAAA,CAChB;AAAA,IACH;AAAA,EAAA,CACD,GACMvB;AACT;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { D as T, E as z, a as D, _ as U, o as w } from "../echart-CU0KmClP.js";
|
|
2
|
+
import { c as C } from "react/compiler-runtime";
|
|
3
|
+
import { useRef as R } from "react";
|
|
4
|
+
function F(x) {
|
|
5
|
+
const e = C(15), {
|
|
6
|
+
selection: s,
|
|
7
|
+
onSelectionChange: t,
|
|
8
|
+
keyFromClick: f,
|
|
9
|
+
keysFromBrush: h
|
|
10
|
+
} = x;
|
|
11
|
+
let n;
|
|
12
|
+
e[0] !== f || e[1] !== t || e[2] !== s ? (n = (S) => {
|
|
13
|
+
if (!t)
|
|
14
|
+
return;
|
|
15
|
+
const b = f(S);
|
|
16
|
+
if (b == null)
|
|
17
|
+
return;
|
|
18
|
+
const a = s ?? [], p = a.indexOf(b), B = p === -1 ? [...a, b] : [...a.slice(0, p), ...a.slice(p + 1)];
|
|
19
|
+
t(B);
|
|
20
|
+
}, e[0] = f, e[1] = t, e[2] = s, e[3] = n) : n = e[3];
|
|
21
|
+
const u = n;
|
|
22
|
+
let r;
|
|
23
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = [], e[4] = r) : r = e[4];
|
|
24
|
+
const E = R(r);
|
|
25
|
+
let c;
|
|
26
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (S) => {
|
|
27
|
+
const k = S;
|
|
28
|
+
E.current = k.batch?.[0]?.selected ?? [];
|
|
29
|
+
}, e[5] = c) : c = e[5];
|
|
30
|
+
const y = c;
|
|
31
|
+
let o;
|
|
32
|
+
e[6] !== h || e[7] !== t ? (o = () => {
|
|
33
|
+
t && t(h(E.current));
|
|
34
|
+
}, e[6] = h, e[7] = t, e[8] = o) : o = e[8];
|
|
35
|
+
const m = o;
|
|
36
|
+
let l;
|
|
37
|
+
e[9] !== m || e[10] !== u ? (l = {
|
|
38
|
+
click: u,
|
|
39
|
+
brushSelected: y,
|
|
40
|
+
brushEnd: m
|
|
41
|
+
}, e[9] = m, e[10] = u, e[11] = l) : l = e[11];
|
|
42
|
+
const d = l, _ = s && s.length > 0 ? s : null;
|
|
43
|
+
let i;
|
|
44
|
+
return e[12] !== d || e[13] !== _ ? (i = {
|
|
45
|
+
onEvents: d,
|
|
46
|
+
selection: _
|
|
47
|
+
}, e[12] = d, e[13] = _, e[14] = i) : i = e[14], i;
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
T as DEFAULT_INIT_OPTS,
|
|
51
|
+
z as Echart,
|
|
52
|
+
D as EchartUI,
|
|
53
|
+
U as __resetSharedResizeObserver,
|
|
54
|
+
w as observeResize,
|
|
55
|
+
F as useChartSelection
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=echart.js.map
|