@sqlrooms/mosaic 0.29.0-rc.5 → 0.29.0-rc.6
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 +43 -39
- package/dist/DataPointLimitError.d.ts +9 -0
- package/dist/DataPointLimitError.d.ts.map +1 -0
- package/dist/DataPointLimitError.js +14 -0
- package/dist/DataPointLimitError.js.map +1 -0
- package/dist/MosaicSlice.d.ts.map +1 -1
- package/dist/MosaicSlice.js +3 -3
- package/dist/MosaicSlice.js.map +1 -1
- package/dist/VgPlotChart.d.ts +8 -11
- package/dist/VgPlotChart.d.ts.map +1 -1
- package/dist/VgPlotChart.js +74 -90
- package/dist/VgPlotChart.js.map +1 -1
- package/dist/VgPlotChartError.d.ts +7 -0
- package/dist/VgPlotChartError.d.ts.map +1 -0
- package/dist/VgPlotChartError.js +9 -0
- package/dist/VgPlotChartError.js.map +1 -0
- package/dist/ai.d.ts +103 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +445 -0
- package/dist/ai.js.map +1 -0
- package/dist/boxplot/BoxPlotClient.d.ts +7 -0
- package/dist/boxplot/BoxPlotClient.d.ts.map +1 -1
- package/dist/boxplot/BoxPlotClient.js +22 -0
- package/dist/boxplot/BoxPlotClient.js.map +1 -1
- package/dist/chart/ChartRuntimeIssuePanel.d.ts +7 -0
- package/dist/chart/ChartRuntimeIssuePanel.d.ts.map +1 -0
- package/dist/chart/ChartRuntimeIssuePanel.js +10 -0
- package/dist/chart/ChartRuntimeIssuePanel.js.map +1 -0
- package/dist/chart/MosaicDashboardChart.d.ts +1 -1
- package/dist/chart/MosaicDashboardChart.d.ts.map +1 -1
- package/dist/chart/MosaicDashboardChart.js +1 -1
- package/dist/chart/MosaicDashboardChart.js.map +1 -1
- package/dist/chart/MosaicDashboardChartContent.d.ts +1 -1
- package/dist/chart/MosaicDashboardChartContent.d.ts.map +1 -1
- package/dist/chart/MosaicDashboardChartContent.js +29 -2
- package/dist/chart/MosaicDashboardChartContent.js.map +1 -1
- package/dist/chart/MosaicDashboardChartRenderer.d.ts +2 -1
- package/dist/chart/MosaicDashboardChartRenderer.d.ts.map +1 -1
- package/dist/chart/MosaicDashboardChartRenderer.js +2 -2
- package/dist/chart/MosaicDashboardChartRenderer.js.map +1 -1
- package/dist/chart/MosaicDashboardComponentChart.d.ts +5 -1
- package/dist/chart/MosaicDashboardComponentChart.d.ts.map +1 -1
- package/dist/chart/MosaicDashboardComponentChart.js +4 -1
- package/dist/chart/MosaicDashboardComponentChart.js.map +1 -1
- package/dist/chart/MosaicDashboardVgPlotChart.d.ts +4 -0
- package/dist/chart/MosaicDashboardVgPlotChart.d.ts.map +1 -1
- package/dist/chart/MosaicDashboardVgPlotChart.js +2 -2
- package/dist/chart/MosaicDashboardVgPlotChart.js.map +1 -1
- package/dist/chart/addChartPanelAction.d.ts +3 -0
- package/dist/chart/addChartPanelAction.d.ts.map +1 -0
- package/dist/chart/addChartPanelAction.js +14 -0
- package/dist/chart/addChartPanelAction.js.map +1 -0
- package/dist/chart/chart-settings/ChartSettings.d.ts.map +1 -1
- package/dist/chart/chart-settings/ChartSettings.js +7 -4
- package/dist/chart/chart-settings/ChartSettings.js.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsContent.d.ts +1 -1
- package/dist/chart/chart-settings/ChartSettingsContent.d.ts.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsContent.js.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsContext.d.ts +0 -2
- package/dist/chart/chart-settings/ChartSettingsContext.d.ts.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsContext.js +6 -7
- package/dist/chart/chart-settings/ChartSettingsContext.js.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsPanel.d.ts +1 -1
- package/dist/chart/chart-settings/ChartSettingsPanel.d.ts.map +1 -1
- package/dist/chart/chart-settings/ChartSettingsPanel.js +1 -1
- package/dist/chart/chart-settings/ChartSettingsPanel.js.map +1 -1
- package/dist/chart/chart-settings/ChartTypeSelector.d.ts.map +1 -1
- package/dist/chart/chart-settings/ChartTypeSelector.js +5 -5
- package/dist/chart/chart-settings/ChartTypeSelector.js.map +1 -1
- package/dist/chart-builders/ColumnSelector.d.ts +0 -2
- package/dist/chart-builders/ColumnSelector.d.ts.map +1 -1
- package/dist/chart-builders/ColumnSelector.js +4 -5
- package/dist/chart-builders/ColumnSelector.js.map +1 -1
- package/dist/chart-builders/ColumnsContext.d.ts +13 -0
- package/dist/chart-builders/ColumnsContext.d.ts.map +1 -0
- package/dist/chart-builders/ColumnsContext.js +15 -0
- package/dist/chart-builders/ColumnsContext.js.map +1 -0
- package/dist/chart-builders/MultiFieldSelector.js +4 -4
- package/dist/chart-builders/MultiFieldSelector.js.map +1 -1
- package/dist/chart-builders/TableSelector.d.ts +14 -0
- package/dist/chart-builders/TableSelector.d.ts.map +1 -0
- package/dist/chart-builders/TableSelector.js +23 -0
- package/dist/chart-builders/TableSelector.js.map +1 -0
- package/dist/chart-runtime.d.ts +50 -0
- package/dist/chart-runtime.d.ts.map +1 -0
- package/dist/chart-runtime.js +76 -0
- package/dist/chart-runtime.js.map +1 -0
- package/dist/chart-types/base-types.d.ts +45 -25
- package/dist/chart-types/base-types.d.ts.map +1 -1
- package/dist/chart-types/base-types.js.map +1 -1
- package/dist/chart-types/box-plot/definition.d.ts.map +1 -1
- package/dist/chart-types/box-plot/definition.js +5 -0
- package/dist/chart-types/box-plot/definition.js.map +1 -1
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.d.ts.map +1 -1
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +4 -1
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +4 -0
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -2
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
- package/dist/chart-types/box-plot/schema.d.ts +5 -0
- package/dist/chart-types/box-plot/schema.d.ts.map +1 -1
- package/dist/chart-types/box-plot/schema.js +2 -0
- package/dist/chart-types/box-plot/schema.js.map +1 -1
- package/dist/chart-types/box-plot/tool.d.ts +5 -9
- package/dist/chart-types/box-plot/tool.d.ts.map +1 -1
- package/dist/chart-types/box-plot/tool.js +14 -6
- package/dist/chart-types/box-plot/tool.js.map +1 -1
- package/dist/chart-types/bubble-chart/definition.d.ts.map +1 -1
- package/dist/chart-types/bubble-chart/definition.js +5 -0
- package/dist/chart-types/bubble-chart/definition.js.map +1 -1
- package/dist/chart-types/bubble-chart/schema.d.ts +5 -0
- package/dist/chart-types/bubble-chart/schema.d.ts.map +1 -1
- package/dist/chart-types/bubble-chart/schema.js +2 -0
- package/dist/chart-types/bubble-chart/schema.js.map +1 -1
- package/dist/chart-types/bubble-chart/tool.d.ts +5 -9
- package/dist/chart-types/bubble-chart/tool.d.ts.map +1 -1
- package/dist/chart-types/bubble-chart/tool.js +17 -9
- package/dist/chart-types/bubble-chart/tool.js.map +1 -1
- package/dist/chart-types/chart-config.d.ts +46 -0
- package/dist/chart-types/chart-config.d.ts.map +1 -1
- package/dist/chart-types/chart-config.js +2 -0
- package/dist/chart-types/chart-config.js.map +1 -1
- package/dist/chart-types/count-plot/schema.d.ts +5 -0
- package/dist/chart-types/count-plot/schema.d.ts.map +1 -1
- package/dist/chart-types/count-plot/schema.js +2 -0
- package/dist/chart-types/count-plot/schema.js.map +1 -1
- package/dist/chart-types/count-plot/tool.d.ts +5 -9
- package/dist/chart-types/count-plot/tool.d.ts.map +1 -1
- package/dist/chart-types/count-plot/tool.js +14 -6
- package/dist/chart-types/count-plot/tool.js.map +1 -1
- package/dist/chart-types/custom-spec/definition.d.ts.map +1 -1
- package/dist/chart-types/custom-spec/definition.js +5 -0
- package/dist/chart-types/custom-spec/definition.js.map +1 -1
- package/dist/chart-types/custom-spec/schema.d.ts +5 -0
- package/dist/chart-types/custom-spec/schema.d.ts.map +1 -1
- package/dist/chart-types/custom-spec/schema.js +2 -0
- package/dist/chart-types/custom-spec/schema.js.map +1 -1
- package/dist/chart-types/data-policy-schema.d.ts +8 -0
- package/dist/chart-types/data-policy-schema.d.ts.map +1 -0
- package/dist/chart-types/data-policy-schema.js +7 -0
- package/dist/chart-types/data-policy-schema.js.map +1 -0
- package/dist/chart-types/heatmap/schema.d.ts +5 -0
- package/dist/chart-types/heatmap/schema.d.ts.map +1 -1
- package/dist/chart-types/heatmap/schema.js +2 -0
- package/dist/chart-types/heatmap/schema.js.map +1 -1
- package/dist/chart-types/heatmap/tool.d.ts +5 -9
- package/dist/chart-types/heatmap/tool.d.ts.map +1 -1
- package/dist/chart-types/heatmap/tool.js +16 -8
- package/dist/chart-types/heatmap/tool.js.map +1 -1
- package/dist/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
- package/dist/chart-types/histogram/HistogramSettings.js +4 -2
- package/dist/chart-types/histogram/HistogramSettings.js.map +1 -1
- package/dist/chart-types/histogram/schema.d.ts +10 -0
- package/dist/chart-types/histogram/schema.d.ts.map +1 -1
- package/dist/chart-types/histogram/schema.js +13 -0
- package/dist/chart-types/histogram/schema.js.map +1 -1
- package/dist/chart-types/histogram/spec.d.ts +1 -1
- package/dist/chart-types/histogram/spec.d.ts.map +1 -1
- package/dist/chart-types/histogram/spec.js +4 -3
- package/dist/chart-types/histogram/spec.js.map +1 -1
- package/dist/chart-types/histogram/tool.d.ts +7 -9
- package/dist/chart-types/histogram/tool.d.ts.map +1 -1
- package/dist/chart-types/histogram/tool.js +17 -7
- package/dist/chart-types/histogram/tool.js.map +1 -1
- package/dist/chart-types/index.d.ts +45 -3
- package/dist/chart-types/index.d.ts.map +1 -1
- package/dist/chart-types/index.js +8 -2
- package/dist/chart-types/index.js.map +1 -1
- package/dist/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
- package/dist/chart-types/line-chart/LineChartSettings.js +3 -1
- package/dist/chart-types/line-chart/LineChartSettings.js.map +1 -1
- package/dist/chart-types/line-chart/definition.d.ts.map +1 -1
- package/dist/chart-types/line-chart/definition.js +7 -0
- package/dist/chart-types/line-chart/definition.js.map +1 -1
- package/dist/chart-types/line-chart/schema.d.ts +5 -0
- package/dist/chart-types/line-chart/schema.d.ts.map +1 -1
- package/dist/chart-types/line-chart/schema.js +2 -0
- package/dist/chart-types/line-chart/schema.js.map +1 -1
- package/dist/chart-types/line-chart/tool.d.ts +5 -9
- package/dist/chart-types/line-chart/tool.d.ts.map +1 -1
- package/dist/chart-types/line-chart/tool.js +16 -8
- package/dist/chart-types/line-chart/tool.js.map +1 -1
- package/dist/chart-types/list-panels-tool.d.ts +35 -0
- package/dist/chart-types/list-panels-tool.d.ts.map +1 -0
- package/dist/chart-types/list-panels-tool.js +66 -0
- package/dist/chart-types/list-panels-tool.js.map +1 -0
- package/dist/chart-types/profiler-tool.d.ts +40 -0
- package/dist/chart-types/profiler-tool.d.ts.map +1 -0
- package/dist/chart-types/profiler-tool.js +73 -0
- package/dist/chart-types/profiler-tool.js.map +1 -0
- package/dist/chart-types/remove-panel-tool.d.ts +31 -0
- package/dist/chart-types/remove-panel-tool.d.ts.map +1 -0
- package/dist/chart-types/remove-panel-tool.js +55 -0
- package/dist/chart-types/remove-panel-tool.js.map +1 -0
- package/dist/chart-types/text-panel-tool.d.ts +42 -0
- package/dist/chart-types/text-panel-tool.d.ts.map +1 -0
- package/dist/chart-types/text-panel-tool.js +71 -0
- package/dist/chart-types/text-panel-tool.js.map +1 -0
- package/dist/chart-types/tool-helpers.d.ts +44 -0
- package/dist/chart-types/tool-helpers.d.ts.map +1 -0
- package/dist/chart-types/tool-helpers.js +129 -0
- package/dist/chart-types/tool-helpers.js.map +1 -0
- package/dist/chart-types/tool-schemas.d.ts +1 -0
- package/dist/chart-types/tool-schemas.d.ts.map +1 -1
- package/dist/chart-types/tool-schemas.js +5 -1
- package/dist/chart-types/tool-schemas.js.map +1 -1
- package/dist/dashboard/MosaicDashboard.d.ts +5 -2
- package/dist/dashboard/MosaicDashboard.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboard.js +20 -39
- package/dist/dashboard/MosaicDashboard.js.map +1 -1
- package/dist/dashboard/MosaicDashboardContext.d.ts +2 -0
- package/dist/dashboard/MosaicDashboardContext.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardContext.js.map +1 -1
- package/dist/dashboard/MosaicDashboardEmptyState.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardEmptyState.js +8 -44
- package/dist/dashboard/MosaicDashboardEmptyState.js.map +1 -1
- package/dist/dashboard/MosaicDashboardPanel.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardPanel.js +2 -5
- package/dist/dashboard/MosaicDashboardPanel.js.map +1 -1
- package/dist/dashboard/MosaicDashboardPanelHeader.d.ts +2 -2
- package/dist/dashboard/MosaicDashboardPanelHeader.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardPanelHeader.js +2 -2
- package/dist/dashboard/MosaicDashboardPanelHeader.js.map +1 -1
- package/dist/dashboard/MosaicDashboardPanels.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardPanels.js +3 -2
- package/dist/dashboard/MosaicDashboardPanels.js.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.d.ts +185 -107
- package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.js +80 -57
- package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
- package/dist/dashboard/action-types.d.ts +25 -0
- package/dist/dashboard/action-types.d.ts.map +1 -0
- package/dist/dashboard/action-types.js +5 -0
- package/dist/dashboard/action-types.js.map +1 -0
- package/dist/dashboard/core-types.d.ts +26 -0
- package/dist/dashboard/core-types.d.ts.map +1 -0
- package/dist/dashboard/core-types.js +21 -0
- package/dist/dashboard/core-types.js.map +1 -0
- package/dist/dashboard/dashboard-types.d.ts +491 -0
- package/dist/dashboard/dashboard-types.d.ts.map +1 -0
- package/dist/dashboard/dashboard-types.js +54 -0
- package/dist/dashboard/dashboard-types.js.map +1 -0
- package/dist/dashboard/defaultPanelActions.d.ts +3 -0
- package/dist/dashboard/defaultPanelActions.d.ts.map +1 -0
- package/dist/dashboard/defaultPanelActions.js +9 -0
- package/dist/dashboard/defaultPanelActions.js.map +1 -0
- package/dist/dashboard/defaultPanelRenderers.d.ts.map +1 -1
- package/dist/dashboard/defaultPanelRenderers.js +1 -1
- package/dist/dashboard/defaultPanelRenderers.js.map +1 -1
- package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts +6 -0
- package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts.map +1 -0
- package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js +46 -0
- package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js.map +1 -0
- package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts +7 -0
- package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts.map +1 -0
- package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js +29 -0
- package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js.map +1 -0
- package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts +6 -0
- package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts.map +1 -0
- package/dist/dashboard/initial-state/MosaicDashboardInitialState.js +9 -0
- package/dist/dashboard/initial-state/MosaicDashboardInitialState.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts +7 -0
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +12 -0
- package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts +7 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +36 -0
- package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -0
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +15 -0
- package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -0
- package/dist/dashboard/useAddPanelActions.d.ts +10 -0
- package/dist/dashboard/useAddPanelActions.d.ts.map +1 -0
- package/dist/dashboard/useAddPanelActions.js +26 -0
- package/dist/dashboard/useAddPanelActions.js.map +1 -0
- package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts +3 -0
- package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts.map +1 -0
- package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js +18 -0
- package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js.map +1 -0
- package/dist/dashboard/useSelectedOrFirstTable.d.ts +10 -0
- package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -0
- package/dist/dashboard/useSelectedOrFirstTable.js +25 -0
- package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -0
- package/dist/dashboard/useTablesWithColumns.d.ts +9 -0
- package/dist/dashboard/useTablesWithColumns.d.ts.map +1 -0
- package/dist/dashboard/useTablesWithColumns.js +13 -0
- package/dist/dashboard/useTablesWithColumns.js.map +1 -0
- package/dist/index.d.ts +25 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts +2 -1
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts.map +1 -1
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js +3 -3
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js.map +1 -1
- package/dist/profiler/addProfilerPanelAction.d.ts +3 -0
- package/dist/profiler/addProfilerPanelAction.d.ts.map +1 -0
- package/dist/profiler/addProfilerPanelAction.js +9 -0
- package/dist/profiler/addProfilerPanelAction.js.map +1 -0
- package/dist/text/MosaicDashboardTextRenderer.d.ts +2 -1
- package/dist/text/MosaicDashboardTextRenderer.d.ts.map +1 -1
- package/dist/text/MosaicDashboardTextRenderer.js +4 -4
- package/dist/text/MosaicDashboardTextRenderer.js.map +1 -1
- package/dist/text/addTextPanelAction.d.ts +3 -0
- package/dist/text/addTextPanelAction.d.ts.map +1 -0
- package/dist/text/addTextPanelAction.js +9 -0
- package/dist/text/addTextPanelAction.js.map +1 -0
- package/dist/useMosaicClient.d.ts +4 -0
- package/dist/useMosaicClient.d.ts.map +1 -1
- package/dist/useMosaicClient.js +33 -3
- package/dist/useMosaicClient.js.map +1 -1
- package/dist/useVgPlotChartError.d.ts +13 -0
- package/dist/useVgPlotChartError.d.ts.map +1 -0
- package/dist/useVgPlotChartError.js +18 -0
- package/dist/useVgPlotChartError.js.map +1 -0
- package/dist/useVgPlotChartRender.d.ts +24 -0
- package/dist/useVgPlotChartRender.d.ts.map +1 -0
- package/dist/useVgPlotChartRender.js +152 -0
- package/dist/useVgPlotChartRender.js.map +1 -0
- package/dist/useVgPlotChartRetention.d.ts +21 -0
- package/dist/useVgPlotChartRetention.d.ts.map +1 -0
- package/dist/useVgPlotChartRetention.js +63 -0
- package/dist/useVgPlotChartRetention.js.map +1 -0
- package/dist/wrapCoordinatorWithValidation.d.ts +11 -0
- package/dist/wrapCoordinatorWithValidation.d.ts.map +1 -0
- package/dist/wrapCoordinatorWithValidation.js +23 -0
- package/dist/wrapCoordinatorWithValidation.js.map +1 -0
- package/package.json +31 -13
- package/dist/dashboard/MosaicDashboardToolbar.d.ts.map +0 -1
- package/dist/dashboard/MosaicDashboardToolbar.js +0 -86
- package/dist/dashboard/MosaicDashboardToolbar.js.map +0 -1
- /package/dist/dashboard/{MosaicDashboardToolbar.d.ts → toolbar/MosaicDashboardToolbar.d.ts} +0 -0
|
@@ -3,6 +3,7 @@ import type { Tool } from 'ai';
|
|
|
3
3
|
export * from './errors';
|
|
4
4
|
import type { ChartTypeDefinition } from './base-types';
|
|
5
5
|
export { ChartConfig, type ChartSettings, type ChartType } from './chart-config';
|
|
6
|
+
export * from './data-policy-schema';
|
|
6
7
|
export * from './histogram/schema';
|
|
7
8
|
export * from './line-chart/schema';
|
|
8
9
|
export * from './count-plot/schema';
|
|
@@ -27,20 +28,31 @@ export * from './custom-spec/definition';
|
|
|
27
28
|
export * from './tool-types';
|
|
28
29
|
export * from './tool-schemas';
|
|
29
30
|
export * from './tool-validation';
|
|
31
|
+
export * from './tool-helpers';
|
|
30
32
|
export * from './histogram/tool';
|
|
31
33
|
export * from './line-chart/tool';
|
|
32
34
|
export * from './count-plot/tool';
|
|
33
35
|
export * from './heatmap/tool';
|
|
34
36
|
export * from './bubble-chart/tool';
|
|
35
37
|
export * from './box-plot/tool';
|
|
36
|
-
|
|
38
|
+
export * from './profiler-tool';
|
|
39
|
+
export * from './text-panel-tool';
|
|
40
|
+
export * from './list-panels-tool';
|
|
41
|
+
export * from './remove-panel-tool';
|
|
42
|
+
import type { DashboardToolDeps } from './base-types';
|
|
37
43
|
export declare const mosaicChartTypes: {
|
|
38
44
|
readonly histogram: import("./base-types").SpecChartTypeDefinition<{
|
|
39
45
|
chartType: "histogram";
|
|
40
46
|
settings: {
|
|
41
47
|
field?: string | undefined;
|
|
48
|
+
maxBins?: number | undefined;
|
|
42
49
|
};
|
|
43
50
|
settingsOpen?: boolean | undefined;
|
|
51
|
+
dataPolicy?: {
|
|
52
|
+
disabled?: boolean | undefined;
|
|
53
|
+
maxRows?: number | undefined;
|
|
54
|
+
reason?: string | undefined;
|
|
55
|
+
} | undefined;
|
|
44
56
|
}>;
|
|
45
57
|
readonly countPlot: import("./base-types").SpecChartTypeDefinition<{
|
|
46
58
|
chartType: "count-plot";
|
|
@@ -48,6 +60,11 @@ export declare const mosaicChartTypes: {
|
|
|
48
60
|
field?: string | undefined;
|
|
49
61
|
};
|
|
50
62
|
settingsOpen?: boolean | undefined;
|
|
63
|
+
dataPolicy?: {
|
|
64
|
+
disabled?: boolean | undefined;
|
|
65
|
+
maxRows?: number | undefined;
|
|
66
|
+
reason?: string | undefined;
|
|
67
|
+
} | undefined;
|
|
51
68
|
}>;
|
|
52
69
|
readonly lineChart: import("./base-types").SpecChartTypeDefinition<{
|
|
53
70
|
chartType: "line-chart";
|
|
@@ -61,6 +78,11 @@ export declare const mosaicChartTypes: {
|
|
|
61
78
|
}[] | undefined;
|
|
62
79
|
};
|
|
63
80
|
settingsOpen?: boolean | undefined;
|
|
81
|
+
dataPolicy?: {
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
maxRows?: number | undefined;
|
|
84
|
+
reason?: string | undefined;
|
|
85
|
+
} | undefined;
|
|
64
86
|
}>;
|
|
65
87
|
readonly heatmap: import("./base-types").SpecChartTypeDefinition<{
|
|
66
88
|
chartType: "heatmap";
|
|
@@ -69,6 +91,11 @@ export declare const mosaicChartTypes: {
|
|
|
69
91
|
y?: string | undefined;
|
|
70
92
|
};
|
|
71
93
|
settingsOpen?: boolean | undefined;
|
|
94
|
+
dataPolicy?: {
|
|
95
|
+
disabled?: boolean | undefined;
|
|
96
|
+
maxRows?: number | undefined;
|
|
97
|
+
reason?: string | undefined;
|
|
98
|
+
} | undefined;
|
|
72
99
|
}>;
|
|
73
100
|
readonly boxPlot: import("./base-types").ComponentChartTypeDefinition<{
|
|
74
101
|
chartType: "box-plot";
|
|
@@ -77,6 +104,11 @@ export declare const mosaicChartTypes: {
|
|
|
77
104
|
y: string;
|
|
78
105
|
};
|
|
79
106
|
settingsOpen?: boolean | undefined;
|
|
107
|
+
dataPolicy?: {
|
|
108
|
+
disabled?: boolean | undefined;
|
|
109
|
+
maxRows?: number | undefined;
|
|
110
|
+
reason?: string | undefined;
|
|
111
|
+
} | undefined;
|
|
80
112
|
}>;
|
|
81
113
|
readonly bubbleChart: import("./base-types").SpecChartTypeDefinition<{
|
|
82
114
|
chartType: "bubble-chart";
|
|
@@ -86,6 +118,11 @@ export declare const mosaicChartTypes: {
|
|
|
86
118
|
size?: string | undefined;
|
|
87
119
|
};
|
|
88
120
|
settingsOpen?: boolean | undefined;
|
|
121
|
+
dataPolicy?: {
|
|
122
|
+
disabled?: boolean | undefined;
|
|
123
|
+
maxRows?: number | undefined;
|
|
124
|
+
reason?: string | undefined;
|
|
125
|
+
} | undefined;
|
|
89
126
|
}>;
|
|
90
127
|
readonly customSpec: import("./base-types").SpecChartTypeDefinition<{
|
|
91
128
|
chartType: "custom-spec";
|
|
@@ -93,6 +130,11 @@ export declare const mosaicChartTypes: {
|
|
|
93
130
|
vgPlotSpec?: unknown;
|
|
94
131
|
};
|
|
95
132
|
settingsOpen?: boolean | undefined;
|
|
133
|
+
dataPolicy?: {
|
|
134
|
+
disabled?: boolean | undefined;
|
|
135
|
+
maxRows?: number | undefined;
|
|
136
|
+
reason?: string | undefined;
|
|
137
|
+
} | undefined;
|
|
96
138
|
}>;
|
|
97
139
|
};
|
|
98
140
|
export declare function createDefaultChartTypes(options?: {
|
|
@@ -102,7 +144,7 @@ export declare function createDefaultChartTypes(options?: {
|
|
|
102
144
|
* Dynamically generate AI tools from chart type definitions.
|
|
103
145
|
*
|
|
104
146
|
* @param chartTypes Array of chart type definitions
|
|
105
|
-
* @param deps Dependencies needed by tool creators (
|
|
147
|
+
* @param deps Dependencies needed by tool creators (resolveArtifact, resolveTable, addPanel, etc.)
|
|
106
148
|
* @param toolNamePrefix Prefix for generated tool names (default: 'create_dashboard_')
|
|
107
149
|
* @returns Record mapping tool names to tool instances
|
|
108
150
|
*
|
|
@@ -111,5 +153,5 @@ export declare function createDefaultChartTypes(options?: {
|
|
|
111
153
|
* const tools = createChartTools(chartTypes, deps);
|
|
112
154
|
* // Returns: { create_dashboard_histogram: ..., create_dashboard_line_chart: ..., ... }
|
|
113
155
|
*/
|
|
114
|
-
export declare function createChartTools(chartTypes: ChartTypeDefinition<any>[], deps:
|
|
156
|
+
export declare function createChartTools(chartTypes: ChartTypeDefinition<any>[], deps: DashboardToolDeps, toolNamePrefix?: string): Record<string, Tool>;
|
|
115
157
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAG7B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAG7B,cAAc,UAAU,CAAC;AAGzB,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAMtD,OAAO,EAAC,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAG7B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAG7B,cAAc,UAAU,CAAC;AAGzB,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAMtD,OAAO,EAAC,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC/E,cAAc,sBAAsB,CAAC;AAGrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAC,0BAA0B,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,0BAA0B,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAC,wBAAwB,EAAC,MAAM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tB"}
|
|
@@ -7,6 +7,7 @@ export * from './errors';
|
|
|
7
7
|
// (chart-types/index imports Settings components, which import ChartSettingsContext,
|
|
8
8
|
// which imports ChartConfig)
|
|
9
9
|
export { ChartConfig } from './chart-config';
|
|
10
|
+
export * from './data-policy-schema';
|
|
10
11
|
// Re-export schemas
|
|
11
12
|
export * from './histogram/schema';
|
|
12
13
|
export * from './line-chart/schema';
|
|
@@ -31,16 +32,21 @@ export * from './heatmap/definition';
|
|
|
31
32
|
export * from './box-plot/definition';
|
|
32
33
|
export * from './bubble-chart/definition';
|
|
33
34
|
export * from './custom-spec/definition';
|
|
34
|
-
// Re-export tool types, schemas, validation, and AI tool creators
|
|
35
|
+
// Re-export tool types, schemas, validation, helpers, and AI tool creators
|
|
35
36
|
export * from './tool-types';
|
|
36
37
|
export * from './tool-schemas';
|
|
37
38
|
export * from './tool-validation';
|
|
39
|
+
export * from './tool-helpers';
|
|
38
40
|
export * from './histogram/tool';
|
|
39
41
|
export * from './line-chart/tool';
|
|
40
42
|
export * from './count-plot/tool';
|
|
41
43
|
export * from './heatmap/tool';
|
|
42
44
|
export * from './bubble-chart/tool';
|
|
43
45
|
export * from './box-plot/tool';
|
|
46
|
+
export * from './profiler-tool';
|
|
47
|
+
export * from './text-panel-tool';
|
|
48
|
+
export * from './list-panels-tool';
|
|
49
|
+
export * from './remove-panel-tool';
|
|
44
50
|
// Import chart type definitions for legacy exports
|
|
45
51
|
import { histogramChartType } from './histogram/definition';
|
|
46
52
|
import { lineChartChartType } from './line-chart/definition';
|
|
@@ -78,7 +84,7 @@ export function createDefaultChartTypes(options) {
|
|
|
78
84
|
* Dynamically generate AI tools from chart type definitions.
|
|
79
85
|
*
|
|
80
86
|
* @param chartTypes Array of chart type definitions
|
|
81
|
-
* @param deps Dependencies needed by tool creators (
|
|
87
|
+
* @param deps Dependencies needed by tool creators (resolveArtifact, resolveTable, addPanel, etc.)
|
|
82
88
|
* @param toolNamePrefix Prefix for generated tool names (default: 'create_dashboard_')
|
|
83
89
|
* @returns Record mapping tool names to tool instances
|
|
84
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,cAAc,cAAc,CAAC;AAK7B,gDAAgD;AAChD,cAAc,UAAU,CAAC;AAKzB,2EAA2E;AAC3E,uEAAuE;AACvE,qFAAqF;AACrF,6BAA6B;AAC7B,OAAO,EAAC,WAAW,EAAqC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,cAAc,cAAc,CAAC;AAK7B,gDAAgD;AAChD,cAAc,UAAU,CAAC;AAKzB,2EAA2E;AAC3E,uEAAuE;AACvE,qFAAqF;AACrF,6BAA6B;AAC7B,OAAO,EAAC,WAAW,EAAqC,MAAM,gBAAgB,CAAC;AAC/E,cAAc,sBAAsB,CAAC;AAErC,oBAAoB;AACpB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AAErC,gCAAgC;AAChC,OAAO,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAC,0BAA0B,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,0BAA0B,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAC,2BAA2B,EAAC,MAAM,kCAAkC,CAAC;AAE7E,wB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AEX,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;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAsC,EACtC,IAAuB,EACvB,iBAAyB,mBAAmB;IAE5C,MAAM,KAAK,GAAyB,EAAE,CAAC;IAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,GAAG,cAAc,GAAG,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACvE,KAAK,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Re-export base types\nexport * from './base-types';\n\n// Import Tool type for createChartTools function\nimport type {Tool} from 'ai';\n\n// Re-export error classes for chart definitions\nexport * from './errors';\n\n// Import specific types needed before re-exports\nimport type {ChartTypeDefinition} from './base-types';\n\n// CRITICAL: Export ChartConfig FIRST, before importing Settings components\n// Export ChartConfig from separate file to avoid circular dependencies\n// (chart-types/index imports Settings components, which import ChartSettingsContext,\n// which imports ChartConfig)\nexport {ChartConfig, type ChartSettings, type ChartType} from './chart-config';\nexport * from './data-policy-schema';\n\n// Re-export schemas\nexport * from './histogram/schema';\nexport * from './line-chart/schema';\nexport * from './count-plot/schema';\nexport * from './heatmap/schema';\nexport * from './box-plot/schema';\nexport * from './bubble-chart/schema';\nexport * from './custom-spec/schema';\n\n// Re-export Settings components\nexport {HistogramSettingsComponent} from './histogram/HistogramSettings';\nexport {LineChartSettingsComponent} from './line-chart/LineChartSettings';\nexport {CountPlotSettingsComponent} from './count-plot/CountPlotSettings';\nexport {HeatmapSettingsComponent} from './heatmap/HeatmapSettings';\nexport {BoxPlotSettingsComponent} from './box-plot/BoxPlotSettings';\nexport {BubbleChartSettingsComponent} from './bubble-chart/BubbleChartSettings';\nexport {CustomSpecSettingsComponent} from './custom-spec/CustomSpecSettings';\n\n// Re-export definitions\nexport * from './histogram/definition';\nexport * from './line-chart/definition';\nexport * from './count-plot/definition';\nexport * from './heatmap/definition';\nexport * from './box-plot/definition';\nexport * from './bubble-chart/definition';\nexport * from './custom-spec/definition';\n\n// Re-export tool types, schemas, validation, helpers, and AI tool creators\nexport * from './tool-types';\nexport * from './tool-schemas';\nexport * from './tool-validation';\nexport * from './tool-helpers';\nexport * from './histogram/tool';\nexport * from './line-chart/tool';\nexport * from './count-plot/tool';\nexport * from './heatmap/tool';\nexport * from './bubble-chart/tool';\nexport * from './box-plot/tool';\nexport * from './profiler-tool';\nexport * from './text-panel-tool';\nexport * from './list-panels-tool';\nexport * from './remove-panel-tool';\n\n// Import chart type definitions for legacy exports\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 {bubbleChartChartType} from './bubble-chart/definition';\nimport {customSpecChartType} from './custom-spec/definition';\nimport type {DashboardToolDeps} from './base-types';\n\n// Legacy compatibility exports\nexport const mosaicChartTypes = {\n histogram: histogramChartType,\n countPlot: countPlotChartType,\n lineChart: lineChartChartType,\n heatmap: heatmapChartType,\n boxPlot: boxPlotChartType,\n bubbleChart: bubbleChartChartType,\n customSpec: customSpecChartType,\n} as const;\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 bubbleChartChartType,\n ];\n\n if (includeCustomSpec) {\n chartTypes.push(customSpecChartType as ChartTypeDefinition<any>);\n }\n\n return chartTypes;\n}\n\n/**\n * Dynamically generate AI tools from chart type definitions.\n *\n * @param chartTypes Array of chart type definitions\n * @param deps Dependencies needed by tool creators (resolveArtifact, resolveTable, addPanel, etc.)\n * @param toolNamePrefix Prefix for generated tool names (default: 'create_dashboard_')\n * @returns Record mapping tool names to tool instances\n *\n * @example\n * const chartTypes = createDefaultChartTypes({includeCustomSpec: false});\n * const tools = createChartTools(chartTypes, deps);\n * // Returns: { create_dashboard_histogram: ..., create_dashboard_line_chart: ..., ... }\n */\nexport function createChartTools(\n chartTypes: ChartTypeDefinition<any>[],\n deps: DashboardToolDeps,\n toolNamePrefix: string = 'create_dashboard_',\n): Record<string, Tool> {\n const tools: Record<string, Tool> = {};\n\n for (const chartType of chartTypes) {\n if (chartType.createTool) {\n const toolName = `${toolNamePrefix}${chartType.id.replace(/-/g, '_')}`;\n tools[toolName] = chartType.createTool(deps);\n }\n }\n\n return tools;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChartSettings.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/LineChartSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LineChartSettings.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/LineChartSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAU9B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,EAyCxC,CAAC"}
|
|
@@ -5,12 +5,14 @@ import { TemporalGranularitySelector } from '../../chart-builders/TemporalGranul
|
|
|
5
5
|
import { useChartSettingsContext } from '../../chart/chart-settings/ChartSettingsContext';
|
|
6
6
|
import { MultiFieldSelector } from '../../chart-builders/MultiFieldSelector';
|
|
7
7
|
import { isTemporalType } from '../../chart-builders/constants';
|
|
8
|
+
import { useColumnsContext } from '../../chart-builders/ColumnsContext';
|
|
8
9
|
/**
|
|
9
10
|
* Explicit settings component for line chart.
|
|
10
11
|
* Composes primitive and compound components for full control over the UI.
|
|
11
12
|
*/
|
|
12
13
|
export const LineChartSettingsComponent = () => {
|
|
13
|
-
const {
|
|
14
|
+
const { onChangeConfig, config } = useChartSettingsContext('line-chart');
|
|
15
|
+
const { columns } = useColumnsContext();
|
|
14
16
|
const xField = columns.find((c) => c.name === config.settings.x);
|
|
15
17
|
const isXFieldTemporal = xField && isTemporalType(xField.type);
|
|
16
18
|
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Field, { label: "X Axis", required: true, children: _jsxs("div", { className: "grid items-end gap-2", style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChartSettings.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/LineChartSettings.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAC,2BAA2B,EAAC,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAC,uBAAuB,EAAC,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAC,cAAc,EAAC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"LineChartSettings.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/LineChartSettings.tsx"],"names":[],"mappings":";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KAAC,2BAA2B,IAC1B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAChC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,EAC/D,UAAU,EAAE,MAAM,CAAC,IAAI,GACvB,CACH,IACG,GACA,EAER,KAAC,KAAK,IAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,kBAC5B,KAAC,kBAAkB,CAAC,OAAO,IACzB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,EACpC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,EACzD,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,GACnD,GACI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {type FC} from 'react';\nimport {Field} from '../../chart-builders/Field';\nimport {ColumnSelector} from '../../chart-builders/ColumnSelector';\n\nimport {TemporalGranularitySelector} from '../../chart-builders/TemporalGranularitySelector';\nimport {useChartSettingsContext} from '../../chart/chart-settings/ChartSettingsContext';\nimport {MultiFieldSelector} from '../../chart-builders/MultiFieldSelector';\nimport {isTemporalType} from '../../chart-builders/constants';\nimport {useColumnsContext} from '../../chart-builders/ColumnsContext';\n\n/**\n * Explicit settings component for line chart.\n * Composes primitive and compound components for full control over the UI.\n */\nexport const LineChartSettingsComponent: FC = () => {\n const {onChangeConfig, config} = useChartSettingsContext('line-chart');\n const {columns} = useColumnsContext();\n\n const xField = columns.find((c) => c.name === config.settings.x);\n const isXFieldTemporal = xField && isTemporalType(xField.type);\n\n return (\n <div className=\"space-y-4\">\n <Field label=\"X Axis\" required>\n <div\n className=\"grid items-end gap-2\"\n style={{\n gridTemplateColumns: isXFieldTemporal\n ? 'minmax(120px, 1fr) 100px'\n : '1fr',\n }}\n >\n <ColumnSelector.Quantitative\n value={config.settings.x}\n onChange={(x) => onChangeConfig('x', x)}\n />\n {isXFieldTemporal && (\n <TemporalGranularitySelector\n value={config.settings.xInterval}\n onChange={(xInterval) => onChangeConfig('xInterval', xInterval)}\n xFieldType={xField.type}\n />\n )}\n </div>\n </Field>\n\n <Field label=\"Y Axis\" required>\n <MultiFieldSelector.Numeric\n value={config.settings.yFields ?? []}\n onChange={(yFields) => onChangeConfig('yFields', yFields)}\n showAggregation={Boolean(config.settings.xInterval)}\n />\n </Field>\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAoB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAoB,MAAM,UAAU,CAAC;AAU5D,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,eAAe,CAkBvE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { LineChartSettingsComponent } from './LineChartSettings';
|
|
|
4
4
|
import { createLineChartAiTool } from './tool';
|
|
5
5
|
import { LineChart } from 'lucide-react';
|
|
6
6
|
import { createLineChartSpec } from './spec';
|
|
7
|
+
import { DEFAULT_CHART_MAX_DATA_POINTS } from '../../chart-runtime';
|
|
7
8
|
const DESCRIPTION = 'Create a line chart of two fields';
|
|
8
9
|
export const lineChartChartType = {
|
|
9
10
|
id: 'line-chart',
|
|
@@ -14,6 +15,12 @@ export const lineChartChartType = {
|
|
|
14
15
|
settingsComponent: LineChartSettingsComponent,
|
|
15
16
|
buildTitle: titleFromDescription(DESCRIPTION),
|
|
16
17
|
createTool: createLineChartAiTool,
|
|
18
|
+
getDataPolicy: ({ config }) => config.settings.xInterval
|
|
19
|
+
? null
|
|
20
|
+
: {
|
|
21
|
+
maxRows: DEFAULT_CHART_MAX_DATA_POINTS,
|
|
22
|
+
reason: 'Unaggregated line charts render source rows. Add a temporal interval or use an aggregated chart for larger datasets.',
|
|
23
|
+
},
|
|
17
24
|
createSpec: createLineChartSpec,
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAC,6BAA6B,EAAC,MAAM,qBAAqB,CAAC;AAElE,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAA6C;IAC1E,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,iBAAiB;IACzB,iBAAiB,EAAE,0BAA0B;IAC7C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,qBAAqB;IACjC,aAAa,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAC1B,MAAM,CAAC,QAAQ,CAAC,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC;YACE,OAAO,EAAE,6BAA6B;YACtC,MAAM,EACJ,sHAAsH;SACzH;IACP,UAAU,EAAE,mBAAmB;CAChC,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {LineChartConfig, LineChartSettings} from './schema';\nimport {titleFromDescription} from '../../chart-builders/chartTypeUtils';\nimport {LineChartSettingsComponent} from './LineChartSettings';\nimport {createLineChartAiTool} from './tool';\nimport {LineChart} from 'lucide-react';\nimport {createLineChartSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../chart-runtime';\n\nconst DESCRIPTION = 'Create a line chart of two fields';\n\nexport const lineChartChartType: SpecChartTypeDefinition<LineChartConfig> = {\n id: 'line-chart',\n label: 'Line Chart',\n description: DESCRIPTION,\n icon: LineChart,\n schema: LineChartSettings,\n settingsComponent: LineChartSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createLineChartAiTool,\n getDataPolicy: ({config}) =>\n config.settings.xInterval\n ? null\n : {\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Unaggregated line charts render source rows. Add a temporal interval or use an aggregated chart for larger datasets.',\n },\n createSpec: createLineChartSpec,\n};\n"]}
|
|
@@ -78,6 +78,11 @@ export declare const LineChartConfig: z.ZodObject<{
|
|
|
78
78
|
}, z.core.$strip>>>;
|
|
79
79
|
}, z.core.$strip>;
|
|
80
80
|
settingsOpen: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
dataPolicy: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
maxRows: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
81
86
|
}, z.core.$strip>;
|
|
82
87
|
export type LineChartConfig = z.infer<typeof LineChartConfig>;
|
|
83
88
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,gBAAgB;;;;;;;;;EAS3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAGhE,eAAO,MAAM,iBAAiB;;;;;EAAuC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGlE,eAAO,MAAM,YAAY;;;;;;;;;iBAMvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;iBAY5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ChartDataPolicyOverrideConfig } from '../data-policy-schema';
|
|
2
3
|
// Temporal interval enum
|
|
3
4
|
export const TemporalInterval = z.enum([
|
|
4
5
|
'year',
|
|
@@ -35,5 +36,6 @@ export const LineChartConfig = z.object({
|
|
|
35
36
|
chartType: z.literal('line-chart'),
|
|
36
37
|
settings: LineChartSettings,
|
|
37
38
|
settingsOpen: z.boolean().optional(),
|
|
39
|
+
dataPolicy: ChartDataPolicyOverrideConfig.optional(),
|
|
38
40
|
});
|
|
39
41
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,yBAAyB;AACzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;CACT,CAAC,CAAC;AAGH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGtE,wBAAwB;AACxB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACnE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACrE,SAAS,EAAE,iBAAiB,CAAC,QAAQ,EAAE;SACpC,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,6CAA6C,CAAC;CAC3D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,CAAC,EAAE,CAAC;SACD,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mDAAmD,CAAC;IAChE,SAAS,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC7C,yDAAyD,CAC1D;IACD,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,YAAY,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;CAClE,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAClC,QAAQ,EAAE,iBAAiB;IAC3B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {ChartDataPolicyOverrideConfig} from '../data-policy-schema';\n\n// Temporal interval enum\nexport const TemporalInterval = z.enum([\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n]);\nexport type TemporalInterval = z.infer<typeof TemporalInterval>;\n\n// Aggregate function enum\nexport const AggregateFunction = z.enum(['sum', 'avg', 'min', 'max']);\nexport type AggregateFunction = z.infer<typeof AggregateFunction>;\n\n// Y-field configuration\nexport const YFieldConfig = z.object({\n field: z.string().describe('Numeric column name to plot on Y axis'),\n color: z.string().optional().describe('Optional color for this line'),\n aggregate: AggregateFunction.optional()\n .default('sum')\n .describe('Aggregation function: sum, avg, min, or max'),\n});\nexport type YFieldConfig = z.infer<typeof YFieldConfig>;\n\nexport const LineChartSettings = z.object({\n x: z\n .string()\n .optional()\n .describe('Column for X axis, typically temporal (date/time)'),\n xInterval: TemporalInterval.optional().describe(\n 'Temporal binning interval: year, month, day, hour, etc.',\n ),\n yFields: z\n .array(YFieldConfig)\n .optional()\n .describe('Array of Y fields to plot, supports multiple lines'),\n});\n\nexport type LineChartSettings = z.infer<typeof LineChartSettings>;\n\nexport const LineChartConfig = z.object({\n chartType: z.literal('line-chart'),\n settings: LineChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type LineChartConfig = z.infer<typeof LineChartConfig>;\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DashboardToolDeps } from '../base-types';
|
|
3
3
|
export declare const LineChartToolParameters: z.ZodObject<{
|
|
4
4
|
artifactId: z.ZodOptional<z.ZodString>;
|
|
5
5
|
tableName: z.ZodOptional<z.ZodString>;
|
|
6
6
|
createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
panelId: z.ZodOptional<z.ZodString>;
|
|
7
8
|
reasoning: z.ZodString;
|
|
8
9
|
settings: z.ZodObject<{
|
|
9
10
|
x: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -30,7 +31,7 @@ export declare const LineChartToolParameters: z.ZodObject<{
|
|
|
30
31
|
}, z.core.$strip>;
|
|
31
32
|
}, z.core.$strip>;
|
|
32
33
|
export type LineChartToolParams = z.infer<typeof LineChartToolParameters>;
|
|
33
|
-
export declare function createLineChartAiTool(deps:
|
|
34
|
+
export declare function createLineChartAiTool(deps: DashboardToolDeps): import("ai").Tool<{
|
|
34
35
|
createArtifactIfMissing: boolean;
|
|
35
36
|
reasoning: string;
|
|
36
37
|
settings: {
|
|
@@ -44,17 +45,12 @@ export declare function createLineChartAiTool(deps: ChartToolDeps): import("ai")
|
|
|
44
45
|
};
|
|
45
46
|
artifactId?: string | undefined;
|
|
46
47
|
tableName?: string | undefined;
|
|
48
|
+
panelId?: string | undefined;
|
|
47
49
|
}, {
|
|
48
50
|
llmResult: {
|
|
49
51
|
success: boolean;
|
|
50
52
|
details: string;
|
|
51
|
-
data:
|
|
52
|
-
panelId: string;
|
|
53
|
-
artifactId: string;
|
|
54
|
-
tableName: string;
|
|
55
|
-
title: string;
|
|
56
|
-
config: any;
|
|
57
|
-
};
|
|
53
|
+
data: import("..").PanelResult;
|
|
58
54
|
errorMessage?: undefined;
|
|
59
55
|
};
|
|
60
56
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAYrD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAElC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkF5D"}
|
|
@@ -3,6 +3,7 @@ import { LineChartSettings, AggregateFunction, TemporalInterval } from './schema
|
|
|
3
3
|
import { BaseChartToolParameters } from '../tool-schemas';
|
|
4
4
|
import { validateColumnExists } from '../tool-validation';
|
|
5
5
|
import { NUMERIC_COLUMN_TYPES, QUANTITATIVE_COLUMN_TYPES, TEMPORAL_COLUMN_TYPES, } from '../../chart-builders/constants';
|
|
6
|
+
import { createOrUpdateChartPanel } from '../tool-helpers';
|
|
6
7
|
const AGGREGATE_FUNCTIONS = AggregateFunction.options;
|
|
7
8
|
const TEMPORAL_INTERVALS = TemporalInterval.options;
|
|
8
9
|
export const LineChartToolParameters = BaseChartToolParameters.extend({
|
|
@@ -22,32 +23,39 @@ Required:
|
|
|
22
23
|
Optional: xInterval for temporal grouping (${TEMPORAL_INTERVALS.join(', ')}) when x is temporal (${TEMPORAL_COLUMN_TYPES.join(', ')}).
|
|
23
24
|
Multiple yFields create multi-line chart for comparing metrics.
|
|
24
25
|
|
|
26
|
+
NOTE: Line charts with aggregation (xInterval or aggregate functions) handle large datasets well. Without aggregation, line charts plot individual points and should not be used for tables with more than ${deps.maxDataPoints.toLocaleString()} rows - use aggregated visualizations instead.
|
|
27
|
+
|
|
28
|
+
To UPDATE an existing line chart: provide the panelId parameter. Otherwise creates new panel.
|
|
29
|
+
|
|
25
30
|
Do NOT use for: single point distributions (use histogram), categorical counts (use count-plot), two-variable correlations (use bubble-chart).`,
|
|
26
31
|
inputSchema: LineChartToolParameters,
|
|
27
32
|
execute: async (params, context) => {
|
|
28
33
|
try {
|
|
29
|
-
const
|
|
34
|
+
const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing, context);
|
|
35
|
+
const { tableName, columns } = deps.resolveTable(artifactId, params.tableName);
|
|
30
36
|
// Validate settings
|
|
31
37
|
validateColumnExists(params.settings.x, QUANTITATIVE_COLUMN_TYPES, columns, 'x');
|
|
32
38
|
for (const yField of params.settings.yFields) {
|
|
33
39
|
validateColumnExists(yField.field, NUMERIC_COLUMN_TYPES, columns, 'yFields');
|
|
34
40
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
:
|
|
38
|
-
const result = deps.createChart({
|
|
39
|
-
artifactId,
|
|
41
|
+
const result = createOrUpdateChartPanel(deps, {
|
|
42
|
+
panelId: params.panelId,
|
|
43
|
+
dashboardId: artifactId,
|
|
40
44
|
tableName,
|
|
45
|
+
title: params.settings.x
|
|
46
|
+
? `Line chart - ${params.settings.yFields?.map((f) => f.field).join(', ') || ''} over ${params.settings.x}`
|
|
47
|
+
: 'Line chart',
|
|
41
48
|
config: {
|
|
42
49
|
chartType: 'line-chart',
|
|
43
50
|
settings: params.settings,
|
|
44
51
|
},
|
|
45
|
-
title,
|
|
46
52
|
});
|
|
47
53
|
return {
|
|
48
54
|
llmResult: {
|
|
49
55
|
success: true,
|
|
50
|
-
details:
|
|
56
|
+
details: params.panelId
|
|
57
|
+
? `Updated line chart "${result.title}".`
|
|
58
|
+
: `Created line chart "${result.title}".`,
|
|
51
59
|
data: result,
|
|
52
60
|
},
|
|
53
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAC,uBAAuB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAC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CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport {LineChartSettings, AggregateFunction, TemporalInterval} from './schema';\nimport {BaseChartToolParameters} from '../tool-schemas';\nimport type {DashboardToolDeps} from '../base-types';\nimport {validateColumnExists} from '../tool-validation';\nimport {\n NUMERIC_COLUMN_TYPES,\n QUANTITATIVE_COLUMN_TYPES,\n TEMPORAL_COLUMN_TYPES,\n} from '../../chart-builders/constants';\nimport {createOrUpdateChartPanel} from '../tool-helpers';\n\nconst AGGREGATE_FUNCTIONS = AggregateFunction.options;\nconst TEMPORAL_INTERVALS = TemporalInterval.options;\n\nexport const LineChartToolParameters = BaseChartToolParameters.extend({\n settings: LineChartSettings.required(),\n});\n\nexport type LineChartToolParams = z.infer<typeof LineChartToolParameters>;\n\nexport function createLineChartAiTool(deps: DashboardToolDeps) {\n return tool({\n description: `Line chart: shows trends and changes over time or ordered continuous variable. Connects data points to show progression.\n\nUse when: user asks about \"trend\", \"over time\", \"changes in\", \"time series\", \"progression of\", \"track X over Y\".\nExample queries: \"population growth over time\", \"temperature trend by month\", \"show land development over years\", \"elevation changes along route\", \"average precipitation by season\".\n\nRequired:\n- x: quantitative column (${QUANTITATIVE_COLUMN_TYPES.join(', ')})\n- yFields: array of {field: string (numeric: ${NUMERIC_COLUMN_TYPES.join(', ')}), aggregate?: ${AGGREGATE_FUNCTIONS.join('|')}}\n\nOptional: xInterval for temporal grouping (${TEMPORAL_INTERVALS.join(', ')}) when x is temporal (${TEMPORAL_COLUMN_TYPES.join(', ')}).\nMultiple yFields create multi-line chart for comparing metrics.\n\nNOTE: Line charts with aggregation (xInterval or aggregate functions) handle large datasets well. Without aggregation, line charts plot individual points and should not be used for tables with more than ${deps.maxDataPoints.toLocaleString()} rows - use aggregated visualizations instead.\n\nTo UPDATE an existing line chart: provide the panelId parameter. Otherwise creates new panel.\n\nDo NOT use for: single point distributions (use histogram), categorical counts (use count-plot), two-variable correlations (use bubble-chart).`,\n inputSchema: LineChartToolParameters,\n execute: async (params, context) => {\n try {\n const artifactId = deps.resolveArtifact(\n params.artifactId,\n params.createArtifactIfMissing,\n context,\n );\n const {tableName, columns} = deps.resolveTable(\n artifactId,\n params.tableName,\n );\n\n // Validate settings\n validateColumnExists(\n params.settings.x,\n QUANTITATIVE_COLUMN_TYPES,\n columns,\n 'x',\n );\n\n for (const yField of params.settings.yFields) {\n validateColumnExists(\n yField.field,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'yFields',\n );\n }\n\n const result = createOrUpdateChartPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n tableName,\n title: params.settings.x\n ? `Line chart - ${params.settings.yFields?.map((f) => f.field).join(', ') || ''} over ${params.settings.x}`\n : 'Line chart',\n config: {\n chartType: 'line-chart',\n settings: params.settings,\n },\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated line chart \"${result.title}\".`\n : `Created line chart \"${result.title}\".`,\n data: result,\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { DashboardToolDeps } from './base-types';
|
|
3
|
+
export declare const ListPanelsToolParameters: z.ZodObject<{
|
|
4
|
+
artifactId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
reasoning: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type ListPanelsToolParams = z.infer<typeof ListPanelsToolParameters>;
|
|
8
|
+
export declare function createListPanelsTool(deps: DashboardToolDeps): import("ai").Tool<{
|
|
9
|
+
reasoning: string;
|
|
10
|
+
artifactId?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
llmResult: {
|
|
13
|
+
success: boolean;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
details?: undefined;
|
|
16
|
+
data?: undefined;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
llmResult: {
|
|
20
|
+
success: boolean;
|
|
21
|
+
details: string;
|
|
22
|
+
data: {
|
|
23
|
+
artifactId: string;
|
|
24
|
+
panels: {
|
|
25
|
+
issue?: import("..").ChartRuntimeIssue | undefined;
|
|
26
|
+
id: any;
|
|
27
|
+
type: any;
|
|
28
|
+
title: any;
|
|
29
|
+
config: any;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
errorMessage?: undefined;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=list-panels-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-panels-tool.d.ts","sourceRoot":"","sources":["../../src/chart-types/list-panels-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,wBAAwB;;;iBAQnC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;GAwD3D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { tool } from 'ai';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const ListPanelsToolParameters = z.object({
|
|
4
|
+
artifactId: z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
|
|
8
|
+
reasoning: z
|
|
9
|
+
.string()
|
|
10
|
+
.describe('Brief rationale for listing dashboard panels.'),
|
|
11
|
+
});
|
|
12
|
+
export function createListPanelsTool(deps) {
|
|
13
|
+
return tool({
|
|
14
|
+
description: `List dashboard panels: returns all panels in the current dashboard with their IDs, types, titles, configurations, and any current runtime issue.
|
|
15
|
+
|
|
16
|
+
Use when: you need to discover panel IDs before updating or removing panels, or when user asks "what's on this dashboard".
|
|
17
|
+
|
|
18
|
+
Runtime issues are transient chart diagnostics such as too-much-data or sql-error. If a panel has an issue, use the panel ID to update it in place with a safer chart configuration.
|
|
19
|
+
|
|
20
|
+
Returns array of: {id, type, title, config, issue?} for each panel.`,
|
|
21
|
+
inputSchema: ListPanelsToolParameters,
|
|
22
|
+
execute: async (params) => {
|
|
23
|
+
try {
|
|
24
|
+
const artifactId = deps.resolveArtifact(params.artifactId);
|
|
25
|
+
const dashboard = deps.getDashboard(artifactId);
|
|
26
|
+
if (!dashboard) {
|
|
27
|
+
return {
|
|
28
|
+
llmResult: {
|
|
29
|
+
success: false,
|
|
30
|
+
errorMessage: `Dashboard "${artifactId}" not found.`,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const panels = dashboard.panels.map((panel) => {
|
|
35
|
+
const issue = deps.getPanelIssue?.(artifactId, panel.id);
|
|
36
|
+
return {
|
|
37
|
+
id: panel.id,
|
|
38
|
+
type: panel.type,
|
|
39
|
+
title: panel.title,
|
|
40
|
+
config: panel.config,
|
|
41
|
+
...(issue ? { issue } : {}),
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
llmResult: {
|
|
46
|
+
success: true,
|
|
47
|
+
details: `Found ${panels.length} panel(s) in dashboard.`,
|
|
48
|
+
data: {
|
|
49
|
+
artifactId,
|
|
50
|
+
panels,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
llmResult: {
|
|
58
|
+
success: false,
|
|
59
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=list-panels-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-panels-tool.js","sourceRoot":"","sources":["../../src/chart-types/list-panels-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC,CAAC;AAIH,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;;oEAMmD;QAChE,WAAW,EAAE,wBAAwB;QACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAE3D,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO;wBACL,SAAS,EAAE;4BACT,OAAO,EAAE,KAAK;4BACd,YAAY,EAAE,cAAc,UAAU,cAAc;yBACrD;qBACF,CAAC;gBACJ,CAAC;gBAED,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;oBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;oBACzD,OAAO;wBACL,EAAE,EAAE,KAAK,CAAC,EAAE;wBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;wBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;wBACpB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;qBAC1B,CAAC;gBACJ,CAAC,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,SAAS,MAAM,CAAC,MAAM,yBAAyB;wBACxD,IAAI,EAAE;4BACJ,UAAU;4BACV,MAAM;yBACP;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from './base-types';\n\nexport const ListPanelsToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n reasoning: z\n .string()\n .describe('Brief rationale for listing dashboard panels.'),\n});\n\nexport type ListPanelsToolParams = z.infer<typeof ListPanelsToolParameters>;\n\nexport function createListPanelsTool(deps: DashboardToolDeps) {\n return tool({\n description: `List dashboard panels: returns all panels in the current dashboard with their IDs, types, titles, configurations, and any current runtime issue.\n\nUse when: you need to discover panel IDs before updating or removing panels, or when user asks \"what's on this dashboard\".\n\nRuntime issues are transient chart diagnostics such as too-much-data or sql-error. If a panel has an issue, use the panel ID to update it in place with a safer chart configuration.\n\nReturns array of: {id, type, title, config, issue?} for each panel.`,\n inputSchema: ListPanelsToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(params.artifactId);\n\n const dashboard = deps.getDashboard(artifactId);\n if (!dashboard) {\n return {\n llmResult: {\n success: false,\n errorMessage: `Dashboard \"${artifactId}\" not found.`,\n },\n };\n }\n\n const panels = dashboard.panels.map((panel: any) => {\n const issue = deps.getPanelIssue?.(artifactId, panel.id);\n return {\n id: panel.id,\n type: panel.type,\n title: panel.title,\n config: panel.config,\n ...(issue ? {issue} : {}),\n };\n });\n\n return {\n llmResult: {\n success: true,\n details: `Found ${panels.length} panel(s) in dashboard.`,\n data: {\n artifactId,\n panels,\n },\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
|