@carto/ps-react-ui 4.4.0-chat-ui.5 → 4.4.0-chat-ui.7
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/chat.js +622 -673
- package/dist/chat.js.map +1 -1
- package/dist/components.js.map +1 -1
- package/dist/data-zoom-layout-DVYB8mIx.js +29 -0
- package/dist/data-zoom-layout-DVYB8mIx.js.map +1 -0
- package/dist/download-config-C7hf33ip.js +58 -0
- package/dist/download-config-C7hf33ip.js.map +1 -0
- package/dist/echart-CU0KmClP.js +176 -0
- package/dist/echart-CU0KmClP.js.map +1 -0
- package/dist/exports-Cr43OCul.js.map +1 -1
- package/dist/exports-Cx-f6m6U.js +63 -0
- package/dist/exports-Cx-f6m6U.js.map +1 -0
- package/dist/formatter-B9Bxn1k7.js +6 -0
- package/dist/formatter-B9Bxn1k7.js.map +1 -0
- package/dist/formula-DuC0NQLH.js +79 -0
- package/dist/formula-DuC0NQLH.js.map +1 -0
- package/dist/lasso-tool-BYbxrJ-7.js.map +1 -1
- package/dist/markdown-BD1jcknS.js +8326 -0
- package/dist/markdown-BD1jcknS.js.map +1 -0
- package/dist/option-builders-F-c9ELi1.js +122 -0
- package/dist/option-builders-F-c9ELi1.js.map +1 -0
- package/dist/options-CthfUJDz.js +46 -0
- package/dist/options-CthfUJDz.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/row-DZSP99LW.js +34 -0
- package/dist/row-DZSP99LW.js.map +1 -0
- package/dist/series-DLNHDWs0.js +90 -0
- package/dist/series-DLNHDWs0.js.map +1 -0
- package/dist/shared-resize-observer-98b1SK1e.js +17 -0
- package/dist/shared-resize-observer-98b1SK1e.js.map +1 -0
- package/dist/smart-tooltip-D4vwQpFf.js.map +1 -1
- package/dist/spread-CngWB5KF.js +68 -0
- package/dist/spread-CngWB5KF.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/tooltip-BDnrRKrp.js.map +1 -1
- package/dist/transforms-Cdx4fkU5.js +106 -0
- package/dist/transforms-Cdx4fkU5.js.map +1 -0
- package/dist/types/chat/containers/chat-content.d.ts +2 -2
- package/dist/types/chat/containers/styles.d.ts +10 -27
- package/dist/types/chat/feedback/chat-tool-code-area.d.ts +1 -3
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/chat/types.d.ts +35 -3
- package/dist/types/components/basemaps/basemaps.d.ts +20 -0
- package/dist/types/components/geolocation-controls/geolocation-controls.d.ts +11 -0
- package/dist/types/components/lasso-tool/lasso-tool-inline.d.ts +17 -0
- package/dist/types/components/lasso-tool/lasso-tool.d.ts +21 -0
- package/dist/types/components/list-data/list-data.d.ts +16 -0
- package/dist/types/components/measurement-tools/measurement-tools.d.ts +20 -0
- package/dist/types/components/smart-tooltip/smart-tooltip.d.ts +17 -0
- package/dist/types/components/tooltip/tooltip.d.ts +13 -0
- package/dist/types/components/zoom-controls/zoom-controls.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/use-widget-ref.d.ts +9 -6
- package/dist/types/widgets/actions/brush-toggle/brush-overlay.d.ts +24 -0
- package/dist/types/widgets/actions/brush-toggle/brush-toggle.d.ts +29 -0
- package/dist/types/widgets/actions/brush-toggle/hit-test.d.ts +19 -0
- package/dist/types/widgets/actions/brush-toggle/hit-test.test.d.ts +1 -0
- package/dist/types/widgets/actions/brush-toggle/style.d.ts +21 -0
- package/dist/types/widgets/actions/brush-toggle/types.d.ts +73 -0
- package/dist/types/widgets/actions/download/download.d.ts +11 -0
- package/dist/types/widgets/actions/download/exports.d.ts +15 -0
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +13 -0
- package/dist/types/widgets/actions/index.d.ts +7 -5
- package/dist/types/widgets/actions/lock-selection/types.d.ts +2 -0
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +8 -2
- package/dist/types/widgets/actions/relative-data/types.d.ts +2 -0
- package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +4 -0
- package/dist/types/widgets/bar/config.d.ts +8 -4
- package/dist/types/widgets/category/category-ui.d.ts +3 -0
- package/dist/types/widgets/category/components/category-bar.d.ts +3 -0
- package/dist/types/widgets/category/components/category-legend.d.ts +3 -0
- package/dist/types/widgets/category/components/category-row-multi.d.ts +5 -1
- package/dist/types/widgets/category/components/category-row-other.d.ts +3 -0
- package/dist/types/widgets/category/components/category-row-single.d.ts +5 -1
- package/dist/types/widgets/category/config.d.ts +11 -0
- package/dist/types/widgets/category/index.d.ts +10 -2
- package/dist/types/widgets/category/style.d.ts +1 -0
- package/dist/types/widgets/category/types.d.ts +1 -0
- package/dist/types/widgets/echart/echart-ui.d.ts +7 -0
- package/dist/types/widgets/echart/echart.d.ts +6 -0
- package/dist/types/widgets/echart/options.d.ts +7 -0
- package/dist/types/widgets/echart/shared-resize-observer.d.ts +12 -0
- package/dist/types/widgets/echart/types.d.ts +5 -1
- package/dist/types/widgets/echart/utils.d.ts +54 -7
- package/dist/types/widgets/echart/utils.test.d.ts +1 -0
- package/dist/types/widgets/error/error.d.ts +10 -0
- package/dist/types/widgets/formula/components/item.d.ts +3 -0
- package/dist/types/widgets/formula/components/prefix.d.ts +3 -0
- package/dist/types/widgets/formula/components/row.d.ts +3 -0
- package/dist/types/widgets/formula/components/series.d.ts +3 -0
- package/dist/types/widgets/formula/components/suffix.d.ts +3 -0
- package/dist/types/widgets/formula/components/value.d.ts +3 -0
- package/dist/types/widgets/formula/config.d.ts +11 -0
- package/dist/types/widgets/formula/config.test.d.ts +1 -0
- package/dist/types/widgets/formula/formula-ui.d.ts +3 -0
- package/dist/types/widgets/histogram/config.d.ts +18 -2
- package/dist/types/widgets/histogram/index.d.ts +2 -1
- package/dist/types/widgets/histogram/types.d.ts +6 -3
- package/dist/types/widgets/loader/loader.d.ts +22 -0
- package/dist/types/widgets/loader/utils.d.ts +26 -3
- package/dist/types/widgets/markdown/config.d.ts +10 -0
- package/dist/types/widgets/markdown/markdown-ui.d.ts +7 -0
- package/dist/types/widgets/markdown/markdown.d.ts +3 -0
- package/dist/types/widgets/no-data/no-data.d.ts +3 -2
- package/dist/types/widgets/no-data/types.d.ts +5 -1
- package/dist/types/widgets/note/note.d.ts +10 -0
- package/dist/types/widgets/pie/config.d.ts +8 -4
- package/dist/types/widgets/range/components/range-item.d.ts +3 -0
- package/dist/types/widgets/range/config.d.ts +5 -0
- package/dist/types/widgets/range/range-ui.d.ts +3 -0
- package/dist/types/widgets/scatterplot/config.d.ts +7 -3
- package/dist/types/widgets/selection-summary/selection-summary.d.ts +11 -0
- package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +10 -0
- package/dist/types/widgets/spread/components/max-value.d.ts +3 -0
- package/dist/types/widgets/spread/components/min-value.d.ts +3 -0
- package/dist/types/widgets/spread/components/separator.d.ts +3 -0
- package/dist/types/widgets/spread/config.d.ts +11 -0
- package/dist/types/widgets/spread/spread-ui.d.ts +3 -0
- package/dist/types/widgets/stores/index.d.ts +3 -2
- package/dist/types/widgets/stores/types.d.ts +12 -10
- package/dist/types/widgets/stores/use-widget-selector.d.ts +35 -0
- package/dist/types/widgets/stores/widget-store-branches.test.d.ts +1 -0
- package/dist/types/widgets/stores/widget-store-performance.test.d.ts +1 -0
- package/dist/types/widgets/stores/widget-store.d.ts +48 -27
- package/dist/types/widgets/subheader/subheader.d.ts +11 -0
- package/dist/types/widgets/table/config.d.ts +8 -3
- package/dist/types/widgets/table/config.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-pagination.d.ts +11 -3
- package/dist/types/widgets/table/hooks/use-selection.d.ts +11 -2
- package/dist/types/widgets/table/hooks/use-sort.d.ts +11 -3
- package/dist/types/widgets/table/index.d.ts +6 -2
- package/dist/types/widgets/table/types.d.ts +1 -1
- package/dist/types/widgets/timeseries/config.d.ts +8 -4
- package/dist/types/widgets/utils/chart-config/download-config.d.ts +3 -0
- package/dist/types/widgets/{_shared → utils}/chart-config/index.d.ts +3 -1
- package/dist/types/widgets/{_shared → utils}/chart-config/option-builders.d.ts +41 -9
- package/dist/types/widgets/utils/chart-config/option-builders.test.d.ts +1 -0
- package/dist/types/widgets/utils/formatter.d.ts +2 -0
- package/dist/types/widgets/utils/index.d.ts +7 -0
- package/dist/types/widgets/wrapper/components/actions.d.ts +3 -0
- package/dist/types/widgets/wrapper/components/options.d.ts +3 -0
- package/dist/types/widgets/wrapper/components/title.d.ts +3 -0
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +14 -0
- package/dist/types/widgets/wrapper/wrapper.d.ts +14 -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/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/use-widget-ref-Ddr_SlJJ.js +22 -0
- package/dist/use-widget-ref-Ddr_SlJJ.js.map +1 -0
- package/dist/use-widget-selector-DFl2hW0R.js +12 -0
- package/dist/use-widget-selector-DFl2hW0R.js.map +1 -0
- package/dist/{utils-idmvq0Oa.js → utils-BOhInag6.js} +95 -70
- package/dist/utils-BOhInag6.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-Bw5zRUGg.js +261 -0
- package/dist/widget-store-Bw5zRUGg.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 +1120 -760
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +87 -97
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +247 -236
- package/dist/widgets/category.js.map +1 -1
- package/dist/widgets/echart.js +100 -99
- package/dist/widgets/echart.js.map +1 -1
- package/dist/widgets/error.js +37 -2
- package/dist/widgets/error.js.map +1 -1
- package/dist/widgets/formula.js +78 -67
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +116 -92
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/loader.js +53 -60
- package/dist/widgets/loader.js.map +1 -1
- package/dist/widgets/markdown.js +55 -53
- package/dist/widgets/markdown.js.map +1 -1
- package/dist/widgets/no-data.js +58 -2
- package/dist/widgets/no-data.js.map +1 -1
- package/dist/widgets/note.js +121 -2
- package/dist/widgets/note.js.map +1 -1
- package/dist/widgets/pie.js +148 -112
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +147 -144
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/scatterplot.js +52 -65
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/selection-summary.js.map +1 -1
- package/dist/widgets/skeleton-loader.js +18 -17
- package/dist/widgets/skeleton-loader.js.map +1 -1
- package/dist/widgets/spread.js +108 -90
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +5 -2
- package/dist/widgets/stores.js.map +1 -1
- package/dist/widgets/subheader.js +29 -29
- package/dist/widgets/subheader.js.map +1 -1
- package/dist/widgets/table.js +429 -440
- package/dist/widgets/table.js.map +1 -1
- package/dist/widgets/timeseries.js +56 -69
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +50 -50
- package/dist/widgets/utils.js +34 -0
- package/dist/widgets/utils.js.map +1 -0
- package/dist/widgets/wrapper.js +156 -158
- package/dist/widgets/wrapper.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 +331 -0
- package/dist/widgets-v2/bar.js.map +1 -0
- package/dist/widgets-v2/category.js +105 -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 +75 -0
- package/dist/widgets-v2/formula.js.map +1 -0
- package/dist/widgets-v2/histogram.js +354 -0
- package/dist/widgets-v2/histogram.js.map +1 -0
- package/dist/widgets-v2/markdown.js +69 -0
- package/dist/widgets-v2/markdown.js.map +1 -0
- package/dist/widgets-v2/pie.js +388 -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 +412 -0
- package/dist/widgets-v2/scatterplot.js.map +1 -0
- package/dist/widgets-v2/spread.js +73 -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 +79 -0
- package/dist/widgets-v2/table.js.map +1 -0
- package/dist/widgets-v2/timeseries.js +359 -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 +954 -0
- package/dist/widgets-v2.js.map +1 -0
- package/package.json +84 -13
- package/src/chat/containers/chat-content.test.tsx +260 -6
- package/src/chat/containers/chat-content.tsx +137 -27
- package/src/chat/containers/chat-starter.tsx +2 -2
- package/src/chat/containers/styles.ts +16 -36
- package/src/chat/feedback/chat-tool-code-area.tsx +1 -1
- package/src/chat/feedback/chat-tool-group.tsx +1 -1
- package/src/chat/feedback/chat-tool-trace.tsx +6 -1
- package/src/chat/index.ts +1 -1
- package/src/chat/types.ts +36 -4
- package/src/components/basemaps/basemaps.tsx +20 -0
- package/src/components/geolocation-controls/geolocation-controls.tsx +11 -0
- 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-inline.tsx +17 -0
- package/src/components/lasso-tool/lasso-tool.test.tsx +198 -0
- package/src/components/lasso-tool/lasso-tool.tsx +21 -0
- package/src/components/list-data/list-data.test.tsx +73 -0
- package/src/components/list-data/list-data.tsx +16 -0
- package/src/components/measurement-tools/measurement-tools.tsx +20 -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/components/smart-tooltip/smart-tooltip.tsx +17 -0
- package/src/components/tooltip/tooltip.tsx +13 -0
- package/src/components/zoom-controls/zoom-controls.tsx +16 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-widget-ref.ts +10 -10
- package/src/widgets/README.md +13 -13
- package/src/widgets/actions/brush-toggle/brush-overlay.test.tsx +465 -0
- package/src/widgets/actions/brush-toggle/brush-overlay.tsx +408 -0
- package/src/widgets/actions/brush-toggle/brush-toggle.test.tsx +208 -0
- package/src/widgets/actions/brush-toggle/brush-toggle.tsx +133 -0
- package/src/widgets/actions/brush-toggle/hit-test.test.ts +65 -0
- package/src/widgets/actions/brush-toggle/hit-test.ts +45 -0
- package/src/widgets/actions/brush-toggle/style.ts +46 -0
- package/src/widgets/actions/brush-toggle/types.ts +78 -0
- package/src/widgets/actions/change-column/change-column-dnd.test.tsx +193 -0
- package/src/widgets/actions/change-column/change-column.test.tsx +1 -1
- package/src/widgets/actions/change-column/change-column.tsx +15 -15
- package/src/widgets/actions/change-column/sortable-column-item.test.tsx +124 -0
- package/src/widgets/actions/change-column/sortable-column-item.tsx +3 -1
- package/src/widgets/actions/download/download.test.tsx +1 -1
- package/src/widgets/actions/download/download.tsx +15 -3
- package/src/widgets/actions/download/exports.tsx +15 -0
- package/src/widgets/actions/fullscreen/fullscreen.tsx +20 -11
- package/src/widgets/actions/index.ts +21 -2
- package/src/widgets/actions/lock-selection/lock-selection.test.tsx +14 -0
- package/src/widgets/actions/lock-selection/lock-selection.tsx +26 -31
- package/src/widgets/actions/lock-selection/types.ts +2 -0
- package/src/widgets/actions/relative-data/relative-data.test.tsx +276 -1
- package/src/widgets/actions/relative-data/relative-data.tsx +113 -54
- package/src/widgets/actions/relative-data/types.ts +2 -0
- package/src/widgets/actions/searcher/searcher-toggle.tsx +11 -12
- package/src/widgets/actions/searcher/searcher.tsx +39 -42
- package/src/widgets/actions/stack-toggle/stack-toggle.test.tsx +4 -4
- package/src/widgets/actions/stack-toggle/stack-toggle.tsx +24 -32
- package/src/widgets/actions/zoom-toggle/zoom-toggle.test.tsx +322 -0
- package/src/widgets/actions/zoom-toggle/zoom-toggle.tsx +62 -80
- package/src/widgets/bar/config.ts +39 -34
- package/src/widgets/bar/style.ts +1 -1
- package/src/widgets/category/category-ui.tsx +41 -34
- package/src/widgets/category/components/category-bar.tsx +3 -0
- package/src/widgets/category/components/category-legend.tsx +3 -0
- package/src/widgets/category/components/category-row-multi.tsx +9 -2
- package/src/widgets/category/components/category-row-other.tsx +3 -0
- package/src/widgets/category/components/category-row-single.tsx +8 -1
- package/src/widgets/category/components/category-rows.test.tsx +213 -0
- package/src/widgets/category/config.ts +11 -0
- package/src/widgets/category/index.ts +13 -14
- package/src/widgets/category/style.ts +1 -0
- package/src/widgets/category/types.ts +1 -0
- package/src/widgets/echart/echart-ui.test.tsx +20 -16
- package/src/widgets/echart/echart-ui.tsx +18 -14
- package/src/widgets/echart/echart.tsx +19 -27
- package/src/widgets/echart/options.ts +8 -4
- package/src/widgets/echart/shared-resize-observer.ts +45 -0
- package/src/widgets/echart/types.ts +5 -1
- package/src/widgets/echart/utils.test.ts +277 -0
- package/src/widgets/echart/utils.ts +94 -21
- package/src/widgets/error/error.tsx +17 -9
- package/src/widgets/formula/components/item.tsx +3 -0
- package/src/widgets/formula/components/prefix.tsx +7 -6
- package/src/widgets/formula/components/row.tsx +7 -4
- package/src/widgets/formula/components/series.tsx +7 -6
- package/src/widgets/formula/components/suffix.tsx +7 -6
- package/src/widgets/formula/components/value.tsx +13 -18
- package/src/widgets/formula/config.test.ts +37 -0
- package/src/widgets/formula/config.ts +11 -0
- package/src/widgets/formula/formula-ui.tsx +4 -1
- package/src/widgets/histogram/config.ts +99 -24
- package/src/widgets/histogram/index.ts +6 -1
- package/src/widgets/histogram/style.ts +1 -1
- package/src/widgets/histogram/types.ts +9 -3
- package/src/widgets/loader/loader.tsx +53 -44
- package/src/widgets/loader/utils.ts +26 -3
- package/src/widgets/markdown/config.ts +10 -0
- package/src/widgets/markdown/markdown-ui.tsx +7 -0
- package/src/widgets/markdown/markdown.tsx +7 -7
- package/src/widgets/no-data/no-data.test.tsx +90 -40
- package/src/widgets/no-data/no-data.tsx +12 -13
- package/src/widgets/no-data/types.ts +5 -1
- package/src/widgets/note/note.tsx +10 -0
- package/src/widgets/pie/config.ts +102 -33
- package/src/widgets/pie/style.ts +1 -1
- package/src/widgets/range/components/range-item.test.tsx +243 -0
- package/src/widgets/range/components/range-item.tsx +25 -20
- package/src/widgets/range/config.ts +5 -0
- package/src/widgets/range/range-ui.tsx +3 -0
- package/src/widgets/scatterplot/config.ts +21 -23
- package/src/widgets/scatterplot/style.ts +1 -1
- package/src/widgets/selection-summary/selection-summary.tsx +11 -0
- package/src/widgets/skeleton-loader/skeleton-loader.tsx +12 -5
- package/src/widgets/spread/components/max-value.tsx +18 -18
- package/src/widgets/spread/components/min-value.tsx +18 -18
- package/src/widgets/spread/components/separator.tsx +3 -0
- package/src/widgets/spread/config.ts +11 -0
- package/src/widgets/spread/spread-ui.tsx +4 -1
- package/src/widgets/stores/index.ts +4 -1
- package/src/widgets/stores/types.ts +12 -18
- package/src/widgets/stores/use-widget-selector.ts +47 -0
- package/src/widgets/stores/widget-store-branches.test.ts +275 -0
- package/src/widgets/stores/widget-store-performance.test.ts +750 -0
- package/src/widgets/stores/widget-store.test.ts +213 -13
- package/src/widgets/stores/widget-store.ts +240 -65
- package/src/widgets/subheader/subheader.tsx +22 -3
- package/src/widgets/table/config.test.ts +65 -0
- package/src/widgets/table/config.ts +8 -4
- package/src/widgets/table/hooks/use-pagination.ts +39 -55
- package/src/widgets/table/hooks/use-selection.ts +31 -26
- package/src/widgets/table/hooks/use-sort.ts +33 -42
- package/src/widgets/table/index.ts +6 -4
- package/src/widgets/table/table-ui.tsx +1 -1
- package/src/widgets/table/types.ts +1 -1
- package/src/widgets/timeseries/config.ts +34 -33
- package/src/widgets/timeseries/style.ts +1 -1
- package/src/widgets/utils/chart-config/download-config.ts +22 -0
- package/src/widgets/{_shared → utils}/chart-config/index.ts +6 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +332 -0
- package/src/widgets/{_shared → utils}/chart-config/option-builders.ts +79 -13
- package/src/widgets/utils/formatter.ts +2 -0
- package/src/widgets/utils/index.ts +26 -0
- package/src/widgets/wrapper/components/actions.tsx +3 -0
- package/src/widgets/wrapper/components/options.tsx +3 -0
- package/src/widgets/wrapper/components/title.tsx +3 -0
- package/src/widgets/wrapper/wrapper-ui.tsx +26 -13
- package/src/widgets/wrapper/wrapper.tsx +18 -6
- 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/error-CEkRPccv.js +0 -39
- package/dist/error-CEkRPccv.js.map +0 -1
- package/dist/index-BnyeR7Qx.js +0 -6601
- package/dist/index-BnyeR7Qx.js.map +0 -1
- package/dist/no-data-hR3KcJ-_.js +0 -60
- package/dist/no-data-hR3KcJ-_.js.map +0 -1
- package/dist/note-t51drNe0.js +0 -124
- package/dist/note-t51drNe0.js.map +0 -1
- package/dist/options-D9wflre6.js +0 -49
- package/dist/options-D9wflre6.js.map +0 -1
- package/dist/row-DTCV0Ocm.js +0 -35
- package/dist/row-DTCV0Ocm.js.map +0 -1
- package/dist/series-CYNOu2Ju.js +0 -91
- package/dist/series-CYNOu2Ju.js.map +0 -1
- package/dist/styles-CAroD5Rc.js +0 -123
- package/dist/styles-CAroD5Rc.js.map +0 -1
- package/dist/types/hooks/use-debounce.d.ts +0 -19
- package/dist/types/widgets/category/components/index.d.ts +0 -10
- package/dist/types/widgets/index.d.ts +0 -9
- package/dist/types/widgets/table/hooks/index.d.ts +0 -6
- package/dist/use-widget-ref-P-2i0MJG.js +0 -19
- package/dist/use-widget-ref-P-2i0MJG.js.map +0 -1
- package/dist/utils-idmvq0Oa.js.map +0 -1
- package/dist/widget-store-CzDt8oSK.js +0 -163
- package/dist/widget-store-CzDt8oSK.js.map +0 -1
- package/dist/widgets.js +0 -13
- package/dist/widgets.js.map +0 -1
- package/src/hooks/use-debounce.ts +0 -55
- package/src/widgets/_shared/chart-config/option-builders.test.ts +0 -40
- package/src/widgets/category/components/index.ts +0 -14
- package/src/widgets/index.ts +0 -25
- package/src/widgets/table/hooks/index.ts +0 -7
- /package/dist/types/widgets/{_shared → utils}/chart-config/config-factory.d.ts +0 -0
- /package/dist/types/widgets/{_shared → utils}/chart-config/csv-modifiers.d.ts +0 -0
- /package/dist/types/widgets/{_shared → utils}/skeleton/index.d.ts +0 -0
- /package/dist/types/widgets/{_shared → utils}/skeleton/styles.d.ts +0 -0
- /package/dist/types/{widgets/_shared/chart-config/option-builders.test.d.ts → widgets-v2/actions/brush-toggle/transforms.test.d.ts} +0 -0
- /package/src/widgets/{_shared → utils}/chart-config/config-factory.ts +0 -0
- /package/src/widgets/{_shared → utils}/chart-config/csv-modifiers.ts +0 -0
- /package/src/widgets/{_shared → utils}/skeleton/index.ts +0 -0
- /package/src/widgets/{_shared → utils}/skeleton/styles.ts +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Widgets v1 vs v2 — Performance Comparison
|
|
2
|
+
|
|
3
|
+
> **Status:** Measured 2026-05-12 on Apple M4 Pro / macOS 26.4.1 / Chrome 147
|
|
4
|
+
> headless. Storybook dev mode (Vite HMR). 5 cold-mount runs per variant, 15
|
|
5
|
+
> total update ticks per dynamic variant (3 ticks × 5 runs). Medians reported.
|
|
6
|
+
|
|
7
|
+
## TL;DR
|
|
8
|
+
|
|
9
|
+
**v2 is ~2× faster than v1 across every variant measured.** Largest wins are
|
|
10
|
+
on dynamic mount (-60 % to -64 %) and 200-widget static (-60 %); the smallest
|
|
11
|
+
(but still substantial) win is the 200-widget update tick (-46 %).
|
|
12
|
+
|
|
13
|
+
| Variant | v1 (ms, median) | v2 (ms, median) | Δ ms | Δ % |
|
|
14
|
+
| --------------------------- | --------------: | --------------: | -----: | -----: |
|
|
15
|
+
| 100 widgets — static | 2 354.3 | 1 110.8 | -1 243 | -52.8% |
|
|
16
|
+
| 200 widgets — static | 7 831.2 | 3 159.4 | -4 672 | -59.7% |
|
|
17
|
+
| 100 widgets — dynamic mount | 2 613.9 | 944.5 | -1 669 | -63.9% |
|
|
18
|
+
| 200 widgets — dynamic mount | 7 500.5 | 2 988.1 | -4 512 | -60.2% |
|
|
19
|
+
| 100 widgets — update tick | 1 073.9 | 419.2 | -655 | -61.0% |
|
|
20
|
+
| 200 widgets — update tick | 3 403.6 | 1 831.3 | -1 572 | -46.2% |
|
|
21
|
+
|
|
22
|
+
## Methodology
|
|
23
|
+
|
|
24
|
+
Both versions ship a matching performance story under Storybook. Each renders
|
|
25
|
+
a deterministic grid of widgets (seeded PRNG, seed `42`) across 9 widget types:
|
|
26
|
+
`bar, pie, timeseries, histogram, scatterplot, category, formula, spread, range`.
|
|
27
|
+
|
|
28
|
+
Each story logs to the console after a double-`rAF` (so paint is included),
|
|
29
|
+
once on mount and once per data refresh in the dynamic variants:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
[Performance] 100 widgets rendered in 2354.3ms ← v1 mount
|
|
33
|
+
[Performance v2] 100 widgets updated in 419.2ms ← v2 per-tick update
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Stories
|
|
37
|
+
|
|
38
|
+
| | v1 | v2 |
|
|
39
|
+
| -------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
40
|
+
| Source | [performance.stories.tsx](../../../../apps/storybook/stories/react-ui/widgets/performance.stories.tsx) | [performance.stories.tsx](../../../../apps/storybook/stories/react-ui/widgets-v2/performance.stories.tsx) |
|
|
41
|
+
| Storybook path | `React Ui/Widgets/Performance` | `React UI/Widgets v2/Performance` |
|
|
42
|
+
| Console prefix | `[Performance]` | `[Performance v2]` |
|
|
43
|
+
|
|
44
|
+
### Procedure
|
|
45
|
+
|
|
46
|
+
1. `pnpm storybook` (already running on `:6006`).
|
|
47
|
+
2. Headless Chrome started via CDP on port 9333 (separate user-data-dir, no
|
|
48
|
+
throttling). Driver: [/tmp/perf-bench.mjs](/tmp/perf-bench.mjs) (one-off,
|
|
49
|
+
not checked in).
|
|
50
|
+
3. For each variant: 5 fresh navigations. On each navigation we capture the
|
|
51
|
+
first `[Performance...] rendered in Xms` log; for dynamic variants we also
|
|
52
|
+
capture the next 3 `updated in Xms` logs (one per 3 s tick).
|
|
53
|
+
4. Medians (and min/max for sanity) computed across runs / ticks.
|
|
54
|
+
|
|
55
|
+
### Environment
|
|
56
|
+
|
|
57
|
+
- **Machine:** Apple M4 Pro, 24 GB RAM
|
|
58
|
+
- **OS:** macOS 26.4.1 (build 25E253)
|
|
59
|
+
- **Browser:** Chrome 147.0.7727.138, headless=new, no throttling
|
|
60
|
+
- **Storybook:** v10.3.6, dev mode (Vite HMR), production build numbers will differ
|
|
61
|
+
- **Date measured:** 2026-05-12
|
|
62
|
+
|
|
63
|
+
## Results
|
|
64
|
+
|
|
65
|
+
### Static render (cold mount)
|
|
66
|
+
|
|
67
|
+
Time from initial render commit to second-rAF paint.
|
|
68
|
+
|
|
69
|
+
| Variant | v1 min/median/max (ms) | v2 min/median/max (ms) | Δ median (%) |
|
|
70
|
+
| ----------- | -------------------------------- | ------------------------------- | -----------: |
|
|
71
|
+
| 100 widgets | 2 214.5 / **2 354.3** / 2 509.6 | 1 020.0 / **1 110.8** / 1 132.5 | -52.8% |
|
|
72
|
+
| 200 widgets | 7 150.4 / **7 831.2** / 12 067.5 | 2 888.9 / **3 159.4** / 3 517.6 | -59.7% |
|
|
73
|
+
|
|
74
|
+
> v1's 200-widget run shows a notable outlier (12.1 s) on one of five runs; v2
|
|
75
|
+
> stays within a tight 2.9–3.5 s band. Median is robust to the outlier and is
|
|
76
|
+
> what should be cited.
|
|
77
|
+
|
|
78
|
+
### Cold mount inside the dynamic variant
|
|
79
|
+
|
|
80
|
+
Same as static, but rendered inside the `*Dynamic` story (which adds a sticky
|
|
81
|
+
update banner and a `setInterval`). Provided as a sanity check — these should
|
|
82
|
+
match the static numbers above and they do.
|
|
83
|
+
|
|
84
|
+
| Variant | v1 min/median/max (ms) | v2 min/median/max (ms) | Δ median (%) |
|
|
85
|
+
| ----------- | ------------------------------- | ------------------------------- | -----------: |
|
|
86
|
+
| 100 widgets | 2 303.2 / **2 613.9** / 2 833.3 | 936.0 / **944.5** / 1 273.0 | -63.9% |
|
|
87
|
+
| 200 widgets | 7 236.0 / **7 500.5** / 8 189.9 | 2 938.3 / **2 988.1** / 3 357.1 | -60.2% |
|
|
88
|
+
|
|
89
|
+
### Dynamic update (per 3 s tick)
|
|
90
|
+
|
|
91
|
+
Time per data refresh — measured after each `setWidgetDefs(...)` commit,
|
|
92
|
+
through double-`rAF` to paint. 15 ticks per variant (3 ticks × 5 runs).
|
|
93
|
+
|
|
94
|
+
| Variant | v1 min/median/max (ms) | v2 min/median/max (ms) | Δ median (%) |
|
|
95
|
+
| ----------- | ------------------------------- | ------------------------------- | -----------: |
|
|
96
|
+
| 100 widgets | 672.9 / **1 073.9** / 1 732.2 | 397.9 / **419.2** / 961.3 | -61.0% |
|
|
97
|
+
| 200 widgets | 2 807.2 / **3 403.6** / 6 048.8 | 1 727.9 / **1 831.3** / 3 471.0 | -46.2% |
|
|
98
|
+
|
|
99
|
+
> The first tick of each dynamic run is consistently the slowest in **both**
|
|
100
|
+
> versions (warmup / JIT / first ECharts dataset swap). v2 amortises this less
|
|
101
|
+
> dramatically than v1 — its update path is steadier (398–480 ms tail for 100
|
|
102
|
+
> widgets; 1 728–1 924 ms tail for 200) while v1 ticks remain noisy throughout
|
|
103
|
+
> (672–1 732 ms at 100; 2 807–6 049 ms at 200).
|
|
104
|
+
|
|
105
|
+
## Raw data
|
|
106
|
+
|
|
107
|
+
Captured to [/tmp/perf-bench.err](/tmp/perf-bench.err) during the run. Pasted
|
|
108
|
+
inline for reproducibility (the file is volatile / not checked in):
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
v1 / 100 static : 2509.6, 2354.3, 2249.9, 2214.5, 2408.7
|
|
112
|
+
v1 / 100 dynamic mount : 2402.2, 2303.2, 2613.9, 2833.3, 2801.8
|
|
113
|
+
v1 / 100 dynamic ticks (3 × 5 run) : 1732.2, 973.4, 672.9 | 1599.1, 994.6, 782.0 | 1688.3, 1020.0, 811.8 | 1181.1, 1255.0, 1073.9 | 975.8, 1457.5, 1110.5
|
|
114
|
+
v1 / 200 static : 8711.4, 12067.5, 7831.2, 7420.5, 7150.4
|
|
115
|
+
v1 / 200 dynamic mount : 8189.9, 7341.1, 7236.0, 7500.5, 7586.4
|
|
116
|
+
v1 / 200 dynamic ticks : 5367.8, 2979.2, 3403.6 | 2807.2, 6048.8, 3734.0 | 2877.3, 6021.2, 3754.5 | 2965.0, 3712.3, 3152.1 | 2945.4, 3823.6, 3112.9
|
|
117
|
+
v2 / 100 static : 1111.6, 1132.5, 1038.1, 1020.0, 1110.8
|
|
118
|
+
v2 / 100 dynamic mount : 1047.7, 944.5, 936.0, 938.9, 1273.0
|
|
119
|
+
v2 / 100 dynamic ticks : 453.2, 407.4, 419.2 | 480.1, 397.9, 403.4 | 428.3, 398.2, 411.8 | 442.7, 412.6, 409.5 | 961.3, 454.0, 604.1
|
|
120
|
+
v2 / 200 static : 3517.6, 3413.2, 2888.9, 3159.4, 2940.4
|
|
121
|
+
v2 / 200 dynamic mount : 2963.9, 3300.6, 3357.1, 2938.3, 2988.1
|
|
122
|
+
v2 / 200 dynamic ticks : 1784.5, 1781.5, 2103.6 | 3208.2, 1924.8, 1834.8 | 3097.6, 1831.3, 1727.9 | 3471.0, 1808.5, 1766.4 | 3137.2, 1821.7, 1759.3
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Architectural notes that affect comparability
|
|
126
|
+
|
|
127
|
+
These are **already known differences** between v1 and v2 — they explain part
|
|
128
|
+
of the delta and matter when judging whether the comparison is apples-to-apples:
|
|
129
|
+
|
|
130
|
+
- **v2 uses pre-composed wrappers from `apps/storybook/stories/modules/widgets/`**
|
|
131
|
+
(e.g. [`Bar`](../../../../apps/storybook/stories/modules/widgets/bar/bar.tsx)).
|
|
132
|
+
These include `Widget.Provider`, `Widget.Toolbox`, `Widget.FullScreen.Slot`,
|
|
133
|
+
`Widget.SelectionSummary`, etc. — i.e. v2 numbers include a slightly richer
|
|
134
|
+
default toolbar surface that v1's perf story does not exercise. Despite
|
|
135
|
+
doing **more** work, v2 still wins ~2× — the underlying primitives are
|
|
136
|
+
faster, not the toolbar that's missing.
|
|
137
|
+
- **Datum shape differs.** v1 uses `{ category, value }`; v2 uses
|
|
138
|
+
`{ name, value }`. Payload sizes are equivalent.
|
|
139
|
+
- **State management.** v1's `useWidgetStore` exposes per-widget config via
|
|
140
|
+
`state.widgets[id]` (one global store, O(n) keys). v2 introduces per-widget
|
|
141
|
+
stores via `getWidgetStore(id)` plus a `Widget.Provider` context. v2 trades
|
|
142
|
+
more mount-time allocations for far fewer cross-widget broadcasts on update
|
|
143
|
+
— which shows up clearly in the update-tick numbers (61 % faster at 100
|
|
144
|
+
widgets, 46 % at 200).
|
|
145
|
+
- **ECharts pipeline.** v2 puts BOTH option phases on a single
|
|
146
|
+
`optionFactory` closure passed as a prop to `Widget.Echart`: Echart's
|
|
147
|
+
layout effect seeds `rawOptions` from the factory's structural branch
|
|
148
|
+
once on mount, configTransforms (Stack/Zoom/Brush) mutate it via the
|
|
149
|
+
middleware, then Echart's render-time `useMemo` calls the factory again
|
|
150
|
+
to merge live `state.data` into the post-transform option. v1 builds
|
|
151
|
+
the full option per render. v2 should win on dynamic updates (no
|
|
152
|
+
re-init) — and does.
|
|
153
|
+
- **Ids.** The 200-widget variant in v2 uses `-dup`-suffixed ids so each of
|
|
154
|
+
the 200 instances has its own per-widget store; v1 reuses the same id across
|
|
155
|
+
the duplicate set (only 100 unique stores). Despite v2 having 2× more store
|
|
156
|
+
instances, it still beats v1.
|
|
157
|
+
|
|
158
|
+
## Observations
|
|
159
|
+
|
|
160
|
+
- **Cold-mount cost direction:** v2 wins by ~53 % at 100 widgets and ~60 % at 200. Scaling is closer to linear in v2 (1.1 s → 3.2 s ≈ 2.9×) than in v1
|
|
161
|
+
(2.4 s → 7.8 s ≈ 3.3×). At larger N the gap widens.
|
|
162
|
+
- **Dynamic-update cost direction:** v2 wins decisively (-61 % / -46 %). The
|
|
163
|
+
per-tick distribution is much tighter — v2's option-factory-fed `setOption`
|
|
164
|
+
avoids re-initialising charts.
|
|
165
|
+
- **Outlier widget types:** not measured per-type in this run. Hot candidates
|
|
166
|
+
for follow-up: `timeseries` (largest data payload, ECharts brush+searcher
|
|
167
|
+
toolbar) and `category` (DOM-heavy, no ECharts).
|
|
168
|
+
- **Variance:** v1 update ticks span 670–1 730 ms at 100 widgets — a 2.6×
|
|
169
|
+
spread, with the first tick of each navigation always slowest. v2 ticks
|
|
170
|
+
span 398–961 ms — 2.4× spread, but the 961 ms is a single outlier; the
|
|
171
|
+
P75 is closer to 450 ms.
|
|
172
|
+
- **First-tick warmup.** Both versions show a slower first tick after mount
|
|
173
|
+
(visible in both 100- and 200-widget update series). v2's first-tick
|
|
174
|
+
penalty is smaller in absolute terms but proportionally similar.
|
|
175
|
+
|
|
176
|
+
## Next steps
|
|
177
|
+
|
|
178
|
+
- [ ] Per-widget-type breakdown — re-run with `WIDGET_TYPES = ['timeseries']`,
|
|
179
|
+
then `['category']`, etc., to isolate which types contribute most to the
|
|
180
|
+
v2 win and where any v2 regressions might hide.
|
|
181
|
+
- [ ] Production-build numbers — Storybook dev mode includes HMR, source-map
|
|
182
|
+
eval, and React dev-mode checks. Expect both versions to be ~30 % faster
|
|
183
|
+
on a `storybook build` artifact; the relative gap may narrow if v1's
|
|
184
|
+
hotspots are dev-mode-only.
|
|
185
|
+
- [ ] Memory profile across 10 dynamic ticks — confirm no widget-store leak
|
|
186
|
+
in v2 (per-widget stores must be torn down when ids change in the doubled
|
|
187
|
+
variant).
|
|
188
|
+
- [ ] Lower-spec hardware — re-run on a baseline laptop to confirm the v2 win
|
|
189
|
+
isn't M4-specific.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
2
|
+
import { act, fireEvent, render, screen } from '@testing-library/react'
|
|
3
|
+
import type { ECharts } from 'echarts'
|
|
4
|
+
import { BrushToggle } from './brush-toggle'
|
|
5
|
+
import { Provider } from '../../provider/widget-provider'
|
|
6
|
+
import {
|
|
7
|
+
applyTransforms,
|
|
8
|
+
clearAllWidgetStores,
|
|
9
|
+
getWidgetStore,
|
|
10
|
+
setEchartInstance,
|
|
11
|
+
} from '../../stores'
|
|
12
|
+
|
|
13
|
+
interface ChartHandlers {
|
|
14
|
+
finished?: () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface MockChart {
|
|
18
|
+
dispatchAction: ReturnType<typeof vi.fn>
|
|
19
|
+
on: (ev: string, cb: () => void) => void
|
|
20
|
+
off: (ev: string, cb: () => void) => void
|
|
21
|
+
__handlers: ChartHandlers
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function makeMockChart(): MockChart {
|
|
25
|
+
const handlers: ChartHandlers = {}
|
|
26
|
+
return {
|
|
27
|
+
dispatchAction: vi.fn(),
|
|
28
|
+
on: (ev, cb) => {
|
|
29
|
+
if (ev === 'finished') handlers.finished = cb
|
|
30
|
+
},
|
|
31
|
+
off: (ev) => {
|
|
32
|
+
if (ev === 'finished') handlers.finished = undefined
|
|
33
|
+
},
|
|
34
|
+
__handlers: handlers,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
beforeEach(() => clearAllWidgetStores())
|
|
39
|
+
afterEach(() => clearAllWidgetStores())
|
|
40
|
+
|
|
41
|
+
describe('<BrushToggle>', () => {
|
|
42
|
+
it('starts disabled by default', () => {
|
|
43
|
+
render(
|
|
44
|
+
<Provider id='bt-1' data={[]}>
|
|
45
|
+
<BrushToggle />
|
|
46
|
+
</Provider>,
|
|
47
|
+
)
|
|
48
|
+
expect(screen.getByLabelText('Enable brush selection')).toBeTruthy()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('respects initialEnabled=true', () => {
|
|
52
|
+
render(
|
|
53
|
+
<Provider id='bt-2' data={[]}>
|
|
54
|
+
<BrushToggle initialEnabled />
|
|
55
|
+
</Provider>,
|
|
56
|
+
)
|
|
57
|
+
expect(screen.getByLabelText('Disable brush selection')).toBeTruthy()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('clicking enables the transform — brush config appears in the post-pipeline option', () => {
|
|
61
|
+
render(
|
|
62
|
+
<Provider id='bt-3' data={[1]}>
|
|
63
|
+
<BrushToggle />
|
|
64
|
+
</Provider>,
|
|
65
|
+
)
|
|
66
|
+
fireEvent.click(screen.getByLabelText('Enable brush selection'))
|
|
67
|
+
// configTransforms now apply inside <Widget.Echart>; replay the
|
|
68
|
+
// pipeline locally over a blank structural option.
|
|
69
|
+
const configTransforms = getWidgetStore('bt-3').getState().configTransforms
|
|
70
|
+
const opts = applyTransforms({}, configTransforms) as {
|
|
71
|
+
brush?: { xAxisIndex?: string }
|
|
72
|
+
}
|
|
73
|
+
expect(opts.brush).toBeTruthy()
|
|
74
|
+
expect(opts.brush?.xAxisIndex).toBe('all')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('dispatches takeGlobalCursor with brush config when enabled and a chart is registered', () => {
|
|
78
|
+
const chart = makeMockChart()
|
|
79
|
+
setEchartInstance('bt-4', chart as unknown as ECharts)
|
|
80
|
+
render(
|
|
81
|
+
<Provider id='bt-4' data={[1]}>
|
|
82
|
+
<BrushToggle initialEnabled />
|
|
83
|
+
</Provider>,
|
|
84
|
+
)
|
|
85
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
86
|
+
type: 'takeGlobalCursor',
|
|
87
|
+
key: 'brush',
|
|
88
|
+
brushOption: { brushType: 'lineX', brushMode: 'multiple' },
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it("re-dispatches takeGlobalCursor on the chart's 'finished' event", () => {
|
|
93
|
+
const chart = makeMockChart()
|
|
94
|
+
setEchartInstance('bt-5', chart as unknown as ECharts)
|
|
95
|
+
render(
|
|
96
|
+
<Provider id='bt-5' data={[1]}>
|
|
97
|
+
<BrushToggle initialEnabled />
|
|
98
|
+
</Provider>,
|
|
99
|
+
)
|
|
100
|
+
chart.dispatchAction.mockClear()
|
|
101
|
+
act(() => chart.__handlers.finished?.())
|
|
102
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
103
|
+
type: 'takeGlobalCursor',
|
|
104
|
+
key: 'brush',
|
|
105
|
+
brushOption: { brushType: 'lineX', brushMode: 'multiple' },
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('on disable: clears the global cursor and wipes drawn areas', () => {
|
|
110
|
+
const chart = makeMockChart()
|
|
111
|
+
setEchartInstance('bt-6', chart as unknown as ECharts)
|
|
112
|
+
render(
|
|
113
|
+
<Provider id='bt-6' data={[1]}>
|
|
114
|
+
<BrushToggle initialEnabled />
|
|
115
|
+
</Provider>,
|
|
116
|
+
)
|
|
117
|
+
chart.dispatchAction.mockClear()
|
|
118
|
+
fireEvent.click(screen.getByLabelText('Disable brush selection'))
|
|
119
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
120
|
+
type: 'takeGlobalCursor',
|
|
121
|
+
})
|
|
122
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
123
|
+
type: 'brush',
|
|
124
|
+
areas: [],
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('honors brushType=rect and brushMode=single', () => {
|
|
129
|
+
const chart = makeMockChart()
|
|
130
|
+
setEchartInstance('bt-7', chart as unknown as ECharts)
|
|
131
|
+
render(
|
|
132
|
+
<Provider id='bt-7' data={[1]}>
|
|
133
|
+
<BrushToggle initialEnabled brushType='rect' brushMode='single' />
|
|
134
|
+
</Provider>,
|
|
135
|
+
)
|
|
136
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
137
|
+
type: 'takeGlobalCursor',
|
|
138
|
+
key: 'brush',
|
|
139
|
+
brushOption: { brushType: 'rect', brushMode: 'single' },
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
it('wipes drawn brush areas when an external selection is cleared while enabled', () => {
|
|
144
|
+
const chart = makeMockChart()
|
|
145
|
+
setEchartInstance('bt-9', chart as unknown as ECharts)
|
|
146
|
+
const { rerender } = render(
|
|
147
|
+
<Provider id='bt-9' data={[1]}>
|
|
148
|
+
<BrushToggle initialEnabled selection={['a', 'b']} />
|
|
149
|
+
</Provider>,
|
|
150
|
+
)
|
|
151
|
+
chart.dispatchAction.mockClear()
|
|
152
|
+
rerender(
|
|
153
|
+
<Provider id='bt-9' data={[1]}>
|
|
154
|
+
<BrushToggle initialEnabled selection={[]} />
|
|
155
|
+
</Provider>,
|
|
156
|
+
)
|
|
157
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
158
|
+
type: 'brush',
|
|
159
|
+
areas: [],
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
it('attaches the cursor reactively when the chart arrives *after* the toggle mounts', () => {
|
|
164
|
+
const chart = makeMockChart()
|
|
165
|
+
render(
|
|
166
|
+
<Provider id='bt-8' data={[1]}>
|
|
167
|
+
<BrushToggle initialEnabled />
|
|
168
|
+
</Provider>,
|
|
169
|
+
)
|
|
170
|
+
// Chart not yet registered — no dispatch should have happened.
|
|
171
|
+
expect(chart.dispatchAction).not.toHaveBeenCalled()
|
|
172
|
+
// Simulate the bridge mounting and publishing the instance.
|
|
173
|
+
act(() => setEchartInstance('bt-8', chart as unknown as ECharts))
|
|
174
|
+
expect(chart.dispatchAction).toHaveBeenCalledWith({
|
|
175
|
+
type: 'takeGlobalCursor',
|
|
176
|
+
key: 'brush',
|
|
177
|
+
brushOption: { brushType: 'lineX', brushMode: 'multiple' },
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
})
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useEffect, type ComponentType } from 'react'
|
|
2
|
+
import { IconButton, type SvgIconProps } from '@mui/material'
|
|
3
|
+
import HighlightAltIcon from '@mui/icons-material/HighlightAlt'
|
|
4
|
+
import { Tooltip } from '../../../components'
|
|
5
|
+
import {
|
|
6
|
+
useEchartInstance,
|
|
7
|
+
useSingleTransform,
|
|
8
|
+
useWidgetId,
|
|
9
|
+
} from '../../stores'
|
|
10
|
+
import { addBrush } from './transforms'
|
|
11
|
+
import { DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleLabels } from './labels'
|
|
12
|
+
import { styles } from './style'
|
|
13
|
+
|
|
14
|
+
const BRUSH_DESCRIPTOR = {
|
|
15
|
+
id: 'brush-toggle',
|
|
16
|
+
type: 'config' as const,
|
|
17
|
+
order: 25,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BrushToggleProps {
|
|
21
|
+
initialEnabled?: boolean
|
|
22
|
+
/**
|
|
23
|
+
* ECharts brush type. `'lineX'` (default) selects a range on the
|
|
24
|
+
* x-axis — appropriate for bar / histogram / timeseries. `'rect'`
|
|
25
|
+
* selects a 2-D rectangle — use for scatterplot. Other ECharts
|
|
26
|
+
* brush types (`'lineY'`, `'polygon'`) are also accepted.
|
|
27
|
+
*/
|
|
28
|
+
brushType?: 'lineX' | 'lineY' | 'rect' | 'polygon'
|
|
29
|
+
/**
|
|
30
|
+
* `'multiple'` (default) lets the user draw additional brushes on
|
|
31
|
+
* top of existing ones. `'single'` replaces the previous brush on
|
|
32
|
+
* each new draw.
|
|
33
|
+
*/
|
|
34
|
+
brushMode?: 'multiple' | 'single'
|
|
35
|
+
/**
|
|
36
|
+
* Optional view of the consumer-owned selection. When provided and
|
|
37
|
+
* the array is empty (`[]`), any brush rectangles currently drawn on
|
|
38
|
+
* the chart are wiped — keeps the UI in sync when the parent clears
|
|
39
|
+
* the selection externally (e.g. via `Widget.SelectionSummary`'s
|
|
40
|
+
* `onClear`). Pass the same array that drives `useChartSelection` /
|
|
41
|
+
* the option factory's `selection` input.
|
|
42
|
+
*
|
|
43
|
+
* Leave `undefined` to opt out — the sync effect becomes a no-op.
|
|
44
|
+
*/
|
|
45
|
+
selection?: readonly unknown[] | null
|
|
46
|
+
labels?: Partial<BrushToggleLabels>
|
|
47
|
+
icon?: ComponentType<SvgIconProps>
|
|
48
|
+
iconProps?: SvgIconProps
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Toggle ECharts' brush selection mode. Two-part wiring:
|
|
53
|
+
*
|
|
54
|
+
* 1. The config transform (`addBrush`) installs the `brush`
|
|
55
|
+
* component on the option so brushed items get the
|
|
56
|
+
* `outOfBrush` dim treatment.
|
|
57
|
+
* 2. ECharts only enters "brush cursor" mode when something
|
|
58
|
+
* dispatches `takeGlobalCursor({ key: 'brush', ... })`. This
|
|
59
|
+
* component drives that dispatch via {@link useEchartInstance},
|
|
60
|
+
* reacting when the chart instance becomes available (the
|
|
61
|
+
* `BrushToggle` mounts before `Widget.Echart` in tree order, so
|
|
62
|
+
* on first mount the chart isn't ready yet).
|
|
63
|
+
*
|
|
64
|
+
* 3. ECharts clears the global cursor on every `setOption`, so we
|
|
65
|
+
* re-dispatch on each `'finished'` event — required for
|
|
66
|
+
* `brushMode: 'multiple'` to keep working across selection-driven
|
|
67
|
+
* re-renders, RelativeData toggles, etc.
|
|
68
|
+
*
|
|
69
|
+
* Selection events (`brushSelected` / `brushEnd`) flow through the
|
|
70
|
+
* existing `useChartSelection` wiring at the consumer level — no extra
|
|
71
|
+
* plumbing here.
|
|
72
|
+
*/
|
|
73
|
+
export function BrushToggle({
|
|
74
|
+
initialEnabled = false,
|
|
75
|
+
brushType = 'lineX',
|
|
76
|
+
brushMode = 'multiple',
|
|
77
|
+
selection,
|
|
78
|
+
labels,
|
|
79
|
+
icon: Icon = HighlightAltIcon,
|
|
80
|
+
iconProps,
|
|
81
|
+
}: BrushToggleProps) {
|
|
82
|
+
const id = useWidgetId()
|
|
83
|
+
const _labels = { ...DEFAULT_BRUSH_TOGGLE_LABELS, ...labels }
|
|
84
|
+
const { enabled, toggle } = useSingleTransform(
|
|
85
|
+
id,
|
|
86
|
+
BRUSH_DESCRIPTOR,
|
|
87
|
+
addBrush,
|
|
88
|
+
{ initialEnabled },
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
// Reactive read of the live instance — the effect below re-runs when
|
|
92
|
+
// the chart arrives, departs, or re-inits, instead of polling.
|
|
93
|
+
const chart = useEchartInstance(id)
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (!chart) return undefined
|
|
97
|
+
if (!enabled) {
|
|
98
|
+
// Disabled: exit brush cursor and wipe any drawn rectangles.
|
|
99
|
+
chart.dispatchAction({ type: 'takeGlobalCursor' })
|
|
100
|
+
chart.dispatchAction({ type: 'brush', areas: [] })
|
|
101
|
+
return undefined
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const enterBrush = (): void => {
|
|
105
|
+
chart.dispatchAction({
|
|
106
|
+
type: 'takeGlobalCursor',
|
|
107
|
+
key: 'brush',
|
|
108
|
+
brushOption: { brushType, brushMode },
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Every `setOption` clears the global cursor. Re-dispatch after
|
|
113
|
+
// each chart render so `brushMode: 'multiple'` stays usable across
|
|
114
|
+
// selection-driven re-renders, RelativeData toggles, etc.
|
|
115
|
+
const onFinished = (): void => enterBrush()
|
|
116
|
+
chart.on('finished', onFinished)
|
|
117
|
+
enterBrush()
|
|
118
|
+
|
|
119
|
+
return () => {
|
|
120
|
+
chart.off('finished', onFinished)
|
|
121
|
+
}
|
|
122
|
+
}, [chart, enabled, brushType, brushMode])
|
|
123
|
+
|
|
124
|
+
// Sync the drawn rectangles with the external selection. When the
|
|
125
|
+
// parent flips `selection` to `[]` (e.g. SelectionSummary's "Clear"
|
|
126
|
+
// button), wipe the brush areas so the chart UI matches the data.
|
|
127
|
+
// Dispatching with an empty `areas` array when nothing is drawn is a
|
|
128
|
+
// safe no-op on ECharts, so no extra "previous value" bookkeeping is
|
|
129
|
+
// needed. Kept as a separate effect so a parent selection change
|
|
130
|
+
// doesn't tear down / re-attach the `'finished'` listener above.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!chart || !enabled) return
|
|
133
|
+
if (selection?.length === 0) {
|
|
134
|
+
chart.dispatchAction({ type: 'brush', areas: [] })
|
|
135
|
+
}
|
|
136
|
+
}, [chart, enabled, selection])
|
|
137
|
+
|
|
138
|
+
const tooltip = enabled ? _labels.on : _labels.off
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<Tooltip title={tooltip}>
|
|
142
|
+
<IconButton
|
|
143
|
+
size='small'
|
|
144
|
+
aria-label={tooltip}
|
|
145
|
+
aria-pressed={enabled}
|
|
146
|
+
onClick={toggle}
|
|
147
|
+
className={enabled ? 'active' : undefined}
|
|
148
|
+
sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}
|
|
149
|
+
>
|
|
150
|
+
<Icon fontSize='small' {...iconProps} />
|
|
151
|
+
</IconButton>
|
|
152
|
+
</Tooltip>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
export const styles = {
|
|
4
|
+
toggle: {
|
|
5
|
+
p: 0.5,
|
|
6
|
+
'& .MuiSvgIcon-root': { fontSize: 20 },
|
|
7
|
+
},
|
|
8
|
+
toggleActive: {
|
|
9
|
+
background: (theme: Theme) => theme.palette.primary.relatedLight,
|
|
10
|
+
},
|
|
11
|
+
} satisfies Record<string, SxProps<Theme>>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { addBrush } from './transforms'
|
|
3
|
+
|
|
4
|
+
describe('addBrush', () => {
|
|
5
|
+
it('adds a brush block with rect/clear toolbox', () => {
|
|
6
|
+
const out = addBrush({}) as {
|
|
7
|
+
brush: { toolbox: string[]; xAxisIndex: string }
|
|
8
|
+
}
|
|
9
|
+
expect(out.brush.toolbox).toEqual(['rect', 'clear'])
|
|
10
|
+
expect(out.brush.xAxisIndex).toBe('all')
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('configures outOfBrush dim alpha at 0.15 (matches v1)', () => {
|
|
14
|
+
const out = addBrush({}) as {
|
|
15
|
+
brush: { outOfBrush: { colorAlpha: number } }
|
|
16
|
+
}
|
|
17
|
+
expect(out.brush.outOfBrush.colorAlpha).toBe(0.15)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('adds the toolbox.feature.brush so the user gets the brush UI', () => {
|
|
21
|
+
const out = addBrush({}) as {
|
|
22
|
+
toolbox: { feature: { brush: { type: string[] } } }
|
|
23
|
+
}
|
|
24
|
+
expect(out.toolbox.feature.brush.type).toEqual(['rect', 'clear'])
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('preserves an existing toolbox config and adds the brush feature on top', () => {
|
|
28
|
+
const seeded = {
|
|
29
|
+
toolbox: { right: 8, feature: { saveAsImage: {} } },
|
|
30
|
+
}
|
|
31
|
+
const out = addBrush(seeded) as {
|
|
32
|
+
toolbox: {
|
|
33
|
+
right: number
|
|
34
|
+
feature: { saveAsImage: object; brush: object }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
expect(out.toolbox.right).toBe(8)
|
|
38
|
+
expect(out.toolbox.feature.saveAsImage).toEqual({})
|
|
39
|
+
expect(out.toolbox.feature.brush).toBeDefined()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('returns the input unchanged when not an object', () => {
|
|
43
|
+
expect(addBrush(null)).toBe(null)
|
|
44
|
+
expect(addBrush(undefined)).toBe(undefined)
|
|
45
|
+
expect(addBrush(42)).toBe(42)
|
|
46
|
+
})
|
|
47
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brush config transform: enables ECharts' brush component on the option
|
|
3
|
+
* object. Module-level constant — identity stable across renders.
|
|
4
|
+
*
|
|
5
|
+
* Pairs with `replaceMergeKeys: ['brush']` so the pipeline replaces (not
|
|
6
|
+
* merges) the brush config on every config-pipeline run. v1 needed a
|
|
7
|
+
* mousemove re-dispatch hack to keep the brush state across data updates;
|
|
8
|
+
* v2 keeps brush state continuous via `notMerge: false` + dynamic
|
|
9
|
+
* replaceMerge in the EchartUI layer (D6) — no hack required.
|
|
10
|
+
*/
|
|
11
|
+
export const addBrush = (option: unknown): unknown => {
|
|
12
|
+
if (option == null || typeof option !== 'object') return option
|
|
13
|
+
const cfg = option as Record<string, unknown>
|
|
14
|
+
return {
|
|
15
|
+
...cfg,
|
|
16
|
+
brush: {
|
|
17
|
+
toolbox: ['rect', 'clear'],
|
|
18
|
+
xAxisIndex: 'all',
|
|
19
|
+
brushLink: 'all',
|
|
20
|
+
outOfBrush: { colorAlpha: 0.15 },
|
|
21
|
+
},
|
|
22
|
+
toolbox: {
|
|
23
|
+
...((cfg.toolbox as object | undefined) ?? {}),
|
|
24
|
+
show: false,
|
|
25
|
+
feature: {
|
|
26
|
+
...((cfg.toolbox as { feature?: object } | undefined)?.feature ?? {}),
|
|
27
|
+
brush: { type: ['rect', 'clear'] },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvgIcon, type SvgIconProps } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
export function ChangeColumnIcon(props: SvgIconProps) {
|
|
4
|
+
return (
|
|
5
|
+
<SvgIcon viewBox='0 0 18 18' {...props}>
|
|
6
|
+
<path
|
|
7
|
+
fill='currentColor'
|
|
8
|
+
fillRule='evenodd'
|
|
9
|
+
d='M14.25 2.25H3.75c-.825 0-1.5.675-1.5 1.5v10.5c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5V3.75c0-.825-.675-1.5-1.5-1.5m-3.75 12h-3V3.75h3zM3.75 3.75H6v10.5H3.75zM12 14.25V3.75h2.25v10.5z'
|
|
10
|
+
clipRule='evenodd'
|
|
11
|
+
/>
|
|
12
|
+
</SvgIcon>
|
|
13
|
+
)
|
|
14
|
+
}
|