@sqlrooms/mosaic 0.29.0-rc.8 → 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/README.md +84 -74
- 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.js +1 -1
- package/dist/charts/MosaicChart.js.map +1 -1
- package/dist/charts/MosaicChartView.d.ts.map +1 -1
- package/dist/charts/MosaicChartView.js +1 -2
- package/dist/charts/MosaicChartView.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 +4 -11
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
- package/dist/charts/chart-types/base-types.d.ts +27 -23
- package/dist/charts/chart-types/base-types.d.ts.map +1 -1
- package/dist/charts/chart-types/base-types.js +3 -1
- 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 +26 -6
- 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/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.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.js +1 -19
- 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 +25 -32
- 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/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/errors.d.ts +10 -0
- package/dist/charts/chart-types/errors.d.ts.map +1 -1
- package/dist/charts/chart-types/errors.js +18 -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.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.js +1 -33
- 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 +26 -36
- 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/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/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/spec.js +1 -21
- package/dist/charts/chart-types/histogram/spec.js.map +1 -1
- package/dist/charts/chart-types/histogram/tool.d.ts +37 -24
- package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/tool.js +38 -32
- 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 +1 -7
- package/dist/charts/chart-types/index.d.ts.map +1 -1
- package/dist/charts/chart-types/index.js +2 -8
- package/dist/charts/chart-types/index.js.map +1 -1
- 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/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.js +5 -46
- package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.d.ts +26 -24
- package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.js +26 -38
- package/dist/charts/chart-types/line-chart/tool.js.map +1 -1
- 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/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/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/definition.js +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/spec.js +1 -45
- package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/tool.d.ts +21 -24
- package/dist/charts/chart-types/scatter-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/tool.js +28 -41
- package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -1
- 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/MosaicDashboardChartRenderer.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js +5 -3
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js.map +1 -1
- package/dist/charts/useChartDataPolicy.js +2 -2
- package/dist/charts/useChartDataPolicy.js.map +1 -1
- package/dist/components/AggregationSelector.d.ts.map +1 -1
- package/dist/components/AggregationSelector.js +1 -1
- package/dist/components/AggregationSelector.js.map +1 -1
- package/dist/components/ColorSelector.d.ts.map +1 -1
- package/dist/components/ColorSelector.js +1 -2
- package/dist/components/ColorSelector.js.map +1 -1
- package/dist/components/FieldSelectorInput.d.ts.map +1 -1
- package/dist/components/FieldSelectorInput.js +3 -3
- package/dist/components/FieldSelectorInput.js.map +1 -1
- package/dist/components/TemporalGranularitySelector.d.ts.map +1 -1
- package/dist/components/TemporalGranularitySelector.js +1 -1
- package/dist/components/TemporalGranularitySelector.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/dashboard-types.d.ts.map +1 -1
- package/dist/dashboard/dashboard-types.js.map +1 -1
- 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/MosaicDashboardDataTableSelector.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js +4 -4
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +5 -3
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -1
- 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/DataTableExplorerCategoryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +3 -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/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js +7 -4
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.d.ts +58 -2
- package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.js +68 -8
- package/dist/data-table-explorer/dataTableExplorerController.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts +23 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +46 -13
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +17 -3
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +9 -6
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js.map +1 -1
- package/dist/data-table-explorer/types.d.ts +10 -0
- 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 +10 -6
- 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/DataTableBlockRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js +2 -2
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
- package/dist/index.d.ts +49 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -25
- 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 +26 -1
- package/dist/useVgPlotChartRender.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 -108
- package/dist/ai/ai.d.ts.map +0 -1
- package/dist/ai/ai.js +0 -461
- 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/components/Combobox.d.ts +0 -45
- package/dist/components/Combobox.d.ts.map +0 -1
- package/dist/components/Combobox.js +0 -58
- package/dist/components/Combobox.js.map +0 -1
- package/dist/components/useCombobox.d.ts +0 -23
- package/dist/components/useCombobox.d.ts.map +0 -1
- package/dist/components/useCombobox.js +0 -26
- package/dist/components/useCombobox.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAyB,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,2BAA2B,EAAC,MAAM,cAAc,CAAC;AACzD,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC5D,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAIH,MAAM,UAAU,uBAAuB,CAAC,EACtC,eAAe,EACf,QAAQ,EACR,aAAa,GACG;IAChB,OAAO,IAAI,CAAgE;QACzE,WAAW,EAAE;;;;;qCAKoB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;;yHAGqD,aAAa,CAAC,cAAc,EAAE;;6IAEV,aAAa,CAAC,cAAc,EAAE,SAAS;QAChL,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;YACvD,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;gBAE1D,2BAA2B,CAAC;oBAC1B,SAAS;oBACT,QAAQ;oBACR,aAAa;iBACd,CAAC,CAAC;gBAEH,MAAM,WAAW,GAA2B;oBAC1C,SAAS,EAAE,cAAuB;oBAClC,QAAQ;iBACT,CAAC;gBAEF,MAAM,QAAQ,CAAC;oBACb,SAAS;oBACT,OAAO;oBACP,MAAM,EAAE,WAAW;oBACnB,KAAK;iBACN,CAAC,CAAC;gBAEH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,wCAAwC;oBACjD,IAAI,EAAE,WAAW;iBAClB,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,YAAY,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBACrE,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport {ScatterPlotChartConfig, ScatterPlotChartSettings} from './schema';\nimport {BaseChartToolInput} from '../../../ai/tool-schemas';\nimport {NUMERIC_COLUMN_TYPES} from '../../../column-types-utils';\nimport {ChartToolParams, ChartToolOutput} from '../tool-types';\nimport {validateScatterPlotSettings} from './validation';\nimport {ensureTable} from '../../../ai/tool-helpers';\n\nexport const ScatterPlotToolInput = BaseChartToolInput.extend({\n settings: ScatterPlotChartSettings.required(),\n});\n\nexport type ScatterPlotToolInput = z.infer<typeof ScatterPlotToolInput>;\n\nexport function createScatterPlotAiTool({\n databaseAdapter,\n addChart,\n maxDataPoints,\n}: ChartToolParams) {\n return tool<ScatterPlotToolInput, ChartToolOutput<ScatterPlotChartConfig>>({\n description: `Scatter chart: plots individual points positioned by two numeric columns (x, y), with optional size dimension.\n\nUse when: user asks to \"plot X vs Y\", \"show relationship between\", \"scatter plot\", \"correlation\", \"compare two numeric columns\".\nExample queries: \"plot latitude vs longitude\", \"show correlation between elevation and temperature\", \"visualize coordinates sized by population\", \"plot area vs population density\".\n\nRequired: x and y must be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}).\nOptional: size can encode a third numeric dimension (magnitude, frequency, count).\n\nIMPORTANT: Scatter charts render ALL rows as individual points. Do NOT create scatter charts for tables with more than ${maxDataPoints.toLocaleString()} rows - use aggregated visualizations instead (histogram, count-plot, line-chart with time intervals, or heatmap).\n\nDo NOT use for: distributions (use histogram), categorical counts (use count-plot), trends over time (use line-chart), or large datasets (>${maxDataPoints.toLocaleString()} rows).`,\n inputSchema: ScatterPlotToolInput,\n execute: async ({tableName, title, settings, panelId}) => {\n try {\n const dataTable = ensureTable(databaseAdapter, tableName);\n\n validateScatterPlotSettings({\n dataTable,\n settings,\n maxDataPoints,\n });\n\n const chartConfig: ScatterPlotChartConfig = {\n chartType: 'scatter-plot' as const,\n settings,\n };\n\n await addChart({\n tableName,\n panelId,\n config: chartConfig,\n title,\n });\n\n return {\n success: true,\n details: `Generated scatter chart configuration.`,\n data: chartConfig,\n };\n } catch (error) {\n return {\n success: false,\n errorMessage: error instanceof Error ? error.message : String(error),\n };\n }\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScatterPlotChartSettings } from './schema';
|
|
2
|
+
import { ValidateSpecOptions } from '../base-types';
|
|
3
|
+
import { TableColumn } from '@sqlrooms/duckdb';
|
|
4
|
+
export type ValidatedScatterPlotSettings = {
|
|
5
|
+
xColumn: TableColumn;
|
|
6
|
+
yColumn: TableColumn;
|
|
7
|
+
sizeColumn?: TableColumn;
|
|
8
|
+
};
|
|
9
|
+
export type ValidateScatterPlotOptions = ValidateSpecOptions<ScatterPlotChartSettings> & {
|
|
10
|
+
maxDataPoints?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function validateScatterPlotSettings({ dataTable, settings: { x, y, size }, maxDataPoints, }: ValidateScatterPlotOptions): ValidatedScatterPlotSettings;
|
|
13
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAQlD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACpC,mBAAmB,CAAC,wBAAwB,CAAC,GAAG;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAC,EACtB,aAAa,GACd,EAAE,0BAA0B,GAAG,4BAA4B,CA6D3D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, TooMuchDataError, } from '../errors';
|
|
2
|
+
import { isNumericType } from '../../../column-types-utils';
|
|
3
|
+
export function validateScatterPlotSettings({ dataTable, settings: { x, y, size }, maxDataPoints, }) {
|
|
4
|
+
// Basic validation for required fields
|
|
5
|
+
if (!x || !y) {
|
|
6
|
+
throw new RequiredFieldsError([
|
|
7
|
+
...(x ? [] : ['X field']),
|
|
8
|
+
...(y ? [] : ['Y field']),
|
|
9
|
+
]);
|
|
10
|
+
}
|
|
11
|
+
// Validate row count to prevent browser crashes
|
|
12
|
+
if (maxDataPoints !== undefined && dataTable.rowCount !== undefined) {
|
|
13
|
+
if (dataTable.rowCount > maxDataPoints) {
|
|
14
|
+
throw new TooMuchDataError('scatter plot', dataTable.rowCount, maxDataPoints);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Validate X and Y field existence
|
|
18
|
+
const xColumn = dataTable.columns.find((col) => col.name === x);
|
|
19
|
+
const yColumn = dataTable.columns.find((col) => col.name === y);
|
|
20
|
+
if (!xColumn || !yColumn) {
|
|
21
|
+
throw new MissingColumnsError([
|
|
22
|
+
...(xColumn ? [] : [x]),
|
|
23
|
+
...(yColumn ? [] : [y]),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
// Validate X and Y field are numeric
|
|
27
|
+
const xIsNumeric = isNumericType(xColumn.type);
|
|
28
|
+
const yIsNumeric = isNumericType(yColumn.type);
|
|
29
|
+
if (!xIsNumeric || !yIsNumeric) {
|
|
30
|
+
throw new InvalidColumnTypeError([
|
|
31
|
+
...(!xIsNumeric ? [xColumn.name] : []),
|
|
32
|
+
...(!yIsNumeric ? [yColumn.name] : []),
|
|
33
|
+
], 'numeric');
|
|
34
|
+
}
|
|
35
|
+
// Validate size field if provided
|
|
36
|
+
let sizeColumn = undefined;
|
|
37
|
+
if (size) {
|
|
38
|
+
sizeColumn = dataTable.columns.find((col) => col.name === size);
|
|
39
|
+
if (!sizeColumn) {
|
|
40
|
+
throw new MissingColumnsError([size]);
|
|
41
|
+
}
|
|
42
|
+
if (!isNumericType(sizeColumn.type)) {
|
|
43
|
+
throw new InvalidColumnTypeError([sizeColumn.name], 'numeric');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
xColumn,
|
|
48
|
+
yColumn,
|
|
49
|
+
sizeColumn,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../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OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import {ScatterPlotChartSettings} from './schema';\nimport {ValidateSpecOptions} from '../base-types';\nimport {\n InvalidColumnTypeError,\n MissingColumnsError,\n RequiredFieldsError,\n TooMuchDataError,\n} from '../errors';\nimport {isNumericType} from '../../../column-types-utils';\nimport {TableColumn} from '@sqlrooms/duckdb';\n\nexport type ValidatedScatterPlotSettings = {\n xColumn: TableColumn;\n yColumn: TableColumn;\n sizeColumn?: TableColumn;\n};\n\nexport type ValidateScatterPlotOptions =\n ValidateSpecOptions<ScatterPlotChartSettings> & {\n maxDataPoints?: number;\n };\n\nexport function validateScatterPlotSettings({\n dataTable,\n settings: {x, y, size},\n maxDataPoints,\n}: ValidateScatterPlotOptions): ValidatedScatterPlotSettings {\n // Basic validation for required fields\n if (!x || !y) {\n throw new RequiredFieldsError([\n ...(x ? [] : ['X field']),\n ...(y ? [] : ['Y field']),\n ]);\n }\n\n // Validate row count to prevent browser crashes\n if (maxDataPoints !== undefined && dataTable.rowCount !== undefined) {\n if (dataTable.rowCount > maxDataPoints) {\n throw new TooMuchDataError(\n 'scatter plot',\n dataTable.rowCount,\n maxDataPoints,\n );\n }\n }\n\n // Validate X and Y field existence\n const xColumn = dataTable.columns.find((col) => col.name === x);\n const yColumn = dataTable.columns.find((col) => col.name === y);\n\n if (!xColumn || !yColumn) {\n throw new MissingColumnsError([\n ...(xColumn ? [] : [x]),\n ...(yColumn ? [] : [y]),\n ]);\n }\n\n // Validate X and Y field are numeric\n const xIsNumeric = isNumericType(xColumn.type);\n const yIsNumeric = isNumericType(yColumn.type);\n if (!xIsNumeric || !yIsNumeric) {\n throw new InvalidColumnTypeError(\n [\n ...(!xIsNumeric ? [xColumn.name] : []),\n ...(!yIsNumeric ? [yColumn.name] : []),\n ],\n 'numeric',\n );\n }\n\n // Validate size field if provided\n let sizeColumn = undefined;\n if (size) {\n sizeColumn = dataTable.columns.find((col) => col.name === size);\n if (!sizeColumn) {\n throw new MissingColumnsError([size]);\n }\n if (!isNumericType(sizeColumn.type)) {\n throw new InvalidColumnTypeError([sizeColumn.name], 'numeric');\n }\n }\n\n return {\n xColumn,\n yColumn,\n sizeColumn,\n };\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Tool } from 'ai';
|
|
2
|
+
import { DatabaseAiAdapter } from '../../ai/database-types';
|
|
3
|
+
import { ToolOutput } from '../../ai/tool-types';
|
|
4
|
+
export type ChartToolOutput<T> = ToolOutput<{
|
|
5
|
+
details: string;
|
|
6
|
+
data: T;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Arguments passed to chart panel creation and update callbacks.
|
|
10
|
+
*/
|
|
11
|
+
type AddChartFunctionArgs = {
|
|
12
|
+
/** Optional table name; worksheet charts require it, dashboard charts may inherit it. */
|
|
13
|
+
tableName?: string;
|
|
14
|
+
/** Optional existing dashboard panel ID to update instead of creating a new panel. */
|
|
15
|
+
panelId?: string;
|
|
16
|
+
/** Optional human-readable chart title. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Chart configuration generated by the chart tool. */
|
|
19
|
+
config: any;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Callback used by chart tools to add or update a rendered chart panel.
|
|
23
|
+
*/
|
|
24
|
+
export type AddChartFunction = (args: AddChartFunctionArgs) => string | Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Dependencies for chart configuration tools.
|
|
27
|
+
* Simple and minimal.
|
|
28
|
+
*/
|
|
29
|
+
export type ChartToolParams = {
|
|
30
|
+
/** Add chart to dashboard */
|
|
31
|
+
addChart: AddChartFunction;
|
|
32
|
+
/** Maximum data points for non-aggregated charts */
|
|
33
|
+
maxDataPoints: number;
|
|
34
|
+
/** Database adapter for resolving tables and columns. */
|
|
35
|
+
databaseAdapter: DatabaseAiAdapter;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Factory for creating chart configuration tools.
|
|
39
|
+
* Chart tools generate ChartConfig and use resolveTable for validation.
|
|
40
|
+
*/
|
|
41
|
+
export type ChartToolFactory<TInput, TOutput> = (params: ChartToolParams) => Tool<TInput, ChartToolOutput<TOutput>>;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=tool-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-types.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/tool-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,UAAU,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC,CAAC;AAEH;;GAEG;AACH,KAAK,oBAAoB,GAAG;IAC1B,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,GAAG,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,oBAAoB,KACvB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,6BAA6B;IAC7B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,eAAe,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,MAAM,EAAE,OAAO,IAAI,CAC9C,MAAM,EAAE,eAAe,KACpB,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-types.js","sourceRoot":"","sources":["../../../src/charts/chart-types/tool-types.ts"],"names":[],"mappings":"","sourcesContent":["import {Tool} from 'ai';\nimport {DatabaseAiAdapter} from '../../ai/database-types';\nimport {ToolOutput} from '../../ai/tool-types';\n\nexport type ChartToolOutput<T> = ToolOutput<{\n details: string;\n data: T;\n}>;\n\n/**\n * Arguments passed to chart panel creation and update callbacks.\n */\ntype AddChartFunctionArgs = {\n /** Optional table name; worksheet charts require it, dashboard charts may inherit it. */\n tableName?: string; // Optional: worksheet charts need it, dashboard charts inherit from dashboard.selectedTable\n /** Optional existing dashboard panel ID to update instead of creating a new panel. */\n panelId?: string;\n /** Optional human-readable chart title. */\n title?: string;\n /** Chart configuration generated by the chart tool. */\n config: any;\n};\n\n/**\n * Callback used by chart tools to add or update a rendered chart panel.\n */\nexport type AddChartFunction = (\n args: AddChartFunctionArgs,\n) => string | Promise<string>;\n\n/**\n * Dependencies for chart configuration tools.\n * Simple and minimal.\n */\nexport type ChartToolParams = {\n /** Add chart to dashboard */\n addChart: AddChartFunction;\n /** Maximum data points for non-aggregated charts */\n maxDataPoints: number;\n /** Database adapter for resolving tables and columns. */\n databaseAdapter: DatabaseAiAdapter;\n};\n\n/**\n * Factory for creating chart configuration tools.\n * Chart tools generate ChartConfig and use resolveTable for validation.\n */\nexport type ChartToolFactory<TInput, TOutput> = (\n params: ChartToolParams,\n) => Tool<TInput, ChartToolOutput<TOutput>>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAEjD,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,mBAAmB,CAAC,GAAG,CAAC,EACnC,cAAc,EAAE,MAAM,GACrB,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/charts/chart-types/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAC9B,SAAmC,EACnC,cAAsB;IAEtB,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;AAC/D,CAAC","sourcesContent":["import {ChartTypeDefinition} from './base-types';\n\nexport function getChartToolName(\n chartType: ChartTypeDefinition<any>,\n toolNamePrefix: string,\n): string {\n return `${toolNamePrefix}${chartType.id.replace(/-/g, '_')}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MosaicDashboardChartRenderer.d.ts","sourceRoot":"","sources":["../../../src/charts/dashboard/MosaicDashboardChartRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACL,KAAK,4BAA4B,EAIlC,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"MosaicDashboardChartRenderer.d.ts","sourceRoot":"","sources":["../../../src/charts/dashboard/MosaicDashboardChartRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACL,KAAK,4BAA4B,EAIlC,MAAM,sCAAsC,CAAC;AA6C9C,eAAO,MAAM,4BAA4B,EAAE,4BAA4B,CAAC,gBAAgB,CAKrF,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BarChart3Icon } from 'lucide-react';
|
|
3
|
-
import { useCallback } from 'react';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
4
|
import { MosaicDashboardChartHeaderActions } from './MosaicDashboardChartHeaderActions';
|
|
5
5
|
import { useStoreWithMosaicDashboard, getMosaicDashboardPanelId, } from '../../dashboard/MosaicDashboardSlice';
|
|
6
6
|
import { MosaicChart } from '../MosaicChart';
|
|
7
|
-
import {
|
|
7
|
+
import { useTablesWithColumns } from '../../hooks/useTablesWithColumns';
|
|
8
|
+
import { resolveMosaicTableReference } from '../../mosaicTableReference';
|
|
8
9
|
const MosaicDashboardChartRenderer = ({ panel, dashboardId, dashboard, selectionName, }) => {
|
|
9
10
|
const tableName = dashboard.selectedTable;
|
|
10
|
-
const
|
|
11
|
+
const tables = useTablesWithColumns();
|
|
12
|
+
const dataTable = useMemo(() => resolveMosaicTableReference(tables, tableName).table, [tableName, tables]);
|
|
11
13
|
const updatePanel = useStoreWithMosaicDashboard((state) => state.mosaicDashboard.updatePanel);
|
|
12
14
|
const runtimeKey = getMosaicDashboardPanelId(dashboardId, panel.id);
|
|
13
15
|
const handleConfigChange = useCallback((config) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MosaicDashboardChartRenderer.js","sourceRoot":"","sources":["../../../src/charts/dashboard/MosaicDashboardChartRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAU,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MosaicDashboardChartRenderer.js","sourceRoot":"","sources":["../../../src/charts/dashboard/MosaicDashboardChartRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAE,OAAO,EAAU,MAAM,OAAO,CAAC;AACpD,OAAO,EAAC,iCAAiC,EAAC,MAAM,qCAAqC,CAAC;AAEtF,OAAO,EAGL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,WAAW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,aAAa,EAAE,iCAAiC;IAChD,IAAI,EAAE,aAAa;CACpB,CAAC","sourcesContent":["import {BarChart3Icon} from 'lucide-react';\nimport {useCallback, useMemo, type FC} from 'react';\nimport {MosaicDashboardChartHeaderActions} from './MosaicDashboardChartHeaderActions';\nimport type {ChartPanelConfig} from '../../dashboard/dashboard-types';\nimport {\n type MosaicDashboardPanelRenderer,\n type ChartPanelRendererProps,\n useStoreWithMosaicDashboard,\n getMosaicDashboardPanelId,\n} from '../../dashboard/MosaicDashboardSlice';\nimport {ChartConfig} from '../chart-types/chart-config';\nimport {MosaicChart} from '../MosaicChart';\nimport {useTablesWithColumns} from '../../hooks/useTablesWithColumns';\nimport {resolveMosaicTableReference} from '../../mosaicTableReference';\n\nconst MosaicDashboardChartRenderer: FC<ChartPanelRendererProps> = ({\n panel,\n dashboardId,\n dashboard,\n selectionName,\n}) => {\n const tableName = dashboard.selectedTable;\n const tables = useTablesWithColumns();\n const dataTable = useMemo(\n () => resolveMosaicTableReference(tables, tableName).table,\n [tableName, tables],\n );\n\n const updatePanel = useStoreWithMosaicDashboard(\n (state) => state.mosaicDashboard.updatePanel,\n );\n\n const runtimeKey = getMosaicDashboardPanelId(dashboardId, panel.id);\n\n const handleConfigChange = useCallback(\n (config: ChartConfig) => {\n updatePanel(dashboardId, panel.id, {config});\n },\n [dashboardId, panel.id, updatePanel],\n );\n\n return (\n <MosaicChart\n dataTable={dataTable}\n selectionName={selectionName}\n config={panel.config}\n runtimeKey={runtimeKey}\n onConfigChange={handleConfigChange}\n dashboardId={dashboardId}\n panelId={panel.id}\n />\n );\n};\n\nexport const mosaicDashboardChartRenderer: MosaicDashboardPanelRenderer<ChartPanelConfig> =\n {\n component: MosaicDashboardChartRenderer,\n headerActions: MosaicDashboardChartHeaderActions,\n icon: BarChart3Icon,\n };\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { resolveChartDataPolicy } from '../chart-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { getChartTableReferenceString } from './chart-types/base-types';
|
|
4
4
|
import { useChartTypeDefinition } from './useChartTypeDefinition';
|
|
5
5
|
export function useChartDataPolicy(dataTable, config) {
|
|
6
6
|
const chartTypeDefinition = useChartTypeDefinition(config.chartType);
|
|
@@ -9,7 +9,7 @@ export function useChartDataPolicy(dataTable, config) {
|
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
const defaultPolicy = chartTypeDefinition.getDataPolicy({
|
|
12
|
-
tableName:
|
|
12
|
+
tableName: getChartTableReferenceString(dataTable),
|
|
13
13
|
config,
|
|
14
14
|
}) ?? null;
|
|
15
15
|
return resolveChartDataPolicy(defaultPolicy, config.dataPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChartDataPolicy.js","sourceRoot":"","sources":["../../src/charts/useChartDataPolicy.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useChartDataPolicy.js","sourceRoot":"","sources":["../../src/charts/useChartDataPolicy.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAC,4BAA4B,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAGhE,MAAM,UAAU,kBAAkB,CAChC,SAAgC,EAChC,MAAmB;IAEnB,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAErE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,CAAC,mBAAmB,EAAE,aAAa,IAAI,CAAC,SAAS,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,aAAa,GACjB,mBAAmB,CAAC,aAAa,CAAC;YAChC,SAAS,EAAE,4BAA4B,CAAC,SAAS,CAAC;YAClD,MAAM;SACP,CAAC,IAAI,IAAI,CAAC;QAEb,OAAO,sBAAsB,CAAC,aAAa,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAClE,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import {useMemo} from 'react';\nimport type {ChartDataPolicy} from '../chart-runtime';\nimport {resolveChartDataPolicy} from '../chart-runtime';\nimport type {ChartConfig} from './chart-types/chart-config';\nimport {getChartTableReferenceString} from './chart-types/base-types';\nimport {useChartTypeDefinition} from './useChartTypeDefinition';\nimport {DataTable} from '@sqlrooms/db';\n\nexport function useChartDataPolicy(\n dataTable: DataTable | undefined,\n config: ChartConfig,\n): ChartDataPolicy | null {\n const chartTypeDefinition = useChartTypeDefinition(config.chartType);\n\n return useMemo(() => {\n if (!chartTypeDefinition?.getDataPolicy || !dataTable) {\n return null;\n }\n\n const defaultPolicy =\n chartTypeDefinition.getDataPolicy({\n tableName: getChartTableReferenceString(dataTable),\n config,\n }) ?? null;\n\n return resolveChartDataPolicy(defaultPolicy, config.dataPolicy);\n }, [config, chartTypeDefinition, dataTable]);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationSelector.d.ts","sourceRoot":"","sources":["../../src/components/AggregationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AggregationSelector.d.ts","sourceRoot":"","sources":["../../src/components/AggregationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAE9B,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC9C;AASD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAoB5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationSelector.js","sourceRoot":"","sources":["../../src/components/AggregationSelector.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AggregationSelector.js","sourceRoot":"","sources":["../../src/components/AggregationSelector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAQtC,MAAM,mBAAmB,GAAG;IAC1B,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;CACpB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiC,CAAC,EAChE,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAE9E,OAAO,CACL,MAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,aACxC,KAAC,QAAQ,CAAC,OAAO,IAAC,SAAS,EAAC,uBAAuB,YACjD,yBAAO,cAAc,EAAE,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,GAAQ,GAC1C,EACnB,KAAC,QAAQ,CAAC,OAAO,cACd,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACnC,KAAC,QAAQ,CAAC,IAAI,IAAoB,KAAK,EAAE,MAAM,CAAC,KAAK,YACnD,eAAM,SAAS,EAAC,SAAS,YAAE,MAAM,CAAC,KAAK,GAAQ,IAD7B,MAAM,CAAC,KAAK,CAEhB,CACjB,CAAC,GACe,IACV,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {FC} from 'react';\nimport {Combobox} from '@sqlrooms/ui';\nimport type {AggregateFunction} from '../schemas';\n\nexport interface AggregationSelectorProps {\n value: AggregateFunction;\n onChange: (value: AggregateFunction) => void;\n}\n\nconst AGGREGATION_OPTIONS = [\n {value: 'sum', label: 'SUM'},\n {value: 'avg', label: 'AVG'},\n {value: 'min', label: 'MIN'},\n {value: 'max', label: 'MAX'},\n] as const;\n\n/**\n * Dropdown for selecting an aggregation function (SUM, AVG, MIN, MAX).\n */\nexport const AggregationSelector: FC<AggregationSelectorProps> = ({\n value,\n onChange,\n}) => {\n const selectedOption = AGGREGATION_OPTIONS.find((opt) => opt.value === value);\n\n return (\n <Combobox value={value} onChange={onChange}>\n <Combobox.Trigger className=\"w-[100px] shadow-none\">\n <span>{selectedOption?.label ?? value.toUpperCase()}</span>\n </Combobox.Trigger>\n <Combobox.Content>\n {AGGREGATION_OPTIONS.map((option) => (\n <Combobox.Item key={option.value} value={option.value}>\n <span className=\"text-xs\">{option.label}</span>\n </Combobox.Item>\n ))}\n </Combobox.Content>\n </Combobox>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSelector.d.ts","sourceRoot":"","sources":["../../src/components/ColorSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorSelector.d.ts","sourceRoot":"","sources":["../../src/components/ColorSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAoB9B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAsBhD,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Combobox } from '
|
|
3
|
-
import { cn } from '@sqlrooms/ui';
|
|
2
|
+
import { Combobox, cn } from '@sqlrooms/ui';
|
|
4
3
|
const ColorSelectorItem = ({ color, className }) => {
|
|
5
4
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn('h-4 w-4 rounded-full border border-gray-300', className), style: { backgroundColor: color } }), _jsx("span", { className: "sr-only", children: color })] }));
|
|
6
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSelector.js","sourceRoot":"","sources":["../../src/components/ColorSelector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"ColorSelector.js","sourceRoot":"","sources":["../../src/components/ColorSelector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAC,MAAM,cAAc,CAAC;AAO1C,MAAM,iBAAiB,GAA+B,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,EAAE,EAAE;IAC3E,OAAO,CACL,8BACE,cACE,SAAS,EAAE,EAAE,CAAC,6CAA6C,EAAE,SAAS,CAAC,EACvE,KAAK,EAAE,EAAC,eAAe,EAAE,KAAK,EAAC,GAC/B,EACF,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,IACvC,CACJ,CAAC;AACJ,CAAC,CAAC;AAQF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,KAAK,EACL,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,aACxC,KAAC,QAAQ,CAAC,OAAO,IACf,SAAS,EAAC,8CAA8C,EACxD,SAAS,EAAC,cAAc,YAExB,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,sBAAsB,GAAG,GACnD,EACnB,KAAC,QAAQ,CAAC,OAAO,cACd,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACpB,KAAC,QAAQ,CAAC,IAAI,IAAa,KAAK,EAAE,KAAK,YACrC,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,GAAI,IADjB,KAAK,CAET,CACjB,CAAC,GACe,IACV,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {FC} from 'react';\nimport {Combobox, cn} from '@sqlrooms/ui';\n\ntype ColorSelectorItemProps = {\n color: string;\n className?: string;\n};\n\nconst ColorSelectorItem: FC<ColorSelectorItemProps> = ({color, className}) => {\n return (\n <>\n <div\n className={cn('h-4 w-4 rounded-full border border-gray-300', className)}\n style={{backgroundColor: color}}\n />\n <span className=\"sr-only\">{color}</span>\n </>\n );\n};\n\nexport type ColorSelectorProps = {\n value: string;\n items: readonly string[];\n onChange: (color: string) => void;\n};\n\n/**\n * Dropdown for selecting a color from the chart color palette.\n * Displays colors as circular indicators.\n */\nexport const ColorSelector: FC<ColorSelectorProps> = ({\n value,\n items,\n onChange,\n}) => {\n return (\n <Combobox value={value} onChange={onChange}>\n <Combobox.Trigger\n className=\"w-auto gap-1.5 px-2 shadow-none [&>svg]:ml-0\"\n ariaLabel=\"Select color\"\n >\n <ColorSelectorItem color={value} className=\"h-3.5 w-3.5 shrink-0\" />\n </Combobox.Trigger>\n <Combobox.Content>\n {items.map((color) => (\n <Combobox.Item key={color} value={color}>\n <ColorSelectorItem color={color} />\n </Combobox.Item>\n ))}\n </Combobox.Content>\n </Combobox>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldSelectorInput.d.ts","sourceRoot":"","sources":["../../src/components/FieldSelectorInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldSelectorInput.d.ts","sourceRoot":"","sources":["../../src/components/FieldSelectorInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAG1C,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+DhE,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Combobox } from '
|
|
3
|
-
import { cn } from '@sqlrooms/ui';
|
|
2
|
+
import { Combobox, cn } from '@sqlrooms/ui';
|
|
4
3
|
/**
|
|
5
4
|
* A searchable dropdown selector for choosing a table column for a chart builder field.
|
|
6
5
|
*/
|
|
@@ -9,6 +8,7 @@ export const FieldSelectorInput = ({ field, columns, value, onChange, className,
|
|
|
9
8
|
? columns.filter((col) => field.types.some((t) => col.type.toUpperCase() === t.toUpperCase()))
|
|
10
9
|
: columns;
|
|
11
10
|
const selectedColumn = filteredColumns.find((col) => col.name === value);
|
|
12
|
-
|
|
11
|
+
const isMissing = Boolean(value && !selectedColumn);
|
|
12
|
+
return (_jsx("div", { className: cn('@container flex flex-col gap-1', className), children: _jsxs(Combobox, { value: value ?? '', onChange: onChange, children: [_jsx(Combobox.Trigger, { className: cn('w-full', isMissing && 'border-destructive/60 bg-destructive/5'), children: selectedColumn ? (_jsxs("span", { className: "flex min-w-0 items-baseline gap-1", children: [_jsx("span", { className: "truncate text-xs", children: selectedColumn.name }), _jsx("span", { className: "text-muted-foreground hidden overflow-hidden text-[8px] whitespace-nowrap @[180px]:inline", children: selectedColumn.type })] })) : value ? (_jsxs("span", { className: "flex min-w-0 items-baseline gap-1", children: [_jsx("span", { className: "text-destructive truncate text-xs", children: value }), _jsx("span", { className: "text-destructive/60 hidden text-[8px] @[180px]:inline", children: "missing" })] })) : (_jsx("span", { className: "text-muted-foreground truncate text-xs", children: placeholder })) }), _jsx(Combobox.Content, { searchable: true, searchPlaceholder: "Search columns...", emptyMessage: "No matching column.", children: filteredColumns.map((col) => (_jsxs(Combobox.Item, { value: col.name, children: [_jsx("span", { className: "truncate text-xs", children: col.name }), _jsx("span", { className: "text-muted-foreground ml-auto text-[8px]", children: col.type })] }, col.name))) })] }) }));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=FieldSelectorInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldSelectorInput.js","sourceRoot":"","sources":["../../src/components/FieldSelectorInput.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"FieldSelectorInput.js","sourceRoot":"","sources":["../../src/components/FieldSelectorInput.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAC,MAAM,cAAc,CAAC;AAW1C;;GAEG;A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AuD,wBAEhE,IACF,CACR,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,wCAAwC,YACrD,WAAW,GACP,CACR,GACgB,EACnB,KAAC,QAAQ,CAAC,OAAO,IACf,UAAU,QACV,iBAAiB,EAAC,mBAAmB,EACrC,YAAY,EAAC,qBAAqB,YAEjC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC5B,MAAC,QAAQ,CAAC,IAAI,IAAgB,KAAK,EAAE,GAAG,CAAC,IAAI,aAC3C,eAAM,SAAS,EAAC,kBAAkB,YAAE,GAAG,CAAC,IAAI,GAAQ,EACpD,eAAM,SAAS,EAAC,0CAA0C,YACvD,GAAG,CAAC,IAAI,GACJ,KAJW,GAAG,CAAC,IAAI,CAKZ,CACjB,CAAC,GACe,IACV,GACP,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport {\n ChartBuilderColumn,\n ChartBuilderField,\n} from '../charts/chart-types/base-types';\nimport {Combobox, cn} from '@sqlrooms/ui';\n\nexport interface FieldSelectorInputProps {\n field: ChartBuilderField;\n columns: ChartBuilderColumn[];\n value: string | undefined;\n onChange: (value: string) => void;\n placeholder?: string;\n className?: string;\n}\n\n/**\n * A searchable dropdown selector for choosing a table column for a chart builder field.\n */\nexport const FieldSelectorInput: React.FC<FieldSelectorInputProps> = ({\n field,\n columns,\n value,\n onChange,\n className,\n placeholder = 'Select...',\n}) => {\n const filteredColumns = field.types\n ? columns.filter((col) =>\n field.types!.some((t) => col.type.toUpperCase() === t.toUpperCase()),\n )\n : columns;\n\n const selectedColumn = filteredColumns.find((col) => col.name === value);\n const isMissing = Boolean(value && !selectedColumn);\n\n return (\n <div className={cn('@container flex flex-col gap-1', className)}>\n <Combobox value={value ?? ''} onChange={onChange}>\n <Combobox.Trigger\n className={cn(\n 'w-full',\n isMissing && 'border-destructive/60 bg-destructive/5',\n )}\n >\n {selectedColumn ? (\n <span className=\"flex min-w-0 items-baseline gap-1\">\n <span className=\"truncate text-xs\">{selectedColumn.name}</span>\n <span className=\"text-muted-foreground hidden overflow-hidden text-[8px] whitespace-nowrap @[180px]:inline\">\n {selectedColumn.type}\n </span>\n </span>\n ) : value ? (\n <span className=\"flex min-w-0 items-baseline gap-1\">\n <span className=\"text-destructive truncate text-xs\">{value}</span>\n <span className=\"text-destructive/60 hidden text-[8px] @[180px]:inline\">\n missing\n </span>\n </span>\n ) : (\n <span className=\"text-muted-foreground truncate text-xs\">\n {placeholder}\n </span>\n )}\n </Combobox.Trigger>\n <Combobox.Content\n searchable\n searchPlaceholder=\"Search columns...\"\n emptyMessage=\"No matching column.\"\n >\n {filteredColumns.map((col) => (\n <Combobox.Item key={col.name} value={col.name}>\n <span className=\"truncate text-xs\">{col.name}</span>\n <span className=\"text-muted-foreground ml-auto text-[8px]\">\n {col.type}\n </span>\n </Combobox.Item>\n ))}\n </Combobox.Content>\n </Combobox>\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemporalGranularitySelector.d.ts","sourceRoot":"","sources":["../../src/components/TemporalGranularitySelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TemporalGranularitySelector.d.ts","sourceRoot":"","sources":["../../src/components/TemporalGranularitySelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAoB,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD,UAAU,gCAAgC;IACxC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAsBD,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,gCAAgC,CAkDzE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
|
+
import { Combobox } from '@sqlrooms/ui';
|
|
3
4
|
import { TEMPORAL_COLUMN_TYPES } from '../column-types-utils';
|
|
4
|
-
import { Combobox } from './Combobox';
|
|
5
5
|
const TEMPORAL_INTERVALS = [
|
|
6
6
|
{ value: 'year', label: 'Year' },
|
|
7
7
|
{ value: 'quarter', label: 'Quarter' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemporalGranularitySelector.js","sourceRoot":"","sources":["../../src/components/TemporalGranularitySelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAU,IAAI,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"TemporalGranularitySelector.js","sourceRoot":"","sources":["../../src/components/TemporalGranularitySelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAU,IAAI,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AAS5D,MAAM,kBAAkB,GAAG;IACzB,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC;IAC9B,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC;IACpC,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAC;IAChC,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC;IAC9B,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC;IAC9B,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,Q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AC,aAAa,YACvC,yBAAO,YAAY,GAAQ,GACV,EACnB,MAAC,QAAQ,CAAC,OAAO,eACf,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,IAAI,YACxB,eAAM,SAAS,EAAC,SAAS,qBAAY,GACvB,EACf,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACpC,KAAC,QAAQ,CAAC,IAAI,IAEZ,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,UAAU,EAAE,KAAK,KAAK,QAAQ,CAAC,KAAK,YAEpC,eAAM,SAAS,EAAC,SAAS,YAAE,QAAQ,CAAC,KAAK,GAAQ,IAJ5C,QAAQ,CAAC,KAAK,CAKL,CACjB,CAAC,IACe,IACV,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,2BAA2B,CAAC,WAAW,GAAG,6BAA6B,CAAC","sourcesContent":["import {type FC, memo, useCallback} from 'react';\nimport {Combobox} from '@sqlrooms/ui';\nimport {TEMPORAL_COLUMN_TYPES} from '../column-types-utils';\nimport type {TemporalInterval} from '../schemas';\n\ninterface TemporalGranularitySelectorProps {\n value?: TemporalInterval;\n onChange: (value?: TemporalInterval) => void;\n xFieldType?: string;\n}\n\nconst TEMPORAL_INTERVALS = [\n {value: 'year', label: 'Year'},\n {value: 'quarter', label: 'Quarter'},\n {value: 'month', label: 'Month'},\n {value: 'week', label: 'Week'},\n {value: 'day', label: 'Day'},\n {value: 'hour', label: 'Hour'},\n {value: 'minute', label: 'Minute'},\n {value: 'second', label: 'Second'},\n] as const;\n\nconst NONE = 'none';\n\nfunction isTemporalField(fieldType?: string): boolean {\n if (!fieldType) return false;\n return TEMPORAL_COLUMN_TYPES.some(\n (type) => fieldType.toUpperCase() === type.toUpperCase(),\n );\n}\n\nexport const TemporalGranularitySelector: FC<TemporalGranularitySelectorProps> =\n memo(({value, onChange, xFieldType}) => {\n // Custom onChange wrapper to handle undefined values\n const handleChange = useCallback(\n (newValue: string) => {\n if (newValue === NONE) {\n onChange(undefined);\n } else {\n onChange(newValue as TemporalInterval);\n }\n },\n [onChange],\n );\n\n // Only render if X field is temporal\n if (!isTemporalField(xFieldType)) {\n return null;\n }\n\n const selectedInterval = TEMPORAL_INTERVALS.find(\n (interval) => interval.value === value,\n );\n const displayValue = selectedInterval?.label ?? 'None';\n const currentValue = value || NONE;\n\n return (\n <Combobox\n value={currentValue}\n onChange={handleChange}\n currentValue={currentValue}\n >\n <Combobox.Trigger className=\"shadow-none\">\n <span>{displayValue}</span>\n </Combobox.Trigger>\n <Combobox.Content>\n <Combobox.Item value={NONE}>\n <span className=\"text-xs\">None</span>\n </Combobox.Item>\n {TEMPORAL_INTERVALS.map((interval) => (\n <Combobox.Item\n key={interval.value}\n value={interval.value}\n isSelected={value === interval.value}\n >\n <span className=\"text-xs\">{interval.label}</span>\n </Combobox.Item>\n ))}\n </Combobox.Content>\n </Combobox>\n );\n });\n\nTemporalGranularitySelector.displayName = 'TemporalGranularitySelector';\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BaseRoomStoreState, RoomCommand } from '@sqlrooms/room-store';
|
|
2
|
+
import type { MosaicDashboardSliceState } from './MosaicDashboardSlice';
|
|
3
|
+
export declare const MOSAIC_DASHBOARD_COMMAND_IDS: {
|
|
4
|
+
readonly setSelectedTable: "dashboard.set-selected-table";
|
|
5
|
+
readonly addPanel: "dashboard.add-panel";
|
|
6
|
+
readonly updatePanel: "dashboard.update-panel";
|
|
7
|
+
readonly removePanel: "dashboard.remove-panel";
|
|
8
|
+
};
|
|
9
|
+
type DashboardCommandState = BaseRoomStoreState & MosaicDashboardSliceState;
|
|
10
|
+
/**
|
|
11
|
+
* Create reusable Mosaic dashboard commands for selected table and panel
|
|
12
|
+
* mutations.
|
|
13
|
+
*
|
|
14
|
+
* These commands delegate to the dashboard slice so UI code, agents, and
|
|
15
|
+
* future automation share the same persistence behavior.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createMosaicDashboardCommands<TRoomState extends DashboardCommandState = DashboardCommandState>(): RoomCommand<TRoomState>[];
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=MosaicDashboardCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MosaicDashboardCommands.d.ts","sourceRoot":"","sources":["../../src/dashboard/MosaicDashboardCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAc1E,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAEtE,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC;AA8BX,KAAK,qBAAqB,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAyC5E;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,SAAS,qBAAqB,GAAG,qBAAqB,KAC7D,WAAW,CAAC,UAAU,CAAC,EAAE,CAyK7B"}
|