@sqlrooms/mosaic 0.29.0-rc.7 → 0.29.0-rc.9
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 +179 -35
- 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/agentIntent.d.ts +5 -0
- package/dist/ai/agentIntent.d.ts.map +1 -0
- package/dist/ai/agentIntent.js +8 -0
- package/dist/ai/agentIntent.js.map +1 -0
- package/dist/ai/block-document/constants.d.ts +9 -0
- package/dist/ai/block-document/constants.d.ts.map +1 -0
- package/dist/ai/block-document/constants.js +9 -0
- package/dist/ai/block-document/constants.js.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts +48 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js +59 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts +19 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js +37 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts +32 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js +37 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js.map +1 -0
- package/dist/ai/constants.d.ts +3 -0
- package/dist/ai/constants.d.ts.map +1 -0
- package/dist/ai/constants.js +3 -0
- package/dist/ai/constants.js.map +1 -0
- package/dist/ai/createDataTableExplorerTool.d.ts +69 -0
- package/dist/ai/createDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/createDataTableExplorerTool.js +68 -0
- package/dist/ai/createDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/constants.d.ts +6 -0
- package/dist/ai/dashboard/constants.d.ts.map +1 -0
- package/dist/ai/dashboard/constants.js +6 -0
- package/dist/ai/dashboard/constants.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts +17 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js +205 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts +14 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js +75 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts +26 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.js +40 -0
- package/dist/ai/dashboard/createDashboardAiTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts +27 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.js +55 -0
- package/dist/ai/dashboard/createDashboardChartTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts +23 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js +29 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts +28 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js +54 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js.map +1 -0
- package/dist/ai/dashboard/dashboard-types.d.ts +59 -0
- package/dist/ai/dashboard/dashboard-types.d.ts.map +1 -0
- package/dist/ai/dashboard/dashboard-types.js +2 -0
- package/dist/ai/dashboard/dashboard-types.js.map +1 -0
- package/dist/ai/database-types.d.ts +12 -0
- package/dist/ai/database-types.d.ts.map +1 -0
- package/dist/ai/database-types.js +2 -0
- package/dist/ai/database-types.js.map +1 -0
- package/dist/ai/errors.d.ts +8 -0
- package/dist/ai/errors.d.ts.map +1 -0
- package/dist/ai/errors.js +11 -0
- package/dist/ai/errors.js.map +1 -0
- package/dist/ai/tool-helpers.d.ts +28 -29
- package/dist/ai/tool-helpers.d.ts.map +1 -1
- package/dist/ai/tool-helpers.js +38 -76
- package/dist/ai/tool-helpers.js.map +1 -1
- package/dist/ai/tool-schemas.d.ts +9 -4
- package/dist/ai/tool-schemas.d.ts.map +1 -1
- package/dist/ai/tool-schemas.js +12 -12
- package/dist/ai/tool-schemas.js.map +1 -1
- package/dist/ai/tool-types.d.ts +19 -1
- package/dist/ai/tool-types.d.ts.map +1 -1
- package/dist/ai/tool-types.js.map +1 -1
- package/dist/ai/types.d.ts +64 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/ai.d.ts +16 -2
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +14 -5
- 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 +19 -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/MosaicChartSpecViewerPanel.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js +2 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js +3 -3
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
- package/dist/charts/chart-types/base-types.d.ts +40 -25
- package/dist/charts/chart-types/base-types.d.ts.map +1 -1
- package/dist/charts/chart-types/base-types.js +5 -0
- package/dist/charts/chart-types/base-types.js.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.js +1 -0
- package/dist/charts/chart-types/box-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts +37 -3
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js +28 -13
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +2 -2
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +12 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -3
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.d.ts +20 -24
- package/dist/charts/chart-types/box-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.js +25 -33
- package/dist/charts/chart-types/box-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/box-plot/validation.d.ts +9 -0
- package/dist/charts/chart-types/box-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/box-plot/validation.js +32 -0
- package/dist/charts/chart-types/box-plot/validation.js.map +1 -0
- 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/column-types.d.ts +8 -0
- package/dist/charts/chart-types/column-types.d.ts.map +1 -0
- package/dist/charts/chart-types/column-types.js +2 -0
- package/dist/charts/chart-types/column-types.js.map +1 -0
- package/dist/charts/chart-types/count-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/definition.js +1 -0
- package/dist/charts/chart-types/count-plot/definition.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 +47 -34
- package/dist/charts/chart-types/count-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.d.ts +19 -24
- package/dist/charts/chart-types/count-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.js +26 -33
- package/dist/charts/chart-types/count-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/count-plot/validation.d.ts +8 -0
- package/dist/charts/chart-types/count-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/count-plot/validation.js +20 -0
- package/dist/charts/chart-types/count-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts +3 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.js +12 -0
- package/dist/charts/chart-types/createChartInstructions.js.map +1 -0
- package/dist/charts/chart-types/createChartTools.d.ts +15 -9
- package/dist/charts/chart-types/createChartTools.d.ts.map +1 -1
- package/dist/charts/chart-types/createChartTools.js +16 -10
- package/dist/charts/chart-types/createChartTools.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/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/custom-spec/definition.js +1 -0
- package/dist/charts/chart-types/custom-spec/definition.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 +35 -0
- package/dist/charts/chart-types/errors.d.ts.map +1 -1
- package/dist/charts/chart-types/errors.js +56 -0
- package/dist/charts/chart-types/errors.js.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.js +1 -0
- package/dist/charts/chart-types/heatmap/definition.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 +21 -21
- package/dist/charts/chart-types/heatmap/spec.js.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.d.ts +20 -24
- package/dist/charts/chart-types/heatmap/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.js +27 -37
- package/dist/charts/chart-types/heatmap/tool.js.map +1 -1
- package/dist/charts/chart-types/heatmap/validation.d.ts +9 -0
- package/dist/charts/chart-types/heatmap/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/heatmap/validation.js +34 -0
- package/dist/charts/chart-types/heatmap/validation.js.map +1 -0
- 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/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/definition.js +1 -0
- package/dist/charts/chart-types/histogram/definition.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 +31 -28
- package/dist/charts/chart-types/histogram/spec.js.map +1 -1
- package/dist/charts/chart-types/histogram/tool.d.ts +39 -24
- package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/tool.js +39 -33
- package/dist/charts/chart-types/histogram/tool.js.map +1 -1
- package/dist/charts/chart-types/histogram/validation.d.ts +9 -0
- package/dist/charts/chart-types/histogram/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/histogram/validation.js +22 -0
- package/dist/charts/chart-types/histogram/validation.js.map +1 -0
- package/dist/charts/chart-types/index.d.ts +5 -11
- package/dist/charts/chart-types/index.d.ts.map +1 -1
- package/dist/charts/chart-types/index.js +6 -12
- 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/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/definition.js +1 -0
- package/dist/charts/chart-types/line-chart/definition.js.map +1 -1
- 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 +56 -65
- package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.d.ts +28 -24
- package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.js +27 -39
- 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/line-chart/validation.d.ts +16 -0
- package/dist/charts/chart-types/line-chart/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/validation.js +43 -0
- package/dist/charts/chart-types/line-chart/validation.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/resolveChartTypes.d.ts +3 -0
- package/dist/charts/chart-types/resolveChartTypes.d.ts.map +1 -0
- package/dist/charts/chart-types/resolveChartTypes.js +8 -0
- package/dist/charts/chart-types/resolveChartTypes.js.map +1 -0
- 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 +25 -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 +37 -0
- package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/tool.d.ts +39 -0
- package/dist/charts/chart-types/scatter-plot/tool.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/tool.js +57 -0
- package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/validation.d.ts +13 -0
- package/dist/charts/chart-types/scatter-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/validation.js +52 -0
- package/dist/charts/chart-types/scatter-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/tool-types.d.ts +43 -0
- package/dist/charts/chart-types/tool-types.d.ts.map +1 -0
- package/dist/charts/chart-types/tool-types.js +2 -0
- package/dist/charts/chart-types/tool-types.js.map +1 -0
- package/dist/charts/chart-types/utils.d.ts +3 -0
- package/dist/charts/chart-types/utils.d.ts.map +1 -0
- package/dist/charts/chart-types/utils.js +4 -0
- package/dist/charts/chart-types/utils.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 +6 -4
- 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 +13 -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/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/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/MosaicDashboardCommands.d.ts +19 -0
- package/dist/dashboard/MosaicDashboardCommands.d.ts.map +1 -0
- package/dist/dashboard/MosaicDashboardCommands.js +226 -0
- package/dist/dashboard/MosaicDashboardCommands.js.map +1 -0
- 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/dashboard-types.js.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/panel/MosaicDashboardPanel.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js +3 -3
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.js +4 -2
- package/dist/dashboard/panel/MosaicDashboardPanels.js.map +1 -1
- 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 +14 -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/dashboard/useSelectedOrFirstTable.d.ts +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.js +10 -8
- package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -1
- 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 +3 -2
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +4 -3
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerCountClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js +4 -4
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.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 +26 -8
- 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 +63 -3
- package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.js +73 -10
- 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 +52 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +153 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +42 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +43 -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 +16 -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 +20 -279
- package/dist/data-table-explorer/useDataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/utils.d.ts +64 -6
- package/dist/data-table-explorer/utils.d.ts.map +1 -1
- package/dist/data-table-explorer/utils.js +58 -0
- package/dist/data-table-explorer/utils.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 +4 -4
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
- package/dist/index.d.ts +55 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -26
- package/dist/index.js.map +1 -1
- package/dist/mosaicTableReference.d.ts +59 -0
- package/dist/mosaicTableReference.d.ts.map +1 -0
- package/dist/mosaicTableReference.js +68 -0
- package/dist/mosaicTableReference.js.map +1 -0
- package/dist/useVgPlotChartRender.d.ts.map +1 -1
- package/dist/useVgPlotChartRender.js +151 -25
- 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/dist/utils/table-lookup.d.ts +7 -0
- package/dist/utils/table-lookup.d.ts.map +1 -0
- package/dist/utils/table-lookup.js +10 -0
- package/dist/utils/table-lookup.js.map +1 -0
- package/package.json +14 -14
- package/dist/ai/ai.d.ts +0 -103
- package/dist/ai/ai.d.ts.map +0 -1
- package/dist/ai/ai.js +0 -419
- package/dist/ai/ai.js.map +0 -1
- package/dist/ai/data-table-explorer-tool.d.ts +0 -40
- package/dist/ai/data-table-explorer-tool.d.ts.map +0 -1
- package/dist/ai/data-table-explorer-tool.js +0 -75
- package/dist/ai/data-table-explorer-tool.js.map +0 -1
- package/dist/ai/list-panels-tool.d.ts +0 -35
- package/dist/ai/list-panels-tool.d.ts.map +0 -1
- package/dist/ai/list-panels-tool.js +0 -66
- package/dist/ai/list-panels-tool.js.map +0 -1
- package/dist/ai/remove-panel-tool.d.ts +0 -31
- package/dist/ai/remove-panel-tool.d.ts.map +0 -1
- package/dist/ai/remove-panel-tool.js +0 -55
- package/dist/ai/remove-panel-tool.js.map +0 -1
- package/dist/ai/tool-validation.d.ts +0 -3
- package/dist/ai/tool-validation.d.ts.map +0 -1
- package/dist/ai/tool-validation.js +0 -11
- package/dist/ai/tool-validation.js.map +0 -1
- 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.d.ts +0 -42
- package/dist/charts/chart-types/bubble-chart/tool.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/tool.js +0 -66
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableExplorerUnsupportedSummaryClient.js","sourceRoot":"","sources":["../../src/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAiB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableExplorerUnsupportedSummaryClient.js","sourceRoot":"","sources":["../../src/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AAOjE,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAU/D,MAAM,OAAO,yCAA0C,SAAQ,YAAY;IACjE,KAAK,GAAG,CAAC,CAAC;IACD,KAAK,CAAc;IACnB,aAAa,CAEpB;IACO,cAAc,CAAqC;IAEpE,YAAY,OAAwC;QAClD,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,IAAa,YAAY;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAEQ,YAAY;QACnB,IAAI,CAAC,aAAa,CAAC;YACjB,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,kBAAkB;SACxD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,KAAK,CAAC,SAA0B,EAAE;QACzC,OAAO,uBAAuB,CAAC;YAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YAC1B,MAAM;YACN,SAAS,EAAE,IAAI,CAAC,cAAc;SAC/B,CAAC,CAAC;IACL,CAAC;IAEQ,WAAW,CAAC,IAAa;QAChC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC;YACjB,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,kBAAkB;SACxD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,UAAU,CAAC,KAAY;QAC9B,IAAI,CAAC,aAAa,CAAC;YACjB,KAAK;YACL,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,kBAAkB;SACxD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import {MosaicClient, type Selection} from '@uwdata/mosaic-core';\nimport {type ExprNode, type Query} from '@uwdata/mosaic-sql';\nimport type * as arrow from 'apache-arrow';\nimport type {\n DataTableExplorerSqlTableReference,\n DataTableExplorerUnsupportedSummary,\n} from './types';\nimport {buildDistinctCountQuery, readCountData} from './utils';\n\ntype UnsupportedSummaryClientOptions = {\n field: arrow.Field;\n onStateChange: (summary: DataTableExplorerUnsupportedSummary) => void;\n selection: Selection;\n tableName: string;\n tableReference?: DataTableExplorerSqlTableReference;\n};\n\nexport class DataTableExplorerUnsupportedSummaryClient extends MosaicClient {\n private count = 0;\n private readonly field: arrow.Field;\n private readonly onStateChange: (\n summary: DataTableExplorerUnsupportedSummary,\n ) => void;\n private readonly tableReference: DataTableExplorerSqlTableReference;\n\n constructor(options: UnsupportedSummaryClientOptions) {\n super(options.selection);\n this.field = options.field;\n this.onStateChange = options.onStateChange;\n this.tableReference = options.tableReference ?? options.tableName;\n }\n\n override get filterStable(): boolean {\n return false;\n }\n\n override queryPending(): this {\n this.onStateChange({\n isLoading: true,\n kind: 'unsupported',\n label: `${this.count.toLocaleString()} distinct values`,\n });\n return this;\n }\n\n override query(filter: Array<ExprNode> = []): Query {\n return buildDistinctCountQuery({\n fieldName: this.field.name,\n filter,\n tableName: this.tableReference,\n });\n }\n\n override queryResult(data: unknown): this {\n this.count = readCountData(data) ?? 0;\n this.onStateChange({\n isLoading: false,\n kind: 'unsupported',\n label: `${this.count.toLocaleString()} distinct values`,\n });\n return this;\n }\n\n override queryError(error: Error): this {\n this.onStateChange({\n error,\n isLoading: false,\n kind: 'unsupported',\n label: `${this.count.toLocaleString()} distinct values`,\n });\n return this;\n }\n}\n"]}
|
|
@@ -3,7 +3,9 @@ import type { Dispatch, SetStateAction } from 'react';
|
|
|
3
3
|
import type { DataTableExplorerCountState } from './DataTableExplorerCountClient';
|
|
4
4
|
import type { DataTableExplorerPageState } from './DataTableExplorerPageClient';
|
|
5
5
|
import type { DataTableExplorerPaginationState, DataTableExplorerSorting, DataTableExplorerSummaryState } from './types';
|
|
6
|
+
import type { MosaicClient } from '@uwdata/mosaic-core';
|
|
6
7
|
export type DataTableExplorerStoreState = {
|
|
8
|
+
client: MosaicClient | null;
|
|
7
9
|
filteredCount: DataTableExplorerCountState;
|
|
8
10
|
lastNonEmptyPageTable?: {
|
|
9
11
|
datasetId: string;
|
|
@@ -17,6 +19,7 @@ export type DataTableExplorerStoreState = {
|
|
|
17
19
|
isLoading: boolean;
|
|
18
20
|
tableName?: string;
|
|
19
21
|
};
|
|
22
|
+
setClient: (client: MosaicClient | null) => void;
|
|
20
23
|
setFilteredCount: (state: DataTableExplorerCountState) => void;
|
|
21
24
|
setPage: (state: DataTableExplorerPageState) => void;
|
|
22
25
|
setPagination: Dispatch<SetStateAction<DataTableExplorerPaginationState>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDataTableExplorerStore.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/createDataTableExplorerStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAC,QAAQ,EAAE,cAAc,EAAC,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EACV,gCAAgC,EAChC,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAcjB,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,EAAE,2BAA2B,CAAC;IAC3C,qBAAqB,CAAC,EAAE;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC;KACxB,CAAC;IACF,IAAI,EAAE,0BAA0B,CAAC;IACjC,UAAU,EAAE,gCAAgC,CAAC;IAC7C,MAAM,EAAE;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,gBAAgB,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAC1E,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,gBAAgB,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,gBAAgB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC/D,UAAU,EAAE,CACV,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,6BAA6B,KACnC,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAC5D,OAAO,EAAE,wBAAwB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,2BAA2B,CAAC;IACxC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC;IACrD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB,
|
|
1
|
+
{"version":3,"file":"createDataTableExplorerStore.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/createDataTableExplorerStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAC,QAAQ,EAAE,cAAc,EAAC,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAC,2BAA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,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC/D,UAAU,EAAE,CACV,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,6BAA6B,KACnC,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAC5D,OAAO,EAAE,wBAAwB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,2BAA2B,CAAC;IACxC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC;IACrD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB,2DAuJA"}
|
|
@@ -15,6 +15,7 @@ function resolveSetStateAction(next, previous) {
|
|
|
15
15
|
export function createDataTableExplorerStore(options) {
|
|
16
16
|
const { initialSorting = [], pageSize } = options;
|
|
17
17
|
return createStore((set) => ({
|
|
18
|
+
client: null,
|
|
18
19
|
filteredCount: { isLoading: false },
|
|
19
20
|
lastNonEmptyPageTable: undefined,
|
|
20
21
|
page: { isLoading: false },
|
|
@@ -23,6 +24,11 @@ export function createDataTableExplorerStore(options) {
|
|
|
23
24
|
fields: [],
|
|
24
25
|
isLoading: false,
|
|
25
26
|
},
|
|
27
|
+
setClient: (client) => {
|
|
28
|
+
set((state) => produce(state, (draft) => {
|
|
29
|
+
draft.client = client;
|
|
30
|
+
}));
|
|
31
|
+
},
|
|
26
32
|
setFilteredCount: (nextState) => {
|
|
27
33
|
set((state) => produce(state, (draft) => {
|
|
28
34
|
draft.filteredCount = nextState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDataTableExplorerStore.js","sourceRoot":"","sources":["../../src/data-table-explorer/createDataTableExplorerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,EACL,uBAAuB,EACvB,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,SAAS,qBAAqB,CAAI,IAAuB,EAAE,QAAW;IACpE,wEAAwE;IACxE,gFAAgF;IAChF,OAAO,OAAO,IAAI,KAAK,UAAU;QAC/B,CAAC,CAAE,IAAwB,CAAC,QAAQ,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAyCD;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAG5C;IACC,MAAM,EAAC,cAAc,GAAG,EAAE,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC;IAEhD,OAAO,WAAW,CAA8B,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACxD,aAAa,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;QACjC,qBAAqB,EAAE,SAAS;QAChC,IAAI,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;QACxB,UAAU,EAAE,oCAAoC,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAC,CAAC;QAC1E,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,KAAK;SACjB;QACD,gBAAgB,EAAE,CAAC,SAAS,EAAE,EAAE;YAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,C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vB,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,mBAAmB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CACpE,CAAC;YACJ,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,GAAG,EAAE;YACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,UAAU,GAAG,oCAAoC,CAAC;oBACtD,GAAG,KAAK,CAAC,UAAU;oBACnB,SAAS,EAAE,CAAC;iBACb,CAAC,CAAC;YACL,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {castDraft, produce} from 'immer';\nimport type * as arrow from 'apache-arrow';\nimport type {Dispatch, SetStateAction} from 'react';\nimport {createStore} from 'zustand/vanilla';\nimport type {DataTableExplorerCountState} from './DataTableExplorerCountClient';\nimport type {DataTableExplorerPageState} from './DataTableExplorerPageClient';\nimport type {\n DataTableExplorerPaginationState,\n DataTableExplorerSorting,\n DataTableExplorerSummaryState,\n} from './types';\nimport {\n createEmptySummaryState,\n normalizeDataTableExplorerPagination,\n} from './utils';\n\nfunction resolveSetStateAction<T>(next: SetStateAction<T>, previous: T): T {\n // Preserve React-style setter semantics so hook callers can pass either\n // a concrete value or an updater function to the local dataTableExplorer store.\n return typeof next === 'function'\n ? (next as (value: T) => T)(previous)\n : next;\n}\n\nexport type DataTableExplorerStoreState = {\n filteredCount: DataTableExplorerCountState;\n lastNonEmptyPageTable?: {\n datasetId: string;\n pageTable: arrow.Table;\n };\n page: DataTableExplorerPageState;\n pagination: DataTableExplorerPaginationState;\n schema: {\n error?: Error;\n fields: arrow.Field[];\n isLoading: boolean;\n tableName?: string;\n };\n setFilteredCount: (state: DataTableExplorerCountState) => void;\n setPage: (state: DataTableExplorerPageState) => void;\n setPagination: Dispatch<SetStateAction<DataTableExplorerPaginationState>>;\n setSchemaError: (error?: Error, tableName?: string) => void;\n setSchemaLoading: (isLoading: boolean, tableName?: string) => void;\n setSchemaSuccess: (fields: arrow.Field[], tableName?: string) => void;\n setSorting: Dispatch<SetStateAction<DataTableExplorerSorting>>;\n setSummary: (\n fieldName: string,\n summary: DataTableExplorerSummaryState,\n ) => void;\n setTotalCount: (state: DataTableExplorerCountState) => void;\n sorting: DataTableExplorerSorting;\n summaries: Record<string, DataTableExplorerSummaryState>;\n syncPageSize: (pageSize: number) => void;\n totalCount: DataTableExplorerCountState;\n clearSummaries: () => void;\n initializeSummaries: (fields: arrow.Field[]) => void;\n resetPageIndex: () => void;\n};\n\nexport type DataTableExplorerStore = ReturnType<\n typeof createDataTableExplorerStore\n>;\n\n/**\n * Creates a dataTableExplorer-local vanilla Zustand store that aggregates schema, row,\n * count, and summary state for a single `useDataTableExplorer()` instance.\n */\nexport function createDataTableExplorerStore(options: {\n initialSorting?: DataTableExplorerSorting;\n pageSize: number;\n}) {\n const {initialSorting = [], pageSize} = options;\n\n return createStore<DataTableExplorerStoreState>((set) => ({\n filteredCount: {isLoading: false},\n lastNonEmptyPageTable: undefined,\n page: {isLoading: false},\n pagination: normalizeDataTableExplorerPagination({pageIndex: 0, pageSize}),\n schema: {\n fields: [],\n isLoading: false,\n },\n setFilteredCount: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.filteredCount = nextState;\n }),\n );\n },\n setPage: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.page = castDraft(nextState);\n if (\n nextState.datasetId &&\n nextState.pageTable &&\n nextState.pageTable.numRows > 0\n ) {\n draft.lastNonEmptyPageTable = {\n datasetId: nextState.datasetId,\n pageTable: castDraft(nextState.pageTable),\n };\n }\n }),\n );\n },\n setPagination: (next) => {\n set((state) =>\n produce(state, (draft) => {\n draft.pagination = normalizeDataTableExplorerPagination(\n resolveSetStateAction(next, state.pagination),\n );\n }),\n );\n },\n setSchemaError: (error, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n draft.schema.error = error;\n draft.schema.isLoading = false;\n draft.schema.tableName = tableName;\n }),\n );\n },\n setSchemaLoading: (isLoading, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n if (tableName !== undefined && draft.schema.tableName !== tableName) {\n draft.schema.fields = [];\n }\n draft.schema.isLoading = isLoading;\n draft.schema.tableName = tableName;\n if (isLoading) {\n draft.schema.error = undefined;\n }\n }),\n );\n },\n setSchemaSuccess: (fields, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n draft.schema.error = undefined;\n draft.schema.fields = fields;\n draft.schema.isLoading = false;\n draft.schema.tableName = tableName;\n }),\n );\n },\n setSorting: (next) => {\n set((state) =>\n produce(state, (draft) => {\n draft.sorting = resolveSetStateAction(next, state.sorting);\n draft.pagination.pageIndex = 0;\n }),\n );\n },\n setSummary: (fieldName, summary) => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries[fieldName] = summary;\n }),\n );\n },\n setTotalCount: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.totalCount = nextState;\n }),\n );\n },\n sorting: initialSorting,\n summaries: {},\n syncPageSize: (nextPageSize) => {\n set((state) =>\n produce(state, (draft) => {\n if (draft.pagination.pageSize === nextPageSize) {\n return;\n }\n draft.pagination = normalizeDataTableExplorerPagination({\n pageIndex: 0,\n pageSize: nextPageSize,\n });\n }),\n );\n },\n totalCount: {isLoading: false},\n clearSummaries: () => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries = {};\n }),\n );\n },\n initializeSummaries: (fields) => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries = Object.fromEntries(\n fields.map((field) => [field.name, createEmptySummaryState(field)]),\n );\n }),\n );\n },\n resetPageIndex: () => {\n set((state) =>\n produce(state, (draft) => {\n draft.pagination = normalizeDataTableExplorerPagination({\n ...draft.pagination,\n pageIndex: 0,\n });\n }),\n );\n },\n }));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"createDataTableExplorerStore.js","sourceRoot":"","sources":["../../src/data-table-explorer/createDataTableExplorerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,EACL,uBAAuB,EACvB,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,SAAS,qBAAqB,CAAI,IAAuB,EAAE,QAAW;IACpE,wEAAwE;IACxE,gFAAgF;IAChF,OAAO,OAAO,IAAI,KAAK,UAAU;QAC/B,CAAC,CAAE,IAAwB,CAAC,QAAQ,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AA6CD;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAG5C;IACC,MAAM,EAAC,cAAc,GAAG,EAAE,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC;IAEhD,OAAO,WAAW,CAA8B,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACxD,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;QACjC,qBAAqB,EAAE,SAAS;QAChC,IAAI,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;QACxB,UAAU,EAAE,oCAAoC,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAC,CAAC;QAC1E,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,KAAK;SACjB;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE;YACpB,GAAG,CAA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AAY;iBACvB,CAAC,CAAC;YACL,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,UAAU,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;QAC9B,cAAc,EAAE,GAAG,EAAE;YACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;YACvB,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,mBAAmB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CACpE,CAAC;YACJ,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,GAAG,EAAE;YACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACZ,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,KAAK,CAAC,UAAU,GAAG,oCAAoC,CAAC;oBACtD,GAAG,KAAK,CAAC,UAAU;oBACnB,SAAS,EAAE,CAAC;iBACb,CAAC,CAAC;YACL,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {castDraft, produce} from 'immer';\nimport type * as arrow from 'apache-arrow';\nimport type {Dispatch, SetStateAction} from 'react';\nimport {createStore} from 'zustand/vanilla';\nimport type {DataTableExplorerCountState} from './DataTableExplorerCountClient';\nimport type {DataTableExplorerPageState} from './DataTableExplorerPageClient';\nimport type {\n DataTableExplorerPaginationState,\n DataTableExplorerSorting,\n DataTableExplorerSummaryState,\n} from './types';\nimport {\n createEmptySummaryState,\n normalizeDataTableExplorerPagination,\n} from './utils';\n\nfunction resolveSetStateAction<T>(next: SetStateAction<T>, previous: T): T {\n // Preserve React-style setter semantics so hook callers can pass either\n // a concrete value or an updater function to the local dataTableExplorer store.\n return typeof next === 'function'\n ? (next as (value: T) => T)(previous)\n : next;\n}\n\nimport type {MosaicClient} from '@uwdata/mosaic-core';\n\nexport type DataTableExplorerStoreState = {\n client: MosaicClient | null;\n filteredCount: DataTableExplorerCountState;\n lastNonEmptyPageTable?: {\n datasetId: string;\n pageTable: arrow.Table;\n };\n page: DataTableExplorerPageState;\n pagination: DataTableExplorerPaginationState;\n schema: {\n error?: Error;\n fields: arrow.Field[];\n isLoading: boolean;\n tableName?: string;\n };\n setClient: (client: MosaicClient | null) => void;\n setFilteredCount: (state: DataTableExplorerCountState) => void;\n setPage: (state: DataTableExplorerPageState) => void;\n setPagination: Dispatch<SetStateAction<DataTableExplorerPaginationState>>;\n setSchemaError: (error?: Error, tableName?: string) => void;\n setSchemaLoading: (isLoading: boolean, tableName?: string) => void;\n setSchemaSuccess: (fields: arrow.Field[], tableName?: string) => void;\n setSorting: Dispatch<SetStateAction<DataTableExplorerSorting>>;\n setSummary: (\n fieldName: string,\n summary: DataTableExplorerSummaryState,\n ) => void;\n setTotalCount: (state: DataTableExplorerCountState) => void;\n sorting: DataTableExplorerSorting;\n summaries: Record<string, DataTableExplorerSummaryState>;\n syncPageSize: (pageSize: number) => void;\n totalCount: DataTableExplorerCountState;\n clearSummaries: () => void;\n initializeSummaries: (fields: arrow.Field[]) => void;\n resetPageIndex: () => void;\n};\n\nexport type DataTableExplorerStore = ReturnType<\n typeof createDataTableExplorerStore\n>;\n\n/**\n * Creates a dataTableExplorer-local vanilla Zustand store that aggregates schema, row,\n * count, and summary state for a single `useDataTableExplorer()` instance.\n */\nexport function createDataTableExplorerStore(options: {\n initialSorting?: DataTableExplorerSorting;\n pageSize: number;\n}) {\n const {initialSorting = [], pageSize} = options;\n\n return createStore<DataTableExplorerStoreState>((set) => ({\n client: null,\n filteredCount: {isLoading: false},\n lastNonEmptyPageTable: undefined,\n page: {isLoading: false},\n pagination: normalizeDataTableExplorerPagination({pageIndex: 0, pageSize}),\n schema: {\n fields: [],\n isLoading: false,\n },\n setClient: (client) => {\n set((state) =>\n produce(state, (draft) => {\n draft.client = client as any;\n }),\n );\n },\n setFilteredCount: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.filteredCount = nextState;\n }),\n );\n },\n setPage: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.page = castDraft(nextState);\n if (\n nextState.datasetId &&\n nextState.pageTable &&\n nextState.pageTable.numRows > 0\n ) {\n draft.lastNonEmptyPageTable = {\n datasetId: nextState.datasetId,\n pageTable: castDraft(nextState.pageTable),\n };\n }\n }),\n );\n },\n setPagination: (next) => {\n set((state) =>\n produce(state, (draft) => {\n draft.pagination = normalizeDataTableExplorerPagination(\n resolveSetStateAction(next, state.pagination),\n );\n }),\n );\n },\n setSchemaError: (error, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n draft.schema.error = error;\n draft.schema.isLoading = false;\n draft.schema.tableName = tableName;\n }),\n );\n },\n setSchemaLoading: (isLoading, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n if (tableName !== undefined && draft.schema.tableName !== tableName) {\n draft.schema.fields = [];\n }\n draft.schema.isLoading = isLoading;\n draft.schema.tableName = tableName;\n if (isLoading) {\n draft.schema.error = undefined;\n }\n }),\n );\n },\n setSchemaSuccess: (fields, tableName) => {\n set((state) =>\n produce(state, (draft) => {\n draft.schema.error = undefined;\n draft.schema.fields = fields;\n draft.schema.isLoading = false;\n draft.schema.tableName = tableName;\n }),\n );\n },\n setSorting: (next) => {\n set((state) =>\n produce(state, (draft) => {\n draft.sorting = resolveSetStateAction(next, state.sorting);\n draft.pagination.pageIndex = 0;\n }),\n );\n },\n setSummary: (fieldName, summary) => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries[fieldName] = summary;\n }),\n );\n },\n setTotalCount: (nextState) => {\n set((state) =>\n produce(state, (draft) => {\n draft.totalCount = nextState;\n }),\n );\n },\n sorting: initialSorting,\n summaries: {},\n syncPageSize: (nextPageSize) => {\n set((state) =>\n produce(state, (draft) => {\n if (draft.pagination.pageSize === nextPageSize) {\n return;\n }\n draft.pagination = normalizeDataTableExplorerPagination({\n pageIndex: 0,\n pageSize: nextPageSize,\n });\n }),\n );\n },\n totalCount: {isLoading: false},\n clearSummaries: () => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries = {};\n }),\n );\n },\n initializeSummaries: (fields) => {\n set((state) =>\n produce(state, (draft) => {\n draft.summaries = Object.fromEntries(\n fields.map((field) => [field.name, createEmptySummaryState(field)]),\n );\n }),\n );\n },\n resetPageIndex: () => {\n set((state) =>\n produce(state, (draft) => {\n draft.pagination = normalizeDataTableExplorerPagination({\n ...draft.pagination,\n pageIndex: 0,\n });\n }),\n );\n },\n }));\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { DataTableExplorerPanelRendererProps } from '../../dashboard/MosaicDashboardSlice';
|
|
3
|
+
export declare const MosaicDashboardDataTableExplorerHeaderActions: FC<DataTableExplorerPanelRendererProps>;
|
|
4
|
+
//# sourceMappingURL=MosaicDashboardDataTableExplorerHeaderActions.d.ts.map
|
package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MosaicDashboardDataTableExplorerHeaderActions.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAI9B,OAAO,KAAK,EAAC,mCAAmC,EAAC,MAAM,sCAAsC,CAAC;AAE9F,eAAO,MAAM,6CAA6C,EAAE,EAAE,CAC5D,mCAAmC,CAepC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePanelClients } from '../../dashboard/usePanelClients';
|
|
3
|
+
import { usePanelResetFilters } from '../../dashboard/hooks/usePanelResetFilters';
|
|
4
|
+
import { ResetFiltersButton } from '../../dashboard/components/ResetFiltersButton';
|
|
5
|
+
export const MosaicDashboardDataTableExplorerHeaderActions = ({ dashboardId, panel, selectionName }) => {
|
|
6
|
+
const panelClients = usePanelClients(dashboardId, panel.id);
|
|
7
|
+
const { hasActiveFilters, reset } = usePanelResetFilters({
|
|
8
|
+
panelClients,
|
|
9
|
+
selectionName,
|
|
10
|
+
});
|
|
11
|
+
return (_jsx(ResetFiltersButton, { disabled: !hasActiveFilters, onClick: reset, tooltip: "Reset panel filters" }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=MosaicDashboardDataTableExplorerHeaderActions.js.map
|
package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MosaicDashboardDataTableExplorerHeaderActions.js","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AAGjF,MAAM,CAAC,MAAM,6CAA6C,GAEtD,CAAC,EAAC,WAAW,EAAE,KAAK,EAAE,aAAa,EAAC,EAAE,EAAE;IAC1C,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5D,MAAM,EAAC,gBAAgB,EAAE,KAAK,EAAC,GAAG,oBAAoB,CAAC;QACrD,YAAY;QACZ,aAAa;KACd,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,CAAC,gBAAgB,EAC3B,OAAO,EAAE,KAAK,EACd,OAAO,EAAC,qBAAqB,GAC7B,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {type FC} from 'react';\nimport {usePanelClients} from '../../dashboard/usePanelClients';\nimport {usePanelResetFilters} from '../../dashboard/hooks/usePanelResetFilters';\nimport {ResetFiltersButton} from '../../dashboard/components/ResetFiltersButton';\nimport type {DataTableExplorerPanelRendererProps} from '../../dashboard/MosaicDashboardSlice';\n\nexport const MosaicDashboardDataTableExplorerHeaderActions: FC<\n DataTableExplorerPanelRendererProps\n> = ({dashboardId, panel, selectionName}) => {\n const panelClients = usePanelClients(dashboardId, panel.id);\n const {hasActiveFilters, reset} = usePanelResetFilters({\n panelClients,\n selectionName,\n });\n\n return (\n <ResetFiltersButton\n disabled={!hasActiveFilters}\n onClick={reset}\n tooltip=\"Reset panel filters\"\n />\n );\n};\n"]}
|
package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MosaicDashboardDataTableExplorerPanelRenderer.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EACL,KAAK,4BAA4B,EAGlC,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"MosaicDashboardDataTableExplorerPanelRenderer.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EACL,KAAK,4BAA4B,EAGlC,MAAM,sCAAsC,CAAC;AAgG9C,eAAO,MAAM,6CAA6C,EAAE,4BAA4B,CAAC,sBAAsB,CAK5G,CAAC"}
|
|
@@ -1,28 +1,46 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SpinnerPane } from '@sqlrooms/ui';
|
|
2
|
+
import { ScrollArea, ScrollBar, SpinnerPane } from '@sqlrooms/ui';
|
|
3
3
|
import { TablePropertiesIcon } from 'lucide-react';
|
|
4
4
|
import { DataTableExplorer } from '../DataTableExplorer';
|
|
5
5
|
import { useStoreWithMosaicDashboard, } from '../../dashboard/MosaicDashboardSlice';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { usePanelClientRegistration } from '../../dashboard/usePanelClientRegistration';
|
|
7
|
+
import { useDataTableExplorerPanelClients } from './useDataTableExplorerPanelClients';
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { useDataTableExplorer } from '../useDataTableExplorer';
|
|
10
|
+
import { MosaicDashboardDataTableExplorerHeaderActions } from './MosaicDashboardDataTableExplorerHeaderActions';
|
|
11
|
+
import { useTablesWithColumns } from '../../hooks/useTablesWithColumns';
|
|
12
|
+
import { resolveMosaicTableReference } from '../../mosaicTableReference';
|
|
13
|
+
const MosaicDashboardDataTableExplorerRendererInner = ({ panel, dashboard, selectionName, selectedTable }) => {
|
|
8
14
|
const connection = useStoreWithMosaicDashboard((state) => state.mosaic.connection);
|
|
9
|
-
const selectedTable = useDataTable(dashboard.selectedTable);
|
|
10
15
|
const pageSize = typeof panel.config.pageSize === 'number'
|
|
11
16
|
? panel.config.pageSize
|
|
12
17
|
: undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
const explorer = useDataTableExplorer({
|
|
19
|
+
tableName: selectedTable.table,
|
|
20
|
+
pageSize: pageSize ?? 10,
|
|
21
|
+
selectionName,
|
|
22
|
+
});
|
|
23
|
+
const explorerClients = useDataTableExplorerPanelClients(explorer, selectedTable, connection.status);
|
|
24
|
+
usePanelClientRegistration(dashboard.id, panel.id, explorerClients);
|
|
16
25
|
if (connection.status === 'loading') {
|
|
17
26
|
return _jsx(SpinnerPane, { className: "h-full w-full" });
|
|
18
27
|
}
|
|
19
28
|
if (connection.status !== 'ready') {
|
|
20
29
|
return (_jsx("div", { className: "text-muted-foreground flex h-full items-center justify-center p-4 text-sm", children: "Mosaic connection is not ready." }));
|
|
21
30
|
}
|
|
22
|
-
return (_jsx(DataTableExplorer, {
|
|
31
|
+
return (_jsx(DataTableExplorer.Root, { explorer: explorer, children: _jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsxs(ScrollArea, { className: "min-h-0 flex-1", children: [_jsxs(DataTableExplorer.Table, { children: [_jsx(DataTableExplorer.Header, {}), _jsx(DataTableExplorer.Rows, {})] }), _jsx(ScrollBar, { orientation: "horizontal" })] }), _jsx(DataTableExplorer.StatusBar, {})] }) }));
|
|
32
|
+
};
|
|
33
|
+
const MosaicDashboardDataTableExplorerRenderer = ({ panel, dashboard, selectionName }) => {
|
|
34
|
+
const tables = useTablesWithColumns();
|
|
35
|
+
const selectedTable = useMemo(() => resolveMosaicTableReference(tables, dashboard.selectedTable).table, [dashboard.selectedTable, tables]);
|
|
36
|
+
if (!selectedTable) {
|
|
37
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-full items-center justify-center p-4 text-sm", children: "Data Table Explorer panels require a table source." }));
|
|
38
|
+
}
|
|
39
|
+
return (_jsx(MosaicDashboardDataTableExplorerRendererInner, { panel: panel, dashboard: dashboard, selectionName: selectionName, selectedTable: selectedTable }));
|
|
23
40
|
};
|
|
24
41
|
export const mosaicDashboardDataTableExplorerPanelRenderer = {
|
|
25
42
|
component: MosaicDashboardDataTableExplorerRenderer,
|
|
43
|
+
headerActions: MosaicDashboardDataTableExplorerHeaderActions,
|
|
26
44
|
icon: TablePropertiesIcon,
|
|
27
45
|
};
|
|
28
46
|
//# sourceMappingURL=MosaicDashboardDataTableExplorerPanelRenderer.js.map
|
package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MosaicDashboardDataTableExplorerPanelRenderer.js","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MosaicDashboardDataTableExplorerPanelRenderer.js","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAGL,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,0BAA0B,EAAC,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAC,gCAAgC,EAAC,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAK,OAAO,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,6CAA6C,EAAC,MAAM,iDAAiD,CAAC;AAE9G,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,2BAA2B,EAAC,MAAM,4BAA4B,CAAC;AAOvE,MAAM,6CAA6C,GAE/C,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAC,EAAE,EAAE;IACvD,MAAM,UAAU,GAAG,2BAA2B,CAC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AE1C,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAC,EAAE,EAAE;IACxC,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,2BAA2B,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,KAAK,EACxE,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAClC,CAAC;IAEF,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CACL,cAAK,SAAS,EAAC,2EAA2E,mEAEpF,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,6CAA6C,IAC5C,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6CAA6C,GACxD;IACE,SAAS,EAAE,wCAAwC;IACnD,aAAa,EAAE,6CAA6C;IAC5D,IAAI,EAAE,mBAAmB;CAC1B,CAAC","sourcesContent":["import {ScrollArea, ScrollBar, SpinnerPane} from '@sqlrooms/ui';\nimport {TablePropertiesIcon} from 'lucide-react';\nimport {DataTableExplorer} from '../DataTableExplorer';\nimport type {DataTableExplorerPanel} from '../../dashboard/dashboard-types';\nimport {\n type MosaicDashboardPanelRenderer,\n type DataTableExplorerPanelRendererProps,\n useStoreWithMosaicDashboard,\n} from '../../dashboard/MosaicDashboardSlice';\nimport {usePanelClientRegistration} from '../../dashboard/usePanelClientRegistration';\nimport {useDataTableExplorerPanelClients} from './useDataTableExplorerPanelClients';\nimport {FC, useMemo} from 'react';\nimport {useDataTableExplorer} from '../useDataTableExplorer';\nimport {MosaicDashboardDataTableExplorerHeaderActions} from './MosaicDashboardDataTableExplorerHeaderActions';\nimport type {DataTable} from '@sqlrooms/db';\nimport {useTablesWithColumns} from '../../hooks/useTablesWithColumns';\nimport {resolveMosaicTableReference} from '../../mosaicTableReference';\n\ntype MosaicDashboardDataTableExplorerRendererInnerProps = Omit<\n DataTableExplorerPanelRendererProps,\n 'dashboardId'\n> & {selectedTable: DataTable};\n\nconst MosaicDashboardDataTableExplorerRendererInner: FC<\n MosaicDashboardDataTableExplorerRendererInnerProps\n> = ({panel, dashboard, selectionName, selectedTable}) => {\n const connection = useStoreWithMosaicDashboard(\n (state) => state.mosaic.connection,\n );\n\n const pageSize =\n typeof panel.config.pageSize === 'number'\n ? panel.config.pageSize\n : undefined;\n\n const explorer = useDataTableExplorer({\n tableName: selectedTable.table,\n pageSize: pageSize ?? 10,\n selectionName,\n });\n\n const explorerClients = useDataTableExplorerPanelClients(\n explorer,\n selectedTable,\n connection.status,\n );\n\n usePanelClientRegistration(dashboard.id, panel.id, explorerClients);\n\n if (connection.status === 'loading') {\n return <SpinnerPane className=\"h-full w-full\" />;\n }\n\n if (connection.status !== 'ready') {\n return (\n <div className=\"text-muted-foreground flex h-full items-center justify-center p-4 text-sm\">\n Mosaic connection is not ready.\n </div>\n );\n }\n\n return (\n <DataTableExplorer.Root explorer={explorer}>\n <div className=\"flex h-full min-h-0 flex-col\">\n <ScrollArea className=\"min-h-0 flex-1\">\n <DataTableExplorer.Table>\n <DataTableExplorer.Header />\n <DataTableExplorer.Rows />\n </DataTableExplorer.Table>\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n <DataTableExplorer.StatusBar />\n </div>\n </DataTableExplorer.Root>\n );\n};\n\nconst MosaicDashboardDataTableExplorerRenderer: FC<\n DataTableExplorerPanelRendererProps\n> = ({panel, dashboard, selectionName}) => {\n const tables = useTablesWithColumns();\n const selectedTable = useMemo(\n () => resolveMosaicTableReference(tables, dashboard.selectedTable).table,\n [dashboard.selectedTable, tables],\n );\n\n if (!selectedTable) {\n return (\n <div className=\"text-muted-foreground flex h-full items-center justify-center p-4 text-sm\">\n Data Table Explorer panels require a table source.\n </div>\n );\n }\n\n return (\n <MosaicDashboardDataTableExplorerRendererInner\n panel={panel}\n dashboard={dashboard}\n selectionName={selectionName}\n selectedTable={selectedTable}\n />\n );\n};\n\nexport const mosaicDashboardDataTableExplorerPanelRenderer: MosaicDashboardPanelRenderer<DataTableExplorerPanel> =\n {\n component: MosaicDashboardDataTableExplorerRenderer,\n headerActions: MosaicDashboardDataTableExplorerHeaderActions,\n icon: TablePropertiesIcon,\n };\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MosaicClient } from '@uwdata/mosaic-core';
|
|
2
|
+
import type { UseDataTableExplorerReturn } from '../types';
|
|
3
|
+
import type { ConnectionStatus } from '../../MosaicSlice';
|
|
4
|
+
import { DataTable } from '@sqlrooms/db';
|
|
5
|
+
/**
|
|
6
|
+
* Extracts all Mosaic clients from a DataTableExplorer instance for panel client registration.
|
|
7
|
+
* This includes:
|
|
8
|
+
* - The main count client (tracks filtered row count)
|
|
9
|
+
* - Histogram interactors (for histogram column interactions)
|
|
10
|
+
* - Category clients (for category column interactions)
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDataTableExplorerPanelClients(explorer: UseDataTableExplorerReturn, selectedTable: DataTable | undefined, connectionStatus: ConnectionStatus): MosaicClient[];
|
|
13
|
+
//# sourceMappingURL=useDataTableExplorerPanelClients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerPanelClients.d.ts","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/useDataTableExplorerPanelClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,0BAA0B,EACpC,aAAa,EAAE,SAAS,GAAG,SAAS,EACpC,gBAAgB,EAAE,gBAAgB,GACjC,YAAY,EAAE,CAyBhB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts all Mosaic clients from a DataTableExplorer instance for panel client registration.
|
|
4
|
+
* This includes:
|
|
5
|
+
* - The main count client (tracks filtered row count)
|
|
6
|
+
* - Histogram interactors (for histogram column interactions)
|
|
7
|
+
* - Category clients (for category column interactions)
|
|
8
|
+
*/
|
|
9
|
+
export function useDataTableExplorerPanelClients(explorer, selectedTable, connectionStatus) {
|
|
10
|
+
return useMemo(() => {
|
|
11
|
+
if (!selectedTable || connectionStatus !== 'ready') {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const clients = [];
|
|
15
|
+
// Add main count client
|
|
16
|
+
if (explorer.client) {
|
|
17
|
+
clients.push(explorer.client);
|
|
18
|
+
}
|
|
19
|
+
// Add summary clients (histogram interactors and category clients)
|
|
20
|
+
explorer.columns.forEach((col) => {
|
|
21
|
+
const summary = col.summary;
|
|
22
|
+
if (summary.kind === 'histogram' && summary.interactor) {
|
|
23
|
+
clients.push(summary.interactor);
|
|
24
|
+
}
|
|
25
|
+
else if (summary.kind === 'category' && summary.client) {
|
|
26
|
+
clients.push(summary.client);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return clients;
|
|
30
|
+
}, [connectionStatus, explorer.client, explorer.columns, selectedTable]);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useDataTableExplorerPanelClients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataTableExplorerPanelClients.js","sourceRoot":"","sources":["../../../src/data-table-explorer/dashboard/useDataTableExplorerPanelClients.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAK9B;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC9C,QAAoC,EACpC,aAAoC,EACpC,gBAAkC;IAElC,OAAO,OAAO,CAAiB,GAAG,EAAE;QAClC,IAAI,CAAC,aAAa,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACnD,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAmB,EAAE,CAAC;QAEnC,wBAAwB;QACxB,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QAED,mEAAmE;QACnE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;YAC5B,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAqC,CAAC,CAAC;YAC9D,CAAC;iBAAM,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACzD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import {type MosaicClient} from '@uwdata/mosaic-core';\nimport {useMemo} from 'react';\nimport type {UseDataTableExplorerReturn} from '../types';\nimport type {ConnectionStatus} from '../../MosaicSlice';\nimport {DataTable} from '@sqlrooms/db';\n\n/**\n * Extracts all Mosaic clients from a DataTableExplorer instance for panel client registration.\n * This includes:\n * - The main count client (tracks filtered row count)\n * - Histogram interactors (for histogram column interactions)\n * - Category clients (for category column interactions)\n */\nexport function useDataTableExplorerPanelClients(\n explorer: UseDataTableExplorerReturn,\n selectedTable: DataTable | undefined,\n connectionStatus: ConnectionStatus,\n): MosaicClient[] {\n return useMemo<MosaicClient[]>(() => {\n if (!selectedTable || connectionStatus !== 'ready') {\n return [];\n }\n\n const clients: MosaicClient[] = [];\n\n // Add main count client\n if (explorer.client) {\n clients.push(explorer.client);\n }\n\n // Add summary clients (histogram interactors and category clients)\n explorer.columns.forEach((col) => {\n const summary = col.summary;\n if (summary.kind === 'histogram' && summary.interactor) {\n clients.push(summary.interactor as unknown as MosaicClient);\n } else if (summary.kind === 'category' && summary.client) {\n clients.push(summary.client);\n }\n });\n\n return clients;\n }, [connectionStatus, explorer.client, explorer.columns, selectedTable]);\n}\n"]}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import type { MosaicClient, Selection } from '@uwdata/mosaic-core';
|
|
2
2
|
import { queryFieldInfo } from '@uwdata/mosaic-core';
|
|
3
3
|
import type * as arrow from 'apache-arrow';
|
|
4
|
-
import
|
|
4
|
+
import { DataTableExplorerCountClient } from './DataTableExplorerCountClient';
|
|
5
|
+
import type { DataTableExplorerSqlTableReference, DataTableExplorerSorting } from './types';
|
|
5
6
|
import type { DataTableExplorerStore } from './createDataTableExplorerStore';
|
|
6
7
|
/**
|
|
7
8
|
* Loads field metadata for the dataTableExplorer table and writes the normalized field
|
|
8
9
|
* definitions into the dataTableExplorer store.
|
|
10
|
+
*
|
|
11
|
+
* @param options.columns Optional subset of column names to load. When omitted,
|
|
12
|
+
* metadata is loaded for every column in the table.
|
|
13
|
+
* @param options.coordinator Mosaic coordinator used to run the field-info query.
|
|
14
|
+
* @param options.store Instance store that receives schema loading, success, and
|
|
15
|
+
* error state.
|
|
16
|
+
* @param options.tableIdentity Stable SQLRooms table identity used for store keys.
|
|
17
|
+
* This should preserve catalog/database identity when available.
|
|
18
|
+
* @param options.tableReference Mosaic SQL table reference used to query the table.
|
|
19
|
+
* Prefer a TableRefNode for qualified table names so dotted identifier parts are
|
|
20
|
+
* not reparsed as separate identifiers.
|
|
9
21
|
*/
|
|
10
22
|
export declare function loadDataTableExplorerSchema(options: {
|
|
11
23
|
columns?: string[];
|
|
12
24
|
coordinator: Parameters<typeof queryFieldInfo>[0];
|
|
13
25
|
store: DataTableExplorerStore;
|
|
14
|
-
|
|
26
|
+
tableIdentity: string;
|
|
27
|
+
tableReference: DataTableExplorerSqlTableReference;
|
|
15
28
|
}): Promise<void>;
|
|
16
29
|
type ReadyConnection = {
|
|
17
30
|
coordinator: {
|
|
@@ -22,6 +35,20 @@ type ReadyConnection = {
|
|
|
22
35
|
/**
|
|
23
36
|
* Connects the paged row client for the current dataTableExplorer page and disconnects
|
|
24
37
|
* it when the caller tears down the lifecycle.
|
|
38
|
+
*
|
|
39
|
+
* @param options.connection Ready Mosaic connection that owns client
|
|
40
|
+
* registration.
|
|
41
|
+
* @param options.fieldNames Ordered fields to include in the page query and page
|
|
42
|
+
* dataset identity.
|
|
43
|
+
* @param options.filter Optional row filter applied to the page query.
|
|
44
|
+
* @param options.pagination Current page index and page size.
|
|
45
|
+
* @param options.sorting Current sort descriptors.
|
|
46
|
+
* @param options.store Instance store that receives page loading, data, and error
|
|
47
|
+
* state.
|
|
48
|
+
* @param options.tableName Stable SQLRooms table identity used for page dataset
|
|
49
|
+
* keys.
|
|
50
|
+
* @param options.tableReference Mosaic SQL table reference used in generated page
|
|
51
|
+
* queries.
|
|
25
52
|
*/
|
|
26
53
|
export declare function connectDataTableExplorerPageClient(options: {
|
|
27
54
|
connection: ReadyConnection;
|
|
@@ -34,10 +61,25 @@ export declare function connectDataTableExplorerPageClient(options: {
|
|
|
34
61
|
sorting: DataTableExplorerSorting;
|
|
35
62
|
store: DataTableExplorerStore;
|
|
36
63
|
tableName: string;
|
|
64
|
+
tableReference: DataTableExplorerSqlTableReference;
|
|
37
65
|
}): () => void;
|
|
38
66
|
/**
|
|
39
67
|
* Connects either the filtered or total count client and routes updates into
|
|
40
68
|
* the corresponding store slice.
|
|
69
|
+
*
|
|
70
|
+
* @param options.connection Ready Mosaic connection that owns client
|
|
71
|
+
* registration.
|
|
72
|
+
* @param options.filterStable Whether Mosaic can treat this count query as
|
|
73
|
+
* stable under filter changes.
|
|
74
|
+
* @param options.selection Optional Mosaic selection that supplies cross-filter
|
|
75
|
+
* predicates.
|
|
76
|
+
* @param options.store Instance store that receives filtered or total count
|
|
77
|
+
* state.
|
|
78
|
+
* @param options.tableName Stable SQLRooms table identity used for client state.
|
|
79
|
+
* @param options.tableReference Mosaic SQL table reference used in generated count
|
|
80
|
+
* queries.
|
|
81
|
+
* @param options.target Selects whether updates go to the filtered or total count
|
|
82
|
+
* store slice.
|
|
41
83
|
*/
|
|
42
84
|
export declare function connectDataTableExplorerCountClient(options: {
|
|
43
85
|
connection: ReadyConnection;
|
|
@@ -45,11 +87,28 @@ export declare function connectDataTableExplorerCountClient(options: {
|
|
|
45
87
|
selection?: Selection;
|
|
46
88
|
store: DataTableExplorerStore;
|
|
47
89
|
tableName: string;
|
|
90
|
+
tableReference: DataTableExplorerSqlTableReference;
|
|
48
91
|
target: 'filtered' | 'total';
|
|
49
|
-
}):
|
|
92
|
+
}): {
|
|
93
|
+
client: DataTableExplorerCountClient;
|
|
94
|
+
cleanup: () => void;
|
|
95
|
+
};
|
|
50
96
|
/**
|
|
51
97
|
* Connects all per-column summary clients for the active schema and initializes
|
|
52
98
|
* matching empty summary state in the dataTableExplorer store.
|
|
99
|
+
*
|
|
100
|
+
* @param options.categoryLimit Maximum number of category buckets to expose before
|
|
101
|
+
* grouping the remainder into an overflow bucket.
|
|
102
|
+
* @param options.connection Ready Mosaic connection that owns summary client
|
|
103
|
+
* registration.
|
|
104
|
+
* @param options.fields Active Arrow fields to summarize.
|
|
105
|
+
* @param options.selection Mosaic selection shared by summary clients.
|
|
106
|
+
* @param options.store Instance store that receives summary state.
|
|
107
|
+
* @param options.summaryBins Requested bin count for histogram summaries.
|
|
108
|
+
* @param options.tableName Human-readable or string table reference kept for
|
|
109
|
+
* summary clients that still accept string identities.
|
|
110
|
+
* @param options.tableReference Mosaic SQL table reference used in generated
|
|
111
|
+
* summary queries.
|
|
53
112
|
*/
|
|
54
113
|
export declare function connectDataTableExplorerSummaryClients(options: {
|
|
55
114
|
categoryLimit: number;
|
|
@@ -59,6 +118,7 @@ export declare function connectDataTableExplorerSummaryClients(options: {
|
|
|
59
118
|
store: DataTableExplorerStore;
|
|
60
119
|
summaryBins: number;
|
|
61
120
|
tableName: string;
|
|
121
|
+
tableReference: DataTableExplorerSqlTableReference;
|
|
62
122
|
}): () => void;
|
|
63
123
|
export {};
|
|
64
124
|
//# sourceMappingURL=dataTableExplorerController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTableExplorerController.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/dataTableExplorerController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"dataTableExplorerController.d.ts","sourceRoot":"","sources":["../../src/data-table-explorer/dataTableExplorerController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAC,4BAA4B,EAAC,MAAM,gCAAgC,CAAC;AAO5E,OAAO,KAAK,EAEV,kCAAkC,EAClC,wBAAwB,EACzB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AAY3E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,2BAA2B,CAAC,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H,wBAAgB,sCAAsC,CAAC,OAAO,EAAE;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,eAAe,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,kCAAkC,CAAC;CACpD,cA4EA"}
|
|
@@ -11,26 +11,54 @@ function toError(error) {
|
|
|
11
11
|
/**
|
|
12
12
|
* Loads field metadata for the dataTableExplorer table and writes the normalized field
|
|
13
13
|
* definitions into the dataTableExplorer store.
|
|
14
|
+
*
|
|
15
|
+
* @param options.columns Optional subset of column names to load. When omitted,
|
|
16
|
+
* metadata is loaded for every column in the table.
|
|
17
|
+
* @param options.coordinator Mosaic coordinator used to run the field-info query.
|
|
18
|
+
* @param options.store Instance store that receives schema loading, success, and
|
|
19
|
+
* error state.
|
|
20
|
+
* @param options.tableIdentity Stable SQLRooms table identity used for store keys.
|
|
21
|
+
* This should preserve catalog/database identity when available.
|
|
22
|
+
* @param options.tableReference Mosaic SQL table reference used to query the table.
|
|
23
|
+
* Prefer a TableRefNode for qualified table names so dotted identifier parts are
|
|
24
|
+
* not reparsed as separate identifiers.
|
|
14
25
|
*/
|
|
15
26
|
export async function loadDataTableExplorerSchema(options) {
|
|
16
|
-
const { columns, coordinator, store,
|
|
17
|
-
store.getState().setSchemaLoading(true,
|
|
27
|
+
const { columns, coordinator, store, tableIdentity, tableReference } = options;
|
|
28
|
+
store.getState().setSchemaLoading(true, tableIdentity);
|
|
18
29
|
try {
|
|
30
|
+
// queryFieldInfo is typed as string-only, but Mosaic's runtime accepts
|
|
31
|
+
// TableRefNode values and preserves identifier boundaries for dotted names.
|
|
32
|
+
const fieldInfoTable = tableReference;
|
|
19
33
|
const fieldInfo = await queryFieldInfo(coordinator, columns?.length
|
|
20
|
-
? columns.map((column) => ({ column, table:
|
|
21
|
-
: [{ column: '*', table:
|
|
34
|
+
? columns.map((column) => ({ column, table: fieldInfoTable }))
|
|
35
|
+
: [{ column: '*', table: fieldInfoTable }]);
|
|
22
36
|
store
|
|
23
37
|
.getState()
|
|
24
|
-
.setSchemaSuccess(fieldInfo.map(fieldInfoToDataTableExplorerField),
|
|
38
|
+
.setSchemaSuccess(fieldInfo.map(fieldInfoToDataTableExplorerField), tableIdentity);
|
|
25
39
|
}
|
|
26
40
|
catch (error) {
|
|
27
|
-
store.getState().setSchemaSuccess([],
|
|
28
|
-
store.getState().setSchemaError(toError(error),
|
|
41
|
+
store.getState().setSchemaSuccess([], tableIdentity);
|
|
42
|
+
store.getState().setSchemaError(toError(error), tableIdentity);
|
|
29
43
|
}
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
32
46
|
* Connects the paged row client for the current dataTableExplorer page and disconnects
|
|
33
47
|
* it when the caller tears down the lifecycle.
|
|
48
|
+
*
|
|
49
|
+
* @param options.connection Ready Mosaic connection that owns client
|
|
50
|
+
* registration.
|
|
51
|
+
* @param options.fieldNames Ordered fields to include in the page query and page
|
|
52
|
+
* dataset identity.
|
|
53
|
+
* @param options.filter Optional row filter applied to the page query.
|
|
54
|
+
* @param options.pagination Current page index and page size.
|
|
55
|
+
* @param options.sorting Current sort descriptors.
|
|
56
|
+
* @param options.store Instance store that receives page loading, data, and error
|
|
57
|
+
* state.
|
|
58
|
+
* @param options.tableName Stable SQLRooms table identity used for page dataset
|
|
59
|
+
* keys.
|
|
60
|
+
* @param options.tableReference Mosaic SQL table reference used in generated page
|
|
61
|
+
* queries.
|
|
34
62
|
*/
|
|
35
63
|
export function connectDataTableExplorerPageClient(options) {
|
|
36
64
|
const client = new DataTableExplorerPageClient({
|
|
@@ -40,6 +68,7 @@ export function connectDataTableExplorerPageClient(options) {
|
|
|
40
68
|
pagination: options.pagination,
|
|
41
69
|
sorting: options.sorting,
|
|
42
70
|
tableName: options.tableName,
|
|
71
|
+
tableReference: options.tableReference,
|
|
43
72
|
});
|
|
44
73
|
options.connection.coordinator.connect(client);
|
|
45
74
|
return () => {
|
|
@@ -49,6 +78,20 @@ export function connectDataTableExplorerPageClient(options) {
|
|
|
49
78
|
/**
|
|
50
79
|
* Connects either the filtered or total count client and routes updates into
|
|
51
80
|
* the corresponding store slice.
|
|
81
|
+
*
|
|
82
|
+
* @param options.connection Ready Mosaic connection that owns client
|
|
83
|
+
* registration.
|
|
84
|
+
* @param options.filterStable Whether Mosaic can treat this count query as
|
|
85
|
+
* stable under filter changes.
|
|
86
|
+
* @param options.selection Optional Mosaic selection that supplies cross-filter
|
|
87
|
+
* predicates.
|
|
88
|
+
* @param options.store Instance store that receives filtered or total count
|
|
89
|
+
* state.
|
|
90
|
+
* @param options.tableName Stable SQLRooms table identity used for client state.
|
|
91
|
+
* @param options.tableReference Mosaic SQL table reference used in generated count
|
|
92
|
+
* queries.
|
|
93
|
+
* @param options.target Selects whether updates go to the filtered or total count
|
|
94
|
+
* store slice.
|
|
52
95
|
*/
|
|
53
96
|
export function connectDataTableExplorerCountClient(options) {
|
|
54
97
|
const setCountState = options.target === 'filtered'
|
|
@@ -59,18 +102,35 @@ export function connectDataTableExplorerCountClient(options) {
|
|
|
59
102
|
onStateChange: setCountState,
|
|
60
103
|
selection: options.selection,
|
|
61
104
|
tableName: options.tableName,
|
|
105
|
+
tableReference: options.tableReference,
|
|
62
106
|
});
|
|
63
107
|
options.connection.coordinator.connect(client);
|
|
64
|
-
return
|
|
65
|
-
client
|
|
108
|
+
return {
|
|
109
|
+
client,
|
|
110
|
+
cleanup: () => {
|
|
111
|
+
client.destroy();
|
|
112
|
+
},
|
|
66
113
|
};
|
|
67
114
|
}
|
|
68
115
|
/**
|
|
69
116
|
* Connects all per-column summary clients for the active schema and initializes
|
|
70
117
|
* matching empty summary state in the dataTableExplorer store.
|
|
118
|
+
*
|
|
119
|
+
* @param options.categoryLimit Maximum number of category buckets to expose before
|
|
120
|
+
* grouping the remainder into an overflow bucket.
|
|
121
|
+
* @param options.connection Ready Mosaic connection that owns summary client
|
|
122
|
+
* registration.
|
|
123
|
+
* @param options.fields Active Arrow fields to summarize.
|
|
124
|
+
* @param options.selection Mosaic selection shared by summary clients.
|
|
125
|
+
* @param options.store Instance store that receives summary state.
|
|
126
|
+
* @param options.summaryBins Requested bin count for histogram summaries.
|
|
127
|
+
* @param options.tableName Human-readable or string table reference kept for
|
|
128
|
+
* summary clients that still accept string identities.
|
|
129
|
+
* @param options.tableReference Mosaic SQL table reference used in generated
|
|
130
|
+
* summary queries.
|
|
71
131
|
*/
|
|
72
132
|
export function connectDataTableExplorerSummaryClients(options) {
|
|
73
|
-
const { categoryLimit, connection, fields, selection, store, summaryBins, tableName, } = options;
|
|
133
|
+
const { categoryLimit, connection, fields, selection, store, summaryBins, tableName, tableReference, } = options;
|
|
74
134
|
store.getState().initializeSummaries(fields);
|
|
75
135
|
const clients = fields.flatMap((field) => {
|
|
76
136
|
const update = (summary) => {
|
|
@@ -83,6 +143,7 @@ export function connectDataTableExplorerSummaryClients(options) {
|
|
|
83
143
|
onStateChange: update,
|
|
84
144
|
selection,
|
|
85
145
|
tableName,
|
|
146
|
+
tableReference,
|
|
86
147
|
}),
|
|
87
148
|
];
|
|
88
149
|
}
|
|
@@ -93,6 +154,7 @@ export function connectDataTableExplorerSummaryClients(options) {
|
|
|
93
154
|
selection,
|
|
94
155
|
steps: summaryBins,
|
|
95
156
|
tableName,
|
|
157
|
+
tableReference,
|
|
96
158
|
valueType: getDataTableExplorerValueType(field.type) === 'date'
|
|
97
159
|
? 'date'
|
|
98
160
|
: 'number',
|
|
@@ -110,6 +172,7 @@ export function connectDataTableExplorerSummaryClients(options) {
|
|
|
110
172
|
onStateChange: update,
|
|
111
173
|
selection,
|
|
112
174
|
tableName,
|
|
175
|
+
tableReference,
|
|
113
176
|
});
|
|
114
177
|
return [
|
|
115
178
|
summaryClient,
|