@carto/ps-react-ui 4.7.0 → 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/actions.js +688 -668
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +14 -13
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/histogram.js +38 -37
- 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-overlay.tsx +24 -2
- 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/histogram/config.ts +1 -3
- 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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import * as echarts from 'echarts';
|
|
3
|
+
export declare const DEFAULT_INIT_OPTS: {
|
|
4
|
+
renderer: "svg";
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export type EchartsEventHandler = (event: unknown) => void;
|
|
8
|
+
export interface EchartUIProps {
|
|
9
|
+
option: echarts.EChartsOption;
|
|
10
|
+
/**
|
|
11
|
+
* Keys to merge as arrays (replace by index) instead of by id. The middleware
|
|
12
|
+
* memoizes this content-stably, so identical sets don't re-trigger setOption.
|
|
13
|
+
*/
|
|
14
|
+
replaceMerge?: readonly string[];
|
|
15
|
+
/**
|
|
16
|
+
* Opaque ECharts event passthrough — handlers fire untransformed.
|
|
17
|
+
*
|
|
18
|
+
* **Must be referentially stable** (memoize it with `useMemo` /
|
|
19
|
+
* `useCallback`, or hoist to module scope). The binding effect depends on
|
|
20
|
+
* the `onEvents` object identity; an inline `{ click: handler }` literal
|
|
21
|
+
* recreates the object on every render and causes every listener to be
|
|
22
|
+
* detached and re-attached each commit.
|
|
23
|
+
*/
|
|
24
|
+
onEvents?: Record<string, EchartsEventHandler>;
|
|
25
|
+
/**
|
|
26
|
+
* Init options forwarded to echarts.init. Captured at mount only — to change
|
|
27
|
+
* `renderer` or `height` after mount, unmount and remount the chart.
|
|
28
|
+
* Defaults: `{ renderer: 'svg', height: 304 }`.
|
|
29
|
+
*/
|
|
30
|
+
init?: echarts.EChartsInitOpts;
|
|
31
|
+
/**
|
|
32
|
+
* Optional callback fired once after the ECharts instance is created
|
|
33
|
+
* (`onInstance(chart)`) and once when it's about to be disposed
|
|
34
|
+
* (`onInstance(null)`). Used by `Widget.Echart` to publish the live
|
|
35
|
+
* instance to the per-widget registry so other actions (e.g.
|
|
36
|
+
* `ZoomToggle`'s disable handler) can reach it without DOM lookups.
|
|
37
|
+
* No need to memoize — the bridge wraps it in `useEffectEvent` so an
|
|
38
|
+
* unstable reference does not re-init the chart.
|
|
39
|
+
*/
|
|
40
|
+
onInstance?: (chart: echarts.ECharts | null) => void;
|
|
41
|
+
className?: string;
|
|
42
|
+
sx?: SxProps<Theme>;
|
|
43
|
+
}
|
|
44
|
+
export declare function EchartUI({ option, replaceMerge, onEvents, init, onInstance, className, sx, }: EchartUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EchartsEventHandler } from './echart-ui';
|
|
2
|
+
import type * as echarts from 'echarts';
|
|
3
|
+
/**
|
|
4
|
+
* Reactive context passed to every {@link OptionFactory} call so the
|
|
5
|
+
* factory can rebuild render-time pieces (axis label / tooltip formatters)
|
|
6
|
+
* from the live store. Drives RelativeData / consumer-formatter changes
|
|
7
|
+
* through to the chart without rebuilding the structural option.
|
|
8
|
+
*/
|
|
9
|
+
export interface OptionFactoryContext {
|
|
10
|
+
formatter?: (value: number) => string;
|
|
11
|
+
labelFormatter?: (value: string | number) => string | number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The per-widget option factory — a single callable that owns BOTH phases
|
|
15
|
+
* of option construction:
|
|
16
|
+
*
|
|
17
|
+
* - **Structural phase** — when `option == null`, return the theme-aware
|
|
18
|
+
* structural option (tooltip / legend / color palette / series
|
|
19
|
+
* template, optionally merged with a consumer-supplied `optionsOverride`).
|
|
20
|
+
* No data is read. `<Widget.Echart>` calls the factory with
|
|
21
|
+
* `(undefined, undefined)` synchronously during render to derive the
|
|
22
|
+
* structural base; `configTransforms` (Stack/Zoom/Brush) then mutate it
|
|
23
|
+
* in the same render pass.
|
|
24
|
+
* - **Merge phase** — when `option` is defined, fuse `data` into the
|
|
25
|
+
* post-configTransforms option at fusion time. `<Widget.Echart>` calls
|
|
26
|
+
* the factory with `(transformed, data, ctx)` on every render.
|
|
27
|
+
*
|
|
28
|
+
* The two phases share a closure (the factory creator captures `theme`,
|
|
29
|
+
* `formatter`, `labelFormatter`, `seriesNames`, `selection`, `optionsOverride`,
|
|
30
|
+
* …), so structural and merge agree on the same widget configuration.
|
|
31
|
+
*
|
|
32
|
+
* The third arg `ctx` carries the **live** store-side formatters at the
|
|
33
|
+
* call site — distinct from the closure-time formatters because actions
|
|
34
|
+
* like RelativeData can install a percent formatter on the store after
|
|
35
|
+
* the factory was constructed. The merge phase reads from `ctx`; the
|
|
36
|
+
* structural phase typically uses the closure-time values.
|
|
37
|
+
*/
|
|
38
|
+
export type OptionFactory = (option: echarts.EChartsOption | undefined, data: unknown, ctx?: OptionFactoryContext) => echarts.EChartsOption;
|
|
39
|
+
export interface EchartProps {
|
|
40
|
+
/**
|
|
41
|
+
* The per-widget {@link OptionFactory}. Required — `<Widget.Echart>`
|
|
42
|
+
* derives the structural option from it (so configTransforms have a base
|
|
43
|
+
* to mutate) and fuses `state.data` into the post-pipeline option at
|
|
44
|
+
* render time. Wrap the factory creator in `useMemo` so its identity is
|
|
45
|
+
* stable across renders.
|
|
46
|
+
*/
|
|
47
|
+
optionFactory: OptionFactory;
|
|
48
|
+
onEvents?: Record<string, EchartsEventHandler>;
|
|
49
|
+
init?: echarts.EChartsInitOpts;
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Stateful Echart bridge — owns the entire ECharts coupling. The whole
|
|
54
|
+
* option pipeline lives here, not in the store:
|
|
55
|
+
*
|
|
56
|
+
* 1. **Structural** — `optionFactory(undefined, undefined)` produces the
|
|
57
|
+
* theme-aware base. Memoized on the factory identity, so the consumer's
|
|
58
|
+
* `useMemo` ID gates the rebuild.
|
|
59
|
+
* 2. **Transformed** — `applyTransforms(structural, configTransforms)`
|
|
60
|
+
* applies any registered configTransforms (Stack/Zoom/Brush) over the
|
|
61
|
+
* structural base. Memoized on `[structural, configTransforms]`.
|
|
62
|
+
* 3. **`replaceMerge`** — derived from the enabled configTransforms'
|
|
63
|
+
* `replaceMergeKeys`, deduped and sorted, seeded with
|
|
64
|
+
* {@link DEFAULT_REPLACE_MERGE}. Memoized on `[configTransforms]` so
|
|
65
|
+
* ECharts sees a stable array reference across non-transform changes.
|
|
66
|
+
* 4. **Merge** — `optionFactory(transformed, data, ctx)` fuses post-
|
|
67
|
+
* pipeline data into the option. Reactive `ctx` carries the live store
|
|
68
|
+
* formatters so RelativeData's percent formatter flows through without
|
|
69
|
+
* a structural rebuild.
|
|
70
|
+
*
|
|
71
|
+
* The `<Widget.Provider>` doesn't know about the factory at all: it stays
|
|
72
|
+
* a renderer-agnostic shell. The `ProviderProps` surface has no ECharts
|
|
73
|
+
* coupling, so non-Echart widgets don't transitively import the type.
|
|
74
|
+
*/
|
|
75
|
+
export declare function Echart({ optionFactory, onEvents, init, className, }: EchartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { EchartUI, DEFAULT_INIT_OPTS, type EchartUIProps, type EchartsEventHandler, } from './echart-ui';
|
|
2
|
+
export { Echart, type EchartProps, type OptionFactory, type OptionFactoryContext, } from './echart';
|
|
3
|
+
export { useChartSelection, type SelectionKey, type UseChartSelectionOptions, type ChartSelectionWiring, } from './use-chart-selection';
|
|
4
|
+
export { observeResize, __resetSharedResizeObserver, } from './shared-resize-observer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CallbackDataParams } from 'echarts/types/dist/shared';
|
|
2
|
+
import { EchartsEventHandler } from './echart-ui';
|
|
3
|
+
export type SelectionKey = string | number;
|
|
4
|
+
export interface UseChartSelectionOptions<K extends SelectionKey> {
|
|
5
|
+
/** Controlled selection. `undefined` is treated the same as `[]`. */
|
|
6
|
+
selection?: readonly K[];
|
|
7
|
+
/** Receives the next selection. When omitted the wiring is a no-op. */
|
|
8
|
+
onSelectionChange?: (next: readonly K[]) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Pull a selection key out of an ECharts `click` event. Return `null` to
|
|
11
|
+
* skip (e.g. a click on empty plot area). For Bar/Pie/Timeseries this is
|
|
12
|
+
* usually `(p) => p.name`; for Histogram/Scatterplot it's the dataIndex.
|
|
13
|
+
*/
|
|
14
|
+
keyFromClick: (params: CallbackDataParams) => K | null;
|
|
15
|
+
/**
|
|
16
|
+
* Map a `brushSelected` payload's `selected[*]` entries (each carrying a
|
|
17
|
+
* `seriesIndex` + `dataIndex[]`) into the full set of selection keys for
|
|
18
|
+
* the brushed area. Called once per brush event.
|
|
19
|
+
*/
|
|
20
|
+
keysFromBrush: (selected: readonly {
|
|
21
|
+
seriesIndex: number;
|
|
22
|
+
dataIndex: number[];
|
|
23
|
+
}[]) => K[];
|
|
24
|
+
}
|
|
25
|
+
export interface ChartSelectionWiring<K extends SelectionKey> {
|
|
26
|
+
/**
|
|
27
|
+
* Pass straight to `<Widget.Echart onEvents={…}>`. Wires `click` and
|
|
28
|
+
* `brushSelected` so the user's interactions reach `onSelectionChange`.
|
|
29
|
+
*/
|
|
30
|
+
onEvents: Record<string, EchartsEventHandler>;
|
|
31
|
+
/**
|
|
32
|
+
* The current selection — `null` when the consumer didn't pass one or it's
|
|
33
|
+
* empty. Mergers should treat `null` as "no dimming" and a non-null array
|
|
34
|
+
* as "render only these as fully opaque, dim the rest".
|
|
35
|
+
*/
|
|
36
|
+
selection: readonly K[] | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Translate ECharts' click + brush events into a consumer-owned selection
|
|
40
|
+
* with the expected dashboard semantics:
|
|
41
|
+
*
|
|
42
|
+
* - **Click toggles** — clicking an item adds it to the selection if
|
|
43
|
+
* absent, removes it if present.
|
|
44
|
+
* - **Brush replaces** — finishing a brush stroke overwrites the selection
|
|
45
|
+
* with whatever the brush covered (drag-to-empty clears).
|
|
46
|
+
*
|
|
47
|
+
* Wire the returned `onEvents` into `<Widget.Echart>` and feed
|
|
48
|
+
* `wiring.selection` to the widget's option factory so the merger can dim
|
|
49
|
+
* non-selected rows at fusion time.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useChartSelection<K extends SelectionKey>({ selection, onSelectionChange, keyFromClick, keysFromBrush, }: UseChartSelectionOptions<K>): ChartSelectionWiring<K>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChipProps } from '@mui/material';
|
|
2
|
+
import { DeltaSeverity } from './types';
|
|
3
|
+
export interface DeltaProps {
|
|
4
|
+
/** Numeric magnitude. Used for the default percent label and severity inference. */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Pre-formatted label override; skips the default percent formatter. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Visual treatment. When omitted it's derived from the sign of `value`:
|
|
10
|
+
* `>0 → 'positive'`, `<0 → 'negative'`, `=0 → 'neutral'`.
|
|
11
|
+
*/
|
|
12
|
+
severity?: DeltaSeverity;
|
|
13
|
+
/** Override the default `Intl.NumberFormat({style:'percent'})` formatter. */
|
|
14
|
+
format?: (value: number) => string;
|
|
15
|
+
ChipProps?: ChipProps;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Comparative delta rendered as a small filled chip. Colour is driven by
|
|
19
|
+
* `severity` (or the sign of `value`); content is `label`, the result of
|
|
20
|
+
* `format(value)`, or the default percent format.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Delta({ value, label, severity, format, ChipProps: chipProps, }: DeltaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DownloadItem } from '../actions/download';
|
|
2
|
+
import { FormulaWidgetData } from './types';
|
|
3
|
+
export interface FormulaDownloadConfigArgs {
|
|
4
|
+
filename: string;
|
|
5
|
+
getData: () => FormulaWidgetData;
|
|
6
|
+
/**
|
|
7
|
+
* Optional getter for the widget's capture element (registered by
|
|
8
|
+
* `Widget.State`). When provided, a PNG item is prepended.
|
|
9
|
+
*/
|
|
10
|
+
getCaptureEl?: () => HTMLElement | null;
|
|
11
|
+
pngPixelRatio?: number;
|
|
12
|
+
pngBackgroundColor?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds download items for the Formula widget. Always includes a CSV item
|
|
16
|
+
* with one row per KPI (`prefix`, `value`, `suffix`, `note`, `delta`).
|
|
17
|
+
* When `getCaptureEl` is supplied, prepends a PNG item that rasterises the
|
|
18
|
+
* captured element via `html2canvas`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createFormulaDownloadConfig(args: FormulaDownloadConfigArgs): DownloadItem[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { FormulaDataItem } from './types';
|
|
3
|
+
export interface FormulaUIProps {
|
|
4
|
+
items: readonly FormulaDataItem[];
|
|
5
|
+
/** Number formatter — applied to each item's `value`. */
|
|
6
|
+
formatter?: (value: number) => string;
|
|
7
|
+
/** Forwarded to the root `<Box>` so consumers can capture the DOM (PNG export). */
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Pure presentational component for the Formula widget. Each item renders as
|
|
12
|
+
* a row containing (in order): optional `Series` avatar, a body with
|
|
13
|
+
* `[prefix] value [suffix]` plus optional `Note`, and an optional `Delta`
|
|
14
|
+
* chip pushed to the right edge.
|
|
15
|
+
*
|
|
16
|
+
* For fully custom layouts, compose {@link Series}, {@link Prefix},
|
|
17
|
+
* {@link Value}, {@link Suffix}, {@link Note}, and {@link Delta} directly
|
|
18
|
+
* instead of passing `items`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function FormulaUI({ items, formatter, ref }: FormulaUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stateful Formula bridge — reads `data` (post-pipeline) and `formatter` from
|
|
3
|
+
* the per-widget store and forwards them to the pure {@link FormulaUI}. Sits
|
|
4
|
+
* inside `<Widget.Provider>`. Demonstrates that the composition shell
|
|
5
|
+
* (Provider, Wrapper, State) doesn't care whether the rendered child is
|
|
6
|
+
* ECharts (Bar) or a custom DOM tree (Formula).
|
|
7
|
+
*/
|
|
8
|
+
export declare function Formula(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Formula } from './formula';
|
|
2
|
+
export { FormulaUI, type FormulaUIProps } from './formula-ui';
|
|
3
|
+
export { Prefix, type PrefixProps } from './prefix';
|
|
4
|
+
export { Suffix, type SuffixProps } from './suffix';
|
|
5
|
+
export { Value, type ValueProps } from './value';
|
|
6
|
+
export { Series, type SeriesProps } from './series';
|
|
7
|
+
export { Note, type NoteProps } from './note';
|
|
8
|
+
export { Delta, type DeltaProps } from './delta';
|
|
9
|
+
export { FormulaSkeleton, type FormulaSkeletonProps } from './skeleton';
|
|
10
|
+
export { createFormulaDownloadConfig } from './download';
|
|
11
|
+
export type { FormulaDataItem, FormulaWidgetData, FormulaSeries, FormulaDelta, DeltaSeverity, } from './types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface NoteProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
TypographyProps?: TypographyProps;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Small subdued caption rendered below a Formula value. Use for short
|
|
9
|
+
* descriptive text (e.g. "Last 7 days", "Excludes refunds").
|
|
10
|
+
*/
|
|
11
|
+
export declare function Note({ children, TypographyProps }: NoteProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface PrefixProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
TypographyProps?: TypographyProps;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Prefix slot for a Formula KPI — large, bold, muted (`text.secondary`).
|
|
9
|
+
* Composable building block for custom formula layouts; the canonical
|
|
10
|
+
* {@link FormulaUI} renders one of these per item when `prefix` is set.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Prefix({ children, TypographyProps }: PrefixProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AvatarProps } from '@mui/material';
|
|
2
|
+
export interface SeriesProps {
|
|
3
|
+
/** Used for the avatar's first-letter glyph and as accessible label. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Avatar background colour (any MUI palette path or CSS colour). */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** Diameter in px. Default `24`. */
|
|
8
|
+
size?: number;
|
|
9
|
+
AvatarProps?: AvatarProps;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Series indicator — circular avatar showing the first letter of `name`.
|
|
13
|
+
* Background colour is `color` (consumer-supplied) or a neutral disabled
|
|
14
|
+
* colour, with text colour computed for contrast against it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Series({ name, color, size, AvatarProps: avatarProps, }: SeriesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
root: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
alignItems: "stretch";
|
|
7
|
+
};
|
|
8
|
+
row: {
|
|
9
|
+
display: "flex";
|
|
10
|
+
alignItems: "flex-start";
|
|
11
|
+
gap: number;
|
|
12
|
+
};
|
|
13
|
+
body: {
|
|
14
|
+
flex: number;
|
|
15
|
+
minWidth: number;
|
|
16
|
+
display: "flex";
|
|
17
|
+
flexDirection: "column";
|
|
18
|
+
gap: number;
|
|
19
|
+
};
|
|
20
|
+
valueRow: {
|
|
21
|
+
display: "inline-flex";
|
|
22
|
+
alignItems: "baseline";
|
|
23
|
+
gap: number;
|
|
24
|
+
};
|
|
25
|
+
delta: {
|
|
26
|
+
alignSelf: "center";
|
|
27
|
+
flexShrink: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface SuffixProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
TypographyProps?: TypographyProps;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Suffix slot for a Formula KPI — large, bold, muted (`text.secondary`).
|
|
9
|
+
* Composable building block for custom formula layouts; the canonical
|
|
10
|
+
* {@link FormulaUI} renders one of these per item when `suffix` is set.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Suffix({ children, TypographyProps }: SuffixProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Series metadata rendered as a coloured avatar at the start of a row. */
|
|
2
|
+
export interface FormulaSeries {
|
|
3
|
+
/** Used for the avatar's first-letter glyph and as accessible label. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Avatar background colour (any MUI palette path or CSS colour). */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
export type DeltaSeverity = 'positive' | 'negative' | 'neutral';
|
|
9
|
+
/** Comparative delta rendered as a coloured chip on the right of a row. */
|
|
10
|
+
export interface FormulaDelta {
|
|
11
|
+
/** Numeric magnitude. Default formatting renders as a percent (e.g. `-12,3 %`). */
|
|
12
|
+
value: number;
|
|
13
|
+
/** Pre-formatted label override (skips the default percent formatter). */
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Visual treatment override. When omitted it's derived from `value`'s sign:
|
|
17
|
+
* `>0 → 'positive'`, `<0 → 'negative'`, `=0 → 'neutral'`.
|
|
18
|
+
*/
|
|
19
|
+
severity?: DeltaSeverity;
|
|
20
|
+
}
|
|
21
|
+
/** A single KPI value rendered by the Formula widget. */
|
|
22
|
+
export interface FormulaDataItem {
|
|
23
|
+
value: number;
|
|
24
|
+
prefix?: string;
|
|
25
|
+
suffix?: string;
|
|
26
|
+
/** Override the value's text colour (e.g. `'success.main'`). */
|
|
27
|
+
color?: string;
|
|
28
|
+
/** Optional series indicator — coloured avatar with first letter of `name`. */
|
|
29
|
+
series?: FormulaSeries;
|
|
30
|
+
/** Optional caption rendered below the value. */
|
|
31
|
+
note?: string;
|
|
32
|
+
/** Optional comparative delta chip rendered to the right of the row. */
|
|
33
|
+
delta?: FormulaDelta;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Formula widget data — an array of KPI items rendered top-to-bottom. A common
|
|
37
|
+
* "single big number" widget is just `[{ value: 123 }]`. Multi-series usage
|
|
38
|
+
* sets `series`, `note`, and/or `delta` per item.
|
|
39
|
+
*/
|
|
40
|
+
export type FormulaWidgetData = readonly FormulaDataItem[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ValueProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Override the default `text.primary` color — useful for sparkline tints. */
|
|
6
|
+
color?: string;
|
|
7
|
+
TypographyProps?: TypographyProps;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Value slot for a Formula KPI — large, bold, primary text color. Composable
|
|
11
|
+
* building block for custom formula layouts; the canonical {@link FormulaUI}
|
|
12
|
+
* renders one of these per item.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Value({ children, color, TypographyProps }: ValueProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DownloadItem } from '../actions/download';
|
|
2
|
+
import { HistogramWidgetData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Download menu items for histograms. Always includes a CSV item with
|
|
5
|
+
* `bin_low, bin_high, series_1_count, series_2_count, …` columns (one row
|
|
6
|
+
* per bin). When `getCaptureEl` is supplied, prepends a PNG item that
|
|
7
|
+
* rasterises the captured element via `html2canvas`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createHistogramDownloadConfig(args: {
|
|
10
|
+
filename: string;
|
|
11
|
+
getData: () => HistogramWidgetData;
|
|
12
|
+
getTicks: () => readonly number[];
|
|
13
|
+
seriesNames?: readonly string[];
|
|
14
|
+
getCaptureEl?: () => HTMLElement | null;
|
|
15
|
+
pngPixelRatio?: number;
|
|
16
|
+
pngBackgroundColor?: string | null;
|
|
17
|
+
}): DownloadItem[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { histogramOptions, createHistogramOptionFactory } from './options';
|
|
2
|
+
export { HistogramSkeleton, type HistogramSkeletonProps } from './skeleton';
|
|
3
|
+
export { createHistogramDownloadConfig } from './download';
|
|
4
|
+
export { toRelativeHistogramData } from './transforms';
|
|
5
|
+
export type { HistogramWidgetData, HistogramOptionsInput, HistogramOptionFactoryInput, HistogramEChartsOption, } from './types';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OptionFactory } from '../echart';
|
|
2
|
+
import { HistogramEChartsOption, HistogramOptionFactoryInput, HistogramOptionsInput } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the **structural** ECharts option for a histogram widget — axes,
|
|
5
|
+
* grid, tooltip, value-axis label formatter, themed legend. Mirrors
|
|
6
|
+
* {@link import('../bar/options').barOptions} so the two widgets share v1
|
|
7
|
+
* look-and-feel: themed dark tooltip with positioner, CARTO color palette,
|
|
8
|
+
* structural legend (`show` toggled by the merger based on series count),
|
|
9
|
+
* y-axis labels rendered inside the plot via the `niceNum` closure pattern.
|
|
10
|
+
*
|
|
11
|
+
* Intentional deviations from bar (histogram-specific):
|
|
12
|
+
* - **No `xAxis.axisLabel.formatter`.** Bin labels are pre-formatted in
|
|
13
|
+
* the merger via `formatNumber(lo)–formatNumber(hi)` and optionally
|
|
14
|
+
* the consumer's `labelFormatter`. The strings on the axis are
|
|
15
|
+
* already display-ready, so there's nothing to post-format here.
|
|
16
|
+
* - **Tooltip formatter reads the array-tuple row shape.** The dataset
|
|
17
|
+
* uses positional `encode: { x: 0, y: 1 }`, so `item.value` comes in
|
|
18
|
+
* as `[binLabel, count]` rather than bar's `{ name, value }` object.
|
|
19
|
+
*
|
|
20
|
+
* Intentionally data-agnostic: no series, no dataset, no x-axis category
|
|
21
|
+
* data (those depend on data + ticks and are added by the option factory's
|
|
22
|
+
* merge phase via {@link createHistogramOptionFactory}).
|
|
23
|
+
*/
|
|
24
|
+
export declare function histogramOptions({ theme, formatter, }: HistogramOptionsInput): HistogramEChartsOption;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the histogram widget's {@link OptionFactory} — one closure that
|
|
27
|
+
* owns BOTH phases of option construction:
|
|
28
|
+
*
|
|
29
|
+
* - **Structural phase** (`option == null`) — builds the theme-aware
|
|
30
|
+
* structural option via {@link histogramOptions}, optionally merging
|
|
31
|
+
* the consumer-supplied `optionsOverride`. Called once by Provider to
|
|
32
|
+
* seed `rawOptions` in the store.
|
|
33
|
+
* - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`
|
|
34
|
+
* (`HistogramWidgetData` — `number[][]`) into the option via the
|
|
35
|
+
* dataset API. Each series gets its own dataset of `[binLabel, count]`
|
|
36
|
+
* pairs derived from `ticks`; series reference their dataset by
|
|
37
|
+
* `datasetIndex` and are encoded by column position. Reactive
|
|
38
|
+
* `ctx.formatter` (driven by RelativeData → `%`) plus `niceMin`/`niceMax`
|
|
39
|
+
* are re-derived here so the y-axis label formatter and the tooltip
|
|
40
|
+
* pick up live store values, mirroring bar.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createHistogramOptionFactory(options: HistogramOptionFactoryInput): OptionFactory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface HistogramSkeletonProps {
|
|
2
|
+
bins?: number;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Loading state for the Histogram widget. Mirrors Bar's skeleton structure
|
|
6
|
+
* — a grid of bars (bin-shaped silhouette, anchored to the bottom) plus a
|
|
7
|
+
* legend stub — so the placeholder reads consistently with Bar.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HistogramSkeleton({ bins }: HistogramSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Histogram-specific `RelativeData` transform. Histogram data is
|
|
3
|
+
* `number[][]` — each series is a flat list of bin counts. This
|
|
4
|
+
* rewrites each count to its share of the series total (0–100), so
|
|
5
|
+
* pairing with `createPercentFormatter` renders the y-axis as
|
|
6
|
+
* percentages.
|
|
7
|
+
*
|
|
8
|
+
* Pass to `<Widget.RelativeData transform={toRelativeHistogramData} />`.
|
|
9
|
+
*
|
|
10
|
+
* The denominator is the sum of |value| across the series so mixed-sign
|
|
11
|
+
* inputs produce sane signed shares-of-magnitude. A series whose total
|
|
12
|
+
* magnitude is zero (all-zero or empty input) is returned unchanged so
|
|
13
|
+
* a stalled or empty data set doesn't show misleading 0% values. Inputs
|
|
14
|
+
* whose shape isn't `number[][]` fall through untouched (same defensive
|
|
15
|
+
* shape-check pattern as the default transform).
|
|
16
|
+
*/
|
|
17
|
+
export declare const toRelativeHistogramData: (input: unknown) => unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
import { EChartsOption } from 'echarts';
|
|
3
|
+
/**
|
|
4
|
+
* Histogram widget data — array of series, each a flat array of bin counts.
|
|
5
|
+
* The option factory's merge phase (see {@link createHistogramOptionFactory})
|
|
6
|
+
* combines this with `ticks` to produce a 2-column dataset (`[binLabel, count]`)
|
|
7
|
+
* for ECharts.
|
|
8
|
+
*/
|
|
9
|
+
export type HistogramWidgetData = readonly (readonly number[])[];
|
|
10
|
+
/** Inputs to the structural-only {@link histogramOptions} builder. */
|
|
11
|
+
export interface HistogramOptionsInput {
|
|
12
|
+
theme: Theme;
|
|
13
|
+
formatter?: (value: number) => string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Combined inputs for the histogram option factory creator. Carries
|
|
17
|
+
* everything the widget needs across BOTH phases — the structural-build
|
|
18
|
+
* (`theme`, `formatter`, `optionsOverride`) AND the data merge (`ticks`,
|
|
19
|
+
* `seriesNames`, `labelFormatter`, `selection`).
|
|
20
|
+
*/
|
|
21
|
+
export interface HistogramOptionFactoryInput {
|
|
22
|
+
theme: Theme;
|
|
23
|
+
formatter?: (value: number) => string;
|
|
24
|
+
/** Bin boundaries — length = bins + 1. */
|
|
25
|
+
ticks: readonly number[];
|
|
26
|
+
/** Optional series names — drives the legend. */
|
|
27
|
+
seriesNames?: readonly string[];
|
|
28
|
+
/**
|
|
29
|
+
* Bin-range label transform (e.g. `"0–10"` → `"[0–10)"`). Distinct from
|
|
30
|
+
* the standard `OptionFactoryContext.labelFormatter` (which operates on
|
|
31
|
+
* categories): this one is histogram-specific and runs only on the
|
|
32
|
+
* generated bin-range strings before they hit the x-axis.
|
|
33
|
+
*/
|
|
34
|
+
labelFormatter?: (label: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Selected bin indices. Bins not in this list render dimmed
|
|
37
|
+
* (`itemStyle.opacity: 0.15`). `null`/empty means no selection.
|
|
38
|
+
*/
|
|
39
|
+
selection?: readonly number[] | null;
|
|
40
|
+
/**
|
|
41
|
+
* Consumer-supplied partial option merged into the structural option at
|
|
42
|
+
* structural-build time. Lets stories override pieces of the theme-aware
|
|
43
|
+
* base without forking the structural builder.
|
|
44
|
+
*/
|
|
45
|
+
optionsOverride?: Partial<EChartsOption>;
|
|
46
|
+
}
|
|
47
|
+
export type HistogramEChartsOption = EChartsOption;
|