@carto/ps-react-ui 4.7.1 → 4.9.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/{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-l4fNHLEg.js +213 -0
- package/dist/range-l4fNHLEg.js.map +1 -0
- package/dist/resolve-theme-color-BdojIw0K.js +47 -0
- package/dist/resolve-theme-color-BdojIw0K.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-CQCAnDLb.js +388 -0
- package/dist/table-CQCAnDLb.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 +46 -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 +53 -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 +43 -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 +51 -0
- package/dist/types/widgets-v2/index.d.ts +108 -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 +57 -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 +27 -0
- package/dist/types/widgets-v2/range/range.d.ts +24 -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 +54 -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 +40 -0
- package/dist/types/widgets-v2/table/table-ui.d.ts +44 -0
- package/dist/types/widgets-v2/table/table.d.ts +50 -0
- package/dist/types/widgets-v2/table/types.d.ts +48 -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 +60 -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/types.d.ts +25 -0
- package/dist/types/widgets-v2/utils/data-zoom-layout.d.ts +11 -0
- package/dist/types/widgets-v2/utils/index.d.ts +3 -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/utils/resolve-theme-color.d.ts +18 -0
- package/dist/types/widgets-v2/utils/resolve-theme-color.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 +330 -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 +353 -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 +387 -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 +411 -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 +358 -0
- package/dist/widgets-v2/timeseries.js.map +1 -0
- package/dist/widgets-v2/utils.js +8 -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 +71 -3
- 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 +334 -0
- package/src/widgets-v2/bar/options.ts +332 -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 +51 -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 +59 -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 +48 -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 +318 -0
- package/src/widgets-v2/histogram/options.ts +338 -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 +55 -0
- package/src/widgets-v2/index.ts +204 -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 +601 -0
- package/src/widgets-v2/pie/options.ts +513 -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 +62 -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 +136 -0
- package/src/widgets-v2/range/range-ui.tsx +278 -0
- package/src/widgets-v2/range/range.test.tsx +68 -0
- package/src/widgets-v2/range/range.tsx +52 -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 +411 -0
- package/src/widgets-v2/scatterplot/options.ts +425 -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 +59 -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 +43 -0
- package/src/widgets-v2/table/table-ui.test.tsx +200 -0
- package/src/widgets-v2/table/table-ui.tsx +364 -0
- package/src/widgets-v2/table/table.test.tsx +119 -0
- package/src/widgets-v2/table/table.tsx +179 -0
- package/src/widgets-v2/table/types.ts +55 -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 +394 -0
- package/src/widgets-v2/timeseries/options.ts +348 -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 +65 -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/types.ts +25 -0
- package/src/widgets-v2/utils/data-zoom-layout.ts +26 -0
- package/src/widgets-v2/utils/index.ts +3 -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/utils/resolve-theme-color.test.ts +43 -0
- package/src/widgets-v2/utils/resolve-theme-color.ts +34 -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,338 @@
|
|
|
1
|
+
import type { EChartsOption } from 'echarts'
|
|
2
|
+
import * as echarts from 'echarts'
|
|
3
|
+
import type { CallbackDataParams } from 'echarts/types/dist/shared'
|
|
4
|
+
import {
|
|
5
|
+
buildGridConfig,
|
|
6
|
+
buildLegendConfig,
|
|
7
|
+
createTooltipFormatter,
|
|
8
|
+
createTooltipPositioner,
|
|
9
|
+
niceNum,
|
|
10
|
+
} from '../../widgets/utils/chart-config'
|
|
11
|
+
import { ZOOM_LAYOUT } from '../actions/zoom-toggle'
|
|
12
|
+
import type { OptionFactory } from '../echart'
|
|
13
|
+
import { mergeOptions, resolveThemeColor } from '../utils'
|
|
14
|
+
import { positionDataZoomForLegend } from '../utils/data-zoom-layout'
|
|
15
|
+
import type {
|
|
16
|
+
HistogramEChartsOption,
|
|
17
|
+
HistogramOptionFactoryInput,
|
|
18
|
+
HistogramOptionsInput,
|
|
19
|
+
HistogramWidgetData,
|
|
20
|
+
} from './types'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builds the **structural** ECharts option for a histogram widget — axes,
|
|
24
|
+
* grid, tooltip, value-axis label formatter, themed legend. Mirrors
|
|
25
|
+
* {@link import('../bar/options').barOptions} so the two widgets share v1
|
|
26
|
+
* look-and-feel: themed dark tooltip with positioner, CARTO color palette,
|
|
27
|
+
* structural legend (`show` toggled by the merger based on series count),
|
|
28
|
+
* y-axis labels rendered inside the plot via the `niceNum` closure pattern.
|
|
29
|
+
*
|
|
30
|
+
* Intentional deviations from bar (histogram-specific):
|
|
31
|
+
* - **No `xAxis.axisLabel.formatter`.** Bin labels are pre-formatted in
|
|
32
|
+
* the merger via `formatNumber(lo)–formatNumber(hi)` and optionally
|
|
33
|
+
* the consumer's `labelFormatter`. The strings on the axis are
|
|
34
|
+
* already display-ready, so there's nothing to post-format here.
|
|
35
|
+
* - **Tooltip formatter reads the array-tuple row shape.** The dataset
|
|
36
|
+
* uses positional `encode: { x: 0, y: 1 }`, so `item.value` comes in
|
|
37
|
+
* as `[binLabel, count]` rather than bar's `{ name, value }` object.
|
|
38
|
+
*
|
|
39
|
+
* Intentionally data-agnostic: no series, no dataset, no x-axis category
|
|
40
|
+
* data (those depend on data + ticks and are added by the option factory's
|
|
41
|
+
* merge phase via {@link createHistogramOptionFactory}).
|
|
42
|
+
*/
|
|
43
|
+
export function histogramOptions({
|
|
44
|
+
theme,
|
|
45
|
+
formatter,
|
|
46
|
+
}: HistogramOptionsInput): HistogramEChartsOption {
|
|
47
|
+
// Closure shared between yAxis min/max callbacks and the label formatter,
|
|
48
|
+
// so only the rounded extents are labelled (matches v1 + bar).
|
|
49
|
+
let niceMin = 0
|
|
50
|
+
let niceMax = 1
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
grid: {
|
|
54
|
+
left: parseInt(theme.spacing(1)),
|
|
55
|
+
top: parseInt(theme.spacing(3)),
|
|
56
|
+
right: parseInt(theme.spacing(1)),
|
|
57
|
+
// Default: no legend. Merger bumps this when there are >1 series.
|
|
58
|
+
...buildGridConfig(false, theme),
|
|
59
|
+
containLabel: true,
|
|
60
|
+
},
|
|
61
|
+
tooltip: {
|
|
62
|
+
trigger: 'axis',
|
|
63
|
+
backgroundColor: theme.palette.grey[900],
|
|
64
|
+
borderWidth: 0,
|
|
65
|
+
padding: [parseInt(theme.spacing(1)), parseInt(theme.spacing(1))],
|
|
66
|
+
textStyle: {
|
|
67
|
+
color: theme.palette.common.white,
|
|
68
|
+
fontSize: 11,
|
|
69
|
+
fontFamily: theme.typography.caption.fontFamily,
|
|
70
|
+
},
|
|
71
|
+
axisPointer: { type: 'line' },
|
|
72
|
+
position: createTooltipPositioner(theme),
|
|
73
|
+
formatter: buildHistogramTooltipFormatter(formatter),
|
|
74
|
+
},
|
|
75
|
+
// Legend styling baked here; `show` is toggled by the merger based on
|
|
76
|
+
// series count. Histogram doesn't accept `labelFormatter` at the
|
|
77
|
+
// options layer (bin labels are pre-formatted in the merger), so we
|
|
78
|
+
// skip the legend `labelFormatter` argument too.
|
|
79
|
+
legend: {
|
|
80
|
+
...buildLegendConfig({ hasLegend: false }),
|
|
81
|
+
},
|
|
82
|
+
axisPointer: { lineStyle: { color: theme.palette.grey[400] } },
|
|
83
|
+
color: [
|
|
84
|
+
theme.palette.secondary.main,
|
|
85
|
+
...Object.values(
|
|
86
|
+
(theme.palette as { qualitative?: { bold?: Record<string, string> } })
|
|
87
|
+
.qualitative?.bold ?? {},
|
|
88
|
+
),
|
|
89
|
+
],
|
|
90
|
+
xAxis: {
|
|
91
|
+
type: 'category',
|
|
92
|
+
axisLine: { show: false },
|
|
93
|
+
axisTick: { show: false },
|
|
94
|
+
axisLabel: {
|
|
95
|
+
padding: [parseInt(theme.spacing(0.5)), 0, 0, 0],
|
|
96
|
+
margin: 0,
|
|
97
|
+
hideOverlap: true,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
yAxis: {
|
|
101
|
+
type: 'value',
|
|
102
|
+
min: (extent: { min: number }) => {
|
|
103
|
+
niceMin = extent.min < 0 ? niceNum(extent.min) : 0
|
|
104
|
+
return niceMin
|
|
105
|
+
},
|
|
106
|
+
max: (extent: { min: number; max: number }) => {
|
|
107
|
+
niceMax = extent.max <= 0 ? 1 : niceNum(extent.max)
|
|
108
|
+
return niceMax
|
|
109
|
+
},
|
|
110
|
+
axisLine: { show: false },
|
|
111
|
+
axisTick: { show: false },
|
|
112
|
+
splitLine: {
|
|
113
|
+
show: true,
|
|
114
|
+
lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },
|
|
115
|
+
},
|
|
116
|
+
axisLabel: {
|
|
117
|
+
fontSize: theme.typography.overlineDelicate?.fontSize,
|
|
118
|
+
fontFamily: theme.typography.overlineDelicate?.fontFamily,
|
|
119
|
+
margin: parseInt(theme.spacing(1)),
|
|
120
|
+
show: true,
|
|
121
|
+
showMaxLabel: true,
|
|
122
|
+
showMinLabel: true,
|
|
123
|
+
verticalAlign: 'bottom',
|
|
124
|
+
inside: true,
|
|
125
|
+
formatter: (value: number) => {
|
|
126
|
+
if (value !== niceMax && value !== niceMin) return ''
|
|
127
|
+
if (value === 0) return ''
|
|
128
|
+
return formatter ? formatter(value) : String(value)
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
} as HistogramEChartsOption
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Returns the histogram widget's {@link OptionFactory} — one closure that
|
|
137
|
+
* owns BOTH phases of option construction:
|
|
138
|
+
*
|
|
139
|
+
* - **Structural phase** (`option == null`) — builds the theme-aware
|
|
140
|
+
* structural option via {@link histogramOptions}, optionally merging
|
|
141
|
+
* the consumer-supplied `optionsOverride`. Called once by Provider to
|
|
142
|
+
* seed `rawOptions` in the store.
|
|
143
|
+
* - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`
|
|
144
|
+
* (`HistogramWidgetData` — `number[][]`) into the option via the
|
|
145
|
+
* dataset API. Each series gets its own dataset of `[binLabel, count]`
|
|
146
|
+
* pairs derived from `ticks`; series reference their dataset by
|
|
147
|
+
* `datasetIndex` and are encoded by column position. Reactive
|
|
148
|
+
* `ctx.formatter` (driven by RelativeData → `%`) plus `niceMin`/`niceMax`
|
|
149
|
+
* are re-derived here so the y-axis label formatter and the tooltip
|
|
150
|
+
* pick up live store values, mirroring bar.
|
|
151
|
+
*/
|
|
152
|
+
export function createHistogramOptionFactory(
|
|
153
|
+
options: HistogramOptionFactoryInput,
|
|
154
|
+
): OptionFactory {
|
|
155
|
+
const { theme, formatter, ticks, series, labelFormatter, selection } = options
|
|
156
|
+
const optionsOverride = options.optionsOverride
|
|
157
|
+
const selectionSet =
|
|
158
|
+
selection && selection.length > 0 ? new Set<number>(selection) : null
|
|
159
|
+
|
|
160
|
+
const binLabels: string[] = []
|
|
161
|
+
for (let i = 0; i < ticks.length - 1; i++) {
|
|
162
|
+
const lo = ticks[i]!
|
|
163
|
+
const hi = ticks[i + 1]!
|
|
164
|
+
const raw = `${formatNumber(lo)}–${formatNumber(hi)}`
|
|
165
|
+
binLabels.push(labelFormatter ? labelFormatter(raw) : raw)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return (option, data, ctx) => {
|
|
169
|
+
if (option == null) {
|
|
170
|
+
const structural = histogramOptions({ theme, formatter })
|
|
171
|
+
return optionsOverride
|
|
172
|
+
? (mergeOptions(
|
|
173
|
+
structural as unknown as Record<string, unknown>,
|
|
174
|
+
optionsOverride as Partial<Record<string, unknown>>,
|
|
175
|
+
) as EChartsOption)
|
|
176
|
+
: structural
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const seriesArr: HistogramWidgetData = Array.isArray(data)
|
|
180
|
+
? (data as HistogramWidgetData)
|
|
181
|
+
: []
|
|
182
|
+
if (seriesArr.length === 0 || binLabels.length === 0) {
|
|
183
|
+
return { ...option, dataset: [], series: [] }
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const hasLegend = seriesArr.length > 1
|
|
187
|
+
const seriesTemplates = Array.isArray(option.series) ? option.series : []
|
|
188
|
+
const broadcastTemplate = seriesTemplates[0] ?? {}
|
|
189
|
+
const baseYAxis =
|
|
190
|
+
typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)
|
|
191
|
+
? option.yAxis
|
|
192
|
+
: {}
|
|
193
|
+
const baseGrid =
|
|
194
|
+
typeof option.grid === 'object' && !Array.isArray(option.grid)
|
|
195
|
+
? option.grid
|
|
196
|
+
: {}
|
|
197
|
+
const baseTooltip =
|
|
198
|
+
typeof option.tooltip === 'object' && !Array.isArray(option.tooltip)
|
|
199
|
+
? option.tooltip
|
|
200
|
+
: {}
|
|
201
|
+
const baseLegend =
|
|
202
|
+
typeof option.legend === 'object' && !Array.isArray(option.legend)
|
|
203
|
+
? option.legend
|
|
204
|
+
: {}
|
|
205
|
+
// Reactive (live store) formatter from ctx — distinct from the
|
|
206
|
+
// closure-time `formatter` captured for the structural-build branch
|
|
207
|
+
// above. RelativeData can install a percent formatter on the store
|
|
208
|
+
// after the factory was constructed; the merge phase reads `ctx` to
|
|
209
|
+
// pick that up.
|
|
210
|
+
const liveFormatter = ctx?.formatter
|
|
211
|
+
|
|
212
|
+
const { niceMinVal, niceMaxVal } = computeHistogramNiceBounds(seriesArr)
|
|
213
|
+
|
|
214
|
+
// Zoom slider layout: when ZoomToggle has installed `dataZoom`, push
|
|
215
|
+
// the slider above the legend (if any) and reserve room in the grid.
|
|
216
|
+
const dataZoomLayout = positionDataZoomForLegend(option.dataZoom, hasLegend)
|
|
217
|
+
const fallbackBottom =
|
|
218
|
+
typeof baseGrid.bottom === 'number' ? baseGrid.bottom : 24
|
|
219
|
+
const baseBottom = hasLegend ? 56 : fallbackBottom
|
|
220
|
+
const gridBottom = dataZoomLayout
|
|
221
|
+
? baseBottom + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap
|
|
222
|
+
: baseBottom
|
|
223
|
+
|
|
224
|
+
// Dim non-selected bins via `series.itemStyle.color`. Per-row
|
|
225
|
+
// `itemStyle` on dataset sources is silently ignored when
|
|
226
|
+
// `series.encode` is in play.
|
|
227
|
+
//
|
|
228
|
+
// We *always* emit `itemStyle.color` (a passthrough when nothing is
|
|
229
|
+
// selected), not conditionally — dropping the key between renders
|
|
230
|
+
// would let ECharts' default merge keep the previous callback alive
|
|
231
|
+
// and bins would stay dimmed forever after an external clear. Always
|
|
232
|
+
// emitting lets normal merge swap the callback in place, no
|
|
233
|
+
// `replaceMerge` and no entry-animation flash on selection on/off.
|
|
234
|
+
const dimItemStyle = {
|
|
235
|
+
color: (params: CallbackDataParams) => {
|
|
236
|
+
const base = params.color as string
|
|
237
|
+
if (!selectionSet) return base
|
|
238
|
+
return selectionSet.has(params.dataIndex)
|
|
239
|
+
? base
|
|
240
|
+
: echarts.color.modifyAlpha(base, 0.15)
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
...option,
|
|
246
|
+
dataset: seriesArr.map((counts) => ({
|
|
247
|
+
source: binLabels.map(
|
|
248
|
+
(label, i) => [label, counts[i] ?? 0] as [string, number],
|
|
249
|
+
),
|
|
250
|
+
})),
|
|
251
|
+
series: seriesArr.map((_, i) => {
|
|
252
|
+
const template =
|
|
253
|
+
(seriesTemplates[i] as object | undefined) ??
|
|
254
|
+
(broadcastTemplate as object)
|
|
255
|
+
const overrideColor = resolveThemeColor(theme, series?.[i]?.color)
|
|
256
|
+
return {
|
|
257
|
+
...(typeof template === 'object' ? template : {}),
|
|
258
|
+
type: 'bar' as const,
|
|
259
|
+
datasetIndex: i,
|
|
260
|
+
name: series?.[i]?.name ?? `Series ${i + 1}`,
|
|
261
|
+
encode: { x: 0, y: 1 },
|
|
262
|
+
barCategoryGap: '0%',
|
|
263
|
+
emphasis: { focus: 'series' },
|
|
264
|
+
itemStyle: dimItemStyle,
|
|
265
|
+
...(overrideColor ? { color: overrideColor } : {}),
|
|
266
|
+
}
|
|
267
|
+
}),
|
|
268
|
+
legend: { ...baseLegend, show: hasLegend },
|
|
269
|
+
grid: { ...baseGrid, bottom: gridBottom },
|
|
270
|
+
...(dataZoomLayout ? { dataZoom: dataZoomLayout } : {}),
|
|
271
|
+
yAxis: {
|
|
272
|
+
...baseYAxis,
|
|
273
|
+
min: niceMinVal,
|
|
274
|
+
max: niceMaxVal,
|
|
275
|
+
axisLabel: {
|
|
276
|
+
...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),
|
|
277
|
+
formatter: (value: number) => {
|
|
278
|
+
if (value !== niceMaxVal && value !== niceMinVal) return ''
|
|
279
|
+
if (value === 0) return ''
|
|
280
|
+
return liveFormatter ? liveFormatter(value) : String(value)
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
} as EChartsOption['yAxis'],
|
|
284
|
+
tooltip: {
|
|
285
|
+
...baseTooltip,
|
|
286
|
+
formatter: buildHistogramTooltipFormatter(liveFormatter),
|
|
287
|
+
},
|
|
288
|
+
} as EChartsOption
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Tooltip formatter for the histogram's positional `[binLabel, count]`
|
|
294
|
+
* row shape. ECharts surfaces the x-axis category through `item.name`
|
|
295
|
+
* (already pre-formatted by the bin-label generator), and `item.value`
|
|
296
|
+
* comes in as the array tuple — distinct from bar's `{ name, value }`
|
|
297
|
+
* object row.
|
|
298
|
+
*/
|
|
299
|
+
function buildHistogramTooltipFormatter(
|
|
300
|
+
formatter: ((value: number) => string) | undefined,
|
|
301
|
+
) {
|
|
302
|
+
return createTooltipFormatter((item) => {
|
|
303
|
+
const row = item.value as [string, number] | undefined
|
|
304
|
+
const raw = row?.[1]
|
|
305
|
+
const formattedValue =
|
|
306
|
+
typeof raw === 'number' && formatter ? formatter(raw) : (raw ?? '')
|
|
307
|
+
const marker = typeof item.marker === 'string' ? item.marker : ''
|
|
308
|
+
const seriesName = item.seriesName ? `${item.seriesName}: ` : ''
|
|
309
|
+
return {
|
|
310
|
+
name: String(item.name ?? ''),
|
|
311
|
+
seriesName,
|
|
312
|
+
marker,
|
|
313
|
+
value: formattedValue,
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function computeHistogramNiceBounds(seriesArr: HistogramWidgetData): {
|
|
319
|
+
niceMinVal: number
|
|
320
|
+
niceMaxVal: number
|
|
321
|
+
} {
|
|
322
|
+
let max = -Infinity
|
|
323
|
+
for (const counts of seriesArr) {
|
|
324
|
+
for (const v of counts) {
|
|
325
|
+
if (typeof v !== 'number' || !Number.isFinite(v)) continue
|
|
326
|
+
if (v > max) max = v
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
niceMinVal: 0,
|
|
331
|
+
niceMaxVal: max <= 0 ? 1 : niceNum(max),
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function formatNumber(n: number): string {
|
|
336
|
+
if (Number.isInteger(n)) return String(n)
|
|
337
|
+
return Number(n.toFixed(2)).toString()
|
|
338
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
import { HistogramSkeleton } from './skeleton'
|
|
4
|
+
|
|
5
|
+
describe('<HistogramSkeleton>', () => {
|
|
6
|
+
it('renders one Skeleton per bin (default 12) plus 4 legend stubs', () => {
|
|
7
|
+
const { container } = render(<HistogramSkeleton />)
|
|
8
|
+
// 12 bars + 2 legend items × (circle + label) = 16.
|
|
9
|
+
expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(16)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('honours a custom bin count', () => {
|
|
13
|
+
const { container } = render(<HistogramSkeleton bins={4} />)
|
|
14
|
+
expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(8)
|
|
15
|
+
})
|
|
16
|
+
})
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Box, Skeleton, type SxProps, type Theme } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
const styles = {
|
|
4
|
+
container: {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'space-between',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
gap: ({ spacing }) => spacing(1),
|
|
10
|
+
height: ({ spacing }) => spacing(38),
|
|
11
|
+
},
|
|
12
|
+
grid: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'flex-end',
|
|
15
|
+
flex: '1 1 auto',
|
|
16
|
+
gap: 0.5,
|
|
17
|
+
width: '100%',
|
|
18
|
+
},
|
|
19
|
+
legend: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
gap: ({ spacing }) => spacing(2),
|
|
23
|
+
height: ({ spacing }) => spacing(5),
|
|
24
|
+
},
|
|
25
|
+
legendItem: {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
gap: ({ spacing }) => spacing(1.5),
|
|
29
|
+
},
|
|
30
|
+
} satisfies Record<string, SxProps<Theme>>
|
|
31
|
+
|
|
32
|
+
const barSx = (height: number): SxProps<Theme> => ({
|
|
33
|
+
flex: 1,
|
|
34
|
+
height: `${height}%`,
|
|
35
|
+
minWidth: 8,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export interface HistogramSkeletonProps {
|
|
39
|
+
bins?: number
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Loading state for the Histogram widget. Mirrors Bar's skeleton structure
|
|
44
|
+
* — a grid of bars (bin-shaped silhouette, anchored to the bottom) plus a
|
|
45
|
+
* legend stub — so the placeholder reads consistently with Bar.
|
|
46
|
+
*/
|
|
47
|
+
export function HistogramSkeleton({ bins = 12 }: HistogramSkeletonProps) {
|
|
48
|
+
// Sample heights mimicking a typical bell-shaped distribution.
|
|
49
|
+
const heights = Array.from({ length: bins }, (_, i) => {
|
|
50
|
+
const t = i / Math.max(1, bins - 1)
|
|
51
|
+
return Math.round(20 + 80 * Math.exp(-((t - 0.5) ** 2) * 8))
|
|
52
|
+
})
|
|
53
|
+
return (
|
|
54
|
+
<Box sx={styles.container}>
|
|
55
|
+
<Box sx={styles.grid}>
|
|
56
|
+
{heights.map((h, i) => (
|
|
57
|
+
<Skeleton key={`bar-${i}`} variant='rectangular' sx={barSx(h)} />
|
|
58
|
+
))}
|
|
59
|
+
</Box>
|
|
60
|
+
<Box sx={styles.legend}>
|
|
61
|
+
{[0, 1].map((i) => (
|
|
62
|
+
<Box key={`legend-${i}`} sx={styles.legendItem}>
|
|
63
|
+
<Skeleton variant='circular' width={8} height={8} />
|
|
64
|
+
<Skeleton width={48} height={8} />
|
|
65
|
+
</Box>
|
|
66
|
+
))}
|
|
67
|
+
</Box>
|
|
68
|
+
</Box>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { toRelativeHistogramData } from './transforms'
|
|
3
|
+
|
|
4
|
+
describe('toRelativeHistogramData', () => {
|
|
5
|
+
it('rewrites each bin count as its share of the series total in 0-100', () => {
|
|
6
|
+
expect(toRelativeHistogramData([[10, 20, 70]])).toEqual([[10, 20, 70]])
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('handles non-100 totals (5/20 = 25%)', () => {
|
|
10
|
+
expect(toRelativeHistogramData([[5, 15]])).toEqual([[25, 75]])
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('handles multiple series independently', () => {
|
|
14
|
+
expect(
|
|
15
|
+
toRelativeHistogramData([
|
|
16
|
+
[3, 7],
|
|
17
|
+
[50, 50],
|
|
18
|
+
]),
|
|
19
|
+
).toEqual([
|
|
20
|
+
[30, 70],
|
|
21
|
+
[50, 50],
|
|
22
|
+
])
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('returns a series unchanged when its total is zero', () => {
|
|
26
|
+
expect(toRelativeHistogramData([[0, 0, 0]])).toEqual([[0, 0, 0]])
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('produces signed share-of-magnitude percentages for mixed-sign series', () => {
|
|
30
|
+
// Denominator is 1000 + 990 = 1990
|
|
31
|
+
const out = toRelativeHistogramData([[1000, -990]]) as number[][]
|
|
32
|
+
expect(out[0]?.[0]).toBeCloseTo(50.25126, 4)
|
|
33
|
+
expect(out[0]?.[1]).toBeCloseTo(-49.74874, 4)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('returns the input unchanged when shape does not match number[][]', () => {
|
|
37
|
+
expect(toRelativeHistogramData(null)).toBe(null)
|
|
38
|
+
expect(toRelativeHistogramData('not an array')).toBe('not an array')
|
|
39
|
+
// Series that isn't a flat number array (e.g. named-value or tuple)
|
|
40
|
+
// is returned as-is — keeps the transform safe to attach to a
|
|
41
|
+
// widget whose shape changes through other actions.
|
|
42
|
+
expect(toRelativeHistogramData([[{ name: 'a', value: 10 }]])).toEqual([
|
|
43
|
+
[{ name: 'a', value: 10 }],
|
|
44
|
+
])
|
|
45
|
+
})
|
|
46
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
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 const toRelativeHistogramData = (input: unknown): unknown => {
|
|
18
|
+
if (!Array.isArray(input)) return input
|
|
19
|
+
return input.map((series: unknown): unknown => {
|
|
20
|
+
if (!isFlatNumberArray(series)) return series
|
|
21
|
+
const total = series.reduce((acc, v) => acc + Math.abs(v), 0)
|
|
22
|
+
if (total <= 0) return series
|
|
23
|
+
return series.map((v) => (v / total) * 100)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function isFlatNumberArray(v: unknown): v is number[] {
|
|
28
|
+
if (!Array.isArray(v)) return false
|
|
29
|
+
return v.every((item) => typeof item === 'number' && Number.isFinite(item))
|
|
30
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Theme } from '@mui/material'
|
|
2
|
+
import type { EChartsOption } from 'echarts'
|
|
3
|
+
import type { WidgetSeries } from '../types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Histogram widget data — array of series, each a flat array of bin counts.
|
|
7
|
+
* The option factory's merge phase (see {@link createHistogramOptionFactory})
|
|
8
|
+
* combines this with `ticks` to produce a 2-column dataset (`[binLabel, count]`)
|
|
9
|
+
* for ECharts.
|
|
10
|
+
*/
|
|
11
|
+
export type HistogramWidgetData = readonly (readonly number[])[]
|
|
12
|
+
|
|
13
|
+
/** Inputs to the structural-only {@link histogramOptions} builder. */
|
|
14
|
+
export interface HistogramOptionsInput {
|
|
15
|
+
theme: Theme
|
|
16
|
+
formatter?: (value: number) => string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Combined inputs for the histogram option factory creator. Carries
|
|
21
|
+
* everything the widget needs across BOTH phases — the structural-build
|
|
22
|
+
* (`theme`, `formatter`, `optionsOverride`) AND the data merge (`ticks`,
|
|
23
|
+
* `series`, `labelFormatter`, `selection`).
|
|
24
|
+
*/
|
|
25
|
+
export interface HistogramOptionFactoryInput {
|
|
26
|
+
theme: Theme
|
|
27
|
+
formatter?: (value: number) => string
|
|
28
|
+
/** Bin boundaries — length = bins + 1. */
|
|
29
|
+
ticks: readonly number[]
|
|
30
|
+
/**
|
|
31
|
+
* Per-series metadata — drives the legend, `series[i].name`, and
|
|
32
|
+
* (when `color` is set) a per-series colour override on the bars.
|
|
33
|
+
*/
|
|
34
|
+
series?: readonly WidgetSeries[]
|
|
35
|
+
/**
|
|
36
|
+
* Bin-range label transform (e.g. `"0–10"` → `"[0–10)"`). Distinct from
|
|
37
|
+
* the standard `OptionFactoryContext.labelFormatter` (which operates on
|
|
38
|
+
* categories): this one is histogram-specific and runs only on the
|
|
39
|
+
* generated bin-range strings before they hit the x-axis.
|
|
40
|
+
*/
|
|
41
|
+
labelFormatter?: (label: string) => string
|
|
42
|
+
/**
|
|
43
|
+
* Selected bin indices. Bins not in this list render dimmed
|
|
44
|
+
* (`itemStyle.opacity: 0.15`). `null`/empty means no selection.
|
|
45
|
+
*/
|
|
46
|
+
selection?: readonly number[] | null
|
|
47
|
+
/**
|
|
48
|
+
* Consumer-supplied partial option merged into the structural option at
|
|
49
|
+
* structural-build time. Lets stories override pieces of the theme-aware
|
|
50
|
+
* base without forking the structural builder.
|
|
51
|
+
*/
|
|
52
|
+
optionsOverride?: Partial<EChartsOption>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type HistogramEChartsOption = EChartsOption
|