@sqlrooms/mosaic 0.29.0-rc.7 → 0.29.0-rc.8
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/LICENSE.md +2 -1
- package/README.md +134 -0
- package/dist/MosaicSlice.d.ts +1 -0
- package/dist/MosaicSlice.d.ts.map +1 -1
- package/dist/MosaicSlice.js.map +1 -1
- package/dist/VgPlotChart.d.ts.map +1 -1
- package/dist/VgPlotChart.js +9 -3
- package/dist/VgPlotChart.js.map +1 -1
- package/dist/ai/ai.d.ts +9 -4
- package/dist/ai/ai.d.ts.map +1 -1
- package/dist/ai/ai.js +91 -49
- package/dist/ai/ai.js.map +1 -1
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/charts/MosaicChart.d.ts +3 -1
- package/dist/charts/MosaicChart.d.ts.map +1 -1
- package/dist/charts/MosaicChart.js +2 -2
- package/dist/charts/MosaicChart.js.map +1 -1
- package/dist/charts/MosaicChartError.d.ts +8 -2
- package/dist/charts/MosaicChartError.d.ts.map +1 -1
- package/dist/charts/MosaicChartError.js +29 -3
- package/dist/charts/MosaicChartError.js.map +1 -1
- package/dist/charts/MosaicChartSettingsButton.d.ts +15 -0
- package/dist/charts/MosaicChartSettingsButton.d.ts.map +1 -0
- package/dist/charts/MosaicChartSettingsButton.js +7 -0
- package/dist/charts/MosaicChartSettingsButton.js.map +1 -0
- package/dist/charts/MosaicChartView.d.ts +2 -0
- package/dist/charts/MosaicChartView.d.ts.map +1 -1
- package/dist/charts/MosaicChartView.js +20 -7
- package/dist/charts/MosaicChartView.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettings.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettings.js +3 -3
- package/dist/charts/chart-settings/MosaicChartSettings.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettingsPanel.js +1 -1
- package/dist/charts/chart-settings/MosaicChartSettingsPanel.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js +11 -4
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
- package/dist/charts/chart-types/base-types.d.ts +17 -6
- package/dist/charts/chart-types/base-types.d.ts.map +1 -1
- package/dist/charts/chart-types/base-types.js +3 -0
- package/dist/charts/chart-types/base-types.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js +3 -8
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/chart-config.d.ts +3 -1
- package/dist/charts/chart-types/chart-config.d.ts.map +1 -1
- package/dist/charts/chart-types/chart-config.js +2 -2
- package/dist/charts/chart-types/chart-config.js.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.d.ts +2 -1
- package/dist/charts/chart-types/count-plot/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.js +65 -34
- package/dist/charts/chart-types/count-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.js +1 -1
- package/dist/charts/chart-types/count-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/createDefaultChartTypes.js +2 -2
- package/dist/charts/chart-types/createDefaultChartTypes.js.map +1 -1
- package/dist/charts/chart-types/custom-spec/spec.d.ts +2 -1
- package/dist/charts/chart-types/custom-spec/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/custom-spec/spec.js +16 -12
- package/dist/charts/chart-types/custom-spec/spec.js.map +1 -1
- package/dist/charts/chart-types/errors.d.ts +25 -0
- package/dist/charts/chart-types/errors.d.ts.map +1 -1
- package/dist/charts/chart-types/errors.js +38 -0
- package/dist/charts/chart-types/errors.js.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.d.ts +2 -1
- package/dist/charts/chart-types/heatmap/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.js +53 -21
- package/dist/charts/chart-types/heatmap/spec.js.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.js +2 -2
- package/dist/charts/chart-types/heatmap/tool.js.map +1 -1
- package/dist/charts/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/HistogramSettings.js +3 -1
- package/dist/charts/chart-types/histogram/HistogramSettings.js.map +1 -1
- package/dist/charts/chart-types/histogram/schema.d.ts +2 -0
- package/dist/charts/chart-types/histogram/schema.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/schema.js +1 -0
- package/dist/charts/chart-types/histogram/schema.js.map +1 -1
- package/dist/charts/chart-types/histogram/spec.d.ts +2 -1
- package/dist/charts/chart-types/histogram/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/spec.js +50 -27
- package/dist/charts/chart-types/histogram/spec.js.map +1 -1
- package/dist/charts/chart-types/histogram/tool.d.ts +2 -0
- package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/tool.js +1 -1
- package/dist/charts/chart-types/histogram/tool.js.map +1 -1
- package/dist/charts/chart-types/index.d.ts +4 -4
- package/dist/charts/chart-types/index.js +4 -4
- package/dist/charts/chart-types/index.js.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartSettings.js +4 -13
- package/dist/charts/chart-types/line-chart/LineChartSettings.js.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js +22 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js +42 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js.map +1 -0
- package/dist/charts/chart-types/line-chart/schema.d.ts +2 -0
- package/dist/charts/chart-types/line-chart/schema.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/schema.js +5 -0
- package/dist/charts/chart-types/line-chart/schema.js.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.d.ts +2 -1
- package/dist/charts/chart-types/line-chart/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.js +97 -65
- package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.d.ts +2 -0
- package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.js +1 -1
- package/dist/charts/chart-types/line-chart/tool.js.map +1 -1
- package/dist/charts/chart-types/line-chart/utils.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/utils.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/utils.js +17 -0
- package/dist/charts/chart-types/line-chart/utils.js.map +1 -0
- package/dist/charts/chart-types/mosaicChartTypes.d.ts +4 -2
- package/dist/charts/chart-types/mosaicChartTypes.d.ts.map +1 -1
- package/dist/charts/chart-types/mosaicChartTypes.js +2 -2
- package/dist/charts/chart-types/mosaicChartTypes.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts +3 -0
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts.map +1 -0
- package/dist/charts/chart-types/{bubble-chart/BubbleChartSettings.js → scatter-plot/ScatterPlotSettings.js} +4 -4
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.d.ts +4 -0
- package/dist/charts/chart-types/scatter-plot/definition.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.js +24 -0
- package/dist/charts/chart-types/scatter-plot/definition.js.map +1 -0
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.d.ts +5 -5
- package/dist/charts/chart-types/scatter-plot/schema.d.ts.map +1 -0
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.js +5 -5
- package/dist/charts/chart-types/scatter-plot/schema.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/spec.d.ts +5 -0
- package/dist/charts/chart-types/scatter-plot/spec.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/spec.js +81 -0
- package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -0
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/tool.d.ts +3 -3
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/tool.js +17 -13
- package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -0
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js +12 -5
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js +2 -2
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js.map +1 -1
- package/dist/charts/useChartDataPolicy.d.ts.map +1 -1
- package/dist/charts/useChartDataPolicy.js +2 -1
- package/dist/charts/useChartDataPolicy.js.map +1 -1
- package/dist/charts/useChartPanelClients.d.ts +8 -0
- package/dist/charts/useChartPanelClients.d.ts.map +1 -0
- package/dist/charts/useChartPanelClients.js +22 -0
- package/dist/charts/useChartPanelClients.js.map +1 -0
- package/dist/charts/useMosaicChartRenderContext.d.ts +2 -3
- package/dist/charts/useMosaicChartRenderContext.d.ts.map +1 -1
- package/dist/charts/useMosaicChartRenderContext.js +15 -15
- package/dist/charts/useMosaicChartRenderContext.js.map +1 -1
- package/dist/charts/worksheet/ChartBlockHeader.d.ts.map +1 -1
- package/dist/charts/worksheet/ChartBlockHeader.js +4 -3
- package/dist/charts/worksheet/ChartBlockHeader.js.map +1 -1
- package/dist/charts/worksheet/ChartBlockRenderer.d.ts.map +1 -1
- package/dist/charts/worksheet/ChartBlockRenderer.js +3 -13
- package/dist/charts/worksheet/ChartBlockRenderer.js.map +1 -1
- package/dist/column-types-utils.d.ts.map +1 -1
- package/dist/column-types-utils.js +12 -4
- package/dist/column-types-utils.js.map +1 -1
- package/dist/components/AggregationSelector.d.ts.map +1 -1
- package/dist/components/AggregationSelector.js +9 -2
- package/dist/components/AggregationSelector.js.map +1 -1
- package/dist/components/BlockCaptionEditor.d.ts +20 -0
- package/dist/components/BlockCaptionEditor.d.ts.map +1 -0
- package/dist/components/BlockCaptionEditor.js +15 -0
- package/dist/components/BlockCaptionEditor.js.map +1 -0
- package/dist/components/ColorSelector.d.ts +12 -0
- package/dist/components/ColorSelector.d.ts.map +1 -0
- package/dist/components/ColorSelector.js +14 -0
- package/dist/components/ColorSelector.js.map +1 -0
- package/dist/components/ColumnSelector.d.ts +1 -0
- package/dist/components/ColumnSelector.d.ts.map +1 -1
- package/dist/components/ColumnSelector.js +2 -2
- package/dist/components/ColumnSelector.js.map +1 -1
- package/dist/components/Combobox.d.ts +45 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox.js +58 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/FieldSelectorInput.d.ts +1 -0
- package/dist/components/FieldSelectorInput.d.ts.map +1 -1
- package/dist/components/FieldSelectorInput.js +4 -9
- package/dist/components/FieldSelectorInput.js.map +1 -1
- package/dist/components/MultiFieldSelector.d.ts +4 -1
- package/dist/components/MultiFieldSelector.d.ts.map +1 -1
- package/dist/components/MultiFieldSelector.js +4 -13
- package/dist/components/MultiFieldSelector.js.map +1 -1
- package/dist/components/TemporalGranularitySelector.d.ts.map +1 -1
- package/dist/components/TemporalGranularitySelector.js +13 -9
- package/dist/components/TemporalGranularitySelector.js.map +1 -1
- package/dist/components/useCombobox.d.ts +23 -0
- package/dist/components/useCombobox.d.ts.map +1 -0
- package/dist/components/useCombobox.js +26 -0
- package/dist/components/useCombobox.js.map +1 -0
- package/dist/constants/chart-colors.d.ts +3 -0
- package/dist/constants/chart-colors.d.ts.map +1 -0
- package/dist/constants/chart-colors.js +5 -0
- package/dist/constants/chart-colors.js.map +1 -0
- package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts +2 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts.map +1 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.js +1 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.js.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.d.ts +22 -4
- package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.js +55 -0
- package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
- package/dist/dashboard/components/ResetFiltersButton.d.ts +14 -0
- package/dist/dashboard/components/ResetFiltersButton.d.ts.map +1 -0
- package/dist/dashboard/components/ResetFiltersButton.js +15 -0
- package/dist/dashboard/components/ResetFiltersButton.js.map +1 -0
- package/dist/dashboard/dashboard-types.d.ts +9 -3
- package/dist/dashboard/dashboard-types.d.ts.map +1 -1
- package/dist/dashboard/hooks/useDashboardResetFilters.d.ts +14 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.d.ts.map +1 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.js +39 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.js.map +1 -0
- package/dist/dashboard/hooks/usePanelResetFilters.d.ts +16 -0
- package/dist/dashboard/hooks/usePanelResetFilters.d.ts.map +1 -0
- package/dist/dashboard/hooks/usePanelResetFilters.js +47 -0
- package/dist/dashboard/hooks/usePanelResetFilters.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +3 -3
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts +7 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js +18 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +4 -32
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts +2 -2
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +12 -10
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -1
- package/dist/dashboard/usePanelClientRegistration.d.ts +7 -0
- package/dist/dashboard/usePanelClientRegistration.d.ts.map +1 -0
- package/dist/dashboard/usePanelClientRegistration.js +30 -0
- package/dist/dashboard/usePanelClientRegistration.js.map +1 -0
- package/dist/dashboard/usePanelClients.d.ts +7 -0
- package/dist/dashboard/usePanelClients.d.ts.map +1 -0
- package/dist/dashboard/usePanelClients.js +13 -0
- package/dist/dashboard/usePanelClients.js.map +1 -0
- package/dist/data-table-explorer/DataTableExplorer.d.ts +4 -2
- package/dist/data-table-explorer/DataTableExplorer.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorer.js +4 -4
- package/dist/data-table-explorer/DataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +1 -0
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js.map +1 -1
- package/dist/data-table-explorer/createDataTableExplorerStore.d.ts +3 -0
- package/dist/data-table-explorer/createDataTableExplorerStore.d.ts.map +1 -1
- package/dist/data-table-explorer/createDataTableExplorerStore.js +6 -0
- package/dist/data-table-explorer/createDataTableExplorerStore.js.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts +4 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts.map +1 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js +13 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js.map +1 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js +22 -7
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map +1 -1
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts +13 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts.map +1 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js +32 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js.map +1 -0
- package/dist/data-table-explorer/dataTableExplorerController.d.ts +5 -1
- package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.js +5 -2
- package/dist/data-table-explorer/dataTableExplorerController.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts +12 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js +19 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts +30 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +120 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +28 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +40 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts +13 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js +40 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts +18 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js +23 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts +27 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js +28 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts +15 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js +21 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js.map +1 -0
- package/dist/data-table-explorer/types.d.ts +6 -3
- package/dist/data-table-explorer/types.d.ts.map +1 -1
- package/dist/data-table-explorer/types.js.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.d.ts.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.js +12 -275
- package/dist/data-table-explorer/useDataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts +1 -0
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js +4 -2
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js +3 -3
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/useVgPlotChartRender.d.ts.map +1 -1
- package/dist/useVgPlotChartRender.js +125 -24
- package/dist/useVgPlotChartRender.js.map +1 -1
- package/dist/useVgPlotChartRetention.d.ts +11 -0
- package/dist/useVgPlotChartRetention.d.ts.map +1 -1
- package/dist/useVgPlotChartRetention.js.map +1 -1
- package/package.json +14 -14
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts +0 -3
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/definition.d.ts +0 -4
- package/dist/charts/chart-types/bubble-chart/definition.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/definition.js +0 -24
- package/dist/charts/chart-types/bubble-chart/definition.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/schema.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/schema.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/spec.d.ts +0 -4
- package/dist/charts/chart-types/bubble-chart/spec.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/spec.js +0 -31
- package/dist/charts/chart-types/bubble-chart/spec.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/tool.js.map +0 -1
- package/dist/hooks/useDataTable.d.ts +0 -3
- package/dist/hooks/useDataTable.d.ts.map +0 -1
- package/dist/hooks/useDataTable.js +0 -28
- package/dist/hooks/useDataTable.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { buildDataTableExplorerBaseQuery, buildDataTableExplorerPageQuery, } from '../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Derives the dataTableExplorer's field and SQL state from the current schema,
|
|
5
|
+
* selection, sorting, and pagination state.
|
|
6
|
+
*/
|
|
7
|
+
export function useDataTableExplorerQueryState({ pagination, rowSelectionVersion, schema, selection, selectionVersion, sorting, tableName, }) {
|
|
8
|
+
const fields = schema.fields;
|
|
9
|
+
const fieldNames = useMemo(() => fields.map((field) => field.name), [fields]);
|
|
10
|
+
const filter = useMemo(() => {
|
|
11
|
+
void selectionVersion;
|
|
12
|
+
return selection.predicate();
|
|
13
|
+
}, [selection, selectionVersion]);
|
|
14
|
+
const rowFilter = useMemo(() => {
|
|
15
|
+
void rowSelectionVersion;
|
|
16
|
+
return selection.predicate();
|
|
17
|
+
}, [rowSelectionVersion, selection]);
|
|
18
|
+
const baseQuery = useMemo(() => buildDataTableExplorerBaseQuery({
|
|
19
|
+
columns: fieldNames,
|
|
20
|
+
filter,
|
|
21
|
+
sorting,
|
|
22
|
+
tableName,
|
|
23
|
+
}), [fieldNames, filter, sorting, tableName]);
|
|
24
|
+
const pageBaseQuery = useMemo(() => buildDataTableExplorerBaseQuery({
|
|
25
|
+
columns: fieldNames,
|
|
26
|
+
filter: rowFilter,
|
|
27
|
+
sorting,
|
|
28
|
+
tableName,
|
|
29
|
+
}), [fieldNames, rowFilter, sorting, tableName]);
|
|
30
|
+
return {
|
|
31
|
+
baseQuery,
|
|
32
|
+
datasetId: [tableName, ...fieldNames].join(''),
|
|
33
|
+
fieldNames,
|
|
34
|
+
fields,
|
|
35
|
+
hasFilters: Array.isArray(filter) ? filter.length > 0 : Boolean(filter),
|
|
36
|
+
pageQuery: buildDataTableExplorerPageQuery(pageBaseQuery, pagination).toString(),
|
|
37
|
+
rowFilter,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=useDataTableExplorerQueryState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerQueryState.js","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerQueryState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAO9B,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,UAAU,CAAC;AAsBlB;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,UAAU,EACV,mBAAmB,EACnB,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,SAAS,GAC6B;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,KAAK,gBAAgB,CAAC;QACtB,OAAO,SAAS,CAAC,SAAS,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,KAAK,mBAAmB,CAAC;QACzB,OAAO,SAAS,CAAC,SAAS,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,OAAO,CACvB,GAAG,EAAE,CACH,+BAA+B,CAAC;QAC9B,OAAO,EAAE,UAAU;QACnB,MAAM;QACN,OAAO;QACP,SAAS;KACV,CAAC,EACJ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CACzC,CAAC;IACF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CACH,+BAA+B,CAAC;QAC9B,OAAO,EAAE,UAAU;QACnB,MAAM,EAAE,SAAS;QACjB,OAAO;QACP,SAAS;KACV,CAAC,EACJ,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAC5C,CAAC;IAEF,OAAO;QACL,SAAS;QACT,SAAS,EAAE,CAAC,SAAS,EAAE,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C,UAAU;QACV,MAAM;QACN,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvE,SAAS,EAAE,+BAA+B,CACxC,aAAa,EACb,UAAU,CACX,CAAC,QAAQ,EAAE;QACZ,SAAS;KACV,CAAC;AACJ,CAAC","sourcesContent":["import {useMemo} from 'react';\nimport type {Selection} from '@uwdata/mosaic-core';\nimport type {DataTableExplorerStoreState} from '../createDataTableExplorerStore';\nimport type {\n DataTableExplorerPaginationState,\n DataTableExplorerSorting,\n} from '../types';\nimport {\n buildDataTableExplorerBaseQuery,\n buildDataTableExplorerPageQuery,\n} from '../utils';\n\nexport type UseDataTableExplorerQueryStateOptions = {\n pagination: DataTableExplorerPaginationState;\n rowSelectionVersion: number;\n schema: DataTableExplorerStoreState['schema'];\n selection: Selection;\n selectionVersion: number;\n sorting: DataTableExplorerSorting;\n tableName: string;\n};\n\nexport type UseDataTableExplorerQueryStateReturn = {\n baseQuery: ReturnType<typeof buildDataTableExplorerBaseQuery>;\n datasetId: string;\n fieldNames: string[];\n fields: DataTableExplorerStoreState['schema']['fields'];\n hasFilters: boolean;\n pageQuery: string;\n rowFilter: ReturnType<Selection['predicate']>;\n};\n\n/**\n * Derives the dataTableExplorer's field and SQL state from the current schema,\n * selection, sorting, and pagination state.\n */\nexport function useDataTableExplorerQueryState({\n pagination,\n rowSelectionVersion,\n schema,\n selection,\n selectionVersion,\n sorting,\n tableName,\n}: UseDataTableExplorerQueryStateOptions): UseDataTableExplorerQueryStateReturn {\n const fields = schema.fields;\n const fieldNames = useMemo(() => fields.map((field) => field.name), [fields]);\n const filter = useMemo(() => {\n void selectionVersion;\n return selection.predicate();\n }, [selection, selectionVersion]);\n const rowFilter = useMemo(() => {\n void rowSelectionVersion;\n return selection.predicate();\n }, [rowSelectionVersion, selection]);\n const baseQuery = useMemo(\n () =>\n buildDataTableExplorerBaseQuery({\n columns: fieldNames,\n filter,\n sorting,\n tableName,\n }),\n [fieldNames, filter, sorting, tableName],\n );\n const pageBaseQuery = useMemo(\n () =>\n buildDataTableExplorerBaseQuery({\n columns: fieldNames,\n filter: rowFilter,\n sorting,\n tableName,\n }),\n [fieldNames, rowFilter, sorting, tableName],\n );\n\n return {\n baseQuery,\n datasetId: [tableName, ...fieldNames].join('\u0001'),\n fieldNames,\n fields,\n hasFilters: Array.isArray(filter) ? filter.length > 0 : Boolean(filter),\n pageQuery: buildDataTableExplorerPageQuery(\n pageBaseQuery,\n pagination,\n ).toString(),\n rowFilter,\n };\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Selection } from '@uwdata/mosaic-core';
|
|
2
|
+
import type { DataTableExplorerOptions } from '../types';
|
|
3
|
+
export type UseDataTableExplorerSelectionOptions = Pick<DataTableExplorerOptions, 'selection' | 'selectionName'>;
|
|
4
|
+
export type UseDataTableExplorerSelectionReturn = {
|
|
5
|
+
selection: Selection;
|
|
6
|
+
selectionVersion: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the dataTableExplorer selection, creating a crossfilter selection when the
|
|
10
|
+
* caller does not supply one, and exposes a version that changes with it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDataTableExplorerSelection(options: UseDataTableExplorerSelectionOptions): UseDataTableExplorerSelectionReturn;
|
|
13
|
+
//# sourceMappingURL=useDataTableExplorerSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerSelection.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerSelection.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,wBAAwB,EACxB,WAAW,GAAG,eAAe,CAC9B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,oCAAoC,GAC5C,mCAAmC,CAyBrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createId } from '@paralleldrive/cuid2';
|
|
2
|
+
import { Selection as MosaicSelection, } from '@uwdata/mosaic-core';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { useStoreWithMosaic } from '../../MosaicSlice';
|
|
5
|
+
/**
|
|
6
|
+
* Tracks Mosaic selection updates as a monotonically increasing version so
|
|
7
|
+
* memoized queries and lifecycle effects can respond to crossfilter changes.
|
|
8
|
+
*/
|
|
9
|
+
function useSelectionVersion(selection) {
|
|
10
|
+
const [version, setVersion] = useState(0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const handleChange = () => setVersion((value) => value + 1);
|
|
13
|
+
selection.addEventListener('value', handleChange);
|
|
14
|
+
return () => selection.removeEventListener('value', handleChange);
|
|
15
|
+
}, [selection]);
|
|
16
|
+
return version;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the dataTableExplorer selection, creating a crossfilter selection when the
|
|
20
|
+
* caller does not supply one, and exposes a version that changes with it.
|
|
21
|
+
*/
|
|
22
|
+
export function useDataTableExplorerSelection(options) {
|
|
23
|
+
const { selection: providedSelection, selectionName } = options;
|
|
24
|
+
const generatedSelectionName = useMemo(() => `mosaic-data-table-explorer-${createId()}`, []);
|
|
25
|
+
const selectionKey = selectionName ?? generatedSelectionName;
|
|
26
|
+
const existingSelection = useStoreWithMosaic((state) => state.mosaic.selections[selectionKey]);
|
|
27
|
+
const getSelection = useStoreWithMosaic((state) => state.mosaic.getSelection);
|
|
28
|
+
const [fallbackSelection] = useState(() => MosaicSelection.crossfilter());
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!providedSelection && !existingSelection) {
|
|
31
|
+
getSelection(selectionKey, 'crossfilter');
|
|
32
|
+
}
|
|
33
|
+
}, [existingSelection, getSelection, providedSelection, selectionKey]);
|
|
34
|
+
const selection = providedSelection ?? existingSelection ?? fallbackSelection;
|
|
35
|
+
return {
|
|
36
|
+
selection,
|
|
37
|
+
selectionVersion: useSelectionVersion(selection),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=useDataTableExplorerSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerSelection.js","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,SAAS,IAAI,eAAe,GAE7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,kBAAkB,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,CAAC,iBAAiB,EAAE,CAAC;YAC7C,YAAY,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAAC,CAAC;IAEvE,MAAM,SAAS,GAAG,iBAAiB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC;IAE9E,OAAO;QACL,SAAS;QACT,gBAAgB,EAAE,mBAAmB,CAAC,SAAS,CAAC;KACjD,CAAC;AACJ,CAAC","sourcesContent":["import {createId} from '@paralleldrive/cuid2';\nimport {\n Selection as MosaicSelection,\n type Selection,\n} from '@uwdata/mosaic-core';\nimport {useEffect, useMemo, useState} from 'react';\nimport {useStoreWithMosaic} from '../../MosaicSlice';\nimport type {DataTableExplorerOptions} from '../types';\n\nexport type UseDataTableExplorerSelectionOptions = Pick<\n DataTableExplorerOptions,\n 'selection' | 'selectionName'\n>;\n\nexport type UseDataTableExplorerSelectionReturn = {\n selection: Selection;\n selectionVersion: number;\n};\n\n/**\n * Tracks Mosaic selection updates as a monotonically increasing version so\n * memoized queries and lifecycle effects can respond to crossfilter changes.\n */\nfunction useSelectionVersion(selection: Selection) {\n const [version, setVersion] = useState(0);\n\n useEffect(() => {\n const handleChange = () => setVersion((value) => value + 1);\n selection.addEventListener('value', handleChange);\n return () => selection.removeEventListener('value', handleChange);\n }, [selection]);\n\n return version;\n}\n\n/**\n * Resolves the dataTableExplorer selection, creating a crossfilter selection when the\n * caller does not supply one, and exposes a version that changes with it.\n */\nexport function useDataTableExplorerSelection(\n options: UseDataTableExplorerSelectionOptions,\n): UseDataTableExplorerSelectionReturn {\n const {selection: providedSelection, selectionName} = options;\n const generatedSelectionName = useMemo(\n () => `mosaic-data-table-explorer-${createId()}`,\n [],\n );\n const selectionKey = selectionName ?? generatedSelectionName;\n const existingSelection = useStoreWithMosaic(\n (state) => state.mosaic.selections[selectionKey],\n );\n const getSelection = useStoreWithMosaic((state) => state.mosaic.getSelection);\n const [fallbackSelection] = useState(() => MosaicSelection.crossfilter());\n\n useEffect(() => {\n if (!providedSelection && !existingSelection) {\n getSelection(selectionKey, 'crossfilter');\n }\n }, [existingSelection, getSelection, providedSelection, selectionKey]);\n\n const selection = providedSelection ?? existingSelection ?? fallbackSelection;\n\n return {\n selection,\n selectionVersion: useSelectionVersion(selection),\n };\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DataTableExplorerStoreState } from '../createDataTableExplorerStore';
|
|
2
|
+
export type UseDataTableExplorerStatusOptions = {
|
|
3
|
+
filteredCount: DataTableExplorerStoreState['filteredCount'];
|
|
4
|
+
page: DataTableExplorerStoreState['page'];
|
|
5
|
+
schema: DataTableExplorerStoreState['schema'];
|
|
6
|
+
summaries: DataTableExplorerStoreState['summaries'];
|
|
7
|
+
totalCount: DataTableExplorerStoreState['totalCount'];
|
|
8
|
+
};
|
|
9
|
+
export type UseDataTableExplorerStatusReturn = {
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
tableError?: Error;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Collapses the aggregated dataTableExplorer client state into the loading and error
|
|
15
|
+
* signals exposed from the public hook.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useDataTableExplorerStatus(options: UseDataTableExplorerStatusOptions): UseDataTableExplorerStatusReturn;
|
|
18
|
+
//# sourceMappingURL=useDataTableExplorerStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerStatus.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,aAAa,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC5D,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,SAAS,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC;IACpD,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iCAAiC,GACzC,gCAAgC,CAqBlC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapses the aggregated dataTableExplorer client state into the loading and error
|
|
3
|
+
* signals exposed from the public hook.
|
|
4
|
+
*/
|
|
5
|
+
export function useDataTableExplorerStatus(options) {
|
|
6
|
+
const { filteredCount, page, schema, summaries, totalCount } = options;
|
|
7
|
+
const hasPendingSummaryInitialization = schema.fields.length > 0 &&
|
|
8
|
+
Object.keys(summaries).length < schema.fields.length;
|
|
9
|
+
return {
|
|
10
|
+
isLoading: schema.isLoading ||
|
|
11
|
+
page.isLoading ||
|
|
12
|
+
filteredCount.isLoading ||
|
|
13
|
+
totalCount.isLoading ||
|
|
14
|
+
hasPendingSummaryInitialization ||
|
|
15
|
+
Object.values(summaries).some((summary) => summary.isLoading),
|
|
16
|
+
tableError: schema.error ??
|
|
17
|
+
page.error ??
|
|
18
|
+
filteredCount.error ??
|
|
19
|
+
totalCount.error ??
|
|
20
|
+
Object.values(summaries).find((summary) => summary.error)?.error,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=useDataTableExplorerStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerStatus.js","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerStatus.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA0C;IAE1C,MAAM,EAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC;IACrE,MAAM,+BAA+B,GACnC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAEvD,OAAO;QACL,SAAS,EACP,MAAM,CAAC,SAAS;YAChB,IAAI,CAAC,SAAS;YACd,aAAa,CAAC,SAAS;YACvB,UAAU,CAAC,SAAS;YACpB,+BAA+B;YAC/B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;QAC/D,UAAU,EACR,MAAM,CAAC,KAAK;YACZ,IAAI,CAAC,KAAK;YACV,aAAa,CAAC,KAAK;YACnB,UAAU,CAAC,KAAK;YAChB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK;KACnE,CAAC;AACJ,CAAC","sourcesContent":["import type {DataTableExplorerStoreState} from '../createDataTableExplorerStore';\n\nexport type UseDataTableExplorerStatusOptions = {\n filteredCount: DataTableExplorerStoreState['filteredCount'];\n page: DataTableExplorerStoreState['page'];\n schema: DataTableExplorerStoreState['schema'];\n summaries: DataTableExplorerStoreState['summaries'];\n totalCount: DataTableExplorerStoreState['totalCount'];\n};\n\nexport type UseDataTableExplorerStatusReturn = {\n isLoading: boolean;\n tableError?: Error;\n};\n\n/**\n * Collapses the aggregated dataTableExplorer client state into the loading and error\n * signals exposed from the public hook.\n */\nexport function useDataTableExplorerStatus(\n options: UseDataTableExplorerStatusOptions,\n): UseDataTableExplorerStatusReturn {\n const {filteredCount, page, schema, summaries, totalCount} = options;\n const hasPendingSummaryInitialization =\n schema.fields.length > 0 &&\n Object.keys(summaries).length < schema.fields.length;\n\n return {\n isLoading:\n schema.isLoading ||\n page.isLoading ||\n filteredCount.isLoading ||\n totalCount.isLoading ||\n hasPendingSummaryInitialization ||\n Object.values(summaries).some((summary) => summary.isLoading),\n tableError:\n schema.error ??\n page.error ??\n filteredCount.error ??\n totalCount.error ??\n Object.values(summaries).find((summary) => summary.error)?.error,\n };\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type DataTableExplorerStore } from '../createDataTableExplorerStore';
|
|
2
|
+
import type { DataTableExplorerSorting } from '../types';
|
|
3
|
+
import type { DataTableExplorerStoreState } from '../createDataTableExplorerStore';
|
|
4
|
+
export type UseDataTableExplorerStoreStateOptions = {
|
|
5
|
+
initialSorting: DataTableExplorerSorting;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
};
|
|
8
|
+
export type UseDataTableExplorerStoreStateReturn = {
|
|
9
|
+
client: DataTableExplorerStoreState['client'];
|
|
10
|
+
filteredCount: DataTableExplorerStoreState['filteredCount'];
|
|
11
|
+
lastNonEmptyPageTable: DataTableExplorerStoreState['lastNonEmptyPageTable'];
|
|
12
|
+
page: DataTableExplorerStoreState['page'];
|
|
13
|
+
pagination: DataTableExplorerStoreState['pagination'];
|
|
14
|
+
dataTableExplorerStore: DataTableExplorerStore;
|
|
15
|
+
schema: DataTableExplorerStoreState['schema'];
|
|
16
|
+
setPagination: DataTableExplorerStoreState['setPagination'];
|
|
17
|
+
setSorting: DataTableExplorerStoreState['setSorting'];
|
|
18
|
+
sorting: DataTableExplorerStoreState['sorting'];
|
|
19
|
+
summaries: DataTableExplorerStoreState['summaries'];
|
|
20
|
+
totalCount: DataTableExplorerStoreState['totalCount'];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Creates the per-dataTableExplorer local store and subscribes to the raw state slices
|
|
24
|
+
* that the public dataTableExplorer hook exposes.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useDataTableExplorerStoreState(options: UseDataTableExplorerStoreStateOptions): UseDataTableExplorerStoreStateReturn;
|
|
27
|
+
//# sourceMappingURL=useDataTableExplorerStoreState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerStoreState.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerStoreState.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,qCAAqC,GAAG;IAClD,cAAc,EAAE,wBAAwB,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,aAAa,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC5D,qBAAqB,EAAE,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;IAC5E,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC1C,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,CAAC;IACtD,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,aAAa,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC5D,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,CAAC;IACtD,OAAO,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAChD,SAAS,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC;IACpD,UAAU,EAAE,2BAA2B,CAAC,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,qCAAqC,GAC7C,oCAAoC,CA+BtC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useStore } from 'zustand';
|
|
3
|
+
import { createDataTableExplorerStore, } from '../createDataTableExplorerStore';
|
|
4
|
+
/**
|
|
5
|
+
* Creates the per-dataTableExplorer local store and subscribes to the raw state slices
|
|
6
|
+
* that the public dataTableExplorer hook exposes.
|
|
7
|
+
*/
|
|
8
|
+
export function useDataTableExplorerStoreState(options) {
|
|
9
|
+
const [dataTableExplorerStore] = useState(() => createDataTableExplorerStore({
|
|
10
|
+
initialSorting: options.initialSorting,
|
|
11
|
+
pageSize: options.pageSize,
|
|
12
|
+
}));
|
|
13
|
+
return {
|
|
14
|
+
client: useStore(dataTableExplorerStore, (state) => state.client),
|
|
15
|
+
filteredCount: useStore(dataTableExplorerStore, (state) => state.filteredCount),
|
|
16
|
+
lastNonEmptyPageTable: useStore(dataTableExplorerStore, (state) => state.lastNonEmptyPageTable),
|
|
17
|
+
page: useStore(dataTableExplorerStore, (state) => state.page),
|
|
18
|
+
pagination: useStore(dataTableExplorerStore, (state) => state.pagination),
|
|
19
|
+
dataTableExplorerStore,
|
|
20
|
+
schema: useStore(dataTableExplorerStore, (state) => state.schema),
|
|
21
|
+
setPagination: useStore(dataTableExplorerStore, (state) => state.setPagination),
|
|
22
|
+
setSorting: useStore(dataTableExplorerStore, (state) => state.setSorting),
|
|
23
|
+
sorting: useStore(dataTableExplorerStore, (state) => state.sorting),
|
|
24
|
+
summaries: useStore(dataTableExplorerStore, (state) => state.summaries),
|
|
25
|
+
totalCount: useStore(dataTableExplorerStore, (state) => state.totalCount),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useDataTableExplorerStoreState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerStoreState.js","sourceRoot":"","sources":["../../../src/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,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;QACzE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;QACnE,SAAS,EAAE,QAAQ,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;QACvE,UAAU,EAAE,QAAQ,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;KAC1E,CAAC;AACJ,CAAC","sourcesContent":["import {useState} from 'react';\nimport {useStore} from 'zustand';\nimport {\n createDataTableExplorerStore,\n type DataTableExplorerStore,\n} from '../createDataTableExplorerStore';\nimport type {DataTableExplorerSorting} from '../types';\nimport type {DataTableExplorerStoreState} from '../createDataTableExplorerStore';\n\nexport type UseDataTableExplorerStoreStateOptions = {\n initialSorting: DataTableExplorerSorting;\n pageSize: number;\n};\n\nexport type UseDataTableExplorerStoreStateReturn = {\n client: DataTableExplorerStoreState['client'];\n filteredCount: DataTableExplorerStoreState['filteredCount'];\n lastNonEmptyPageTable: DataTableExplorerStoreState['lastNonEmptyPageTable'];\n page: DataTableExplorerStoreState['page'];\n pagination: DataTableExplorerStoreState['pagination'];\n dataTableExplorerStore: DataTableExplorerStore;\n schema: DataTableExplorerStoreState['schema'];\n setPagination: DataTableExplorerStoreState['setPagination'];\n setSorting: DataTableExplorerStoreState['setSorting'];\n sorting: DataTableExplorerStoreState['sorting'];\n summaries: DataTableExplorerStoreState['summaries'];\n totalCount: DataTableExplorerStoreState['totalCount'];\n};\n\n/**\n * Creates the per-dataTableExplorer local store and subscribes to the raw state slices\n * that the public dataTableExplorer hook exposes.\n */\nexport function useDataTableExplorerStoreState(\n options: UseDataTableExplorerStoreStateOptions,\n): UseDataTableExplorerStoreStateReturn {\n const [dataTableExplorerStore] = useState(() =>\n createDataTableExplorerStore({\n initialSorting: options.initialSorting,\n pageSize: options.pageSize,\n }),\n );\n\n return {\n client: useStore(dataTableExplorerStore, (state) => state.client),\n filteredCount: useStore(\n dataTableExplorerStore,\n (state) => state.filteredCount,\n ),\n lastNonEmptyPageTable: useStore(\n dataTableExplorerStore,\n (state) => state.lastNonEmptyPageTable,\n ),\n page: useStore(dataTableExplorerStore, (state) => state.page),\n pagination: useStore(dataTableExplorerStore, (state) => state.pagination),\n dataTableExplorerStore,\n schema: useStore(dataTableExplorerStore, (state) => state.schema),\n setPagination: useStore(\n dataTableExplorerStore,\n (state) => state.setPagination,\n ),\n setSorting: useStore(dataTableExplorerStore, (state) => state.setSorting),\n sorting: useStore(dataTableExplorerStore, (state) => state.sorting),\n summaries: useStore(dataTableExplorerStore, (state) => state.summaries),\n totalCount: useStore(dataTableExplorerStore, (state) => state.totalCount),\n };\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Table } from 'apache-arrow';
|
|
2
|
+
import type { DataTableExplorerStoreState } from '../createDataTableExplorerStore';
|
|
3
|
+
export type UseDataTableExplorerVisiblePageOptions = {
|
|
4
|
+
lastNonEmptyPageTable: DataTableExplorerStoreState['lastNonEmptyPageTable'];
|
|
5
|
+
pageDatasetId: string;
|
|
6
|
+
page: DataTableExplorerStoreState['page'];
|
|
7
|
+
rowSelectionVersion: number;
|
|
8
|
+
selectionVersion: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Keeps the last non-empty page result visible while live brushing has moved
|
|
12
|
+
* ahead of the deferred row query, avoiding transient "No rows" flashes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useDataTableExplorerVisiblePage(options: UseDataTableExplorerVisiblePageOptions): Table | undefined;
|
|
15
|
+
//# sourceMappingURL=useDataTableExplorerVisiblePage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerVisiblePage.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerVisiblePage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,sCAAsC,GAAG;IACnD,qBAAqB,EAAE,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,KAAK,GAAG,SAAS,CAwBnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useDebounce } from '@sqlrooms/ui';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps the last non-empty page result visible while live brushing has moved
|
|
4
|
+
* ahead of the deferred row query, avoiding transient "No rows" flashes.
|
|
5
|
+
*/
|
|
6
|
+
export function useDataTableExplorerVisiblePage(options) {
|
|
7
|
+
const { lastNonEmptyPageTable, page, pageDatasetId, rowSelectionVersion, selectionVersion, } = options;
|
|
8
|
+
const isRowDisplayStale = selectionVersion !== rowSelectionVersion;
|
|
9
|
+
const hasCurrentRows = !!page.pageTable && page.pageTable.numRows > 0;
|
|
10
|
+
const canReuseLastNonEmptyPage = !!lastNonEmptyPageTable &&
|
|
11
|
+
lastNonEmptyPageTable.datasetId === pageDatasetId;
|
|
12
|
+
const canShowStableEmpty = !page.isLoading &&
|
|
13
|
+
!isRowDisplayStale &&
|
|
14
|
+
(!page.pageTable || page.pageTable.numRows === 0);
|
|
15
|
+
const showStableEmpty = useDebounce(canShowStableEmpty, 120);
|
|
16
|
+
if (hasCurrentRows || !canReuseLastNonEmptyPage) {
|
|
17
|
+
return page.pageTable;
|
|
18
|
+
}
|
|
19
|
+
return showStableEmpty ? page.pageTable : lastNonEmptyPageTable.pageTable;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=useDataTableExplorerVisiblePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerVisiblePage.js","sourceRoot":"","sources":["../../../src/data-table-explorer/hooks/useDataTableExplorerVisiblePage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAYzC;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAA+C;IAE/C,MAAM,EACJ,qBAAqB,EACrB,IAAI,EACJ,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACjB,GAAG,OAAO,CAAC;IACZ,MAAM,iBAAiB,GAAG,gBAAgB,KAAK,mBAAmB,CAAC;IACnE,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC,CAAC;IACtE,MAAM,wBAAwB,GAC5B,CAAC,CAAC,qBAAqB;QACvB,qBAAqB,CAAC,SAAS,KAAK,aAAa,CAAC;IACpD,MAAM,kBAAkB,GACtB,CAAC,IAAI,CAAC,SAAS;QACf,CAAC,iBAAiB;QAClB,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;IACpD,MAAM,eAAe,GAAG,WAAW,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAE7D,IAAI,cAAc,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,SAAS,CAAC;AAC5E,CAAC","sourcesContent":["import {useDebounce} from '@sqlrooms/ui';\nimport type {Table} from 'apache-arrow';\nimport type {DataTableExplorerStoreState} from '../createDataTableExplorerStore';\n\nexport type UseDataTableExplorerVisiblePageOptions = {\n lastNonEmptyPageTable: DataTableExplorerStoreState['lastNonEmptyPageTable'];\n pageDatasetId: string;\n page: DataTableExplorerStoreState['page'];\n rowSelectionVersion: number;\n selectionVersion: number;\n};\n\n/**\n * Keeps the last non-empty page result visible while live brushing has moved\n * ahead of the deferred row query, avoiding transient \"No rows\" flashes.\n */\nexport function useDataTableExplorerVisiblePage(\n options: UseDataTableExplorerVisiblePageOptions,\n): Table | undefined {\n const {\n lastNonEmptyPageTable,\n page,\n pageDatasetId,\n rowSelectionVersion,\n selectionVersion,\n } = options;\n const isRowDisplayStale = selectionVersion !== rowSelectionVersion;\n const hasCurrentRows = !!page.pageTable && page.pageTable.numRows > 0;\n const canReuseLastNonEmptyPage =\n !!lastNonEmptyPageTable &&\n lastNonEmptyPageTable.datasetId === pageDatasetId;\n const canShowStableEmpty =\n !page.isLoading &&\n !isRowDisplayStale &&\n (!page.pageTable || page.pageTable.numRows === 0);\n const showStableEmpty = useDebounce(canShowStableEmpty, 120);\n\n if (hasCurrentRows || !canReuseLastNonEmptyPage) {\n return page.pageTable;\n }\n\n return showStableEmpty ? page.pageTable : lastNonEmptyPageTable.pageTable;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Selection } from '@uwdata/mosaic-core';
|
|
1
|
+
import type { QualifiedTableName } from '@sqlrooms/db';
|
|
2
|
+
import type { MosaicClient, Selection } from '@uwdata/mosaic-core';
|
|
3
3
|
import type { Interval1D } from '@uwdata/mosaic-plot';
|
|
4
4
|
import type { Field, Table } from 'apache-arrow';
|
|
5
5
|
import type { Dispatch, SetStateAction } from 'react';
|
|
@@ -41,6 +41,7 @@ export type DataTableExplorerCategoryBucket = {
|
|
|
41
41
|
export type DataTableExplorerCategorySummary = DataTableExplorerSummaryStatus & {
|
|
42
42
|
bucketCount: number;
|
|
43
43
|
buckets: DataTableExplorerCategoryBucket[];
|
|
44
|
+
client?: MosaicClient;
|
|
44
45
|
kind: 'category';
|
|
45
46
|
selectedKey?: string;
|
|
46
47
|
toggleValue: (key: string) => void;
|
|
@@ -57,6 +58,7 @@ export type DataTableExplorerColumnState = {
|
|
|
57
58
|
name: string;
|
|
58
59
|
summary: DataTableExplorerSummaryState;
|
|
59
60
|
};
|
|
61
|
+
export type DataTableExplorerTableReference = string | QualifiedTableName;
|
|
60
62
|
export type DataTableExplorerOptions = {
|
|
61
63
|
categoryLimit?: number;
|
|
62
64
|
columns?: string[];
|
|
@@ -65,9 +67,10 @@ export type DataTableExplorerOptions = {
|
|
|
65
67
|
selection?: Selection;
|
|
66
68
|
selectionName?: string;
|
|
67
69
|
summaryBins?: number;
|
|
68
|
-
tableName:
|
|
70
|
+
tableName: DataTableExplorerTableReference;
|
|
69
71
|
};
|
|
70
72
|
export type UseDataTableExplorerReturn = {
|
|
73
|
+
client: MosaicClient | null;
|
|
71
74
|
columns: DataTableExplorerColumnState[];
|
|
72
75
|
filteredRowCount?: number;
|
|
73
76
|
hasFilters: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAC,KAAK,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAC,QAAQ,EAAE,cAAc,EAAC,MAAM,OAAO,CAAC;AAEpD,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC;IAAC,EAAE,EAA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AK,CAAC;IAClB,UAAU,EAAE,gCAAgC,CAAC;IAC7C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAC1E,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,wBAAwB,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-table-explorer/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-table-explorer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {QualifiedTableName} from '@sqlrooms/db';\nimport type {MosaicClient, Selection} from '@uwdata/mosaic-core';\nimport type {Interval1D} from '@uwdata/mosaic-plot';\nimport type {Field, Table} from 'apache-arrow';\nimport type {Dispatch, SetStateAction} from 'react';\n\nexport type DataTableExplorerSorting = Array<{id: string; desc: boolean}>;\n\nexport type DataTableExplorerPaginationState = {\n pageIndex: number;\n pageSize: number;\n};\n\nexport type DataTableExplorerBinValue = number | Date;\n\nexport type DataTableExplorerBin = {\n x0: DataTableExplorerBinValue;\n x1: DataTableExplorerBinValue;\n length: number;\n};\n\nexport type DataTableExplorerSummaryStatus = {\n error?: Error;\n isLoading: boolean;\n};\n\nexport type DataTableExplorerHistogramSummary =\n DataTableExplorerSummaryStatus & {\n filteredBins: DataTableExplorerBin[];\n filteredNullCount: number;\n interactor: Interval1D | null;\n kind: 'histogram';\n totalBins: DataTableExplorerBin[];\n totalNullCount: number;\n valueType: 'date' | 'number';\n };\n\nexport type DataTableExplorerCategoryBucket = {\n filteredCount: number;\n key: string;\n kind: 'null' | 'overflow' | 'unique' | 'value';\n label: string;\n selectable: boolean;\n totalCount: number;\n};\n\nexport type DataTableExplorerCategorySummary =\n DataTableExplorerSummaryStatus & {\n bucketCount: number;\n buckets: DataTableExplorerCategoryBucket[];\n client?: MosaicClient;\n kind: 'category';\n selectedKey?: string;\n toggleValue: (key: string) => void;\n };\n\nexport type DataTableExplorerUnsupportedSummary =\n DataTableExplorerSummaryStatus & {\n kind: 'unsupported';\n label: string;\n };\n\nexport type DataTableExplorerSummaryState =\n | DataTableExplorerCategorySummary\n | DataTableExplorerHistogramSummary\n | DataTableExplorerUnsupportedSummary;\n\nexport type DataTableExplorerColumnKind =\n | 'category'\n | 'histogram'\n | 'unsupported';\n\nexport type DataTableExplorerColumnState = {\n field: Field;\n kind: DataTableExplorerColumnKind;\n name: string;\n summary: DataTableExplorerSummaryState;\n};\n\nexport type DataTableExplorerTableReference = string | QualifiedTableName;\n\nexport type DataTableExplorerOptions = {\n categoryLimit?: number;\n columns?: string[];\n initialSorting?: DataTableExplorerSorting;\n pageSize?: number;\n selection?: Selection;\n selectionName?: string;\n summaryBins?: number;\n tableName: DataTableExplorerTableReference;\n};\n\nexport type UseDataTableExplorerReturn = {\n client: MosaicClient | null;\n columns: DataTableExplorerColumnState[];\n filteredRowCount?: number;\n hasFilters: boolean;\n isLoading: boolean;\n pageQuery: string;\n pageTable?: Table;\n pagination: DataTableExplorerPaginationState;\n reset: () => void;\n selection: Selection;\n setPagination: Dispatch<SetStateAction<DataTableExplorerPaginationState>>;\n setSorting: Dispatch<SetStateAction<DataTableExplorerSorting>>;\n sorting: DataTableExplorerSorting;\n sql: string;\n tableError?: Error;\n totalRowCount?: number;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataTableExplorer.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/useDataTableExplorer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDataTableExplorer.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/useDataTableExplorer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAejB;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,GAChC,0BAA0B,CA+G5B"}
|