@sqlrooms/mosaic 0.29.0-rc.7 → 0.29.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +2 -1
- package/README.md +179 -35
- package/dist/MosaicSlice.d.ts +1 -0
- package/dist/MosaicSlice.d.ts.map +1 -1
- package/dist/MosaicSlice.js.map +1 -1
- package/dist/VgPlotChart.d.ts.map +1 -1
- package/dist/VgPlotChart.js +9 -3
- package/dist/VgPlotChart.js.map +1 -1
- package/dist/ai/agentIntent.d.ts +5 -0
- package/dist/ai/agentIntent.d.ts.map +1 -0
- package/dist/ai/agentIntent.js +8 -0
- package/dist/ai/agentIntent.js.map +1 -0
- package/dist/ai/block-document/constants.d.ts +9 -0
- package/dist/ai/block-document/constants.d.ts.map +1 -0
- package/dist/ai/block-document/constants.js +9 -0
- package/dist/ai/block-document/constants.js.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts +48 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js +59 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts +19 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js +37 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts +32 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js +37 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js.map +1 -0
- package/dist/ai/constants.d.ts +3 -0
- package/dist/ai/constants.d.ts.map +1 -0
- package/dist/ai/constants.js +3 -0
- package/dist/ai/constants.js.map +1 -0
- package/dist/ai/createDataTableExplorerTool.d.ts +69 -0
- package/dist/ai/createDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/createDataTableExplorerTool.js +68 -0
- package/dist/ai/createDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/constants.d.ts +6 -0
- package/dist/ai/dashboard/constants.d.ts.map +1 -0
- package/dist/ai/dashboard/constants.js +6 -0
- package/dist/ai/dashboard/constants.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts +17 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js +205 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts +14 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js +75 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts +26 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.js +40 -0
- package/dist/ai/dashboard/createDashboardAiTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts +27 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.js +55 -0
- package/dist/ai/dashboard/createDashboardChartTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts +23 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js +29 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts +28 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js +54 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js.map +1 -0
- package/dist/ai/dashboard/dashboard-types.d.ts +59 -0
- package/dist/ai/dashboard/dashboard-types.d.ts.map +1 -0
- package/dist/ai/dashboard/dashboard-types.js +2 -0
- package/dist/ai/dashboard/dashboard-types.js.map +1 -0
- package/dist/ai/database-types.d.ts +12 -0
- package/dist/ai/database-types.d.ts.map +1 -0
- package/dist/ai/database-types.js +2 -0
- package/dist/ai/database-types.js.map +1 -0
- package/dist/ai/errors.d.ts +8 -0
- package/dist/ai/errors.d.ts.map +1 -0
- package/dist/ai/errors.js +11 -0
- package/dist/ai/errors.js.map +1 -0
- package/dist/ai/tool-helpers.d.ts +28 -29
- package/dist/ai/tool-helpers.d.ts.map +1 -1
- package/dist/ai/tool-helpers.js +38 -76
- package/dist/ai/tool-helpers.js.map +1 -1
- package/dist/ai/tool-schemas.d.ts +9 -4
- package/dist/ai/tool-schemas.d.ts.map +1 -1
- package/dist/ai/tool-schemas.js +12 -12
- package/dist/ai/tool-schemas.js.map +1 -1
- package/dist/ai/tool-types.d.ts +19 -1
- package/dist/ai/tool-types.d.ts.map +1 -1
- package/dist/ai/tool-types.js.map +1 -1
- package/dist/ai/types.d.ts +64 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/ai.d.ts +16 -2
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +14 -5
- package/dist/ai.js.map +1 -1
- package/dist/charts/MosaicChart.d.ts +3 -1
- package/dist/charts/MosaicChart.d.ts.map +1 -1
- package/dist/charts/MosaicChart.js +2 -2
- package/dist/charts/MosaicChart.js.map +1 -1
- package/dist/charts/MosaicChartError.d.ts +8 -2
- package/dist/charts/MosaicChartError.d.ts.map +1 -1
- package/dist/charts/MosaicChartError.js +29 -3
- package/dist/charts/MosaicChartError.js.map +1 -1
- package/dist/charts/MosaicChartSettingsButton.d.ts +15 -0
- package/dist/charts/MosaicChartSettingsButton.d.ts.map +1 -0
- package/dist/charts/MosaicChartSettingsButton.js +7 -0
- package/dist/charts/MosaicChartSettingsButton.js.map +1 -0
- package/dist/charts/MosaicChartView.d.ts +2 -0
- package/dist/charts/MosaicChartView.d.ts.map +1 -1
- package/dist/charts/MosaicChartView.js +19 -7
- package/dist/charts/MosaicChartView.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettings.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettings.js +3 -3
- package/dist/charts/chart-settings/MosaicChartSettings.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSettingsPanel.js +1 -1
- package/dist/charts/chart-settings/MosaicChartSettingsPanel.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js +2 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js +3 -3
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
- package/dist/charts/chart-types/base-types.d.ts +40 -25
- package/dist/charts/chart-types/base-types.d.ts.map +1 -1
- package/dist/charts/chart-types/base-types.js +5 -0
- package/dist/charts/chart-types/base-types.js.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.js +1 -0
- package/dist/charts/chart-types/box-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts +37 -3
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js +28 -13
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +2 -2
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +12 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -3
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.d.ts +20 -24
- package/dist/charts/chart-types/box-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.js +25 -33
- package/dist/charts/chart-types/box-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/box-plot/validation.d.ts +9 -0
- package/dist/charts/chart-types/box-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/box-plot/validation.js +32 -0
- package/dist/charts/chart-types/box-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/chart-config.d.ts +3 -1
- package/dist/charts/chart-types/chart-config.d.ts.map +1 -1
- package/dist/charts/chart-types/chart-config.js +2 -2
- package/dist/charts/chart-types/chart-config.js.map +1 -1
- package/dist/charts/chart-types/column-types.d.ts +8 -0
- package/dist/charts/chart-types/column-types.d.ts.map +1 -0
- package/dist/charts/chart-types/column-types.js +2 -0
- package/dist/charts/chart-types/column-types.js.map +1 -0
- package/dist/charts/chart-types/count-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/definition.js +1 -0
- package/dist/charts/chart-types/count-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.d.ts +2 -1
- package/dist/charts/chart-types/count-plot/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.js +47 -34
- package/dist/charts/chart-types/count-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.d.ts +19 -24
- package/dist/charts/chart-types/count-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.js +26 -33
- package/dist/charts/chart-types/count-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/count-plot/validation.d.ts +8 -0
- package/dist/charts/chart-types/count-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/count-plot/validation.js +20 -0
- package/dist/charts/chart-types/count-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts +3 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.js +12 -0
- package/dist/charts/chart-types/createChartInstructions.js.map +1 -0
- package/dist/charts/chart-types/createChartTools.d.ts +15 -9
- package/dist/charts/chart-types/createChartTools.d.ts.map +1 -1
- package/dist/charts/chart-types/createChartTools.js +16 -10
- package/dist/charts/chart-types/createChartTools.js.map +1 -1
- package/dist/charts/chart-types/createDefaultChartTypes.js +2 -2
- package/dist/charts/chart-types/createDefaultChartTypes.js.map +1 -1
- package/dist/charts/chart-types/custom-spec/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/custom-spec/definition.js +1 -0
- package/dist/charts/chart-types/custom-spec/definition.js.map +1 -1
- package/dist/charts/chart-types/custom-spec/spec.d.ts +2 -1
- package/dist/charts/chart-types/custom-spec/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/custom-spec/spec.js +16 -12
- package/dist/charts/chart-types/custom-spec/spec.js.map +1 -1
- package/dist/charts/chart-types/errors.d.ts +35 -0
- package/dist/charts/chart-types/errors.d.ts.map +1 -1
- package/dist/charts/chart-types/errors.js +56 -0
- package/dist/charts/chart-types/errors.js.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.js +1 -0
- package/dist/charts/chart-types/heatmap/definition.js.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.d.ts +2 -1
- package/dist/charts/chart-types/heatmap/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.js +21 -21
- package/dist/charts/chart-types/heatmap/spec.js.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.d.ts +20 -24
- package/dist/charts/chart-types/heatmap/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.js +27 -37
- package/dist/charts/chart-types/heatmap/tool.js.map +1 -1
- package/dist/charts/chart-types/heatmap/validation.d.ts +9 -0
- package/dist/charts/chart-types/heatmap/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/heatmap/validation.js +34 -0
- package/dist/charts/chart-types/heatmap/validation.js.map +1 -0
- package/dist/charts/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/HistogramSettings.js +3 -1
- package/dist/charts/chart-types/histogram/HistogramSettings.js.map +1 -1
- package/dist/charts/chart-types/histogram/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/definition.js +1 -0
- package/dist/charts/chart-types/histogram/definition.js.map +1 -1
- package/dist/charts/chart-types/histogram/schema.d.ts +2 -0
- package/dist/charts/chart-types/histogram/schema.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/schema.js +1 -0
- package/dist/charts/chart-types/histogram/schema.js.map +1 -1
- package/dist/charts/chart-types/histogram/spec.d.ts +2 -1
- package/dist/charts/chart-types/histogram/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/spec.js +31 -28
- package/dist/charts/chart-types/histogram/spec.js.map +1 -1
- package/dist/charts/chart-types/histogram/tool.d.ts +39 -24
- package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/tool.js +39 -33
- package/dist/charts/chart-types/histogram/tool.js.map +1 -1
- package/dist/charts/chart-types/histogram/validation.d.ts +9 -0
- package/dist/charts/chart-types/histogram/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/histogram/validation.js +22 -0
- package/dist/charts/chart-types/histogram/validation.js.map +1 -0
- package/dist/charts/chart-types/index.d.ts +5 -11
- package/dist/charts/chart-types/index.d.ts.map +1 -1
- package/dist/charts/chart-types/index.js +6 -12
- package/dist/charts/chart-types/index.js.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartSettings.js +4 -13
- package/dist/charts/chart-types/line-chart/LineChartSettings.js.map +1 -1
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js +22 -0
- package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js +42 -0
- package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js.map +1 -0
- package/dist/charts/chart-types/line-chart/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/definition.js +1 -0
- package/dist/charts/chart-types/line-chart/definition.js.map +1 -1
- package/dist/charts/chart-types/line-chart/schema.d.ts +2 -0
- package/dist/charts/chart-types/line-chart/schema.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/schema.js +5 -0
- package/dist/charts/chart-types/line-chart/schema.js.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.d.ts +2 -1
- package/dist/charts/chart-types/line-chart/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.js +56 -65
- package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.d.ts +28 -24
- package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.js +27 -39
- package/dist/charts/chart-types/line-chart/tool.js.map +1 -1
- package/dist/charts/chart-types/line-chart/utils.d.ts +7 -0
- package/dist/charts/chart-types/line-chart/utils.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/utils.js +17 -0
- package/dist/charts/chart-types/line-chart/utils.js.map +1 -0
- package/dist/charts/chart-types/line-chart/validation.d.ts +16 -0
- package/dist/charts/chart-types/line-chart/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/validation.js +43 -0
- package/dist/charts/chart-types/line-chart/validation.js.map +1 -0
- package/dist/charts/chart-types/mosaicChartTypes.d.ts +4 -2
- package/dist/charts/chart-types/mosaicChartTypes.d.ts.map +1 -1
- package/dist/charts/chart-types/mosaicChartTypes.js +2 -2
- package/dist/charts/chart-types/mosaicChartTypes.js.map +1 -1
- package/dist/charts/chart-types/resolveChartTypes.d.ts +3 -0
- package/dist/charts/chart-types/resolveChartTypes.d.ts.map +1 -0
- package/dist/charts/chart-types/resolveChartTypes.js +8 -0
- package/dist/charts/chart-types/resolveChartTypes.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts +3 -0
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts.map +1 -0
- package/dist/charts/chart-types/{bubble-chart/BubbleChartSettings.js → scatter-plot/ScatterPlotSettings.js} +4 -4
- package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.d.ts +4 -0
- package/dist/charts/chart-types/scatter-plot/definition.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.js +25 -0
- package/dist/charts/chart-types/scatter-plot/definition.js.map +1 -0
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.d.ts +5 -5
- package/dist/charts/chart-types/scatter-plot/schema.d.ts.map +1 -0
- package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.js +5 -5
- package/dist/charts/chart-types/scatter-plot/schema.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/spec.d.ts +5 -0
- package/dist/charts/chart-types/scatter-plot/spec.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/spec.js +37 -0
- package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/tool.d.ts +39 -0
- package/dist/charts/chart-types/scatter-plot/tool.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/tool.js +57 -0
- package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/validation.d.ts +13 -0
- package/dist/charts/chart-types/scatter-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/validation.js +52 -0
- package/dist/charts/chart-types/scatter-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/tool-types.d.ts +43 -0
- package/dist/charts/chart-types/tool-types.d.ts.map +1 -0
- package/dist/charts/chart-types/tool-types.js +2 -0
- package/dist/charts/chart-types/tool-types.js.map +1 -0
- package/dist/charts/chart-types/utils.d.ts +3 -0
- package/dist/charts/chart-types/utils.d.ts.map +1 -0
- package/dist/charts/chart-types/utils.js +4 -0
- package/dist/charts/chart-types/utils.js.map +1 -0
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js +12 -5
- package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js +6 -4
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js.map +1 -1
- package/dist/charts/useChartDataPolicy.d.ts.map +1 -1
- package/dist/charts/useChartDataPolicy.js +2 -1
- package/dist/charts/useChartDataPolicy.js.map +1 -1
- package/dist/charts/useChartPanelClients.d.ts +8 -0
- package/dist/charts/useChartPanelClients.d.ts.map +1 -0
- package/dist/charts/useChartPanelClients.js +22 -0
- package/dist/charts/useChartPanelClients.js.map +1 -0
- package/dist/charts/useMosaicChartRenderContext.d.ts +2 -3
- package/dist/charts/useMosaicChartRenderContext.d.ts.map +1 -1
- package/dist/charts/useMosaicChartRenderContext.js +15 -15
- package/dist/charts/useMosaicChartRenderContext.js.map +1 -1
- package/dist/charts/worksheet/ChartBlockHeader.d.ts.map +1 -1
- package/dist/charts/worksheet/ChartBlockHeader.js +4 -3
- package/dist/charts/worksheet/ChartBlockHeader.js.map +1 -1
- package/dist/charts/worksheet/ChartBlockRenderer.d.ts.map +1 -1
- package/dist/charts/worksheet/ChartBlockRenderer.js +3 -13
- package/dist/charts/worksheet/ChartBlockRenderer.js.map +1 -1
- package/dist/column-types-utils.d.ts.map +1 -1
- package/dist/column-types-utils.js +12 -4
- package/dist/column-types-utils.js.map +1 -1
- package/dist/components/AggregationSelector.d.ts.map +1 -1
- package/dist/components/AggregationSelector.js +9 -2
- package/dist/components/AggregationSelector.js.map +1 -1
- package/dist/components/BlockCaptionEditor.d.ts +20 -0
- package/dist/components/BlockCaptionEditor.d.ts.map +1 -0
- package/dist/components/BlockCaptionEditor.js +15 -0
- package/dist/components/BlockCaptionEditor.js.map +1 -0
- package/dist/components/ColorSelector.d.ts +12 -0
- package/dist/components/ColorSelector.d.ts.map +1 -0
- package/dist/components/ColorSelector.js +13 -0
- package/dist/components/ColorSelector.js.map +1 -0
- package/dist/components/ColumnSelector.d.ts +1 -0
- package/dist/components/ColumnSelector.d.ts.map +1 -1
- package/dist/components/ColumnSelector.js +2 -2
- package/dist/components/ColumnSelector.js.map +1 -1
- package/dist/components/FieldSelectorInput.d.ts +1 -0
- package/dist/components/FieldSelectorInput.d.ts.map +1 -1
- package/dist/components/FieldSelectorInput.js +4 -9
- package/dist/components/FieldSelectorInput.js.map +1 -1
- package/dist/components/MultiFieldSelector.d.ts +4 -1
- package/dist/components/MultiFieldSelector.d.ts.map +1 -1
- package/dist/components/MultiFieldSelector.js +4 -13
- package/dist/components/MultiFieldSelector.js.map +1 -1
- package/dist/components/TemporalGranularitySelector.d.ts.map +1 -1
- package/dist/components/TemporalGranularitySelector.js +13 -9
- package/dist/components/TemporalGranularitySelector.js.map +1 -1
- package/dist/constants/chart-colors.d.ts +3 -0
- package/dist/constants/chart-colors.d.ts.map +1 -0
- package/dist/constants/chart-colors.js +5 -0
- package/dist/constants/chart-colors.js.map +1 -0
- package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts +2 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts.map +1 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.js +1 -1
- package/dist/dashboard/DefaultMosaicDashboardBlock.js.map +1 -1
- package/dist/dashboard/MosaicDashboardCommands.d.ts +19 -0
- package/dist/dashboard/MosaicDashboardCommands.d.ts.map +1 -0
- package/dist/dashboard/MosaicDashboardCommands.js +226 -0
- package/dist/dashboard/MosaicDashboardCommands.js.map +1 -0
- package/dist/dashboard/MosaicDashboardSlice.d.ts +22 -4
- package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.js +55 -0
- package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
- package/dist/dashboard/components/ResetFiltersButton.d.ts +14 -0
- package/dist/dashboard/components/ResetFiltersButton.d.ts.map +1 -0
- package/dist/dashboard/components/ResetFiltersButton.js +15 -0
- package/dist/dashboard/components/ResetFiltersButton.js.map +1 -0
- package/dist/dashboard/dashboard-types.d.ts +9 -3
- package/dist/dashboard/dashboard-types.d.ts.map +1 -1
- package/dist/dashboard/dashboard-types.js.map +1 -1
- package/dist/dashboard/hooks/useDashboardResetFilters.d.ts +14 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.d.ts.map +1 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.js +39 -0
- package/dist/dashboard/hooks/useDashboardResetFilters.js.map +1 -0
- package/dist/dashboard/hooks/usePanelResetFilters.d.ts +16 -0
- package/dist/dashboard/hooks/usePanelResetFilters.d.ts.map +1 -0
- package/dist/dashboard/hooks/usePanelResetFilters.js +47 -0
- package/dist/dashboard/hooks/usePanelResetFilters.js.map +1 -0
- package/dist/dashboard/panel/MosaicDashboardPanel.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js +3 -3
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.js +4 -2
- package/dist/dashboard/panel/MosaicDashboardPanels.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +3 -3
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts +7 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js +18 -0
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +4 -32
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts +2 -2
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +14 -10
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -1
- package/dist/dashboard/usePanelClientRegistration.d.ts +7 -0
- package/dist/dashboard/usePanelClientRegistration.d.ts.map +1 -0
- package/dist/dashboard/usePanelClientRegistration.js +30 -0
- package/dist/dashboard/usePanelClientRegistration.js.map +1 -0
- package/dist/dashboard/usePanelClients.d.ts +7 -0
- package/dist/dashboard/usePanelClients.d.ts.map +1 -0
- package/dist/dashboard/usePanelClients.js +13 -0
- package/dist/dashboard/usePanelClients.js.map +1 -0
- package/dist/dashboard/useSelectedOrFirstTable.d.ts +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.js +10 -8
- package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorer.d.ts +4 -2
- package/dist/data-table-explorer/DataTableExplorer.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorer.js +4 -4
- package/dist/data-table-explorer/DataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +4 -3
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerCountClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js +4 -4
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js.map +1 -1
- package/dist/data-table-explorer/createDataTableExplorerStore.d.ts +3 -0
- package/dist/data-table-explorer/createDataTableExplorerStore.d.ts.map +1 -1
- package/dist/data-table-explorer/createDataTableExplorerStore.js +6 -0
- package/dist/data-table-explorer/createDataTableExplorerStore.js.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts +4 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts.map +1 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js +13 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js.map +1 -0
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js +26 -8
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map +1 -1
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts +13 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts.map +1 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js +32 -0
- package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js.map +1 -0
- package/dist/data-table-explorer/dataTableExplorerController.d.ts +63 -3
- package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.js +73 -10
- package/dist/data-table-explorer/dataTableExplorerController.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts +12 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js +19 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts +52 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +153 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +42 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +43 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts +13 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js +40 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts +18 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js +23 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts +27 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js +28 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts +15 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts.map +1 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js +21 -0
- package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js.map +1 -0
- package/dist/data-table-explorer/types.d.ts +16 -3
- package/dist/data-table-explorer/types.d.ts.map +1 -1
- package/dist/data-table-explorer/types.js.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.d.ts.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.js +20 -279
- package/dist/data-table-explorer/useDataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/utils.d.ts +64 -6
- package/dist/data-table-explorer/utils.d.ts.map +1 -1
- package/dist/data-table-explorer/utils.js +58 -0
- package/dist/data-table-explorer/utils.js.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts +1 -0
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js +4 -2
- package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js +4 -4
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
- package/dist/index.d.ts +55 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -26
- package/dist/index.js.map +1 -1
- package/dist/mosaicTableReference.d.ts +59 -0
- package/dist/mosaicTableReference.d.ts.map +1 -0
- package/dist/mosaicTableReference.js +68 -0
- package/dist/mosaicTableReference.js.map +1 -0
- package/dist/useVgPlotChartRender.d.ts.map +1 -1
- package/dist/useVgPlotChartRender.js +151 -25
- package/dist/useVgPlotChartRender.js.map +1 -1
- package/dist/useVgPlotChartRetention.d.ts +11 -0
- package/dist/useVgPlotChartRetention.d.ts.map +1 -1
- package/dist/useVgPlotChartRetention.js.map +1 -1
- package/dist/utils/table-lookup.d.ts +7 -0
- package/dist/utils/table-lookup.d.ts.map +1 -0
- package/dist/utils/table-lookup.js +10 -0
- package/dist/utils/table-lookup.js.map +1 -0
- package/package.json +14 -14
- package/dist/ai/ai.d.ts +0 -103
- package/dist/ai/ai.d.ts.map +0 -1
- package/dist/ai/ai.js +0 -419
- package/dist/ai/ai.js.map +0 -1
- package/dist/ai/data-table-explorer-tool.d.ts +0 -40
- package/dist/ai/data-table-explorer-tool.d.ts.map +0 -1
- package/dist/ai/data-table-explorer-tool.js +0 -75
- package/dist/ai/data-table-explorer-tool.js.map +0 -1
- package/dist/ai/list-panels-tool.d.ts +0 -35
- package/dist/ai/list-panels-tool.d.ts.map +0 -1
- package/dist/ai/list-panels-tool.js +0 -66
- package/dist/ai/list-panels-tool.js.map +0 -1
- package/dist/ai/remove-panel-tool.d.ts +0 -31
- package/dist/ai/remove-panel-tool.d.ts.map +0 -1
- package/dist/ai/remove-panel-tool.js +0 -55
- package/dist/ai/remove-panel-tool.js.map +0 -1
- package/dist/ai/tool-validation.d.ts +0 -3
- package/dist/ai/tool-validation.d.ts.map +0 -1
- package/dist/ai/tool-validation.js +0 -11
- package/dist/ai/tool-validation.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts +0 -3
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/definition.d.ts +0 -4
- package/dist/charts/chart-types/bubble-chart/definition.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/definition.js +0 -24
- package/dist/charts/chart-types/bubble-chart/definition.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/schema.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/schema.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/spec.d.ts +0 -4
- package/dist/charts/chart-types/bubble-chart/spec.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/spec.js +0 -31
- package/dist/charts/chart-types/bubble-chart/spec.js.map +0 -1
- package/dist/charts/chart-types/bubble-chart/tool.d.ts +0 -42
- package/dist/charts/chart-types/bubble-chart/tool.d.ts.map +0 -1
- package/dist/charts/chart-types/bubble-chart/tool.js +0 -66
- package/dist/charts/chart-types/bubble-chart/tool.js.map +0 -1
- package/dist/hooks/useDataTable.d.ts +0 -3
- package/dist/hooks/useDataTable.d.ts.map +0 -1
- package/dist/hooks/useDataTable.js +0 -28
- package/dist/hooks/useDataTable.js.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { DashboardToolDeps } from '../charts/chart-types/base-types';
|
|
3
|
-
export declare const ListPanelsToolParameters: z.ZodObject<{
|
|
4
|
-
artifactId: z.ZodOptional<z.ZodString>;
|
|
5
|
-
reasoning: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export type ListPanelsToolParams = z.infer<typeof ListPanelsToolParameters>;
|
|
8
|
-
export declare function createListPanelsTool(deps: DashboardToolDeps): import("ai").Tool<{
|
|
9
|
-
reasoning: string;
|
|
10
|
-
artifactId?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
llmResult: {
|
|
13
|
-
success: boolean;
|
|
14
|
-
errorMessage: string;
|
|
15
|
-
details?: undefined;
|
|
16
|
-
data?: undefined;
|
|
17
|
-
};
|
|
18
|
-
} | {
|
|
19
|
-
llmResult: {
|
|
20
|
-
success: boolean;
|
|
21
|
-
details: string;
|
|
22
|
-
data: {
|
|
23
|
-
artifactId: string;
|
|
24
|
-
panels: {
|
|
25
|
-
issue?: import("..").ChartRuntimeIssue | undefined;
|
|
26
|
-
id: any;
|
|
27
|
-
type: any;
|
|
28
|
-
title: any;
|
|
29
|
-
config: any;
|
|
30
|
-
}[];
|
|
31
|
-
};
|
|
32
|
-
errorMessage?: undefined;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
35
|
-
//# sourceMappingURL=list-panels-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-panels-tool.d.ts","sourceRoot":"","sources":["../../src/ai/list-panels-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;iBAQnC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;GAwD3D"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { tool } from 'ai';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export const ListPanelsToolParameters = z.object({
|
|
4
|
-
artifactId: z
|
|
5
|
-
.string()
|
|
6
|
-
.optional()
|
|
7
|
-
.describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
|
|
8
|
-
reasoning: z
|
|
9
|
-
.string()
|
|
10
|
-
.describe('Brief rationale for listing dashboard panels.'),
|
|
11
|
-
});
|
|
12
|
-
export function createListPanelsTool(deps) {
|
|
13
|
-
return tool({
|
|
14
|
-
description: `List dashboard panels: returns all panels in the current dashboard with their IDs, types, titles, configurations, and any current runtime issue.
|
|
15
|
-
|
|
16
|
-
Use when: you need to discover panel IDs before updating or removing panels, or when user asks "what's on this dashboard".
|
|
17
|
-
|
|
18
|
-
Runtime issues are transient chart diagnostics such as too-much-data or sql-error. If a panel has an issue, use the panel ID to update it in place with a safer chart configuration.
|
|
19
|
-
|
|
20
|
-
Returns array of: {id, type, title, config, issue?} for each panel.`,
|
|
21
|
-
inputSchema: ListPanelsToolParameters,
|
|
22
|
-
execute: async (params) => {
|
|
23
|
-
try {
|
|
24
|
-
const artifactId = deps.resolveArtifact(params.artifactId);
|
|
25
|
-
const dashboard = deps.getDashboard(artifactId);
|
|
26
|
-
if (!dashboard) {
|
|
27
|
-
return {
|
|
28
|
-
llmResult: {
|
|
29
|
-
success: false,
|
|
30
|
-
errorMessage: `Dashboard "${artifactId}" not found.`,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const panels = dashboard.panels.map((panel) => {
|
|
35
|
-
const issue = deps.getPanelIssue?.(artifactId, panel.id);
|
|
36
|
-
return {
|
|
37
|
-
id: panel.id,
|
|
38
|
-
type: panel.type,
|
|
39
|
-
title: panel.title,
|
|
40
|
-
config: panel.config,
|
|
41
|
-
...(issue ? { issue } : {}),
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
llmResult: {
|
|
46
|
-
success: true,
|
|
47
|
-
details: `Found ${panels.length} panel(s) in dashboard.`,
|
|
48
|
-
data: {
|
|
49
|
-
artifactId,
|
|
50
|
-
panels,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return {
|
|
57
|
-
llmResult: {
|
|
58
|
-
success: false,
|
|
59
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=list-panels-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-panels-tool.js","sourceRoot":"","sources":["../../src/ai/list-panels-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC,CAAC;AAIH,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;;oEAMmD;QAChE,WAAW,EAAE,wBAAwB;QACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAE3D,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO;wBACL,SAAS,EAAE;4BACT,OAAO,EAAE,KAAK;4BACd,YAAY,EAAE,cAAc,UAAU,cAAc;yBACrD;qBACF,CAAC;gBACJ,CAAC;gBAED,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;oBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;oBACzD,OAAO;wBACL,EAAE,EAAE,KAAK,CAAC,EAAE;wBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;wBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;wBACpB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;qBAC1B,CAAC;gBACJ,CAAC,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,SAAS,MAAM,CAAC,MAAM,yBAAyB;wBACxD,IAAI,EAAE;4BACJ,UAAU;4BACV,MAAM;yBACP;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from '../charts/chart-types/base-types';\n\nexport const ListPanelsToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n reasoning: z\n .string()\n .describe('Brief rationale for listing dashboard panels.'),\n});\n\nexport type ListPanelsToolParams = z.infer<typeof ListPanelsToolParameters>;\n\nexport function createListPanelsTool(deps: DashboardToolDeps) {\n return tool({\n description: `List dashboard panels: returns all panels in the current dashboard with their IDs, types, titles, configurations, and any current runtime issue.\n\nUse when: you need to discover panel IDs before updating or removing panels, or when user asks \"what's on this dashboard\".\n\nRuntime issues are transient chart diagnostics such as too-much-data or sql-error. If a panel has an issue, use the panel ID to update it in place with a safer chart configuration.\n\nReturns array of: {id, type, title, config, issue?} for each panel.`,\n inputSchema: ListPanelsToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(params.artifactId);\n\n const dashboard = deps.getDashboard(artifactId);\n if (!dashboard) {\n return {\n llmResult: {\n success: false,\n errorMessage: `Dashboard \"${artifactId}\" not found.`,\n },\n };\n }\n\n const panels = dashboard.panels.map((panel: any) => {\n const issue = deps.getPanelIssue?.(artifactId, panel.id);\n return {\n id: panel.id,\n type: panel.type,\n title: panel.title,\n config: panel.config,\n ...(issue ? {issue} : {}),\n };\n });\n\n return {\n llmResult: {\n success: true,\n details: `Found ${panels.length} panel(s) in dashboard.`,\n data: {\n artifactId,\n panels,\n },\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { DashboardToolDeps } from '../charts/chart-types/base-types';
|
|
3
|
-
export declare const RemovePanelToolParameters: z.ZodObject<{
|
|
4
|
-
artifactId: z.ZodOptional<z.ZodString>;
|
|
5
|
-
panelId: z.ZodString;
|
|
6
|
-
reasoning: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export type RemovePanelToolParams = z.infer<typeof RemovePanelToolParameters>;
|
|
9
|
-
export declare function createRemovePanelTool(deps: DashboardToolDeps): import("ai").Tool<{
|
|
10
|
-
panelId: string;
|
|
11
|
-
reasoning: string;
|
|
12
|
-
artifactId?: string | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
llmResult: {
|
|
15
|
-
success: boolean;
|
|
16
|
-
details: string;
|
|
17
|
-
data: {
|
|
18
|
-
artifactId: string;
|
|
19
|
-
panelId: string;
|
|
20
|
-
};
|
|
21
|
-
errorMessage?: undefined;
|
|
22
|
-
};
|
|
23
|
-
} | {
|
|
24
|
-
llmResult: {
|
|
25
|
-
success: boolean;
|
|
26
|
-
errorMessage: string;
|
|
27
|
-
details?: undefined;
|
|
28
|
-
data?: undefined;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
31
|
-
//# sourceMappingURL=remove-panel-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-panel-tool.d.ts","sourceRoot":"","sources":["../../src/ai/remove-panel-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;iBAWpC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;GA+C5D"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { tool } from 'ai';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export const RemovePanelToolParameters = z.object({
|
|
4
|
-
artifactId: z
|
|
5
|
-
.string()
|
|
6
|
-
.optional()
|
|
7
|
-
.describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
|
|
8
|
-
panelId: z
|
|
9
|
-
.string()
|
|
10
|
-
.describe('ID of the panel to remove. Use list_dashboard_panels to discover panel IDs.'),
|
|
11
|
-
reasoning: z.string().describe('Brief rationale for removing this panel.'),
|
|
12
|
-
});
|
|
13
|
-
export function createRemovePanelTool(deps) {
|
|
14
|
-
return tool({
|
|
15
|
-
description: `Remove dashboard panel: deletes a panel from the dashboard by its ID.
|
|
16
|
-
|
|
17
|
-
Use when: user asks to "remove", "delete", "get rid of" a specific panel.
|
|
18
|
-
|
|
19
|
-
Use list_dashboard_panels first to discover panel IDs.`,
|
|
20
|
-
inputSchema: RemovePanelToolParameters,
|
|
21
|
-
execute: async (params) => {
|
|
22
|
-
try {
|
|
23
|
-
const artifactId = deps.resolveArtifact(params.artifactId);
|
|
24
|
-
const dashboard = deps.getDashboard(artifactId);
|
|
25
|
-
if (!dashboard) {
|
|
26
|
-
throw new Error(`Dashboard "${artifactId}" not found.`);
|
|
27
|
-
}
|
|
28
|
-
const panelExists = dashboard.panels.some((panel) => panel.id === params.panelId);
|
|
29
|
-
if (!panelExists) {
|
|
30
|
-
throw new Error(`Panel "${params.panelId}" not found in dashboard "${artifactId}". Cannot remove.`);
|
|
31
|
-
}
|
|
32
|
-
deps.removePanel(artifactId, params.panelId);
|
|
33
|
-
return {
|
|
34
|
-
llmResult: {
|
|
35
|
-
success: true,
|
|
36
|
-
details: `Removed panel "${params.panelId}" from dashboard.`,
|
|
37
|
-
data: {
|
|
38
|
-
artifactId,
|
|
39
|
-
panelId: params.panelId,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
return {
|
|
46
|
-
llmResult: {
|
|
47
|
-
success: false,
|
|
48
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=remove-panel-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-panel-tool.js","sourceRoot":"","sources":["../../src/ai/remove-panel-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CACP,6EAA6E,CAC9E;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC3E,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;uDAIsC;QACnD,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,cAAc,UAAU,cAAc,CAAC,CAAC;gBAC1D,CAAC;gBACD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CACvC,CAAC,KAAmB,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CACrD,CAAC;gBACF,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CACb,UAAU,MAAM,CAAC,OAAO,6BAA6B,UAAU,mBAAmB,CACnF,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;gBAE7C,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,kBAAkB,MAAM,CAAC,OAAO,mBAAmB;wBAC5D,IAAI,EAAE;4BACJ,UAAU;4BACV,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from '../charts/chart-types/base-types';\n\nexport const RemovePanelToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n panelId: z\n .string()\n .describe(\n 'ID of the panel to remove. Use list_dashboard_panels to discover panel IDs.',\n ),\n reasoning: z.string().describe('Brief rationale for removing this panel.'),\n});\n\nexport type RemovePanelToolParams = z.infer<typeof RemovePanelToolParameters>;\n\nexport function createRemovePanelTool(deps: DashboardToolDeps) {\n return tool({\n description: `Remove dashboard panel: deletes a panel from the dashboard by its ID.\n\nUse when: user asks to \"remove\", \"delete\", \"get rid of\" a specific panel.\n\nUse list_dashboard_panels first to discover panel IDs.`,\n inputSchema: RemovePanelToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(params.artifactId);\n const dashboard = deps.getDashboard(artifactId);\n if (!dashboard) {\n throw new Error(`Dashboard \"${artifactId}\" not found.`);\n }\n const panelExists = dashboard.panels.some(\n (panel: {id: string}) => panel.id === params.panelId,\n );\n if (!panelExists) {\n throw new Error(\n `Panel \"${params.panelId}\" not found in dashboard \"${artifactId}\". Cannot remove.`,\n );\n }\n\n deps.removePanel(artifactId, params.panelId);\n\n return {\n llmResult: {\n success: true,\n details: `Removed panel \"${params.panelId}\" from dashboard.`,\n data: {\n artifactId,\n panelId: params.panelId,\n },\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ChartBuilderColumn } from '../charts/chart-types/base-types';
|
|
2
|
-
export declare function validateColumnExists(columnName: string, expectedTypes: string[] | undefined, columns: ChartBuilderColumn[], fieldKey: string): void;
|
|
3
|
-
//# sourceMappingURL=tool-validation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-validation.d.ts","sourceRoot":"","sources":["../../src/ai/tool-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAEzE,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EAAE,GAAG,SAAS,EACnC,OAAO,EAAE,kBAAkB,EAAE,EAC7B,QAAQ,EAAE,MAAM,GACf,IAAI,CAkBN"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function validateColumnExists(columnName, expectedTypes, columns, fieldKey) {
|
|
2
|
-
const column = columns.find((candidate) => candidate.name === columnName);
|
|
3
|
-
if (!column) {
|
|
4
|
-
throw new Error(`Unknown column "${columnName}" for field "${fieldKey}". Available columns: ${columns.map((c) => c.name).join(', ') || '(none)'}.`);
|
|
5
|
-
}
|
|
6
|
-
if (expectedTypes?.length &&
|
|
7
|
-
!expectedTypes.some((type) => type.toUpperCase() === column.type.toUpperCase())) {
|
|
8
|
-
throw new Error(`Column "${columnName}" has type ${column.type} but field "${fieldKey}" expects ${expectedTypes.join(', ')}.`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=tool-validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-validation.js","sourceRoot":"","sources":["../../src/ai/tool-validation.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAClC,UAAkB,EAClB,aAAmC,EACnC,OAA6B,EAC7B,QAAgB;IAEhB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAC1E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,mBAAmB,UAAU,gBAAgB,QAAQ,yBAAyB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,GAAG,CACnI,CAAC;IACJ,CAAC;IAED,IACE,aAAa,EAAE,MAAM;QACrB,CAAC,aAAa,CAAC,IAAI,CACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAC3D,EACD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,WAAW,UAAU,cAAc,MAAM,CAAC,IAAI,eAAe,QAAQ,aAAa,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC9G,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type {ChartBuilderColumn} from '../charts/chart-types/base-types';\n\nexport function validateColumnExists(\n columnName: string,\n expectedTypes: string[] | undefined,\n columns: ChartBuilderColumn[],\n fieldKey: string,\n): void {\n const column = columns.find((candidate) => candidate.name === columnName);\n if (!column) {\n throw new Error(\n `Unknown column \"${columnName}\" for field \"${fieldKey}\". Available columns: ${columns.map((c) => c.name).join(', ') || '(none)'}.`,\n );\n }\n\n if (\n expectedTypes?.length &&\n !expectedTypes.some(\n (type) => type.toUpperCase() === column.type.toUpperCase(),\n )\n ) {\n throw new Error(\n `Column \"${columnName}\" has type ${column.type} but field \"${fieldKey}\" expects ${expectedTypes.join(', ')}.`,\n );\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleChartSettings.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/BubbleChartSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAK9B,eAAO,MAAM,4BAA4B,EAAE,EAqB1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleChartSettings.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/BubbleChartSettings.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,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 BubbleChartSettingsComponent: FC = () => {\n const {onChangeConfig, config} =\n useMosaicChartSettingsContext('bubble-chart');\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 </div>\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,iBAAiB,EAAsB,MAAM,UAAU,CAAC;AAUhE,eAAO,MAAM,oBAAoB,EAAE,uBAAuB,CAAC,iBAAiB,CAgBzE,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BubbleChartSettings } from './schema';
|
|
2
|
-
import { titleFromDescription } from '../../../chart-builders/chartTypeUtils';
|
|
3
|
-
import { BubbleChartSettingsComponent } from './BubbleChartSettings';
|
|
4
|
-
import { createBubbleChartAiTool } from './tool';
|
|
5
|
-
import { Workflow } from 'lucide-react';
|
|
6
|
-
import { createBubbleChartSpec } from './spec';
|
|
7
|
-
import { DEFAULT_CHART_MAX_DATA_POINTS } from '../../../chart-runtime';
|
|
8
|
-
const DESCRIPTION = 'Create a bubble chart';
|
|
9
|
-
export const bubbleChartChartType = {
|
|
10
|
-
id: 'bubble-chart',
|
|
11
|
-
label: 'Bubble Chart',
|
|
12
|
-
description: DESCRIPTION,
|
|
13
|
-
icon: Workflow,
|
|
14
|
-
schema: BubbleChartSettings,
|
|
15
|
-
settingsComponent: BubbleChartSettingsComponent,
|
|
16
|
-
buildTitle: titleFromDescription(DESCRIPTION),
|
|
17
|
-
createTool: createBubbleChartAiTool,
|
|
18
|
-
getDataPolicy: () => ({
|
|
19
|
-
maxRows: DEFAULT_CHART_MAX_DATA_POINTS,
|
|
20
|
-
reason: 'Bubble charts render one point per row. Use a heatmap or another aggregated chart for larger datasets.',
|
|
21
|
-
}),
|
|
22
|
-
createSpec: createBubbleChartSpec,
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAChE,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,uBAAuB,CAAC;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAC/B;IACE,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,mBAAmB;IAC3B,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,wGAAwG;KAC3G,CAAC;IACF,UAAU,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {BubbleChartConfig, BubbleChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {BubbleChartSettingsComponent} from './BubbleChartSettings';\nimport {createBubbleChartAiTool} from './tool';\nimport {Workflow} from 'lucide-react';\nimport {createBubbleChartSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../../chart-runtime';\n\nconst DESCRIPTION = 'Create a bubble chart';\n\nexport const bubbleChartChartType: SpecChartTypeDefinition<BubbleChartConfig> =\n {\n id: 'bubble-chart',\n label: 'Bubble Chart',\n description: DESCRIPTION,\n icon: Workflow,\n schema: BubbleChartSettings,\n settingsComponent: BubbleChartSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createBubbleChartAiTool,\n getDataPolicy: () => ({\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Bubble charts render one point per row. Use a heatmap or another aggregated chart for larger datasets.',\n }),\n createSpec: createBubbleChartSpec,\n };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,mBAAmB;;;;iBAO9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAK5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,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,2CAA2C,CAAC;CACzD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACpC,QAAQ,EAAE,mBAAmB;IAC7B,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 BubbleChartSettings = 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 bubble size (optional)'),\n});\n\nexport type BubbleChartSettings = z.infer<typeof BubbleChartSettings>;\n\nexport const BubbleChartConfig = z.object({\n chartType: z.literal('bubble-chart'),\n settings: BubbleChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type BubbleChartConfig = z.infer<typeof BubbleChartConfig>;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAK7C,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,EAAC,CAAC,EAAE,CAAC,EAAC,EAAE,mBAAmB,GAC1B,IAAI,CA2BN"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ChartSpecError } from '../errors';
|
|
2
|
-
const FG_COLOR = 'var(--color-chart-1)';
|
|
3
|
-
export function createBubbleChartSpec(tableName, { x, y }) {
|
|
4
|
-
if (!x) {
|
|
5
|
-
throw new ChartSpecError('X field is required for bubble chart');
|
|
6
|
-
}
|
|
7
|
-
if (!y) {
|
|
8
|
-
throw new ChartSpecError('Y field is required for bubble chart');
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
plot: [
|
|
12
|
-
{
|
|
13
|
-
mark: 'dot',
|
|
14
|
-
data: { from: tableName, filterBy: '$brush' },
|
|
15
|
-
x,
|
|
16
|
-
y,
|
|
17
|
-
fill: FG_COLOR,
|
|
18
|
-
fillOpacity: 0.5,
|
|
19
|
-
r: 3,
|
|
20
|
-
},
|
|
21
|
-
{ select: 'intervalXY', as: '$brush' },
|
|
22
|
-
],
|
|
23
|
-
xLabel: x,
|
|
24
|
-
yLabel: y,
|
|
25
|
-
height: 250,
|
|
26
|
-
width: 380,
|
|
27
|
-
margins: { left: 50, right: 20, top: 20, bottom: 50 },
|
|
28
|
-
params: { brush: { select: 'crossfilter' } },
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAEzC,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,UAAU,qBAAqB,CACnC,SAAiB,EACjB,EAAC,CAAC,EAAE,CAAC,EAAsB;IAE3B,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,cAAc,CAAC,sCAAsC,CAAC,CAAC;IACnE,CAAC;IACD,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,cAAc,CAAC,sCAAsC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC;gBAC3C,CAAC;gBACD,CAAC;gBACD,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,GAAG;gBAChB,CAAC,EAAE,CAAC;aACL;YACD,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAC;SACrC;QACD,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,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 {BubbleChartSettings} from './schema';\nimport {ChartSpecError} from '../errors';\n\nconst FG_COLOR = 'var(--color-chart-1)';\n\nexport function createBubbleChartSpec(\n tableName: string,\n {x, y}: BubbleChartSettings,\n): Spec {\n if (!x) {\n throw new ChartSpecError('X field is required for bubble chart');\n }\n if (!y) {\n throw new ChartSpecError('Y field is required for bubble chart');\n }\n return {\n plot: [\n {\n mark: 'dot',\n data: {from: tableName, filterBy: '$brush'},\n x,\n y,\n fill: FG_COLOR,\n fillOpacity: 0.5,\n r: 3,\n },\n {select: 'intervalXY', as: '$brush'},\n ],\n xLabel: x,\n yLabel: y,\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"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type DashboardToolDeps } from '../base-types';
|
|
3
|
-
export declare const BubbleChartToolParameters: z.ZodObject<{
|
|
4
|
-
artifactId: z.ZodOptional<z.ZodString>;
|
|
5
|
-
tableName: z.ZodOptional<z.ZodString>;
|
|
6
|
-
createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
-
panelId: z.ZodOptional<z.ZodString>;
|
|
8
|
-
reasoning: z.ZodString;
|
|
9
|
-
settings: z.ZodObject<{
|
|
10
|
-
x: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
11
|
-
y: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
12
|
-
size: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type BubbleChartToolParams = z.infer<typeof BubbleChartToolParameters>;
|
|
16
|
-
export declare function createBubbleChartAiTool(deps: DashboardToolDeps): import("ai").Tool<{
|
|
17
|
-
createArtifactIfMissing: boolean;
|
|
18
|
-
reasoning: string;
|
|
19
|
-
settings: {
|
|
20
|
-
x: string;
|
|
21
|
-
y: string;
|
|
22
|
-
size: string;
|
|
23
|
-
};
|
|
24
|
-
artifactId?: string | undefined;
|
|
25
|
-
tableName?: string | undefined;
|
|
26
|
-
panelId?: string | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
llmResult: {
|
|
29
|
-
success: boolean;
|
|
30
|
-
details: string;
|
|
31
|
-
data: import("..").PanelResult;
|
|
32
|
-
errorMessage?: undefined;
|
|
33
|
-
};
|
|
34
|
-
} | {
|
|
35
|
-
llmResult: {
|
|
36
|
-
success: boolean;
|
|
37
|
-
errorMessage: string;
|
|
38
|
-
details?: undefined;
|
|
39
|
-
data?: undefined;
|
|
40
|
-
};
|
|
41
|
-
}>;
|
|
42
|
-
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAKrD,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAEpC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;GA6E9D"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { tool } from 'ai';
|
|
2
|
-
import { BubbleChartSettings } from './schema';
|
|
3
|
-
import { BaseChartToolParameters } from '../../../ai/tool-schemas';
|
|
4
|
-
import { validateColumnExists } from '../../../ai/tool-validation';
|
|
5
|
-
import { NUMERIC_COLUMN_TYPES } from '../../../column-types-utils';
|
|
6
|
-
import { createOrUpdateChartPanel } from '../../../ai/tool-helpers';
|
|
7
|
-
export const BubbleChartToolParameters = BaseChartToolParameters.extend({
|
|
8
|
-
settings: BubbleChartSettings.required(),
|
|
9
|
-
});
|
|
10
|
-
export function createBubbleChartAiTool(deps) {
|
|
11
|
-
return tool({
|
|
12
|
-
description: `Bubble/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: Bubble charts render ALL rows as individual points. Do NOT create bubble charts for tables with more than ${deps.maxDataPoints.toLocaleString()} rows - use aggregated visualizations instead (histogram, count-plot, line-chart with time intervals, or heatmap).
|
|
21
|
-
|
|
22
|
-
To UPDATE an existing bubble chart: provide the panelId parameter. Otherwise creates new panel.
|
|
23
|
-
|
|
24
|
-
Do NOT use for: distributions (use histogram), categorical counts (use count-plot), trends over time (use line-chart), or large datasets (>${deps.maxDataPoints.toLocaleString()} rows).`,
|
|
25
|
-
inputSchema: BubbleChartToolParameters,
|
|
26
|
-
execute: async (params, context) => {
|
|
27
|
-
try {
|
|
28
|
-
const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing, context);
|
|
29
|
-
const { tableName, columns } = deps.resolveTable(artifactId, params.tableName);
|
|
30
|
-
// Validate settings
|
|
31
|
-
validateColumnExists(params.settings.x, NUMERIC_COLUMN_TYPES, columns, 'x');
|
|
32
|
-
validateColumnExists(params.settings.y, NUMERIC_COLUMN_TYPES, columns, 'y');
|
|
33
|
-
const result = createOrUpdateChartPanel(deps, {
|
|
34
|
-
panelId: params.panelId,
|
|
35
|
-
dashboardId: artifactId,
|
|
36
|
-
tableName,
|
|
37
|
-
title: params.settings.x && params.settings.y
|
|
38
|
-
? `Bubble chart - ${params.settings.x} vs ${params.settings.y}`
|
|
39
|
-
: 'Bubble chart',
|
|
40
|
-
config: {
|
|
41
|
-
chartType: 'bubble-chart',
|
|
42
|
-
settings: params.settings,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
llmResult: {
|
|
47
|
-
success: true,
|
|
48
|
-
details: params.panelId
|
|
49
|
-
? `Updated bubble chart "${result.title}".`
|
|
50
|
-
: `Created bubble chart "${result.title}".`,
|
|
51
|
-
data: result,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return {
|
|
57
|
-
llmResult: {
|
|
58
|
-
success: false,
|
|
59
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/bubble-chart/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACtE,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAIH,MAAM,UAAU,uBAAuB,CAAC,IAAuB;IAC7D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;qCAKoB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;;uHAGmD,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE;;;;6IAIb,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,SAAS;QACrL,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CACrC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,uBAAuB,EAC9B,OAAO,CACR,CAAC;gBACF,MAAM,EAAC,SAAS,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,YAAY,CAC5C,UAAU,EACV,MAAM,CAAC,SAAS,CACjB,CAAC;gBAEF,oBAAoB;gBACpB,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,EAAE;oBAC5C,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,WAAW,EAAE,UAAU;oBACvB,SAAS;oBACT,KAAK,EACH,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;wBACpC,CAAC,CAAC,kBAAkB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE;wBAC/D,CAAC,CAAC,cAAc;oBACpB,MAAM,EAAE;wBACN,SAAS,EAAE,cAAc;wBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;iBACF,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,MAAM,CAAC,OAAO;4BACrB,CAAC,CAAC,yBAAyB,MAAM,CAAC,KAAK,IAAI;4BAC3C,CAAC,CAAC,yBAAyB,MAAM,CAAC,KAAK,IAAI;wBAC7C,IAAI,EAAE,MAAM;qBACb;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport {BubbleChartSettings} from './schema';\nimport {BaseChartToolParameters} from '../../../ai/tool-schemas';\nimport {type DashboardToolDeps} from '../base-types';\nimport {validateColumnExists} from '../../../ai/tool-validation';\nimport {NUMERIC_COLUMN_TYPES} from '../../../column-types-utils';\nimport {createOrUpdateChartPanel} from '../../../ai/tool-helpers';\n\nexport const BubbleChartToolParameters = BaseChartToolParameters.extend({\n settings: BubbleChartSettings.required(),\n});\n\nexport type BubbleChartToolParams = z.infer<typeof BubbleChartToolParameters>;\n\nexport function createBubbleChartAiTool(deps: DashboardToolDeps) {\n return tool({\n description: `Bubble/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: Bubble charts render ALL rows as individual points. Do NOT create bubble charts for tables with more than ${deps.maxDataPoints.toLocaleString()} rows - use aggregated visualizations instead (histogram, count-plot, line-chart with time intervals, or heatmap).\n\nTo UPDATE an existing bubble chart: provide the panelId parameter. Otherwise creates new panel.\n\nDo NOT use for: distributions (use histogram), categorical counts (use count-plot), trends over time (use line-chart), or large datasets (>${deps.maxDataPoints.toLocaleString()} rows).`,\n inputSchema: BubbleChartToolParameters,\n execute: async (params, context) => {\n try {\n const artifactId = deps.resolveArtifact(\n params.artifactId,\n params.createArtifactIfMissing,\n context,\n );\n const {tableName, columns} = deps.resolveTable(\n artifactId,\n params.tableName,\n );\n\n // Validate settings\n validateColumnExists(\n params.settings.x,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'x',\n );\n\n validateColumnExists(\n params.settings.y,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'y',\n );\n\n const result = createOrUpdateChartPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n tableName,\n title:\n params.settings.x && params.settings.y\n ? `Bubble chart - ${params.settings.x} vs ${params.settings.y}`\n : 'Bubble chart',\n config: {\n chartType: 'bubble-chart',\n settings: params.settings,\n },\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated bubble chart \"${result.title}\".`\n : `Created bubble chart \"${result.title}\".`,\n data: result,\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDataTable.d.ts","sourceRoot":"","sources":["../../src/hooks/useDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAkC5C,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,SAAS,GAAG,SAAS,CAIvB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useTablesWithColumns } from './useTablesWithColumns';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the full table reference (database.schema.table) as a string,
|
|
5
|
-
* without SQL escaping (for UI display and matching).
|
|
6
|
-
*/
|
|
7
|
-
function getTableReference(table) {
|
|
8
|
-
return [table.table.database, table.table.schema, table.table.table]
|
|
9
|
-
.filter((part) => Boolean(part))
|
|
10
|
-
.join('.');
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Finds a table by name, checking multiple naming formats.
|
|
14
|
-
*/
|
|
15
|
-
function findTableByName(tables, tableName) {
|
|
16
|
-
if (!tableName) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return tables.find((table) => getTableReference(table) === tableName ||
|
|
20
|
-
table.table.table === tableName ||
|
|
21
|
-
table.tableName === tableName ||
|
|
22
|
-
table.table.toString() === tableName);
|
|
23
|
-
}
|
|
24
|
-
export function useDataTable(tableName) {
|
|
25
|
-
const tables = useTablesWithColumns();
|
|
26
|
-
return useMemo(() => findTableByName(tables, tableName), [tables, tableName]);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=useDataTable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDataTable.js","sourceRoot":"","sources":["../../src/hooks/useDataTable.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAgB;IACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;SACjE,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC/C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CACtB,MAAmB,EACnB,SAA6B;IAE7B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAChB,CAAC,KAAK,EAAE,EAAE,CACR,iBAAiB,CAAC,KAAK,CAAC,KAAK,SAAS;QACtC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS;QAC/B,KAAK,CAAC,SAAS,KAAK,SAAS;QAC7B,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,SAAS,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,SAA6B;IAE7B,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IAEtC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import type {DataTable} from '@sqlrooms/db';\nimport {useMemo} from 'react';\nimport {useTablesWithColumns} from './useTablesWithColumns';\n\n/**\n * Returns the full table reference (database.schema.table) as a string,\n * without SQL escaping (for UI display and matching).\n */\nfunction getTableReference(table: DataTable): string {\n return [table.table.database, table.table.schema, table.table.table]\n .filter((part): part is string => Boolean(part))\n .join('.');\n}\n\n/**\n * Finds a table by name, checking multiple naming formats.\n */\nfunction findTableByName(\n tables: DataTable[],\n tableName: string | undefined,\n): DataTable | undefined {\n if (!tableName) {\n return undefined;\n }\n\n return tables.find(\n (table) =>\n getTableReference(table) === tableName ||\n table.table.table === tableName ||\n table.tableName === tableName ||\n table.table.toString() === tableName,\n );\n}\n\nexport function useDataTable(\n tableName: string | undefined,\n): DataTable | undefined {\n const tables = useTablesWithColumns();\n\n return useMemo(() => findTableByName(tables, tableName), [tables, tableName]);\n}\n"]}
|