@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,45 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getChartTableReference } from '../base-types';
|
|
2
|
+
import { validateCountPlotSettings } from './validation';
|
|
2
3
|
const BG_COLOR = 'var(--color-chart-overlay)';
|
|
3
4
|
const FG_COLOR = 'var(--color-chart-1)';
|
|
4
|
-
export function createCountPlotSpec(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export function createCountPlotSpec(options) {
|
|
6
|
+
const { dataTable, selectionName } = options;
|
|
7
|
+
const { fieldColumn } = validateCountPlotSettings(options);
|
|
8
|
+
const tableReference = getChartTableReference(dataTable);
|
|
8
9
|
// Count plot shows categorical frequency as horizontal bars
|
|
9
10
|
// Categories on Y-axis, counts on X-axis
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
inset: 0.5,
|
|
11
|
+
const plot = [
|
|
12
|
+
{
|
|
13
|
+
mark: 'barX',
|
|
14
|
+
data: { from: tableReference },
|
|
15
|
+
x: { count: null },
|
|
16
|
+
y: {
|
|
17
|
+
column: fieldColumn.name,
|
|
18
|
+
sort: { x: 'sum', order: 'desc', limit: 100 },
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
fill: BG_COLOR,
|
|
21
|
+
inset: 0.5,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
mark: 'barX',
|
|
25
|
+
data: { from: tableReference, filterBy: '$brush' },
|
|
26
|
+
x: { count: null },
|
|
27
|
+
y: {
|
|
28
|
+
column: fieldColumn.name,
|
|
29
|
+
sort: { x: 'sum', order: 'desc', limit: 100 },
|
|
27
30
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
fill: FG_COLOR,
|
|
32
|
+
inset: 0.5,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
mark: 'text',
|
|
36
|
+
data: { from: tableReference, filterBy: '$brush' },
|
|
37
|
+
x: { count: null },
|
|
38
|
+
y: {
|
|
39
|
+
column: fieldColumn.name,
|
|
40
|
+
sort: { x: 'sum', order: 'desc', limit: 100 },
|
|
38
41
|
},
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
text: { count: null },
|
|
43
|
+
dx: 5,
|
|
44
|
+
textAnchor: 'start',
|
|
45
|
+
fill: 'currentColor',
|
|
46
|
+
fontSize: 11,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
if (selectionName) {
|
|
50
|
+
plot.push({ select: 'intervalY', as: '$brush' });
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
plot,
|
|
41
54
|
xLabel: 'Count',
|
|
42
|
-
yLabel:
|
|
55
|
+
yLabel: fieldColumn.name,
|
|
43
56
|
height: 400,
|
|
44
57
|
width: 380,
|
|
45
58
|
margins: { left: 50, right: 50, top: 20, bottom: 50 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACxE,OAAO,EAAC,yBAAyB,EAAC,MAAM,cAAc,CAAC;AAEvD,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,UAAU,mBAAmB,CACjC,OAAkD;IAElD,MAAM,EAAC,SAAS,EAAE,aAAa,EAAC,GAAG,OAAO,CAAC;IAE3C,MAAM,EAAC,WAAW,EAAC,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACzD,MAAM,cAAc,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAEzD,4DAA4D;IAC5D,yCAAyC;IACzC,MAAM,IAAI,GAAc;QACtB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAC,IAAI,EAAE,cAAc,EAAC;YAC5B,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;YAChB,CAAC,EAAE;gBACD,MAAM,EAAE,WAAW,CAAC,IAAI;gBACxB,IAAI,EAAE,EAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAC;aAC5C;YACD,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;SACX;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAC;YAChD,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;YAChB,CAAC,EAAE;gBACD,MAAM,EAAE,WAAW,CAAC,IAAI;gBACxB,IAAI,EAAE,EAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAC;aAC5C;YACD,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;SACX;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAC;YAChD,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;YAChB,CAAC,EAAE;gBACD,MAAM,EAAE,WAAW,CAAC,IAAI;gBACxB,IAAI,EAAE,EAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAC;aAC5C;YACD,IAAI,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;YACnB,EAAE,EAAE,CAAC;YACL,UAAU,EAAE,OAAO;YACnB,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE,EAAE;SACb;KACF,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,WAAW,CAAC,IAAI;QACxB,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 {CountPlotChartSettings} from './schema';\nimport {CreateSpecOptions, getChartTableReference} from '../base-types';\nimport {validateCountPlotSettings} from './validation';\n\nconst BG_COLOR = 'var(--color-chart-overlay)';\nconst FG_COLOR = 'var(--color-chart-1)';\n\nexport function createCountPlotSpec(\n options: CreateSpecOptions<CountPlotChartSettings>,\n): Spec {\n const {dataTable, selectionName} = options;\n\n const {fieldColumn} = validateCountPlotSettings(options);\n const tableReference = getChartTableReference(dataTable);\n\n // Count plot shows categorical frequency as horizontal bars\n // Categories on Y-axis, counts on X-axis\n const plot: unknown[] = [\n {\n mark: 'barX',\n data: {from: tableReference},\n x: {count: null},\n y: {\n column: fieldColumn.name,\n sort: {x: 'sum', order: 'desc', limit: 100},\n },\n fill: BG_COLOR,\n inset: 0.5,\n },\n {\n mark: 'barX',\n data: {from: tableReference, filterBy: '$brush'},\n x: {count: null},\n y: {\n column: fieldColumn.name,\n sort: {x: 'sum', order: 'desc', limit: 100},\n },\n fill: FG_COLOR,\n inset: 0.5,\n },\n {\n mark: 'text',\n data: {from: tableReference, filterBy: '$brush'},\n x: {count: null},\n y: {\n column: fieldColumn.name,\n sort: {x: 'sum', order: 'desc', limit: 100},\n },\n text: {count: null},\n dx: 5,\n textAnchor: 'start',\n fill: 'currentColor',\n fontSize: 11,\n },\n ];\n\n if (selectionName) {\n plot.push({select: 'intervalY', as: '$brush'});\n }\n\n return {\n plot,\n xLabel: 'Count',\n yLabel: fieldColumn.name,\n height: 400,\n width: 380,\n margins: {left: 50, right: 50, top: 20, bottom: 50},\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
2
|
+
import { ChartToolParams, ChartToolOutput } from '../tool-types';
|
|
3
|
+
export declare const CountPlotToolInput: z.ZodObject<{
|
|
4
|
+
tableName: z.ZodString;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
6
|
panelId: z.ZodOptional<z.ZodString>;
|
|
8
7
|
reasoning: z.ZodString;
|
|
9
8
|
settings: z.ZodObject<{
|
|
10
9
|
field: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
11
10
|
}, z.core.$strip>;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
|
-
export type
|
|
14
|
-
export declare function createCountPlotAiTool(
|
|
15
|
-
|
|
12
|
+
export type CountPlotToolInput = z.infer<typeof CountPlotToolInput>;
|
|
13
|
+
export declare function createCountPlotAiTool({ databaseAdapter, addChart, }: ChartToolParams): import("ai").Tool<{
|
|
14
|
+
tableName: string;
|
|
16
15
|
reasoning: string;
|
|
17
16
|
settings: {
|
|
18
17
|
field: string;
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
tableName?: string | undefined;
|
|
19
|
+
title?: string | undefined;
|
|
22
20
|
panelId?: string | undefined;
|
|
23
|
-
}, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
data: import("..").PanelResult;
|
|
28
|
-
errorMessage?: undefined;
|
|
29
|
-
};
|
|
30
|
-
} | {
|
|
31
|
-
llmResult: {
|
|
32
|
-
success: boolean;
|
|
33
|
-
errorMessage: string;
|
|
34
|
-
details?: undefined;
|
|
35
|
-
data?: undefined;
|
|
21
|
+
}, ChartToolOutput<{
|
|
22
|
+
chartType: "count-plot";
|
|
23
|
+
settings: {
|
|
24
|
+
field?: string | undefined;
|
|
36
25
|
};
|
|
37
|
-
|
|
26
|
+
settingsOpen?: boolean | undefined;
|
|
27
|
+
dataPolicy?: {
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
maxRows?: number | undefined;
|
|
30
|
+
reason?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}>>;
|
|
38
33
|
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-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,kBAAkB;;;;;;;;iBAE7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,wBAAgB,qBAAqB,CAAC,EACpC,eAAe,EACf,QAAQ,GACT,EAAE,eAAe;;;;;;;;;;;;;;;;;;;IAgDjB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { tool } from 'ai';
|
|
2
2
|
import { CountPlotChartSettings } from './schema';
|
|
3
|
-
import {
|
|
4
|
-
import { validateColumnExists } from '../../../ai/tool-validation';
|
|
3
|
+
import { BaseChartToolInput } from '../../../ai/tool-schemas';
|
|
5
4
|
import { CATEGORICAL_COLUMN_TYPES } from '../../../column-types-utils';
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { validateCountPlotSettings } from './validation';
|
|
6
|
+
import { ensureTable } from '../../../ai/tool-helpers';
|
|
7
|
+
export const CountPlotToolInput = BaseChartToolInput.extend({
|
|
8
8
|
settings: CountPlotChartSettings.required(),
|
|
9
9
|
});
|
|
10
|
-
export function createCountPlotAiTool(
|
|
10
|
+
export function createCountPlotAiTool({ databaseAdapter, addChart, }) {
|
|
11
11
|
return tool({
|
|
12
12
|
description: `Count plot: horizontal bar chart showing frequency of categorical/text values. Counts how many times each unique value appears.
|
|
13
13
|
|
|
@@ -18,43 +18,36 @@ Required: field must be categorical/text (${CATEGORICAL_COLUMN_TYPES.join(', ')}
|
|
|
18
18
|
|
|
19
19
|
NOTE: Count plots aggregate by counting unique values, so they handle large datasets efficiently (no data point limit).
|
|
20
20
|
|
|
21
|
-
To UPDATE an existing count plot: provide the panelId parameter. Otherwise creates new panel.
|
|
22
|
-
|
|
23
21
|
CRITICAL: Only for categorical data (text, categories, enums).
|
|
24
|
-
Do NOT use for: numeric distributions (use histogram), relationships between columns (use
|
|
25
|
-
inputSchema:
|
|
26
|
-
execute: async (
|
|
22
|
+
Do NOT use for: numeric distributions (use histogram), relationships between columns (use scatter-plot), time series (use line-chart).`,
|
|
23
|
+
inputSchema: CountPlotToolInput,
|
|
24
|
+
execute: async ({ tableName, title, settings, panelId }) => {
|
|
27
25
|
try {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const dataTable = ensureTable(databaseAdapter, tableName);
|
|
27
|
+
validateCountPlotSettings({
|
|
28
|
+
dataTable,
|
|
29
|
+
settings,
|
|
30
|
+
});
|
|
31
|
+
const chartConfig = {
|
|
32
|
+
chartType: 'count-plot',
|
|
33
|
+
settings,
|
|
34
|
+
};
|
|
35
|
+
await addChart({
|
|
35
36
|
tableName,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
settings: params.settings,
|
|
40
|
-
},
|
|
37
|
+
panelId,
|
|
38
|
+
title,
|
|
39
|
+
config: chartConfig,
|
|
41
40
|
});
|
|
42
41
|
return {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
? `Updated count plot "${result.title}".`
|
|
47
|
-
: `Created count plot "${result.title}".`,
|
|
48
|
-
data: result,
|
|
49
|
-
},
|
|
42
|
+
success: true,
|
|
43
|
+
details: `Generated count plot configuration for "${settings.field}".`,
|
|
44
|
+
data: chartConfig,
|
|
50
45
|
};
|
|
51
46
|
}
|
|
52
47
|
catch (error) {
|
|
53
48
|
return {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
57
|
-
},
|
|
49
|
+
success: false,
|
|
50
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
58
51
|
};
|
|
59
52
|
}
|
|
60
53
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAuB,sBAAsB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAC,yBAAyB,EAAC,MAAM,cAAc,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC1D,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,EACpC,eAAe,EACf,QAAQ,GACQ;IAChB,OAAO,IAAI,CAA4D;QACrE,WAAW,EAAE;;;;;4CAK2B,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;uIAKwD;QACnI,WAAW,EAAE,kBAAkB;QAC/B,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,yBAAyB,CAAC;oBACxB,SAAS;oBACT,QAAQ;iBACT,CAAC,CAAC;gBAEH,MAAM,WAAW,GAAyB;oBACxC,SAAS,EAAE,YAAqB;oBAChC,QAAQ;iBACT,CAAC;gBAEF,MAAM,QAAQ,CAAC;oBACb,SAAS;oBACT,OAAO;oBACP,KAAK;oBACL,MAAM,EAAE,WAAW;iBACpB,CAAC,CAAC;gBAEH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,2CAA2C,QAAQ,CAAC,KAAK,IAAI;oBACtE,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 {CountPlotChartConfig, CountPlotChartSettings} from './schema';\nimport {BaseChartToolInput} from '../../../ai/tool-schemas';\nimport {CATEGORICAL_COLUMN_TYPES} from '../../../column-types-utils';\nimport {ChartToolParams, ChartToolOutput} from '../tool-types';\nimport {validateCountPlotSettings} from './validation';\nimport {ensureTable} from '../../../ai/tool-helpers';\n\nexport const CountPlotToolInput = BaseChartToolInput.extend({\n settings: CountPlotChartSettings.required(),\n});\n\nexport type CountPlotToolInput = z.infer<typeof CountPlotToolInput>;\n\nexport function createCountPlotAiTool({\n databaseAdapter,\n addChart,\n}: ChartToolParams) {\n return tool<CountPlotToolInput, ChartToolOutput<CountPlotChartConfig>>({\n description: `Count plot: horizontal bar chart showing frequency of categorical/text values. Counts how many times each unique value appears.\n\nUse when: user asks to \"count\", \"frequency of\", \"how many\", \"breakdown by category\", \"distribution of [text/category column]\".\nExample queries: \"count by land use type\", \"how many features per administrative region\", \"frequency of terrain types\", \"breakdown by zone classification\", \"count parcels by ownership type\".\n\nRequired: field must be categorical/text (${CATEGORICAL_COLUMN_TYPES.join(', ')}).\n\nNOTE: Count plots aggregate by counting unique values, so they handle large datasets efficiently (no data point limit).\n\nCRITICAL: Only for categorical data (text, categories, enums).\nDo NOT use for: numeric distributions (use histogram), relationships between columns (use scatter-plot), time series (use line-chart).`,\n inputSchema: CountPlotToolInput,\n execute: async ({tableName, title, settings, panelId}) => {\n try {\n const dataTable = ensureTable(databaseAdapter, tableName);\n\n validateCountPlotSettings({\n dataTable,\n settings,\n });\n\n const chartConfig: CountPlotChartConfig = {\n chartType: 'count-plot' as const,\n settings,\n };\n\n await addChart({\n tableName,\n panelId,\n title,\n config: chartConfig,\n });\n\n return {\n success: true,\n details: `Generated count plot configuration for \"${settings.field}\".`,\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,8 @@
|
|
|
1
|
+
import { CountPlotChartSettings } from './schema';
|
|
2
|
+
import { ValidateSpecOptions } from '../base-types';
|
|
3
|
+
import { TableColumn } from '@sqlrooms/duckdb';
|
|
4
|
+
export type ValidatedCountPlotSettings = {
|
|
5
|
+
fieldColumn: TableColumn;
|
|
6
|
+
};
|
|
7
|
+
export declare function validateCountPlotSettings({ dataTable, settings: { field }, }: ValidateSpecOptions<CountPlotChartSettings>): ValidatedCountPlotSettings;
|
|
8
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAOlD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EAAE,EAAC,KAAK,EAAC,GAClB,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,GAAG,0BAA0B,CAoB1E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, } from '../errors';
|
|
2
|
+
import { isCategoricalType } from '../../../column-types-utils';
|
|
3
|
+
export function validateCountPlotSettings({ dataTable, settings: { field }, }) {
|
|
4
|
+
// Basic validation for required fields
|
|
5
|
+
if (!field) {
|
|
6
|
+
throw new RequiredFieldsError('Field');
|
|
7
|
+
}
|
|
8
|
+
// Validate field existence and type
|
|
9
|
+
const fieldColumn = dataTable.columns.find((col) => col.name === field);
|
|
10
|
+
if (!fieldColumn) {
|
|
11
|
+
throw new MissingColumnsError(field);
|
|
12
|
+
}
|
|
13
|
+
if (!isCategoricalType(fieldColumn.type)) {
|
|
14
|
+
throw new InvalidColumnTypeError(fieldColumn.name, 'categorical');
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
fieldColumn,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAO9D,MAAM,UAAU,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EAAE,EAAC,KAAK,EAAC,GAC2B;IAC5C,uCAAuC;IACvC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,oCAAoC;IACpC,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IAExE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,sBAAsB,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC;IAED,OAAO;QACL,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["import {CountPlotChartSettings} from './schema';\nimport {ValidateSpecOptions} from '../base-types';\nimport {\n InvalidColumnTypeError,\n MissingColumnsError,\n RequiredFieldsError,\n} from '../errors';\nimport {isCategoricalType} from '../../../column-types-utils';\nimport {TableColumn} from '@sqlrooms/duckdb';\n\nexport type ValidatedCountPlotSettings = {\n fieldColumn: TableColumn;\n};\n\nexport function validateCountPlotSettings({\n dataTable,\n settings: {field},\n}: ValidateSpecOptions<CountPlotChartSettings>): ValidatedCountPlotSettings {\n // Basic validation for required fields\n if (!field) {\n throw new RequiredFieldsError('Field');\n }\n\n // Validate field existence and type\n const fieldColumn = dataTable.columns.find((col) => col.name === field);\n\n if (!fieldColumn) {\n throw new MissingColumnsError(field);\n }\n\n if (!isCategoricalType(fieldColumn.type)) {\n throw new InvalidColumnTypeError(fieldColumn.name, 'categorical');\n }\n\n return {\n fieldColumn,\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createChartInstructions.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartInstructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAGtD,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,EACtC,cAAc,EAAE,MAAM,GACrB,MAAM,CAUR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getChartToolName } from './utils';
|
|
2
|
+
export function createChartToolsInstructions(chartTypes, toolNamePrefix) {
|
|
3
|
+
return chartTypes
|
|
4
|
+
.filter((chartType) => chartType.createTool)
|
|
5
|
+
.map((chartType) => {
|
|
6
|
+
const toolName = getChartToolName(chartType, toolNamePrefix);
|
|
7
|
+
const description = chartType.aiDescription;
|
|
8
|
+
return `${toolName} - ${description}`;
|
|
9
|
+
})
|
|
10
|
+
.join('\n');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=createChartInstructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createChartInstructions.js","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartInstructions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAEzC,MAAM,UAAU,4BAA4B,CAC1C,UAAsC,EACtC,cAAsB;IAEtB,OAAO,UAAU;SACd,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC;SAC3C,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,aAAa,CAAC;QAE5C,OAAO,GAAG,QAAQ,MAAM,WAAW,EAAE,CAAC;IACxC,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["import type {ChartTypeDefinition} from './base-types';\nimport {getChartToolName} from './utils';\n\nexport function createChartToolsInstructions(\n chartTypes: ChartTypeDefinition<any>[],\n toolNamePrefix: string,\n): string {\n return chartTypes\n .filter((chartType) => chartType.createTool)\n .map((chartType) => {\n const toolName = getChartToolName(chartType, toolNamePrefix);\n const description = chartType.aiDescription;\n\n return `${toolName} - ${description}`;\n })\n .join('\\n');\n}\n"]}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import type { Tool } from 'ai';
|
|
2
|
-
import type { ChartTypeDefinition
|
|
2
|
+
import type { ChartTypeDefinition } from './base-types';
|
|
3
|
+
import type { ChartToolParams } from './tool-types';
|
|
3
4
|
/**
|
|
4
|
-
* Dynamically generate
|
|
5
|
+
* Dynamically generate chart configuration tools from chart type definitions.
|
|
5
6
|
*
|
|
6
|
-
* @param chartTypes Array of chart type definitions
|
|
7
|
-
* @param
|
|
8
|
-
* @param toolNamePrefix
|
|
7
|
+
* @param chartTypes - Array of chart type definitions
|
|
8
|
+
* @param params - Chart tool parameters containing addChart function, maxDataPoints limit, and databaseAdapter for table/column resolution
|
|
9
|
+
* @param toolNamePrefix - Required prefix for generated tool names (e.g., 'create_dashboard_' or 'create_block_document_chart_')
|
|
9
10
|
* @returns Record mapping tool names to tool instances
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
|
-
* const chartTypes =
|
|
13
|
-
* const
|
|
14
|
-
*
|
|
13
|
+
* const chartTypes = resolveChartTypes();
|
|
14
|
+
* const params: ChartToolParams = {
|
|
15
|
+
* addChart: (chartParams) => dashboardAdapter.addPanel(chartParams),
|
|
16
|
+
* maxDataPoints: 10000,
|
|
17
|
+
* databaseAdapter: myDatabaseAdapter
|
|
18
|
+
* };
|
|
19
|
+
* const tools = createChartTools(chartTypes, params, 'create_dashboard_');
|
|
20
|
+
* // Returns: { create_dashboard_histogram: Tool, create_dashboard_line_chart: Tool, ... }
|
|
15
21
|
*/
|
|
16
|
-
export declare function createChartTools(chartTypes: ChartTypeDefinition<any>[],
|
|
22
|
+
export declare function createChartTools(chartTypes: ChartTypeDefinition<any>[], params: ChartToolParams, toolNamePrefix: string): Record<string, Tool>;
|
|
17
23
|
//# sourceMappingURL=createChartTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createChartTools.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,EAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"createChartTools.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAGlD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,EACtC,MAAM,EAAE,eAAe,EACvB,cAAc,EAAE,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAWtB"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
+
import { getChartToolName } from './utils';
|
|
1
2
|
/**
|
|
2
|
-
* Dynamically generate
|
|
3
|
+
* Dynamically generate chart configuration tools from chart type definitions.
|
|
3
4
|
*
|
|
4
|
-
* @param chartTypes Array of chart type definitions
|
|
5
|
-
* @param
|
|
6
|
-
* @param toolNamePrefix
|
|
5
|
+
* @param chartTypes - Array of chart type definitions
|
|
6
|
+
* @param params - Chart tool parameters containing addChart function, maxDataPoints limit, and databaseAdapter for table/column resolution
|
|
7
|
+
* @param toolNamePrefix - Required prefix for generated tool names (e.g., 'create_dashboard_' or 'create_block_document_chart_')
|
|
7
8
|
* @returns Record mapping tool names to tool instances
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
|
-
* const chartTypes =
|
|
11
|
-
* const
|
|
12
|
-
*
|
|
11
|
+
* const chartTypes = resolveChartTypes();
|
|
12
|
+
* const params: ChartToolParams = {
|
|
13
|
+
* addChart: (chartParams) => dashboardAdapter.addPanel(chartParams),
|
|
14
|
+
* maxDataPoints: 10000,
|
|
15
|
+
* databaseAdapter: myDatabaseAdapter
|
|
16
|
+
* };
|
|
17
|
+
* const tools = createChartTools(chartTypes, params, 'create_dashboard_');
|
|
18
|
+
* // Returns: { create_dashboard_histogram: Tool, create_dashboard_line_chart: Tool, ... }
|
|
13
19
|
*/
|
|
14
|
-
export function createChartTools(chartTypes,
|
|
20
|
+
export function createChartTools(chartTypes, params, toolNamePrefix) {
|
|
15
21
|
const tools = {};
|
|
16
22
|
for (const chartType of chartTypes) {
|
|
17
23
|
if (chartType.createTool) {
|
|
18
|
-
const toolName =
|
|
19
|
-
tools[toolName] = chartType.createTool(
|
|
24
|
+
const toolName = getChartToolName(chartType, toolNamePrefix);
|
|
25
|
+
tools[toolName] = chartType.createTool(params);
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
return tools;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createChartTools.js","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartTools.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"createChartTools.js","sourceRoot":"","sources":["../../../src/charts/chart-types/createChartTools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAsC,EACtC,MAAuB,EACvB,cAAsB;IAEtB,MAAM,KAAK,GAAyB,EAAE,CAAC;IAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YAC7D,KAAK,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type {Tool} from 'ai';\nimport type {ChartTypeDefinition} from './base-types';\nimport type {ChartToolParams} from './tool-types';\nimport {getChartToolName} from './utils';\n\n/**\n * Dynamically generate chart configuration tools from chart type definitions.\n *\n * @param chartTypes - Array of chart type definitions\n * @param params - Chart tool parameters containing addChart function, maxDataPoints limit, and databaseAdapter for table/column resolution\n * @param toolNamePrefix - Required prefix for generated tool names (e.g., 'create_dashboard_' or 'create_block_document_chart_')\n * @returns Record mapping tool names to tool instances\n *\n * @example\n * const chartTypes = resolveChartTypes();\n * const params: ChartToolParams = {\n * addChart: (chartParams) => dashboardAdapter.addPanel(chartParams),\n * maxDataPoints: 10000,\n * databaseAdapter: myDatabaseAdapter\n * };\n * const tools = createChartTools(chartTypes, params, 'create_dashboard_');\n * // Returns: { create_dashboard_histogram: Tool, create_dashboard_line_chart: Tool, ... }\n */\nexport function createChartTools(\n chartTypes: ChartTypeDefinition<any>[],\n params: ChartToolParams,\n toolNamePrefix: string,\n): Record<string, Tool> {\n const tools: Record<string, Tool> = {};\n\n for (const chartType of chartTypes) {\n if (chartType.createTool) {\n const toolName = getChartToolName(chartType, toolNamePrefix);\n tools[toolName] = chartType.createTool(params);\n }\n }\n\n return tools;\n}\n"]}
|
|
@@ -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
|
* Creates the default set of chart type definitions.
|
|
@@ -20,7 +20,7 @@ export function createDefaultChartTypes(options) {
|
|
|
20
20
|
lineChartChartType,
|
|
21
21
|
heatmapChartType,
|
|
22
22
|
boxPlotChartType,
|
|
23
|
-
|
|
23
|
+
scatterPlotChartType,
|
|
24
24
|
];
|
|
25
25
|
if (includeCustomSpec) {
|
|
26
26
|
chartTypes.push(customSpecChartType);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDefaultChartTypes.js","sourceRoot":"","sources":["../../../src/charts/chart-types/createDefaultChartTypes.ts"],"names":[],"mappings":"AACA,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;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAEvC;IACC,MAAM,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,IAAI,IAAI,CAAC;IAC7D,MAAM,UAAU,GAA+B;QAC7C,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;QAChB,gBAAgB;QAChB,oBAAoB;KACrB,CAAC;IAEF,IAAI,iBAAiB,EAAE,CAAC;QACtB,UAAU,CAAC,IAAI,CAAC,mBAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type {ChartTypeDefinition} from './base-types';\nimport {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":"createDefaultChartTypes.js","sourceRoot":"","sources":["../../../src/charts/chart-types/createDefaultChartTypes.ts"],"names":[],"mappings":"AACA,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;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAEvC;IACC,MAAM,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,IAAI,IAAI,CAAC;IAC7D,MAAM,UAAU,GAA+B;QAC7C,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;QAChB,gBAAgB;QAChB,oBAAoB;KACrB,CAAC;IAEF,IAAI,iBAAiB,EAAE,CAAC;QACtB,UAAU,CAAC,IAAI,CAAC,mBAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type {ChartTypeDefinition} from './base-types';\nimport {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 * Creates the default set of chart type definitions.\n *\n * @param options - Configuration options\n * @param options.includeCustomSpec - Whether to include the custom spec chart type (default: true)\n * @returns Array of chart type definitions\n */\nexport function createDefaultChartTypes(options?: {\n includeCustomSpec?: boolean;\n}): ChartTypeDefinition<any>[] {\n const includeCustomSpec = options?.includeCustomSpec ?? true;\n const chartTypes: ChartTypeDefinition<any>[] = [\n histogramChartType,\n countPlotChartType,\n lineChartChartType,\n heatmapChartType,\n boxPlotChartType,\n scatterPlotChartType,\n ];\n\n if (includeCustomSpec) {\n chartTypes.push(customSpecChartType as ChartTypeDefinition<any>);\n }\n\n return chartTypes;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AASxE,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AASxE,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,CAAC,qBAAqB,CAgB5E,CAAC"}
|
|
@@ -9,6 +9,7 @@ export const customSpecChartType = {
|
|
|
9
9
|
id: 'custom-spec',
|
|
10
10
|
label: 'Custom Spec',
|
|
11
11
|
description: DESCRIPTION,
|
|
12
|
+
aiDescription: `${DESCRIPTION} - custom visualization using Mosaic vgplot spec`,
|
|
12
13
|
icon: Code,
|
|
13
14
|
schema: CustomSpecChartSettings,
|
|
14
15
|
settingsComponent: CustomSpecSettingsComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAC9B;IACE,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,uBAAuB;IAC/B,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,OAAO,EAAE,6BAA6B;QACtC,MAAM,EACJ,0GAA0G;KAC7G,CAAC;IACF,UAAU,EAAE,gBAAgB;CAC7B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CustomSpecChartConfig, CustomSpecChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {CustomSpecSettingsComponent} from './CustomSpecSettings';\nimport {Code} from 'lucide-react';\nimport {createCustomSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../../chart-runtime';\n\nconst DESCRIPTION = 'Create a chart with custom spec';\n\nexport const customSpecChartType: SpecChartTypeDefinition<CustomSpecChartConfig> =\n {\n id: 'custom-spec',\n label: 'Custom Spec',\n description: DESCRIPTION,\n icon: Code,\n schema: CustomSpecChartSettings,\n settingsComponent: CustomSpecSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n getDataPolicy: () => ({\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Custom specs are validated conservatively because SQLRooms cannot infer whether each mark is aggregated.',\n }),\n createSpec: createCustomSpec,\n };\n"]}
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAC9B;IACE,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,GAAG,WAAW,kDAAkD;IAC/E,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,uBAAuB;IAC/B,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,OAAO,EAAE,6BAA6B;QACtC,MAAM,EACJ,0GAA0G;KAC7G,CAAC;IACF,UAAU,EAAE,gBAAgB;CAC7B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CustomSpecChartConfig, CustomSpecChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {CustomSpecSettingsComponent} from './CustomSpecSettings';\nimport {Code} from 'lucide-react';\nimport {createCustomSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../../chart-runtime';\n\nconst DESCRIPTION = 'Create a chart with custom spec';\n\nexport const customSpecChartType: SpecChartTypeDefinition<CustomSpecChartConfig> =\n {\n id: 'custom-spec',\n label: 'Custom Spec',\n description: DESCRIPTION,\n aiDescription: `${DESCRIPTION} - custom visualization using Mosaic vgplot spec`,\n icon: Code,\n schema: CustomSpecChartSettings,\n settingsComponent: CustomSpecSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n getDataPolicy: () => ({\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Custom specs are validated conservatively because SQLRooms cannot infer whether each mark is aggregated.',\n }),\n createSpec: createCustomSpec,\n };\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Spec } from '@uwdata/mosaic-spec';
|
|
2
2
|
import { CustomSpecChartSettings } from './schema';
|
|
3
|
-
|
|
3
|
+
import { CreateSpecOptions } from '../base-types';
|
|
4
|
+
export declare function createCustomSpec({ dataTable, settings: { vgPlotSpec }, selectionName, }: CreateSpecOptions<CustomSpecChartSettings>): Spec;
|
|
4
5
|
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAyB,MAAM,eAAe,CAAC;AAExE,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EAAE,EAAC,UAAU,EAAC,EACtB,aAAa,GACd,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,GAAG,IAAI,CA4BnD"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { getChartTableReference } from '../base-types';
|
|
2
|
+
export function createCustomSpec({ dataTable, settings: { vgPlotSpec }, selectionName, }) {
|
|
2
3
|
if (vgPlotSpec) {
|
|
3
4
|
return vgPlotSpec;
|
|
4
5
|
}
|
|
5
6
|
// Default starter spec
|
|
7
|
+
const plot = [
|
|
8
|
+
{
|
|
9
|
+
mark: 'rectY',
|
|
10
|
+
data: { from: getChartTableReference(dataTable), filterBy: '$brush' },
|
|
11
|
+
x: { bin: 'field_name', maxbins: 25 },
|
|
12
|
+
y: { count: null },
|
|
13
|
+
fill: 'steelblue',
|
|
14
|
+
inset: 0.5,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
if (selectionName) {
|
|
18
|
+
plot.push({ select: 'intervalX', as: '$brush' });
|
|
19
|
+
}
|
|
6
20
|
return {
|
|
7
|
-
plot
|
|
8
|
-
{
|
|
9
|
-
mark: 'rectY',
|
|
10
|
-
data: { from: tableName, filterBy: '$brush' },
|
|
11
|
-
x: { bin: 'field_name', maxbins: 25 },
|
|
12
|
-
y: { count: null },
|
|
13
|
-
fill: 'steelblue',
|
|
14
|
-
inset: 0.5,
|
|
15
|
-
},
|
|
16
|
-
{ select: 'intervalX', as: '$brush' },
|
|
17
|
-
],
|
|
21
|
+
plot,
|
|
18
22
|
xLabel: 'field_name',
|
|
19
23
|
height: 200,
|
|
20
24
|
width: 380,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/custom-spec/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAExE,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EAAE,EAAC,UAAU,EAAC,EACtB,aAAa,GAC8B;IAC3C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAkB,CAAC;IAC5B,CAAC;IAED,uBAAuB;IACvB,MAAM,IAAI,GAAc;QACtB;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAC;YACnE,CAAC,EAAE,EAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAC;YACnC,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;YAChB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG;SACX;KACF,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC,EAAC;KACjC,CAAC;AACZ,CAAC","sourcesContent":["import {Spec} from '@uwdata/mosaic-spec';\nimport {CustomSpecChartSettings} from './schema';\nimport {CreateSpecOptions, getChartTableReference} from '../base-types';\n\nexport function createCustomSpec({\n dataTable,\n settings: {vgPlotSpec},\n selectionName,\n}: CreateSpecOptions<CustomSpecChartSettings>): Spec {\n if (vgPlotSpec) {\n return vgPlotSpec as Spec;\n }\n\n // Default starter spec\n const plot: unknown[] = [\n {\n mark: 'rectY',\n data: {from: getChartTableReference(dataTable), filterBy: '$brush'},\n x: {bin: 'field_name', maxbins: 25},\n y: {count: null},\n fill: 'steelblue',\n inset: 0.5,\n },\n ];\n\n if (selectionName) {\n plot.push({select: 'intervalX', as: '$brush'});\n }\n\n return {\n plot,\n xLabel: 'field_name',\n height: 200,\n width: 380,\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
|