@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/line-chart/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAOlD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGrE,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,WAAW,CAAC;QACpB,SAAS,EAAE,iBAAiB,CAAC;QAC7B,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,OAAY,EAAE,SAAS,EAAC,GACvC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,0BAA0B,CAgDrE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, } from '../errors';
|
|
2
|
+
import { isNumericType, isQuantitativeType } from '../../../column-types-utils';
|
|
3
|
+
import { DEFAULT_CHART_FALLBACK_COLOR } from '../../../constants/chart-colors';
|
|
4
|
+
export function validateLineChartSettings({ dataTable, settings: { x, yFields = [], xInterval }, }) {
|
|
5
|
+
// Basic validation for required fields
|
|
6
|
+
if (!x || yFields.length === 0) {
|
|
7
|
+
throw new RequiredFieldsError([
|
|
8
|
+
...(x ? [] : ['X-axis']),
|
|
9
|
+
...(yFields.length > 0 ? [] : ['Y-axis']),
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
12
|
+
// Validate X and Y field existence
|
|
13
|
+
const xColumn = dataTable.columns.find((col) => col.name === x);
|
|
14
|
+
const yColumns = yFields.map((y) => ({
|
|
15
|
+
field: y.field,
|
|
16
|
+
column: dataTable.columns.find((col) => col.name === y.field),
|
|
17
|
+
aggregate: y.aggregate ?? 'sum',
|
|
18
|
+
color: y.color ?? DEFAULT_CHART_FALLBACK_COLOR,
|
|
19
|
+
}));
|
|
20
|
+
const missingYColumns = yColumns.filter((y) => !y.column);
|
|
21
|
+
if (!xColumn || missingYColumns.length > 0) {
|
|
22
|
+
throw new MissingColumnsError([
|
|
23
|
+
...(xColumn ? [] : ['X-axis']),
|
|
24
|
+
...missingYColumns.map((y) => y.field),
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
// Validate X and Y field types
|
|
28
|
+
if (!isQuantitativeType(xColumn.type)) {
|
|
29
|
+
throw new InvalidColumnTypeError(xColumn.name, 'quantitative');
|
|
30
|
+
}
|
|
31
|
+
const invalidYFields = yColumns.filter((y) => {
|
|
32
|
+
return y.column && !isNumericType(y.column.type);
|
|
33
|
+
});
|
|
34
|
+
if (invalidYFields.length > 0) {
|
|
35
|
+
throw new InvalidColumnTypeError(invalidYFields.map(({ field }) => field), 'numeric');
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
xColumn,
|
|
39
|
+
yColumns,
|
|
40
|
+
xInterval,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/line-chart/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAC,4BAA4B,EAAC,MAAM,iCAAiC,CAAC;AAa7E,MAAM,UAAU,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,OAAO,GAAG,EAAE,EAAE,SAAS,EAAC,GACC;IACvC,uCAAuC;IACvC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACxB,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC;QAC7D,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,KAAK;QAC/B,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,4BAA4B;KAC/C,CAAC,CAAC,CAAC;IAEJ,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAE1D,IAAI,CAAC,OAAO,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC9B,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;IAED,+BAA+B;IAC/B,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3C,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,sBAAsB,CAC9B,cAAc,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EACtC,SAAS,CACV,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,QAAQ;QACR,SAAS;KACoB,CAAC;AAClC,CAAC","sourcesContent":["import {LineChartSettings} from './schema';\nimport {ValidateSpecOptions} from '../base-types';\nimport {\n InvalidColumnTypeError,\n MissingColumnsError,\n RequiredFieldsError,\n} from '../errors';\nimport {isNumericType, isQuantitativeType} from '../../../column-types-utils';\nimport {TableColumn} from '@sqlrooms/duckdb';\nimport {AggregateFunction, TemporalInterval} from '../../../schemas';\nimport {DEFAULT_CHART_FALLBACK_COLOR} from '../../../constants/chart-colors';\n\nexport type ValidatedLineChartSettings = {\n xColumn: TableColumn;\n yColumns: {\n field: string;\n column: TableColumn;\n aggregate: AggregateFunction;\n color: string;\n }[];\n xInterval?: TemporalInterval;\n};\n\nexport function validateLineChartSettings({\n dataTable,\n settings: {x, yFields = [], xInterval},\n}: ValidateSpecOptions<LineChartSettings>): ValidatedLineChartSettings {\n // Basic validation for required fields\n if (!x || yFields.length === 0) {\n throw new RequiredFieldsError([\n ...(x ? [] : ['X-axis']),\n ...(yFields.length > 0 ? [] : ['Y-axis']),\n ]);\n }\n\n // Validate X and Y field existence\n const xColumn = dataTable.columns.find((col) => col.name === x);\n const yColumns = yFields.map((y) => ({\n field: y.field,\n column: dataTable.columns.find((col) => col.name === y.field),\n aggregate: y.aggregate ?? 'sum',\n color: y.color ?? DEFAULT_CHART_FALLBACK_COLOR,\n }));\n\n const missingYColumns = yColumns.filter((y) => !y.column);\n\n if (!xColumn || missingYColumns.length > 0) {\n throw new MissingColumnsError([\n ...(xColumn ? [] : ['X-axis']),\n ...missingYColumns.map((y) => y.field),\n ]);\n }\n\n // Validate X and Y field types\n if (!isQuantitativeType(xColumn.type)) {\n throw new InvalidColumnTypeError(xColumn.name, 'quantitative');\n }\n\n const invalidYFields = yColumns.filter((y) => {\n return y.column && !isNumericType(y.column.type);\n });\n\n if (invalidYFields.length > 0) {\n throw new InvalidColumnTypeError(\n invalidYFields.map(({field}) => field),\n 'numeric',\n );\n }\n\n return {\n xColumn,\n yColumns,\n xInterval,\n } as ValidatedLineChartSettings;\n}\n"]}
|
|
@@ -7,6 +7,7 @@ export declare const mosaicChartTypes: {
|
|
|
7
7
|
settings: {
|
|
8
8
|
field?: string | undefined;
|
|
9
9
|
maxBins?: number | undefined;
|
|
10
|
+
color?: string | undefined;
|
|
10
11
|
};
|
|
11
12
|
settingsOpen?: boolean | undefined;
|
|
12
13
|
dataPolicy?: {
|
|
@@ -30,6 +31,7 @@ export declare const mosaicChartTypes: {
|
|
|
30
31
|
readonly lineChart: import("./base-types").SpecChartTypeDefinition<{
|
|
31
32
|
chartType: "line-chart";
|
|
32
33
|
settings: {
|
|
34
|
+
showLegend: boolean;
|
|
33
35
|
x?: string | undefined;
|
|
34
36
|
xInterval?: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | undefined;
|
|
35
37
|
yFields?: {
|
|
@@ -71,8 +73,8 @@ export declare const mosaicChartTypes: {
|
|
|
71
73
|
reason?: string | undefined;
|
|
72
74
|
} | undefined;
|
|
73
75
|
}>;
|
|
74
|
-
readonly
|
|
75
|
-
chartType: "
|
|
76
|
+
readonly scatterPlot: import("./base-types").SpecChartTypeDefinition<{
|
|
77
|
+
chartType: "scatter-plot";
|
|
76
78
|
settings: {
|
|
77
79
|
x?: string | undefined;
|
|
78
80
|
y?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mosaicChartTypes.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/mosaicChartTypes.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"mosaicChartTypes.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/mosaicChartTypes.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { lineChartChartType } from './line-chart/definition';
|
|
|
3
3
|
import { countPlotChartType } from './count-plot/definition';
|
|
4
4
|
import { heatmapChartType } from './heatmap/definition';
|
|
5
5
|
import { boxPlotChartType } from './box-plot/definition';
|
|
6
|
-
import {
|
|
6
|
+
import { scatterPlotChartType } from './scatter-plot/definition';
|
|
7
7
|
import { customSpecChartType } from './custom-spec/definition';
|
|
8
8
|
/**
|
|
9
9
|
* Legacy compatibility exports for all available chart types.
|
|
@@ -14,7 +14,7 @@ export const mosaicChartTypes = {
|
|
|
14
14
|
lineChart: lineChartChartType,
|
|
15
15
|
heatmap: heatmapChartType,
|
|
16
16
|
boxPlot: boxPlotChartType,
|
|
17
|
-
|
|
17
|
+
scatterPlot: scatterPlotChartType,
|
|
18
18
|
customSpec: customSpecChartType,
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=mosaicChartTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mosaicChartTypes.js","sourceRoot":"","sources":["../../../src/charts/chart-types/mosaicChartTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;IAC7B,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,oBAAoB;IACjC,UAAU,EAAE,mBAAmB;CACvB,CAAC","sourcesContent":["import {histogramChartType} from './histogram/definition';\nimport {lineChartChartType} from './line-chart/definition';\nimport {countPlotChartType} from './count-plot/definition';\nimport {heatmapChartType} from './heatmap/definition';\nimport {boxPlotChartType} from './box-plot/definition';\nimport {
|
|
1
|
+
{"version":3,"file":"mosaicChartTypes.js","sourceRoot":"","sources":["../../../src/charts/chart-types/mosaicChartTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,kBAAkB;IAC7B,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,oBAAoB;IACjC,UAAU,EAAE,mBAAmB;CACvB,CAAC","sourcesContent":["import {histogramChartType} from './histogram/definition';\nimport {lineChartChartType} from './line-chart/definition';\nimport {countPlotChartType} from './count-plot/definition';\nimport {heatmapChartType} from './heatmap/definition';\nimport {boxPlotChartType} from './box-plot/definition';\nimport {scatterPlotChartType} from './scatter-plot/definition';\nimport {customSpecChartType} from './custom-spec/definition';\n\n/**\n * Legacy compatibility exports for all available chart types.\n */\nexport const mosaicChartTypes = {\n histogram: histogramChartType,\n countPlot: countPlotChartType,\n lineChart: lineChartChartType,\n heatmap: heatmapChartType,\n boxPlot: boxPlotChartType,\n scatterPlot: scatterPlotChartType,\n customSpec: customSpecChartType,\n} as const;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveChartTypes.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/resolveChartTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAGjD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,GACjD,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAM5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createDefaultChartTypes } from './createDefaultChartTypes';
|
|
2
|
+
export function resolveChartTypes(chartTypes) {
|
|
3
|
+
if (chartTypes === undefined) {
|
|
4
|
+
return createDefaultChartTypes({ includeCustomSpec: false });
|
|
5
|
+
}
|
|
6
|
+
return chartTypes;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=resolveChartTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveChartTypes.js","sourceRoot":"","sources":["../../../src/charts/chart-types/resolveChartTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,MAAM,UAAU,iBAAiB,CAC/B,UAAkD;IAElD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,uBAAuB,CAAC,EAAC,iBAAiB,EAAE,KAAK,EAAC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import {ChartTypeDefinition} from './base-types';\nimport {createDefaultChartTypes} from './createDefaultChartTypes';\n\nexport function resolveChartTypes(\n chartTypes: ChartTypeDefinition<any>[] | undefined,\n): ChartTypeDefinition<any>[] {\n if (chartTypes === undefined) {\n return createDefaultChartTypes({includeCustomSpec: false});\n }\n\n return chartTypes;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScatterPlotSettings.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/ScatterPlotSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAK9B,eAAO,MAAM,4BAA4B,EAAE,EA6B1C,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Field } from '../../../components/Field';
|
|
3
3
|
import { ColumnSelector } from '../../../components/ColumnSelector';
|
|
4
4
|
import { useMosaicChartSettingsContext } from '../../chart-settings/MosaicChartSettingsContext';
|
|
5
|
-
export const
|
|
6
|
-
const { onChangeConfig, config } = useMosaicChartSettingsContext('
|
|
7
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Field, { label: "X Field", required: true, children: _jsx(ColumnSelector.Numeric, { value: config.settings.x, onChange: (x) => onChangeConfig('x', x) }) }), _jsx(Field, { label: "Y Field", required: true, children: _jsx(ColumnSelector.Numeric, { value: config.settings.y, onChange: (y) => onChangeConfig('y', y) }) })] }));
|
|
5
|
+
export const ScatterPlotSettingsComponent = () => {
|
|
6
|
+
const { onChangeConfig, config } = useMosaicChartSettingsContext('scatter-plot');
|
|
7
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Field, { label: "X Field", required: true, children: _jsx(ColumnSelector.Numeric, { value: config.settings.x, onChange: (x) => onChangeConfig('x', x) }) }), _jsx(Field, { label: "Y Field", required: true, children: _jsx(ColumnSelector.Numeric, { value: config.settings.y, onChange: (y) => onChangeConfig('y', y) }) }), _jsx(Field, { label: "Size Field", children: _jsx(ColumnSelector.Numeric, { value: config.settings.size, onChange: (size) => onChangeConfig('size', size), placeholder: "(optional)" }) })] }));
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=ScatterPlotSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScatterPlotSettings.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/ScatterPlotSettings.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAC,6BAA6B,EAAC,MAAM,iDAAiD,CAAC;AAE9F,MAAM,CAAC,MAAM,4BAA4B,GAAO,GAAG,EAAE;IACnD,MAAM,EAAC,cAAc,EAAE,MAAM,EAAC,GAC5B,6BAA6B,CAAC,cAAc,CAAC,CAAC;IAEhD,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,KAAK,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,kBAC7B,KAAC,cAAc,CAAC,OAAO,IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GACvC,GACI,EAER,KAAC,KAAK,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,kBAC7B,KAAC,cAAc,CAAC,OAAO,IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GACvC,GACI,EAER,KAAC,KAAK,IAAC,KAAK,EAAC,YAAY,YACvB,KAAC,cAAc,CAAC,OAAO,IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAChD,WAAW,EAAC,YAAY,GACxB,GACI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {type FC} from 'react';\nimport {Field} from '../../../components/Field';\nimport {ColumnSelector} from '../../../components/ColumnSelector';\nimport {useMosaicChartSettingsContext} from '../../chart-settings/MosaicChartSettingsContext';\n\nexport const ScatterPlotSettingsComponent: FC = () => {\n const {onChangeConfig, config} =\n useMosaicChartSettingsContext('scatter-plot');\n\n return (\n <div className=\"space-y-4\">\n <Field label=\"X Field\" required>\n <ColumnSelector.Numeric\n value={config.settings.x}\n onChange={(x) => onChangeConfig('x', x)}\n />\n </Field>\n\n <Field label=\"Y Field\" required>\n <ColumnSelector.Numeric\n value={config.settings.y}\n onChange={(y) => onChangeConfig('y', y)}\n />\n </Field>\n\n <Field label=\"Size Field\">\n <ColumnSelector.Numeric\n value={config.settings.size}\n onChange={(size) => onChangeConfig('size', size)}\n placeholder=\"(optional)\"\n />\n </Field>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,sBAAsB,EAA2B,MAAM,UAAU,CAAC;AAU1E,eAAO,MAAM,oBAAoB,EAAE,uBAAuB,CAAC,sBAAsB,CAiB9E,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ScatterPlotChartSettings } from './schema';
|
|
2
|
+
import { titleFromDescription } from '../../../chart-builders/chartTypeUtils';
|
|
3
|
+
import { ScatterPlotSettingsComponent } from './ScatterPlotSettings';
|
|
4
|
+
import { createScatterPlotAiTool } from './tool';
|
|
5
|
+
import { Workflow } from 'lucide-react';
|
|
6
|
+
import { createScatterPlotSpec } from './spec';
|
|
7
|
+
import { DEFAULT_CHART_MAX_DATA_POINTS } from '../../../chart-runtime';
|
|
8
|
+
const DESCRIPTION = 'Create a scatter plot chart';
|
|
9
|
+
export const scatterPlotChartType = {
|
|
10
|
+
id: 'scatter-plot',
|
|
11
|
+
label: 'Scatter Plot',
|
|
12
|
+
description: DESCRIPTION,
|
|
13
|
+
aiDescription: `${DESCRIPTION} - relationship between two numeric columns (avoid for >10k rows, use heatmap instead)`,
|
|
14
|
+
icon: Workflow,
|
|
15
|
+
schema: ScatterPlotChartSettings,
|
|
16
|
+
settingsComponent: ScatterPlotSettingsComponent,
|
|
17
|
+
buildTitle: titleFromDescription(DESCRIPTION),
|
|
18
|
+
createTool: createScatterPlotAiTool,
|
|
19
|
+
getDataPolicy: () => ({
|
|
20
|
+
maxRows: DEFAULT_CHART_MAX_DATA_POINTS,
|
|
21
|
+
reason: 'Scatter charts render one point per row. Use a heatmap or another aggregated chart for larger datasets.',
|
|
22
|
+
}),
|
|
23
|
+
createSpec: createScatterPlotSpec,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,4BAA4B,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,uBAAuB,EAAC,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAC/B;IACE,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,GAAG,WAAW,wFAAwF;IACrH,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,wBAAwB;IAChC,iBAAiB,EAAE,4BAA4B;IAC/C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,uBAAuB;IACnC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,OAAO,EAAE,6BAA6B;QACtC,MAAM,EACJ,yGAAyG;KAC5G,CAAC;IACF,UAAU,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {ScatterPlotChartConfig, ScatterPlotChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {ScatterPlotSettingsComponent} from './ScatterPlotSettings';\nimport {createScatterPlotAiTool} from './tool';\nimport {Workflow} from 'lucide-react';\nimport {createScatterPlotSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../../chart-runtime';\n\nconst DESCRIPTION = 'Create a scatter plot chart';\n\nexport const scatterPlotChartType: SpecChartTypeDefinition<ScatterPlotChartConfig> =\n {\n id: 'scatter-plot',\n label: 'Scatter Plot',\n description: DESCRIPTION,\n aiDescription: `${DESCRIPTION} - relationship between two numeric columns (avoid for >10k rows, use heatmap instead)`,\n icon: Workflow,\n schema: ScatterPlotChartSettings,\n settingsComponent: ScatterPlotSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createScatterPlotAiTool,\n getDataPolicy: () => ({\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Scatter charts render one point per row. Use a heatmap or another aggregated chart for larger datasets.',\n }),\n createSpec: createScatterPlotSpec,\n };\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ScatterPlotChartSettings: z.ZodObject<{
|
|
3
3
|
x: z.ZodOptional<z.ZodString>;
|
|
4
4
|
y: z.ZodOptional<z.ZodString>;
|
|
5
5
|
size: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
|
-
export type
|
|
8
|
-
export declare const
|
|
9
|
-
chartType: z.ZodLiteral<"
|
|
7
|
+
export type ScatterPlotChartSettings = z.infer<typeof ScatterPlotChartSettings>;
|
|
8
|
+
export declare const ScatterPlotChartConfig: z.ZodObject<{
|
|
9
|
+
chartType: z.ZodLiteral<"scatter-plot">;
|
|
10
10
|
settings: z.ZodObject<{
|
|
11
11
|
x: z.ZodOptional<z.ZodString>;
|
|
12
12
|
y: z.ZodOptional<z.ZodString>;
|
|
@@ -19,5 +19,5 @@ export declare const BubbleChartConfig: z.ZodObject<{
|
|
|
19
19
|
reason: z.ZodOptional<z.ZodString>;
|
|
20
20
|
}, z.core.$strip>>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
export type
|
|
22
|
+
export type ScatterPlotChartConfig = z.infer<typeof ScatterPlotChartConfig>;
|
|
23
23
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,wBAAwB;;;;iBAOnC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;iBAKjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ChartDataPolicyOverrideConfig } from '../data-policy-schema';
|
|
3
|
-
export const
|
|
3
|
+
export const ScatterPlotChartSettings = z.object({
|
|
4
4
|
x: z.string().optional().describe('Numeric column for X axis position'),
|
|
5
5
|
y: z.string().optional().describe('Numeric column for Y axis position'),
|
|
6
6
|
size: z
|
|
7
7
|
.string()
|
|
8
8
|
.optional()
|
|
9
|
-
.describe('Numeric column for
|
|
9
|
+
.describe('Numeric column for point size (optional)'),
|
|
10
10
|
});
|
|
11
|
-
export const
|
|
12
|
-
chartType: z.literal('
|
|
13
|
-
settings:
|
|
11
|
+
export const ScatterPlotChartConfig = z.object({
|
|
12
|
+
chartType: z.literal('scatter-plot'),
|
|
13
|
+
settings: ScatterPlotChartSettings,
|
|
14
14
|
settingsOpen: z.boolean().optional(),
|
|
15
15
|
dataPolicy: ChartDataPolicyOverrideConfig.optional(),
|
|
16
16
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACvE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACvE,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0CAA0C,CAAC;CACxD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACpC,QAAQ,EAAE,wBAAwB;IAClC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {ChartDataPolicyOverrideConfig} from '../data-policy-schema';\n\nexport const ScatterPlotChartSettings = z.object({\n x: z.string().optional().describe('Numeric column for X axis position'),\n y: z.string().optional().describe('Numeric column for Y axis position'),\n size: z\n .string()\n .optional()\n .describe('Numeric column for point size (optional)'),\n});\n\nexport type ScatterPlotChartSettings = z.infer<typeof ScatterPlotChartSettings>;\n\nexport const ScatterPlotChartConfig = z.object({\n chartType: z.literal('scatter-plot'),\n settings: ScatterPlotChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type ScatterPlotChartConfig = z.infer<typeof ScatterPlotChartConfig>;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Spec } from '@uwdata/mosaic-spec';
|
|
2
|
+
import { ScatterPlotChartSettings } from './schema';
|
|
3
|
+
import { CreateSpecOptions } from '../base-types';
|
|
4
|
+
export declare function createScatterPlotSpec(options: CreateSpecOptions<ScatterPlotChartSettings>): Spec;
|
|
5
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,UAAU,CAAC;AAIlD,OAAO,EAAC,iBAAiB,EAAyB,MAAM,eAAe,CAAC;AAKxE,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,GACnD,IAAI,CAoCN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { validateScatterPlotSettings } from './validation';
|
|
2
|
+
import { getChartTableReference } from '../base-types';
|
|
3
|
+
const FG_COLOR = 'var(--color-chart-1)';
|
|
4
|
+
const DEFAULT_POINT_SIZE = 3;
|
|
5
|
+
export function createScatterPlotSpec(options) {
|
|
6
|
+
const { dataTable, selectionName } = options;
|
|
7
|
+
const { xColumn, yColumn, sizeColumn } = validateScatterPlotSettings(options);
|
|
8
|
+
const dotMark = {
|
|
9
|
+
mark: 'dot',
|
|
10
|
+
data: { from: getChartTableReference(dataTable), filterBy: '$brush' },
|
|
11
|
+
x: xColumn.name,
|
|
12
|
+
y: yColumn.name,
|
|
13
|
+
fill: FG_COLOR,
|
|
14
|
+
fillOpacity: 0.5,
|
|
15
|
+
};
|
|
16
|
+
// If size column is provided, use it for point radius; otherwise use fixed size
|
|
17
|
+
if (sizeColumn) {
|
|
18
|
+
dotMark.r = sizeColumn.name;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
dotMark.r = DEFAULT_POINT_SIZE;
|
|
22
|
+
}
|
|
23
|
+
const plot = [dotMark];
|
|
24
|
+
if (selectionName) {
|
|
25
|
+
plot.push({ select: 'intervalXY', as: '$brush' });
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
plot,
|
|
29
|
+
xLabel: xColumn.name,
|
|
30
|
+
yLabel: yColumn.name,
|
|
31
|
+
height: 250,
|
|
32
|
+
width: 380,
|
|
33
|
+
margins: { left: 50, right: 20, top: 20, bottom: 50 },
|
|
34
|
+
params: { brush: { select: 'crossfilter' } },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,2BAA2B,EAAC,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAoB,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAExE,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AACxC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,UAAU,qBAAqB,CACnC,OAAoD;IAEpD,MAAM,EAAC,SAAS,EAAE,aAAa,EAAC,GAAG,OAAO,CAAC;IAE3C,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAC,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAE5E,MAAM,OAAO,GAA4B;QACvC,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAC;QACnE,CAAC,EAAE,OAAO,CAAC,IAAI;QACf,CAAC,EAAE,OAAO,CAAC,IAAI;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,GAAG;KACjB,CAAC;IAEF,gFAAgF;IAChF,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,CAAC,GAAG,kBAAkB,CAAC;IACjC,CAAC;IAED,MAAM,IAAI,GAAc,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,OAAO,CAAC,IAAI;QACpB,MAAM,EAAE,OAAO,CAAC,IAAI;QACpB,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;QACnD,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC,EAAC;KACjC,CAAC;AACZ,CAAC","sourcesContent":["import type {Spec} from '@uwdata/mosaic-spec';\nimport {ScatterPlotChartSettings} from './schema';\n\nimport {validateScatterPlotSettings} from './validation';\n\nimport {CreateSpecOptions, getChartTableReference} from '../base-types';\n\nconst FG_COLOR = 'var(--color-chart-1)';\nconst DEFAULT_POINT_SIZE = 3;\n\nexport function createScatterPlotSpec(\n options: CreateSpecOptions<ScatterPlotChartSettings>,\n): Spec {\n const {dataTable, selectionName} = options;\n\n const {xColumn, yColumn, sizeColumn} = validateScatterPlotSettings(options);\n\n const dotMark: Record<string, unknown> = {\n mark: 'dot',\n data: {from: getChartTableReference(dataTable), filterBy: '$brush'},\n x: xColumn.name,\n y: yColumn.name,\n fill: FG_COLOR,\n fillOpacity: 0.5,\n };\n\n // If size column is provided, use it for point radius; otherwise use fixed size\n if (sizeColumn) {\n dotMark.r = sizeColumn.name;\n } else {\n dotMark.r = DEFAULT_POINT_SIZE;\n }\n\n const plot: unknown[] = [dotMark];\n\n if (selectionName) {\n plot.push({select: 'intervalXY', as: '$brush'});\n }\n\n return {\n plot,\n xLabel: xColumn.name,\n yLabel: yColumn.name,\n height: 250,\n width: 380,\n margins: {left: 50, right: 20, top: 20, bottom: 50},\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ChartToolParams, ChartToolOutput } from '../tool-types';
|
|
3
|
+
export declare const ScatterPlotToolInput: z.ZodObject<{
|
|
4
|
+
tableName: z.ZodString;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
panelId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
reasoning: z.ZodString;
|
|
8
|
+
settings: z.ZodObject<{
|
|
9
|
+
x: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
y: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
size: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ScatterPlotToolInput = z.infer<typeof ScatterPlotToolInput>;
|
|
15
|
+
export declare function createScatterPlotAiTool({ databaseAdapter, addChart, maxDataPoints, }: ChartToolParams): import("ai").Tool<{
|
|
16
|
+
tableName: string;
|
|
17
|
+
reasoning: string;
|
|
18
|
+
settings: {
|
|
19
|
+
x: string;
|
|
20
|
+
y: string;
|
|
21
|
+
size: string;
|
|
22
|
+
};
|
|
23
|
+
title?: string | undefined;
|
|
24
|
+
panelId?: string | undefined;
|
|
25
|
+
}, ChartToolOutput<{
|
|
26
|
+
chartType: "scatter-plot";
|
|
27
|
+
settings: {
|
|
28
|
+
x?: string | undefined;
|
|
29
|
+
y?: string | undefined;
|
|
30
|
+
size?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
settingsOpen?: boolean | undefined;
|
|
33
|
+
dataPolicy?: {
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
maxRows?: number | undefined;
|
|
36
|
+
reason?: string | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/scatter-plot/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAI/D,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAE/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,wBAAgB,uBAAuB,CAAC,EACtC,eAAe,EACf,QAAQ,EACR,aAAa,GACd,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;IAiDjB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { tool } from 'ai';
|
|
2
|
+
import { ScatterPlotChartSettings } from './schema';
|
|
3
|
+
import { BaseChartToolInput } from '../../../ai/tool-schemas';
|
|
4
|
+
import { NUMERIC_COLUMN_TYPES } from '../../../column-types-utils';
|
|
5
|
+
import { validateScatterPlotSettings } from './validation';
|
|
6
|
+
import { ensureTable } from '../../../ai/tool-helpers';
|
|
7
|
+
export const ScatterPlotToolInput = BaseChartToolInput.extend({
|
|
8
|
+
settings: ScatterPlotChartSettings.required(),
|
|
9
|
+
});
|
|
10
|
+
export function createScatterPlotAiTool({ databaseAdapter, addChart, maxDataPoints, }) {
|
|
11
|
+
return tool({
|
|
12
|
+
description: `Scatter chart: plots individual points positioned by two numeric columns (x, y), with optional size dimension.
|
|
13
|
+
|
|
14
|
+
Use when: user asks to "plot X vs Y", "show relationship between", "scatter plot", "correlation", "compare two numeric columns".
|
|
15
|
+
Example queries: "plot latitude vs longitude", "show correlation between elevation and temperature", "visualize coordinates sized by population", "plot area vs population density".
|
|
16
|
+
|
|
17
|
+
Required: x and y must be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}).
|
|
18
|
+
Optional: size can encode a third numeric dimension (magnitude, frequency, count).
|
|
19
|
+
|
|
20
|
+
IMPORTANT: 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).
|
|
21
|
+
|
|
22
|
+
Do NOT use for: distributions (use histogram), categorical counts (use count-plot), trends over time (use line-chart), or large datasets (>${maxDataPoints.toLocaleString()} rows).`,
|
|
23
|
+
inputSchema: ScatterPlotToolInput,
|
|
24
|
+
execute: async ({ tableName, title, settings, panelId }) => {
|
|
25
|
+
try {
|
|
26
|
+
const dataTable = ensureTable(databaseAdapter, tableName);
|
|
27
|
+
validateScatterPlotSettings({
|
|
28
|
+
dataTable,
|
|
29
|
+
settings,
|
|
30
|
+
maxDataPoints,
|
|
31
|
+
});
|
|
32
|
+
const chartConfig = {
|
|
33
|
+
chartType: 'scatter-plot',
|
|
34
|
+
settings,
|
|
35
|
+
};
|
|
36
|
+
await addChart({
|
|
37
|
+
tableName,
|
|
38
|
+
panelId,
|
|
39
|
+
config: chartConfig,
|
|
40
|
+
title,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
success: true,
|
|
44
|
+
details: `Generated scatter chart configuration.`,
|
|
45
|
+
data: chartConfig,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +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,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":["../../../../src/charts/chart-types/scatter-plot/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAc1D,MAAM,UAAU,2BAA2B,CAAC,EAC1C,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAC,EACtB,aAAa,GACc;IAC3B,uCAAuC;IACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,gDAAgD;IAChD,IAAI,aAAa,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACpE,IAAI,SAAS,CAAC,QAAQ,GAAG,aAAa,EAAE,CAAC;YACvC,MAAM,IAAI,gBAAgB,CACxB,cAAc,EACd,SAAS,CAAC,QAAQ,EAClB,aAAa,CACd,CAAC;QACJ,CAAC;IACH,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAEhE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IAED,qCAAqC;IACrC,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,sBAAsB,CAC9B;YACE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACvC,EACD,SAAS,CACV,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,IAAI,UAAU,GAAG,SAAS,CAAC;IAC3B,IAAI,IAAI,EAAE,CAAC;QACT,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,sBAAsB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO;QACP,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"}
|