@sqlrooms/mosaic 0.29.0-rc.8 → 0.29.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -74
- package/dist/ai/agentIntent.d.ts +5 -0
- package/dist/ai/agentIntent.d.ts.map +1 -0
- package/dist/ai/agentIntent.js +8 -0
- package/dist/ai/agentIntent.js.map +1 -0
- package/dist/ai/block-document/constants.d.ts +9 -0
- package/dist/ai/block-document/constants.d.ts.map +1 -0
- package/dist/ai/block-document/constants.js +9 -0
- package/dist/ai/block-document/constants.js.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts +48 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts.map +1 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js +59 -0
- package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts +19 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js +37 -0
- package/dist/ai/block-document/createBlockDocumentChartTools.js.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts +32 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js +37 -0
- package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js.map +1 -0
- package/dist/ai/constants.d.ts +3 -0
- package/dist/ai/constants.d.ts.map +1 -0
- package/dist/ai/constants.js +3 -0
- package/dist/ai/constants.js.map +1 -0
- package/dist/ai/createDataTableExplorerTool.d.ts +69 -0
- package/dist/ai/createDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/createDataTableExplorerTool.js +68 -0
- package/dist/ai/createDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/constants.d.ts +6 -0
- package/dist/ai/dashboard/constants.d.ts.map +1 -0
- package/dist/ai/dashboard/constants.js +6 -0
- package/dist/ai/dashboard/constants.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts +17 -0
- package/dist/ai/dashboard/createDashboardAgentTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js +205 -0
- package/dist/ai/dashboard/createDashboardAgentTool.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts +14 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js +75 -0
- package/dist/ai/dashboard/createDashboardAiAdapter.js.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts +26 -0
- package/dist/ai/dashboard/createDashboardAiTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardAiTools.js +40 -0
- package/dist/ai/dashboard/createDashboardAiTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts +27 -0
- package/dist/ai/dashboard/createDashboardChartTools.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardChartTools.js +55 -0
- package/dist/ai/dashboard/createDashboardChartTools.js.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts +23 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js +29 -0
- package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts +28 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts.map +1 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js +54 -0
- package/dist/ai/dashboard/createListDashboardPanelsTool.js.map +1 -0
- package/dist/ai/dashboard/dashboard-types.d.ts +59 -0
- package/dist/ai/dashboard/dashboard-types.d.ts.map +1 -0
- package/dist/ai/dashboard/dashboard-types.js +2 -0
- package/dist/ai/dashboard/dashboard-types.js.map +1 -0
- package/dist/ai/database-types.d.ts +12 -0
- package/dist/ai/database-types.d.ts.map +1 -0
- package/dist/ai/database-types.js +2 -0
- package/dist/ai/database-types.js.map +1 -0
- package/dist/ai/errors.d.ts +8 -0
- package/dist/ai/errors.d.ts.map +1 -0
- package/dist/ai/errors.js +11 -0
- package/dist/ai/errors.js.map +1 -0
- package/dist/ai/tool-helpers.d.ts +28 -29
- package/dist/ai/tool-helpers.d.ts.map +1 -1
- package/dist/ai/tool-helpers.js +38 -76
- package/dist/ai/tool-helpers.js.map +1 -1
- package/dist/ai/tool-schemas.d.ts +9 -4
- package/dist/ai/tool-schemas.d.ts.map +1 -1
- package/dist/ai/tool-schemas.js +12 -12
- package/dist/ai/tool-schemas.js.map +1 -1
- package/dist/ai/tool-types.d.ts +19 -1
- package/dist/ai/tool-types.d.ts.map +1 -1
- package/dist/ai/tool-types.js.map +1 -1
- package/dist/ai/types.d.ts +64 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/ai.d.ts +16 -2
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +14 -5
- package/dist/ai.js.map +1 -1
- package/dist/charts/MosaicChart.js +1 -1
- package/dist/charts/MosaicChart.js.map +1 -1
- package/dist/charts/MosaicChartView.d.ts.map +1 -1
- package/dist/charts/MosaicChartView.js +1 -2
- package/dist/charts/MosaicChartView.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js +2 -1
- package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.d.ts.map +1 -1
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js +4 -11
- package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
- package/dist/charts/chart-types/base-types.d.ts +27 -23
- package/dist/charts/chart-types/base-types.d.ts.map +1 -1
- package/dist/charts/chart-types/base-types.js +3 -1
- package/dist/charts/chart-types/base-types.js.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/definition.js +1 -0
- package/dist/charts/chart-types/box-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts +37 -3
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js +26 -6
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +2 -2
- package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +12 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -3
- package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.d.ts +20 -24
- package/dist/charts/chart-types/box-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/box-plot/tool.js +25 -33
- package/dist/charts/chart-types/box-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/box-plot/validation.d.ts +9 -0
- package/dist/charts/chart-types/box-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/box-plot/validation.js +32 -0
- package/dist/charts/chart-types/box-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/column-types.d.ts +8 -0
- package/dist/charts/chart-types/column-types.d.ts.map +1 -0
- package/dist/charts/chart-types/column-types.js +2 -0
- package/dist/charts/chart-types/column-types.js.map +1 -0
- package/dist/charts/chart-types/count-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/definition.js +1 -0
- package/dist/charts/chart-types/count-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/spec.js +1 -19
- package/dist/charts/chart-types/count-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.d.ts +19 -24
- package/dist/charts/chart-types/count-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/count-plot/tool.js +25 -32
- package/dist/charts/chart-types/count-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/count-plot/validation.d.ts +8 -0
- package/dist/charts/chart-types/count-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/count-plot/validation.js +20 -0
- package/dist/charts/chart-types/count-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts +3 -0
- package/dist/charts/chart-types/createChartInstructions.d.ts.map +1 -0
- package/dist/charts/chart-types/createChartInstructions.js +12 -0
- package/dist/charts/chart-types/createChartInstructions.js.map +1 -0
- package/dist/charts/chart-types/createChartTools.d.ts +15 -9
- package/dist/charts/chart-types/createChartTools.d.ts.map +1 -1
- package/dist/charts/chart-types/createChartTools.js +16 -10
- package/dist/charts/chart-types/createChartTools.js.map +1 -1
- package/dist/charts/chart-types/custom-spec/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/custom-spec/definition.js +1 -0
- package/dist/charts/chart-types/custom-spec/definition.js.map +1 -1
- package/dist/charts/chart-types/errors.d.ts +10 -0
- package/dist/charts/chart-types/errors.d.ts.map +1 -1
- package/dist/charts/chart-types/errors.js +18 -0
- package/dist/charts/chart-types/errors.js.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/definition.js +1 -0
- package/dist/charts/chart-types/heatmap/definition.js.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/spec.js +1 -33
- package/dist/charts/chart-types/heatmap/spec.js.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.d.ts +20 -24
- package/dist/charts/chart-types/heatmap/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/heatmap/tool.js +26 -36
- package/dist/charts/chart-types/heatmap/tool.js.map +1 -1
- package/dist/charts/chart-types/heatmap/validation.d.ts +9 -0
- package/dist/charts/chart-types/heatmap/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/heatmap/validation.js +34 -0
- package/dist/charts/chart-types/heatmap/validation.js.map +1 -0
- package/dist/charts/chart-types/histogram/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/definition.js +1 -0
- package/dist/charts/chart-types/histogram/definition.js.map +1 -1
- package/dist/charts/chart-types/histogram/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/spec.js +1 -21
- package/dist/charts/chart-types/histogram/spec.js.map +1 -1
- package/dist/charts/chart-types/histogram/tool.d.ts +37 -24
- package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/histogram/tool.js +38 -32
- package/dist/charts/chart-types/histogram/tool.js.map +1 -1
- package/dist/charts/chart-types/histogram/validation.d.ts +9 -0
- package/dist/charts/chart-types/histogram/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/histogram/validation.js +22 -0
- package/dist/charts/chart-types/histogram/validation.js.map +1 -0
- package/dist/charts/chart-types/index.d.ts +1 -7
- package/dist/charts/chart-types/index.d.ts.map +1 -1
- package/dist/charts/chart-types/index.js +2 -8
- package/dist/charts/chart-types/index.js.map +1 -1
- package/dist/charts/chart-types/line-chart/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/definition.js +1 -0
- package/dist/charts/chart-types/line-chart/definition.js.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/spec.js +5 -46
- package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.d.ts +26 -24
- package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/line-chart/tool.js +26 -38
- package/dist/charts/chart-types/line-chart/tool.js.map +1 -1
- package/dist/charts/chart-types/line-chart/validation.d.ts +16 -0
- package/dist/charts/chart-types/line-chart/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/line-chart/validation.js +43 -0
- package/dist/charts/chart-types/line-chart/validation.js.map +1 -0
- package/dist/charts/chart-types/resolveChartTypes.d.ts +3 -0
- package/dist/charts/chart-types/resolveChartTypes.d.ts.map +1 -0
- package/dist/charts/chart-types/resolveChartTypes.js +8 -0
- package/dist/charts/chart-types/resolveChartTypes.js.map +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/definition.js +1 -0
- package/dist/charts/chart-types/scatter-plot/definition.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/spec.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/spec.js +1 -45
- package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/tool.d.ts +21 -24
- package/dist/charts/chart-types/scatter-plot/tool.d.ts.map +1 -1
- package/dist/charts/chart-types/scatter-plot/tool.js +28 -41
- package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -1
- package/dist/charts/chart-types/scatter-plot/validation.d.ts +13 -0
- package/dist/charts/chart-types/scatter-plot/validation.d.ts.map +1 -0
- package/dist/charts/chart-types/scatter-plot/validation.js +52 -0
- package/dist/charts/chart-types/scatter-plot/validation.js.map +1 -0
- package/dist/charts/chart-types/tool-types.d.ts +43 -0
- package/dist/charts/chart-types/tool-types.d.ts.map +1 -0
- package/dist/charts/chart-types/tool-types.js +2 -0
- package/dist/charts/chart-types/tool-types.js.map +1 -0
- package/dist/charts/chart-types/utils.d.ts +3 -0
- package/dist/charts/chart-types/utils.d.ts.map +1 -0
- package/dist/charts/chart-types/utils.js +4 -0
- package/dist/charts/chart-types/utils.js.map +1 -0
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.d.ts.map +1 -1
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js +5 -3
- package/dist/charts/dashboard/MosaicDashboardChartRenderer.js.map +1 -1
- package/dist/charts/useChartDataPolicy.js +2 -2
- package/dist/charts/useChartDataPolicy.js.map +1 -1
- package/dist/components/AggregationSelector.d.ts.map +1 -1
- package/dist/components/AggregationSelector.js +1 -1
- package/dist/components/AggregationSelector.js.map +1 -1
- package/dist/components/ColorSelector.d.ts.map +1 -1
- package/dist/components/ColorSelector.js +1 -2
- package/dist/components/ColorSelector.js.map +1 -1
- package/dist/components/FieldSelectorInput.d.ts.map +1 -1
- package/dist/components/FieldSelectorInput.js +3 -3
- package/dist/components/FieldSelectorInput.js.map +1 -1
- package/dist/components/TemporalGranularitySelector.d.ts.map +1 -1
- package/dist/components/TemporalGranularitySelector.js +1 -1
- package/dist/components/TemporalGranularitySelector.js.map +1 -1
- package/dist/dashboard/MosaicDashboardCommands.d.ts +19 -0
- package/dist/dashboard/MosaicDashboardCommands.d.ts.map +1 -0
- package/dist/dashboard/MosaicDashboardCommands.js +226 -0
- package/dist/dashboard/MosaicDashboardCommands.js.map +1 -0
- package/dist/dashboard/dashboard-types.d.ts.map +1 -1
- package/dist/dashboard/dashboard-types.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanel.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js +3 -3
- package/dist/dashboard/panel/MosaicDashboardPanelLayout.js.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.d.ts.map +1 -1
- package/dist/dashboard/panel/MosaicDashboardPanels.js +4 -2
- package/dist/dashboard/panel/MosaicDashboardPanels.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js +4 -4
- package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -1
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +5 -3
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.d.ts +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -1
- package/dist/dashboard/useSelectedOrFirstTable.js +10 -8
- package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerCategoryClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerCountClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerCountClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js +4 -4
- package/dist/data-table-explorer/DataTableExplorerHistogramClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js +3 -1
- package/dist/data-table-explorer/DataTableExplorerPageClient.js.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts +3 -2
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts.map +1 -1
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js +3 -3
- package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js +7 -4
- package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.d.ts +58 -2
- package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
- package/dist/data-table-explorer/dataTableExplorerController.js +68 -8
- package/dist/data-table-explorer/dataTableExplorerController.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts +23 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +46 -13
- package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +17 -3
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -1
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +9 -6
- package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js.map +1 -1
- package/dist/data-table-explorer/types.d.ts +10 -0
- package/dist/data-table-explorer/types.d.ts.map +1 -1
- package/dist/data-table-explorer/types.js.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.d.ts.map +1 -1
- package/dist/data-table-explorer/useDataTableExplorer.js +10 -6
- package/dist/data-table-explorer/useDataTableExplorer.js.map +1 -1
- package/dist/data-table-explorer/utils.d.ts +64 -6
- package/dist/data-table-explorer/utils.d.ts.map +1 -1
- package/dist/data-table-explorer/utils.js +58 -0
- package/dist/data-table-explorer/utils.js.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.d.ts.map +1 -1
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js +2 -2
- package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
- package/dist/index.d.ts +49 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -25
- package/dist/index.js.map +1 -1
- package/dist/mosaicTableReference.d.ts +59 -0
- package/dist/mosaicTableReference.d.ts.map +1 -0
- package/dist/mosaicTableReference.js +68 -0
- package/dist/mosaicTableReference.js.map +1 -0
- package/dist/useVgPlotChartRender.d.ts.map +1 -1
- package/dist/useVgPlotChartRender.js +26 -1
- package/dist/useVgPlotChartRender.js.map +1 -1
- package/dist/utils/table-lookup.d.ts +7 -0
- package/dist/utils/table-lookup.d.ts.map +1 -0
- package/dist/utils/table-lookup.js +10 -0
- package/dist/utils/table-lookup.js.map +1 -0
- package/package.json +14 -14
- package/dist/ai/ai.d.ts +0 -108
- package/dist/ai/ai.d.ts.map +0 -1
- package/dist/ai/ai.js +0 -461
- package/dist/ai/ai.js.map +0 -1
- package/dist/ai/data-table-explorer-tool.d.ts +0 -40
- package/dist/ai/data-table-explorer-tool.d.ts.map +0 -1
- package/dist/ai/data-table-explorer-tool.js +0 -75
- package/dist/ai/data-table-explorer-tool.js.map +0 -1
- package/dist/ai/list-panels-tool.d.ts +0 -35
- package/dist/ai/list-panels-tool.d.ts.map +0 -1
- package/dist/ai/list-panels-tool.js +0 -66
- package/dist/ai/list-panels-tool.js.map +0 -1
- package/dist/ai/remove-panel-tool.d.ts +0 -31
- package/dist/ai/remove-panel-tool.d.ts.map +0 -1
- package/dist/ai/remove-panel-tool.js +0 -55
- package/dist/ai/remove-panel-tool.js.map +0 -1
- package/dist/ai/tool-validation.d.ts +0 -3
- package/dist/ai/tool-validation.d.ts.map +0 -1
- package/dist/ai/tool-validation.js +0 -11
- package/dist/ai/tool-validation.js.map +0 -1
- package/dist/components/Combobox.d.ts +0 -45
- package/dist/components/Combobox.d.ts.map +0 -1
- package/dist/components/Combobox.js +0 -58
- package/dist/components/Combobox.js.map +0 -1
- package/dist/components/useCombobox.d.ts +0 -23
- package/dist/components/useCombobox.d.ts.map +0 -1
- package/dist/components/useCombobox.js +0 -26
- package/dist/components/useCombobox.js.map +0 -1
|
@@ -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"]}
|
|
@@ -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"]}
|
|
@@ -29,4 +29,14 @@ export declare class InvalidColumnTypeError extends ChartSpecError {
|
|
|
29
29
|
readonly expectedType: string;
|
|
30
30
|
constructor(columnNames: string[] | string, expectedType: string);
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Error thrown when attempting to create a chart that would render too many data points.
|
|
34
|
+
* Used to prevent browser crashes from non-aggregated charts on large datasets.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TooMuchDataError extends ChartSpecError {
|
|
37
|
+
readonly chartType: string;
|
|
38
|
+
readonly rowCount: number;
|
|
39
|
+
readonly maxDataPoints: number;
|
|
40
|
+
constructor(chartType: string, rowCount: number, maxDataPoints: number);
|
|
41
|
+
}
|
|
32
42
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;gBAElB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;CAM1C;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAEnB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;CAM3C;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,cAAc;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM;CAQjE"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;gBAElB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;CAM1C;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAEnB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;CAM3C;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,cAAc;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM;CAQjE;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAYvE"}
|
|
@@ -45,4 +45,22 @@ export class InvalidColumnTypeError extends ChartSpecError {
|
|
|
45
45
|
this.name = 'InvalidColumnTypeError';
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Error thrown when attempting to create a chart that would render too many data points.
|
|
50
|
+
* Used to prevent browser crashes from non-aggregated charts on large datasets.
|
|
51
|
+
*/
|
|
52
|
+
export class TooMuchDataError extends ChartSpecError {
|
|
53
|
+
chartType;
|
|
54
|
+
rowCount;
|
|
55
|
+
maxDataPoints;
|
|
56
|
+
constructor(chartType, rowCount, maxDataPoints) {
|
|
57
|
+
super(`Cannot create ${chartType} with ${rowCount.toLocaleString()} rows. ` +
|
|
58
|
+
`This chart type renders individual data points and is limited to ${maxDataPoints.toLocaleString()} rows. ` +
|
|
59
|
+
`Use an aggregated visualization instead (histogram, heatmap, or line chart with time intervals).`);
|
|
60
|
+
this.chartType = chartType;
|
|
61
|
+
this.rowCount = rowCount;
|
|
62
|
+
this.maxDataPoints = maxDataPoints;
|
|
63
|
+
this.name = 'TooMuchDataError';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
48
66
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/charts/chart-types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IAC5C,UAAU,CAAW;IAE9B,YAAY,UAA6B;QACvC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAErC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IAC5C,WAAW,CAAW;IAE/B,YAAY,WAA8B;QACxC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAEzC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAC/C,WAAW,CAAW;IACtB,YAAY,CAAS;IAE9B,YAAY,WAA8B,EAAE,YAAoB;QAC9D,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAE7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF","sourcesContent":["/**\n * Base error class for chart specification generation errors.\n */\nexport class ChartSpecError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ChartSpecError';\n }\n}\n\n/**\n * Error thrown when required chart configuration fields are missing.\n * Used during chart validation to indicate which fields must be provided.\n */\nexport class RequiredFieldsError extends ChartSpecError {\n readonly fieldNames: string[];\n\n constructor(fieldNames: string | string[]) {\n super('Required fields are missing');\n\n this.fieldNames = Array.isArray(fieldNames) ? fieldNames : [fieldNames];\n this.name = 'RequiredFieldsError';\n }\n}\n\n/**\n * Error thrown when chart configuration references columns that don't exist in the data table.\n * Used during chart validation to indicate which columns could not be found.\n */\nexport class MissingColumnsError extends ChartSpecError {\n readonly columnNames: string[];\n\n constructor(columnNames: string | string[]) {\n super('Columns not found in data table');\n\n this.columnNames = Array.isArray(columnNames) ? columnNames : [columnNames];\n this.name = 'MissingColumnsError';\n }\n}\n\n/**\n * Error thrown when chart configuration uses columns with incompatible data types.\n * Used during chart validation to indicate which columns have invalid types and what type is expected.\n */\nexport class InvalidColumnTypeError extends ChartSpecError {\n readonly columnNames: string[];\n readonly expectedType: string;\n\n constructor(columnNames: string[] | string, expectedType: string) {\n super('Invalid column type');\n\n this.columnNames = Array.isArray(columnNames) ? columnNames : [columnNames];\n this.expectedType = expectedType;\n\n this.name = 'InvalidColumnTypeError';\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/charts/chart-types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IAC5C,UAAU,CAAW;IAE9B,YAAY,UAA6B;QACvC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAErC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IAC5C,WAAW,CAAW;IAE/B,YAAY,WAA8B;QACxC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAEzC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAC/C,WAAW,CAAW;IACtB,YAAY,CAAS;IAE9B,YAAY,WAA8B,EAAE,YAAoB;QAC9D,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAE7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IACzC,SAAS,CAAS;IAClB,QAAQ,CAAS;IACjB,aAAa,CAAS;IAE/B,YAAY,SAAiB,EAAE,QAAgB,EAAE,aAAqB;QACpE,KAAK,CACH,iBAAiB,SAAS,SAAS,QAAQ,CAAC,cAAc,EAAE,SAAS;YACnE,oEAAoE,aAAa,CAAC,cAAc,EAAE,SAAS;YAC3G,kGAAkG,CACrG,CAAC;QAEF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF","sourcesContent":["/**\n * Base error class for chart specification generation errors.\n */\nexport class ChartSpecError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ChartSpecError';\n }\n}\n\n/**\n * Error thrown when required chart configuration fields are missing.\n * Used during chart validation to indicate which fields must be provided.\n */\nexport class RequiredFieldsError extends ChartSpecError {\n readonly fieldNames: string[];\n\n constructor(fieldNames: string | string[]) {\n super('Required fields are missing');\n\n this.fieldNames = Array.isArray(fieldNames) ? fieldNames : [fieldNames];\n this.name = 'RequiredFieldsError';\n }\n}\n\n/**\n * Error thrown when chart configuration references columns that don't exist in the data table.\n * Used during chart validation to indicate which columns could not be found.\n */\nexport class MissingColumnsError extends ChartSpecError {\n readonly columnNames: string[];\n\n constructor(columnNames: string | string[]) {\n super('Columns not found in data table');\n\n this.columnNames = Array.isArray(columnNames) ? columnNames : [columnNames];\n this.name = 'MissingColumnsError';\n }\n}\n\n/**\n * Error thrown when chart configuration uses columns with incompatible data types.\n * Used during chart validation to indicate which columns have invalid types and what type is expected.\n */\nexport class InvalidColumnTypeError extends ChartSpecError {\n readonly columnNames: string[];\n readonly expectedType: string;\n\n constructor(columnNames: string[] | string, expectedType: string) {\n super('Invalid column type');\n\n this.columnNames = Array.isArray(columnNames) ? columnNames : [columnNames];\n this.expectedType = expectedType;\n\n this.name = 'InvalidColumnTypeError';\n }\n}\n\n/**\n * Error thrown when attempting to create a chart that would render too many data points.\n * Used to prevent browser crashes from non-aggregated charts on large datasets.\n */\nexport class TooMuchDataError extends ChartSpecError {\n readonly chartType: string;\n readonly rowCount: number;\n readonly maxDataPoints: number;\n\n constructor(chartType: string, rowCount: number, maxDataPoints: number) {\n super(\n `Cannot create ${chartType} with ${rowCount.toLocaleString()} rows. ` +\n `This chart type renders individual data points and is limited to ${maxDataPoints.toLocaleString()} rows. ` +\n `Use an aggregated visualization instead (histogram, heatmap, or line chart with time intervals).`,\n );\n\n this.chartType = chartType;\n this.rowCount = rowCount;\n this.maxDataPoints = maxDataPoints;\n this.name = 'TooMuchDataError';\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AASlE,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AASlE,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,CAAC,kBAAkB,CAWxE,CAAC"}
|
|
@@ -9,6 +9,7 @@ export const heatmapChartType = {
|
|
|
9
9
|
id: 'heatmap',
|
|
10
10
|
label: 'Heatmap',
|
|
11
11
|
description: DESCRIPTION,
|
|
12
|
+
aiDescription: `${DESCRIPTION} - density/patterns across two dimensions (preferred for large datasets)`,
|
|
12
13
|
icon: Grid3X3,
|
|
13
14
|
schema: HeatmapChartSettings,
|
|
14
15
|
settingsComponent: HeatmapSettingsComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,wBAAwB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEzC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,oBAAoB;IAC5B,iBAAiB,EAAE,wBAAwB;IAC3C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE,iBAAiB;CAC9B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {HeatmapChartConfig, HeatmapChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {HeatmapSettingsComponent} from './HeatmapSettings';\nimport {createHeatmapAiTool} from './tool';\nimport {Grid3X3} from 'lucide-react';\nimport {createHeatmapSpec} from './spec';\n\nconst DESCRIPTION = 'Create a 2D heatmap of two fields';\n\nexport const heatmapChartType: SpecChartTypeDefinition<HeatmapChartConfig> = {\n id: 'heatmap',\n label: 'Heatmap',\n description: DESCRIPTION,\n icon: Grid3X3,\n schema: HeatmapChartSettings,\n settingsComponent: HeatmapSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createHeatmapAiTool,\n createSpec: createHeatmapSpec,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,wBAAwB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEzC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,GAAG,WAAW,0EAA0E;IACvG,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,oBAAoB;IAC5B,iBAAiB,EAAE,wBAAwB;IAC3C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE,iBAAiB;CAC9B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {HeatmapChartConfig, HeatmapChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {HeatmapSettingsComponent} from './HeatmapSettings';\nimport {createHeatmapAiTool} from './tool';\nimport {Grid3X3} from 'lucide-react';\nimport {createHeatmapSpec} from './spec';\n\nconst DESCRIPTION = 'Create a 2D heatmap of two fields';\n\nexport const heatmapChartType: SpecChartTypeDefinition<HeatmapChartConfig> = {\n id: 'heatmap',\n label: 'Heatmap',\n description: DESCRIPTION,\n aiDescription: `${DESCRIPTION} - density/patterns across two dimensions (preferred for large datasets)`,\n icon: Grid3X3,\n schema: HeatmapChartSettings,\n settingsComponent: HeatmapSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createHeatmapAiTool,\n createSpec: createHeatmapSpec,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAyB,MAAM,eAAe,CAAC;AAGxE,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,GAC/C,IAAI,CAgCN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, } from '../errors';
|
|
2
1
|
import { getChartTableReference } from '../base-types';
|
|
3
|
-
import {
|
|
2
|
+
import { validateHeatmapSettings } from './validation';
|
|
4
3
|
export function createHeatmapSpec(options) {
|
|
5
4
|
const { dataTable, selectionName } = options;
|
|
6
5
|
const { xColumn, yColumn } = validateHeatmapSettings(options);
|
|
@@ -30,35 +29,4 @@ export function createHeatmapSpec(options) {
|
|
|
30
29
|
params: { brush: { select: 'crossfilter' } },
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
function validateHeatmapSettings({ dataTable, settings: { x, y }, }) {
|
|
34
|
-
// Basic validation for required fields
|
|
35
|
-
if (!x || !y) {
|
|
36
|
-
throw new RequiredFieldsError([
|
|
37
|
-
...(x ? [] : ['X field']),
|
|
38
|
-
...(y ? [] : ['Y field']),
|
|
39
|
-
]);
|
|
40
|
-
}
|
|
41
|
-
// Validate X and Y field existence
|
|
42
|
-
const xColumn = dataTable.columns.find((col) => col.name === x);
|
|
43
|
-
const yColumn = dataTable.columns.find((col) => col.name === y);
|
|
44
|
-
if (!xColumn || !yColumn) {
|
|
45
|
-
throw new MissingColumnsError([
|
|
46
|
-
...(xColumn ? [] : [x]),
|
|
47
|
-
...(yColumn ? [] : [y]),
|
|
48
|
-
]);
|
|
49
|
-
}
|
|
50
|
-
// Validate X and Y field are numeric
|
|
51
|
-
const xIsNumeric = isNumericType(xColumn.type);
|
|
52
|
-
const yIsNumeric = isNumericType(yColumn.type);
|
|
53
|
-
if (!xIsNumeric || !yIsNumeric) {
|
|
54
|
-
throw new InvalidColumnTypeError([
|
|
55
|
-
...(!xIsNumeric ? [xColumn.name] : []),
|
|
56
|
-
...(!yIsNumeric ? [yColumn.name] : []),
|
|
57
|
-
], 'numeric');
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
xColumn,
|
|
61
|
-
yColumn,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
32
|
//# sourceMappingURL=spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/spec.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACxE,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAErD,MAAM,UAAU,iBAAiB,CAC/B,OAAgD;IAEhD,MAAM,EAAC,SAAS,EAAE,aAAa,EAAC,GAAG,OAAO,CAAC;IAE3C,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAE5D,MAAM,IAAI,GAAc;QACtB;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,EAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAC;YACnE,CAAC,EAAE,OAAO,CAAC,IAAI;YACf,CAAC,EAAE,OAAO,CAAC,IAAI;YACf,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;SACb;KACF,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,OAAO,CAAC,IAAI;QACpB,MAAM,EAAE,OAAO,CAAC,IAAI;QACpB,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;QACnD,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC,EAAC;KACjC,CAAC;AACZ,CAAC","sourcesContent":["import type {Spec} from '@uwdata/mosaic-spec';\nimport {HeatmapChartSettings} from './schema';\nimport {CreateSpecOptions, getChartTableReference} from '../base-types';\nimport {validateHeatmapSettings} from './validation';\n\nexport function createHeatmapSpec(\n options: CreateSpecOptions<HeatmapChartSettings>,\n): Spec {\n const {dataTable, selectionName} = options;\n\n const {xColumn, yColumn} = validateHeatmapSettings(options);\n\n const plot: unknown[] = [\n {\n mark: 'raster',\n data: {from: getChartTableReference(dataTable), filterBy: '$brush'},\n x: xColumn.name,\n y: yColumn.name,\n fill: 'density',\n bandwidth: 0,\n pixelSize: 3,\n },\n ];\n\n if (selectionName) {\n plot.push({select: 'intervalXY', as: '$brush'});\n }\n\n return {\n plot,\n colorScale: 'sqrt',\n colorScheme: 'ylorrd',\n xLabel: xColumn.name,\n yLabel: yColumn.name,\n height: 250,\n width: 380,\n margins: {left: 50, right: 20, top: 20, bottom: 50},\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
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 HeatmapToolInput: 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<{
|
|
@@ -11,30 +10,27 @@ export declare const HeatmapToolParameters: z.ZodObject<{
|
|
|
11
10
|
y: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
}, z.core.$strip>;
|
|
14
|
-
export type
|
|
15
|
-
export declare function createHeatmapAiTool(
|
|
16
|
-
|
|
13
|
+
export type HeatmapToolInput = z.infer<typeof HeatmapToolInput>;
|
|
14
|
+
export declare function createHeatmapAiTool({ databaseAdapter, addChart, maxDataPoints, }: ChartToolParams): import("ai").Tool<{
|
|
15
|
+
tableName: string;
|
|
17
16
|
reasoning: string;
|
|
18
17
|
settings: {
|
|
19
18
|
x: string;
|
|
20
19
|
y: string;
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
tableName?: string | undefined;
|
|
21
|
+
title?: string | undefined;
|
|
24
22
|
panelId?: string | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
errorMessage?: undefined;
|
|
31
|
-
};
|
|
32
|
-
} | {
|
|
33
|
-
llmResult: {
|
|
34
|
-
success: boolean;
|
|
35
|
-
errorMessage: string;
|
|
36
|
-
details?: undefined;
|
|
37
|
-
data?: undefined;
|
|
23
|
+
}, ChartToolOutput<{
|
|
24
|
+
chartType: "heatmap";
|
|
25
|
+
settings: {
|
|
26
|
+
x?: string | undefined;
|
|
27
|
+
y?: string | undefined;
|
|
38
28
|
};
|
|
39
|
-
|
|
29
|
+
settingsOpen?: boolean | undefined;
|
|
30
|
+
dataPolicy?: {
|
|
31
|
+
disabled?: boolean | undefined;
|
|
32
|
+
maxRows?: number | undefined;
|
|
33
|
+
reason?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}>>;
|
|
40
36
|
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/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/heatmap/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,gBAAgB;;;;;;;;;iBAE3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,QAAQ,EACR,aAAa,GACd,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;IAiDjB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { tool } from 'ai';
|
|
2
2
|
import { HeatmapChartSettings } from './schema';
|
|
3
|
-
import {
|
|
4
|
-
import { validateColumnExists } from '../../../ai/tool-validation';
|
|
3
|
+
import { BaseChartToolInput } from '../../../ai/tool-schemas';
|
|
5
4
|
import { NUMERIC_COLUMN_TYPES } from '../../../column-types-utils';
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { validateHeatmapSettings } from './validation';
|
|
6
|
+
import { ensureTable } from '../../../ai/tool-helpers';
|
|
7
|
+
export const HeatmapToolInput = BaseChartToolInput.extend({
|
|
8
8
|
settings: HeatmapChartSettings.required(),
|
|
9
9
|
});
|
|
10
|
-
export function createHeatmapAiTool(
|
|
10
|
+
export function createHeatmapAiTool({ databaseAdapter, addChart, maxDataPoints, }) {
|
|
11
11
|
return tool({
|
|
12
12
|
description: `Heatmap: visualizes density or aggregated values across two dimensions using color intensity in a grid. Each cell color shows count/sum at that x,y position.
|
|
13
13
|
|
|
@@ -16,49 +16,39 @@ Example queries: "heatmap of population density by latitude and longitude", "tem
|
|
|
16
16
|
|
|
17
17
|
Required: x and y should be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}) for creating the grid.
|
|
18
18
|
|
|
19
|
-
NOTE: Heatmaps aggregate data into grid cells and compute density/counts, so they handle large datasets efficiently (no data point limit). Heatmaps are a good alternative when scatter charts would exceed ${
|
|
20
|
-
|
|
21
|
-
To UPDATE an existing heatmap: provide the panelId parameter. Otherwise creates new panel.
|
|
19
|
+
NOTE: Heatmaps aggregate data into grid cells and compute density/counts, so they handle large datasets efficiently (no data point limit). Heatmaps are a good alternative when scatter charts would exceed ${maxDataPoints.toLocaleString()} rows.
|
|
22
20
|
|
|
23
21
|
Best for: large datasets with overlapping points, finding patterns/hotspots in 2D space, temporal patterns (hour×day), spatial density visualization.
|
|
24
22
|
|
|
25
23
|
Do NOT use for: individual point plots (use scatter-plot), single variable distribution (use histogram), time trends (use line-chart).`,
|
|
26
|
-
inputSchema:
|
|
27
|
-
execute: async (
|
|
24
|
+
inputSchema: HeatmapToolInput,
|
|
25
|
+
execute: async ({ tableName, title, settings, panelId }) => {
|
|
28
26
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
const dataTable = ensureTable(databaseAdapter, tableName);
|
|
28
|
+
validateHeatmapSettings({
|
|
29
|
+
dataTable,
|
|
30
|
+
settings,
|
|
31
|
+
});
|
|
32
|
+
const chartConfig = {
|
|
33
|
+
chartType: 'heatmap',
|
|
34
|
+
settings,
|
|
35
|
+
};
|
|
36
|
+
await addChart({
|
|
37
37
|
tableName,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
config: {
|
|
42
|
-
chartType: 'heatmap',
|
|
43
|
-
settings: params.settings,
|
|
44
|
-
},
|
|
38
|
+
panelId,
|
|
39
|
+
title,
|
|
40
|
+
config: chartConfig,
|
|
45
41
|
});
|
|
46
42
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? `Updated heatmap "${result.title}".`
|
|
51
|
-
: `Created heatmap "${result.title}".`,
|
|
52
|
-
data: result,
|
|
53
|
-
},
|
|
43
|
+
success: true,
|
|
44
|
+
details: `Generated heatmap configuration.`,
|
|
45
|
+
data: chartConfig,
|
|
54
46
|
};
|
|
55
47
|
}
|
|
56
48
|
catch (error) {
|
|
57
49
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
61
|
-
},
|
|
50
|
+
success: false,
|
|
51
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
62
52
|
};
|
|
63
53
|
}
|
|
64
54
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/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/heatmap/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAqB,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACxD,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAIH,MAAM,UAAU,mBAAmB,CAAC,EAClC,eAAe,EACf,QAAQ,EACR,aAAa,GACG;IAChB,OAAO,IAAI,CAAwD;QACjE,WAAW,EAAE;;;;;uCAKsB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;8MAEwI,aAAa,CAAC,cAAc,EAAE;;;;uIAIrG;QACnI,WAAW,EAAE,gBAAgB;QAC7B,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,uBAAuB,CAAC;oBACtB,SAAS;oBACT,QAAQ;iBACT,CAAC,CAAC;gBAEH,MAAM,WAAW,GAAuB;oBACtC,SAAS,EAAE,SAAkB;oBAC7B,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,kCAAkC;oBAC3C,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 {HeatmapChartConfig, HeatmapChartSettings} from './schema';\nimport {BaseChartToolInput} from '../../../ai/tool-schemas';\nimport {NUMERIC_COLUMN_TYPES} from '../../../column-types-utils';\nimport {ChartToolParams, ChartToolOutput} from '../tool-types';\nimport {validateHeatmapSettings} from './validation';\nimport {ensureTable} from '../../../ai/tool-helpers';\n\nexport const HeatmapToolInput = BaseChartToolInput.extend({\n settings: HeatmapChartSettings.required(),\n});\n\nexport type HeatmapToolInput = z.infer<typeof HeatmapToolInput>;\n\nexport function createHeatmapAiTool({\n databaseAdapter,\n addChart,\n maxDataPoints,\n}: ChartToolParams) {\n return tool<HeatmapToolInput, ChartToolOutput<HeatmapChartConfig>>({\n description: `Heatmap: visualizes density or aggregated values across two dimensions using color intensity in a grid. Each cell color shows count/sum at that x,y position.\n\nUse when: user asks about \"heatmap\", \"density by X and Y\", \"activity by [category] and [category]\", \"intensity\", \"patterns across two dimensions\".\nExample queries: \"heatmap of population density by latitude and longitude\", \"temperature by elevation and month\", \"show building density by coordinates\", \"land use intensity by region and type\", \"feature distribution by grid cell\".\n\nRequired: x and y should be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}) for creating the grid.\n\nNOTE: Heatmaps aggregate data into grid cells and compute density/counts, so they handle large datasets efficiently (no data point limit). Heatmaps are a good alternative when scatter charts would exceed ${maxDataPoints.toLocaleString()} rows.\n\nBest for: large datasets with overlapping points, finding patterns/hotspots in 2D space, temporal patterns (hour×day), spatial density visualization.\n\nDo NOT use for: individual point plots (use scatter-plot), single variable distribution (use histogram), time trends (use line-chart).`,\n inputSchema: HeatmapToolInput,\n execute: async ({tableName, title, settings, panelId}) => {\n try {\n const dataTable = ensureTable(databaseAdapter, tableName);\n\n validateHeatmapSettings({\n dataTable,\n settings,\n });\n\n const chartConfig: HeatmapChartConfig = {\n chartType: 'heatmap' 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 heatmap configuration.`,\n data: chartConfig,\n };\n } catch (error) {\n return {\n success: false,\n errorMessage: error instanceof Error ? error.message : String(error),\n };\n }\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeatmapChartSettings } from './schema';
|
|
2
|
+
import { ValidateSpecOptions } from '../base-types';
|
|
3
|
+
import { TableColumn } from '@sqlrooms/duckdb';
|
|
4
|
+
export type ValidatedHeatmapSettings = {
|
|
5
|
+
xColumn: TableColumn;
|
|
6
|
+
yColumn: TableColumn;
|
|
7
|
+
};
|
|
8
|
+
export declare function validateHeatmapSettings({ dataTable, settings: { x, y }, }: ValidateSpecOptions<HeatmapChartSettings>): ValidatedHeatmapSettings;
|
|
9
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAOlD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,GACjB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,GAAG,wBAAwB,CAqCtE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, } from '../errors';
|
|
2
|
+
import { isNumericType } from '../../../column-types-utils';
|
|
3
|
+
export function validateHeatmapSettings({ dataTable, settings: { x, y }, }) {
|
|
4
|
+
// Basic validation for required fields
|
|
5
|
+
if (!x || !y) {
|
|
6
|
+
throw new RequiredFieldsError([
|
|
7
|
+
...(x ? [] : ['X field']),
|
|
8
|
+
...(y ? [] : ['Y field']),
|
|
9
|
+
]);
|
|
10
|
+
}
|
|
11
|
+
// Validate X and Y field existence
|
|
12
|
+
const xColumn = dataTable.columns.find((col) => col.name === x);
|
|
13
|
+
const yColumn = dataTable.columns.find((col) => col.name === y);
|
|
14
|
+
if (!xColumn || !yColumn) {
|
|
15
|
+
throw new MissingColumnsError([
|
|
16
|
+
...(xColumn ? [] : [x]),
|
|
17
|
+
...(yColumn ? [] : [y]),
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
// Validate X and Y field are numeric
|
|
21
|
+
const xIsNumeric = isNumericType(xColumn.type);
|
|
22
|
+
const yIsNumeric = isNumericType(yColumn.type);
|
|
23
|
+
if (!xIsNumeric || !yIsNumeric) {
|
|
24
|
+
throw new InvalidColumnTypeError([
|
|
25
|
+
...(!xIsNumeric ? [xColumn.name] : []),
|
|
26
|
+
...(!yIsNumeric ? [yColumn.name] : []),
|
|
27
|
+
], 'numeric');
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
xColumn,
|
|
31
|
+
yColumn,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/heatmap/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAQ1D,MAAM,UAAU,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,GAC0B;IAC1C,uCAAuC;IACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAEhE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IAED,qCAAqC;IACrC,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,sBAAsB,CAC9B;YACE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACvC,EACD,SAAS,CACV,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import {HeatmapChartSettings} from './schema';\nimport {ValidateSpecOptions} from '../base-types';\nimport {\n InvalidColumnTypeError,\n MissingColumnsError,\n RequiredFieldsError,\n} from '../errors';\nimport {isNumericType} from '../../../column-types-utils';\nimport {TableColumn} from '@sqlrooms/duckdb';\n\nexport type ValidatedHeatmapSettings = {\n xColumn: TableColumn;\n yColumn: TableColumn;\n};\n\nexport function validateHeatmapSettings({\n dataTable,\n settings: {x, y},\n}: ValidateSpecOptions<HeatmapChartSettings>): ValidatedHeatmapSettings {\n // Basic validation for required fields\n if (!x || !y) {\n throw new RequiredFieldsError([\n ...(x ? [] : ['X field']),\n ...(y ? [] : ['Y field']),\n ]);\n }\n\n // Validate X and Y field existence\n const xColumn = dataTable.columns.find((col) => col.name === x);\n const yColumn = dataTable.columns.find((col) => col.name === y);\n\n if (!xColumn || !yColumn) {\n throw new MissingColumnsError([\n ...(xColumn ? [] : [x]),\n ...(yColumn ? [] : [y]),\n ]);\n }\n\n // Validate X and Y field are numeric\n const xIsNumeric = isNumericType(xColumn.type);\n const yIsNumeric = isNumericType(yColumn.type);\n if (!xIsNumeric || !yIsNumeric) {\n throw new InvalidColumnTypeError(\n [\n ...(!xIsNumeric ? [xColumn.name] : []),\n ...(!yIsNumeric ? [yColumn.name] : []),\n ],\n 'numeric',\n );\n }\n\n return {\n xColumn,\n yColumn,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/histogram/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,UAAU,CAAC;AAStE,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/histogram/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,UAAU,CAAC;AAStE,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAY1E,CAAC"}
|