@sqlrooms/mosaic 0.29.0-rc.3 → 0.29.0-rc.4
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 +90 -1
- package/dist/MosaicChartBuilder.d.ts +0 -4
- package/dist/MosaicChartBuilder.d.ts.map +1 -1
- package/dist/MosaicChartBuilder.js +0 -6
- package/dist/MosaicChartBuilder.js.map +1 -1
- package/dist/MosaicSlice.d.ts +17 -10
- package/dist/MosaicSlice.d.ts.map +1 -1
- package/dist/MosaicSlice.js +4 -1
- package/dist/MosaicSlice.js.map +1 -1
- package/dist/boxplot/BoxPlotClient.d.ts +58 -0
- package/dist/boxplot/BoxPlotClient.d.ts.map +1 -0
- package/dist/boxplot/BoxPlotClient.js +264 -0
- package/dist/boxplot/BoxPlotClient.js.map +1 -0
- package/dist/chart/MosaicDashboardChart.d.ts +14 -0
- package/dist/chart/MosaicDashboardChart.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardChart.js +21 -0
- package/dist/chart/MosaicDashboardChart.js.map +1 -0
- package/dist/chart/MosaicDashboardChartContent.d.ts +16 -0
- package/dist/chart/MosaicDashboardChartContent.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardChartContent.js +18 -0
- package/dist/chart/MosaicDashboardChartContent.js.map +1 -0
- package/dist/chart/MosaicDashboardChartHeaderActions.d.ts +4 -0
- package/dist/chart/MosaicDashboardChartHeaderActions.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardChartHeaderActions.js +16 -0
- package/dist/chart/MosaicDashboardChartHeaderActions.js.map +1 -0
- package/dist/chart/MosaicDashboardChartRenderer.d.ts +3 -0
- package/dist/chart/MosaicDashboardChartRenderer.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardChartRenderer.js +31 -0
- package/dist/chart/MosaicDashboardChartRenderer.js.map +1 -0
- package/dist/chart/MosaicDashboardComponentChart.d.ts +14 -0
- package/dist/chart/MosaicDashboardComponentChart.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardComponentChart.js +11 -0
- package/dist/chart/MosaicDashboardComponentChart.js.map +1 -0
- package/dist/chart/MosaicDashboardVgPlotChart.d.ts +10 -0
- package/dist/chart/MosaicDashboardVgPlotChart.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardVgPlotChart.js +10 -0
- package/dist/chart/MosaicDashboardVgPlotChart.js.map +1 -0
- package/dist/chart/MosaicDashboardVgPlotError.d.ts +8 -0
- package/dist/chart/MosaicDashboardVgPlotError.d.ts.map +1 -0
- package/dist/chart/MosaicDashboardVgPlotError.js +11 -0
- package/dist/chart/MosaicDashboardVgPlotError.js.map +1 -0
- package/dist/{dashboard → chart}/chart-settings/ChartSettings.d.ts +12 -7
- package/dist/chart/chart-settings/ChartSettings.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartSettings.js +71 -0
- package/dist/chart/chart-settings/ChartSettings.js.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsContent.d.ts +13 -0
- package/dist/chart/chart-settings/ChartSettingsContent.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsContent.js +18 -0
- package/dist/chart/chart-settings/ChartSettingsContent.js.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsContext.d.ts +27 -0
- package/dist/chart/chart-settings/ChartSettingsContext.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsContext.js +35 -0
- package/dist/chart/chart-settings/ChartSettingsContext.js.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsPanel.d.ts +14 -0
- package/dist/chart/chart-settings/ChartSettingsPanel.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartSettingsPanel.js +17 -0
- package/dist/chart/chart-settings/ChartSettingsPanel.js.map +1 -0
- package/dist/chart/chart-settings/ChartSpecViewerPanel.d.ts +9 -0
- package/dist/chart/chart-settings/ChartSpecViewerPanel.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartSpecViewerPanel.js +11 -0
- package/dist/chart/chart-settings/ChartSpecViewerPanel.js.map +1 -0
- package/dist/chart/chart-settings/ChartTypeSelector.d.ts +9 -0
- package/dist/chart/chart-settings/ChartTypeSelector.d.ts.map +1 -0
- package/dist/chart/chart-settings/ChartTypeSelector.js +16 -0
- package/dist/chart/chart-settings/ChartTypeSelector.js.map +1 -0
- package/dist/chart/chart-settings/useTableColumns.d.ts.map +1 -0
- package/dist/{dashboard → chart}/chart-settings/useTableColumns.js +1 -1
- package/dist/chart/chart-settings/useTableColumns.js.map +1 -0
- package/dist/chart/useBrushSelectionParams.d.ts +3 -0
- package/dist/chart/useBrushSelectionParams.d.ts.map +1 -0
- package/dist/chart/useBrushSelectionParams.js +16 -0
- package/dist/chart/useBrushSelectionParams.js.map +1 -0
- package/dist/chart/useChartRetainer.d.ts +3 -0
- package/dist/chart/useChartRetainer.d.ts.map +1 -0
- package/dist/chart/useChartRetainer.js +11 -0
- package/dist/chart/useChartRetainer.js.map +1 -0
- package/dist/chart/useGenerateSpec.d.ts +13 -0
- package/dist/chart/useGenerateSpec.d.ts.map +1 -0
- package/dist/chart/useGenerateSpec.js +32 -0
- package/dist/chart/useGenerateSpec.js.map +1 -0
- package/dist/chart-builders/AggregationSelector.d.ts +11 -0
- package/dist/chart-builders/AggregationSelector.d.ts.map +1 -0
- package/dist/chart-builders/AggregationSelector.js +9 -0
- package/dist/chart-builders/AggregationSelector.js.map +1 -0
- package/dist/chart-builders/ChartBuilderActions.d.ts +2 -2
- package/dist/chart-builders/ChartBuilderActions.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderActions.js +24 -16
- package/dist/chart-builders/ChartBuilderActions.js.map +1 -1
- package/dist/chart-builders/ChartBuilderContent.d.ts +4 -6
- package/dist/chart-builders/ChartBuilderContent.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderContent.js.map +1 -1
- package/dist/chart-builders/ChartBuilderContext.d.ts +5 -6
- package/dist/chart-builders/ChartBuilderContext.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderContext.js.map +1 -1
- package/dist/chart-builders/ChartBuilderDialog.d.ts +7 -10
- package/dist/chart-builders/ChartBuilderDialog.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderDialog.js +1 -1
- package/dist/chart-builders/ChartBuilderDialog.js.map +1 -1
- package/dist/chart-builders/ChartBuilderFields.d.ts +2 -2
- package/dist/chart-builders/ChartBuilderFields.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderFields.js +28 -14
- package/dist/chart-builders/ChartBuilderFields.js.map +1 -1
- package/dist/chart-builders/ChartBuilderRoot.d.ts +4 -6
- package/dist/chart-builders/ChartBuilderRoot.d.ts.map +1 -1
- package/dist/chart-builders/ChartBuilderRoot.js +9 -28
- package/dist/chart-builders/ChartBuilderRoot.js.map +1 -1
- package/dist/chart-builders/ColumnSelector.d.ts +15 -0
- package/dist/chart-builders/ColumnSelector.d.ts.map +1 -0
- package/dist/chart-builders/ColumnSelector.js +31 -0
- package/dist/chart-builders/ColumnSelector.js.map +1 -0
- package/dist/chart-builders/Field.d.ts +11 -0
- package/dist/chart-builders/Field.d.ts.map +1 -0
- package/dist/chart-builders/Field.js +9 -0
- package/dist/chart-builders/Field.js.map +1 -0
- package/dist/chart-builders/FieldSelectorInput.d.ts +2 -1
- package/dist/chart-builders/FieldSelectorInput.d.ts.map +1 -1
- package/dist/chart-builders/FieldSelectorInput.js +5 -5
- package/dist/chart-builders/FieldSelectorInput.js.map +1 -1
- package/dist/chart-builders/MultiFieldSelector.d.ts +14 -0
- package/dist/chart-builders/MultiFieldSelector.d.ts.map +1 -0
- package/dist/chart-builders/MultiFieldSelector.js +53 -0
- package/dist/chart-builders/MultiFieldSelector.js.map +1 -0
- package/dist/chart-builders/TemporalGranularitySelector.d.ts +10 -0
- package/dist/chart-builders/TemporalGranularitySelector.d.ts.map +1 -0
- package/dist/chart-builders/TemporalGranularitySelector.js +37 -0
- package/dist/chart-builders/TemporalGranularitySelector.js.map +1 -0
- package/dist/chart-builders/chartSpecTitle.d.ts +1 -1
- package/dist/chart-builders/chartSpecTitle.d.ts.map +1 -1
- package/dist/chart-builders/chartSpecTitle.js.map +1 -1
- package/dist/chart-builders/chartTypeUtils.d.ts +5 -9
- package/dist/chart-builders/chartTypeUtils.d.ts.map +1 -1
- package/dist/chart-builders/chartTypeUtils.js +24 -32
- package/dist/chart-builders/chartTypeUtils.js.map +1 -1
- package/dist/chart-builders/constants.d.ts +5 -0
- package/dist/chart-builders/constants.d.ts.map +1 -1
- package/dist/chart-builders/constants.js +13 -0
- package/dist/chart-builders/constants.js.map +1 -1
- package/dist/chart-builders/createChartBuilderStore.d.ts +5 -5
- package/dist/chart-builders/createChartBuilderStore.d.ts.map +1 -1
- package/dist/chart-builders/createChartBuilderStore.js.map +1 -1
- package/dist/chart-types/base-types.d.ts +112 -18
- package/dist/chart-types/base-types.d.ts.map +1 -1
- package/dist/chart-types/base-types.js +6 -1
- package/dist/chart-types/base-types.js.map +1 -1
- package/dist/chart-types/box-plot/BoxPlotSettings.d.ts +3 -0
- package/dist/chart-types/box-plot/BoxPlotSettings.d.ts.map +1 -0
- package/dist/chart-types/box-plot/BoxPlotSettings.js +9 -0
- package/dist/chart-types/box-plot/BoxPlotSettings.js.map +1 -0
- package/dist/chart-types/box-plot/definition.d.ts +3 -3
- package/dist/chart-types/box-plot/definition.d.ts.map +1 -1
- package/dist/chart-types/box-plot/definition.js +10 -36
- package/dist/chart-types/box-plot/definition.js.map +1 -1
- package/dist/chart-types/box-plot/renderer/BoxPlotErrorBoundary.d.ts +18 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotErrorBoundary.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotErrorBoundary.js +28 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotErrorBoundary.js.map +1 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.d.ts +9 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +115 -0
- package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -0
- package/dist/chart-types/box-plot/renderer/constants.d.ts +24 -0
- package/dist/chart-types/box-plot/renderer/constants.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/constants.js +17 -0
- package/dist/chart-types/box-plot/renderer/constants.js.map +1 -0
- package/dist/chart-types/box-plot/renderer/plot.d.ts +14 -0
- package/dist/chart-types/box-plot/renderer/plot.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/plot.js +91 -0
- package/dist/chart-types/box-plot/renderer/plot.js.map +1 -0
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +14 -0
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js +45 -0
- package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -0
- package/dist/chart-types/box-plot/renderer/utils.d.ts +6 -0
- package/dist/chart-types/box-plot/renderer/utils.d.ts.map +1 -0
- package/dist/chart-types/box-plot/renderer/utils.js +34 -0
- package/dist/chart-types/box-plot/renderer/utils.js.map +1 -0
- package/dist/chart-types/box-plot/schema.d.ts +4 -5
- package/dist/chart-types/box-plot/schema.d.ts.map +1 -1
- package/dist/chart-types/box-plot/schema.js +2 -3
- package/dist/chart-types/box-plot/schema.js.map +1 -1
- package/dist/chart-types/box-plot/tool.d.ts +44 -0
- package/dist/chart-types/box-plot/tool.d.ts.map +1 -0
- package/dist/chart-types/box-plot/tool.js +59 -0
- package/dist/chart-types/box-plot/tool.js.map +1 -0
- package/dist/chart-types/bubble-chart/BubbleChartSettings.d.ts +3 -0
- package/dist/chart-types/bubble-chart/BubbleChartSettings.d.ts.map +1 -0
- package/dist/chart-types/bubble-chart/BubbleChartSettings.js +9 -0
- package/dist/chart-types/bubble-chart/BubbleChartSettings.js.map +1 -0
- package/dist/chart-types/bubble-chart/definition.d.ts +3 -3
- package/dist/chart-types/bubble-chart/definition.d.ts.map +1 -1
- package/dist/chart-types/bubble-chart/definition.js +10 -39
- package/dist/chart-types/bubble-chart/definition.js.map +1 -1
- package/dist/chart-types/bubble-chart/schema.d.ts +2 -1
- package/dist/chart-types/bubble-chart/schema.d.ts.map +1 -1
- package/dist/chart-types/bubble-chart/schema.js +6 -3
- package/dist/chart-types/bubble-chart/schema.js.map +1 -1
- package/dist/chart-types/bubble-chart/spec.d.ts +4 -0
- package/dist/chart-types/bubble-chart/spec.d.ts.map +1 -0
- package/dist/chart-types/bubble-chart/spec.js +31 -0
- package/dist/chart-types/bubble-chart/spec.js.map +1 -0
- package/dist/chart-types/bubble-chart/tool.d.ts +46 -0
- package/dist/chart-types/bubble-chart/tool.d.ts.map +1 -0
- package/dist/chart-types/bubble-chart/tool.js +58 -0
- package/dist/chart-types/bubble-chart/tool.js.map +1 -0
- package/dist/chart-types/chart-config.d.ts +92 -0
- package/dist/chart-types/chart-config.d.ts.map +1 -0
- package/dist/chart-types/chart-config.js +47 -0
- package/dist/chart-types/chart-config.js.map +1 -0
- package/dist/chart-types/count-plot/CountPlotSettings.d.ts +3 -0
- package/dist/chart-types/count-plot/CountPlotSettings.d.ts.map +1 -0
- package/dist/chart-types/count-plot/CountPlotSettings.js +9 -0
- package/dist/chart-types/count-plot/CountPlotSettings.js.map +1 -0
- package/dist/chart-types/count-plot/definition.d.ts +3 -3
- package/dist/chart-types/count-plot/definition.d.ts.map +1 -1
- package/dist/chart-types/count-plot/definition.js +10 -41
- package/dist/chart-types/count-plot/definition.js.map +1 -1
- package/dist/chart-types/count-plot/schema.d.ts +0 -1
- package/dist/chart-types/count-plot/schema.d.ts.map +1 -1
- package/dist/chart-types/count-plot/schema.js +4 -2
- package/dist/chart-types/count-plot/schema.js.map +1 -1
- package/dist/chart-types/count-plot/spec.d.ts +4 -0
- package/dist/chart-types/count-plot/spec.d.ts.map +1 -0
- package/dist/chart-types/count-plot/spec.js +49 -0
- package/dist/chart-types/count-plot/spec.js.map +1 -0
- package/dist/chart-types/count-plot/tool.d.ts +42 -0
- package/dist/chart-types/count-plot/tool.d.ts.map +1 -0
- package/dist/chart-types/count-plot/tool.js +55 -0
- package/dist/chart-types/count-plot/tool.js.map +1 -0
- package/dist/chart-types/custom-spec/CustomSpecSettings.d.ts +7 -0
- package/dist/chart-types/custom-spec/CustomSpecSettings.d.ts.map +1 -0
- package/dist/chart-types/custom-spec/CustomSpecSettings.js +30 -0
- package/dist/chart-types/custom-spec/CustomSpecSettings.js.map +1 -0
- package/dist/chart-types/custom-spec/definition.d.ts +3 -3
- package/dist/chart-types/custom-spec/definition.d.ts.map +1 -1
- package/dist/chart-types/custom-spec/definition.js +8 -19
- package/dist/chart-types/custom-spec/definition.js.map +1 -1
- package/dist/chart-types/custom-spec/schema.d.ts +6 -3
- package/dist/chart-types/custom-spec/schema.d.ts.map +1 -1
- package/dist/chart-types/custom-spec/schema.js +3 -2
- package/dist/chart-types/custom-spec/schema.js.map +1 -1
- package/dist/chart-types/custom-spec/spec.d.ts +4 -0
- package/dist/chart-types/custom-spec/spec.d.ts.map +1 -0
- package/dist/chart-types/custom-spec/spec.js +24 -0
- package/dist/chart-types/custom-spec/spec.js.map +1 -0
- package/dist/chart-types/errors.d.ts +23 -0
- package/dist/chart-types/errors.d.ts.map +1 -0
- package/dist/chart-types/errors.js +26 -0
- package/dist/chart-types/errors.js.map +1 -0
- package/dist/chart-types/heatmap/HeatmapSettings.d.ts +3 -0
- package/dist/chart-types/heatmap/HeatmapSettings.d.ts.map +1 -0
- package/dist/chart-types/heatmap/HeatmapSettings.js +9 -0
- package/dist/chart-types/heatmap/HeatmapSettings.js.map +1 -0
- package/dist/chart-types/heatmap/definition.d.ts +3 -3
- package/dist/chart-types/heatmap/definition.d.ts.map +1 -1
- package/dist/chart-types/heatmap/definition.js +10 -40
- package/dist/chart-types/heatmap/definition.js.map +1 -1
- package/dist/chart-types/heatmap/schema.d.ts +0 -1
- package/dist/chart-types/heatmap/schema.d.ts.map +1 -1
- package/dist/chart-types/heatmap/schema.js +2 -3
- package/dist/chart-types/heatmap/schema.js.map +1 -1
- package/dist/chart-types/heatmap/spec.d.ts +4 -0
- package/dist/chart-types/heatmap/spec.d.ts.map +1 -0
- package/dist/chart-types/heatmap/spec.js +32 -0
- package/dist/chart-types/heatmap/spec.js.map +1 -0
- package/dist/chart-types/heatmap/tool.d.ts +44 -0
- package/dist/chart-types/heatmap/tool.d.ts.map +1 -0
- package/dist/chart-types/heatmap/tool.js +59 -0
- package/dist/chart-types/heatmap/tool.js.map +1 -0
- package/dist/chart-types/histogram/HistogramSettings.d.ts +3 -0
- package/dist/chart-types/histogram/HistogramSettings.d.ts.map +1 -0
- package/dist/chart-types/histogram/HistogramSettings.js +9 -0
- package/dist/chart-types/histogram/HistogramSettings.js.map +1 -0
- package/dist/chart-types/histogram/definition.d.ts +3 -3
- package/dist/chart-types/histogram/definition.d.ts.map +1 -1
- package/dist/chart-types/histogram/definition.js +10 -40
- package/dist/chart-types/histogram/definition.js.map +1 -1
- package/dist/chart-types/histogram/schema.d.ts +0 -1
- package/dist/chart-types/histogram/schema.d.ts.map +1 -1
- package/dist/chart-types/histogram/schema.js +4 -2
- package/dist/chart-types/histogram/schema.js.map +1 -1
- package/dist/chart-types/histogram/spec.d.ts +4 -0
- package/dist/chart-types/histogram/spec.d.ts.map +1 -0
- package/dist/chart-types/histogram/spec.js +36 -0
- package/dist/chart-types/histogram/spec.js.map +1 -0
- package/dist/chart-types/histogram/tool.d.ts +42 -0
- package/dist/chart-types/histogram/tool.d.ts.map +1 -0
- package/dist/chart-types/histogram/tool.js +55 -0
- package/dist/chart-types/histogram/tool.js.map +1 -0
- package/dist/chart-types/index.d.ts +102 -96
- package/dist/chart-types/index.d.ts.map +1 -1
- package/dist/chart-types/index.js +71 -41
- package/dist/chart-types/index.js.map +1 -1
- package/dist/chart-types/line-chart/LineChartSettings.d.ts +7 -0
- package/dist/chart-types/line-chart/LineChartSettings.d.ts.map +1 -0
- package/dist/chart-types/line-chart/LineChartSettings.js +22 -0
- package/dist/chart-types/line-chart/LineChartSettings.js.map +1 -0
- package/dist/chart-types/line-chart/definition.d.ts +3 -3
- package/dist/chart-types/line-chart/definition.d.ts.map +1 -1
- package/dist/chart-types/line-chart/definition.js +10 -37
- package/dist/chart-types/line-chart/definition.js.map +1 -1
- package/dist/chart-types/line-chart/schema.d.ts +69 -3
- package/dist/chart-types/line-chart/schema.d.ts.map +1 -1
- package/dist/chart-types/line-chart/schema.js +30 -3
- package/dist/chart-types/line-chart/schema.js.map +1 -1
- package/dist/chart-types/line-chart/spec.d.ts +4 -0
- package/dist/chart-types/line-chart/spec.d.ts.map +1 -0
- package/dist/chart-types/line-chart/spec.js +91 -0
- package/dist/chart-types/line-chart/spec.js.map +1 -0
- package/dist/chart-types/line-chart/tool.d.ts +68 -0
- package/dist/chart-types/line-chart/tool.d.ts.map +1 -0
- package/dist/chart-types/line-chart/tool.js +66 -0
- package/dist/chart-types/line-chart/tool.js.map +1 -0
- package/dist/chart-types/tool-schemas.d.ts +8 -0
- package/dist/chart-types/tool-schemas.d.ts.map +1 -0
- package/dist/chart-types/tool-schemas.js +18 -0
- package/dist/chart-types/tool-schemas.js.map +1 -0
- package/dist/chart-types/tool-types.d.ts +26 -0
- package/dist/chart-types/tool-types.d.ts.map +1 -0
- package/dist/chart-types/tool-types.js +2 -0
- package/dist/chart-types/tool-types.js.map +1 -0
- package/dist/chart-types/tool-validation.d.ts +3 -0
- package/dist/chart-types/tool-validation.d.ts.map +1 -0
- package/dist/chart-types/tool-validation.js +11 -0
- package/dist/chart-types/tool-validation.js.map +1 -0
- package/dist/chart-types/useChartTypeDefinition.d.ts +3 -0
- package/dist/chart-types/useChartTypeDefinition.d.ts.map +1 -0
- package/dist/chart-types/useChartTypeDefinition.js +8 -0
- package/dist/chart-types/useChartTypeDefinition.js.map +1 -0
- package/dist/dashboard/MosaicDashboard.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboard.js +7 -11
- package/dist/dashboard/MosaicDashboard.js.map +1 -1
- package/dist/dashboard/MosaicDashboardEmptyState.d.ts +2 -0
- package/dist/dashboard/MosaicDashboardEmptyState.d.ts.map +1 -0
- package/dist/dashboard/MosaicDashboardEmptyState.js +50 -0
- package/dist/dashboard/MosaicDashboardEmptyState.js.map +1 -0
- package/dist/dashboard/MosaicDashboardPanelLayout.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardPanelLayout.js +23 -2
- package/dist/dashboard/MosaicDashboardPanelLayout.js.map +1 -1
- package/dist/dashboard/MosaicDashboardPanels.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardPanels.js +2 -1
- package/dist/dashboard/MosaicDashboardPanels.js.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.d.ts +212 -87
- package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardSlice.js +65 -18
- package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
- package/dist/dashboard/MosaicDashboardToolbar.d.ts.map +1 -1
- package/dist/dashboard/MosaicDashboardToolbar.js +9 -4
- package/dist/dashboard/MosaicDashboardToolbar.js.map +1 -1
- package/dist/dashboard/defaultPanelRenderers.d.ts.map +1 -1
- package/dist/dashboard/defaultPanelRenderers.js +6 -4
- package/dist/dashboard/defaultPanelRenderers.js.map +1 -1
- package/dist/dashboard/utils.d.ts +3 -0
- package/dist/dashboard/utils.d.ts.map +1 -0
- package/dist/dashboard/utils.js +16 -0
- package/dist/dashboard/utils.js.map +1 -0
- package/dist/index.d.ts +6 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/{dashboard → profiler}/MosaicDashboardProfilerPanelRenderer.d.ts +1 -1
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts.map +1 -0
- package/dist/{dashboard → profiler}/MosaicDashboardProfilerPanelRenderer.js +2 -2
- package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js.map +1 -0
- package/dist/text/MosaicDashboardTextRenderer.d.ts +3 -0
- package/dist/text/MosaicDashboardTextRenderer.d.ts.map +1 -0
- package/dist/text/MosaicDashboardTextRenderer.js +46 -0
- package/dist/text/MosaicDashboardTextRenderer.js.map +1 -0
- package/package.json +38 -35
- package/dist/chart-builders/builders.d.ts +0 -34
- package/dist/chart-builders/builders.d.ts.map +0 -1
- package/dist/chart-builders/builders.js +0 -51
- package/dist/chart-builders/builders.js.map +0 -1
- package/dist/chart-builders/describeChartSpecs.d.ts +0 -9
- package/dist/chart-builders/describeChartSpecs.d.ts.map +0 -1
- package/dist/chart-builders/describeChartSpecs.js +0 -41
- package/dist/chart-builders/describeChartSpecs.js.map +0 -1
- package/dist/chart-builders/hooks/useChartFieldForm.d.ts +0 -13
- package/dist/chart-builders/hooks/useChartFieldForm.d.ts.map +0 -1
- package/dist/chart-builders/hooks/useChartFieldForm.js +0 -12
- package/dist/chart-builders/hooks/useChartFieldForm.js.map +0 -1
- package/dist/chart-builders/types.d.ts +0 -23
- package/dist/chart-builders/types.d.ts.map +0 -1
- package/dist/chart-builders/types.js +0 -17
- package/dist/chart-builders/types.js.map +0 -1
- package/dist/chart-types/box-plot/index.d.ts +0 -3
- package/dist/chart-types/box-plot/index.d.ts.map +0 -1
- package/dist/chart-types/box-plot/index.js +0 -3
- package/dist/chart-types/box-plot/index.js.map +0 -1
- package/dist/chart-types/bubble-chart/index.d.ts +0 -3
- package/dist/chart-types/bubble-chart/index.d.ts.map +0 -1
- package/dist/chart-types/bubble-chart/index.js +0 -3
- package/dist/chart-types/bubble-chart/index.js.map +0 -1
- package/dist/chart-types/count-plot/index.d.ts +0 -3
- package/dist/chart-types/count-plot/index.d.ts.map +0 -1
- package/dist/chart-types/count-plot/index.js +0 -3
- package/dist/chart-types/count-plot/index.js.map +0 -1
- package/dist/chart-types/custom-spec/index.d.ts +0 -3
- package/dist/chart-types/custom-spec/index.d.ts.map +0 -1
- package/dist/chart-types/custom-spec/index.js +0 -3
- package/dist/chart-types/custom-spec/index.js.map +0 -1
- package/dist/chart-types/ecdf/definition.d.ts +0 -4
- package/dist/chart-types/ecdf/definition.d.ts.map +0 -1
- package/dist/chart-types/ecdf/definition.js +0 -47
- package/dist/chart-types/ecdf/definition.js.map +0 -1
- package/dist/chart-types/ecdf/index.d.ts +0 -3
- package/dist/chart-types/ecdf/index.d.ts.map +0 -1
- package/dist/chart-types/ecdf/index.js +0 -3
- package/dist/chart-types/ecdf/index.js.map +0 -1
- package/dist/chart-types/ecdf/schema.d.ts +0 -15
- package/dist/chart-types/ecdf/schema.d.ts.map +0 -1
- package/dist/chart-types/ecdf/schema.js +0 -11
- package/dist/chart-types/ecdf/schema.js.map +0 -1
- package/dist/chart-types/heatmap/index.d.ts +0 -3
- package/dist/chart-types/heatmap/index.d.ts.map +0 -1
- package/dist/chart-types/heatmap/index.js +0 -3
- package/dist/chart-types/heatmap/index.js.map +0 -1
- package/dist/chart-types/histogram/index.d.ts +0 -3
- package/dist/chart-types/histogram/index.d.ts.map +0 -1
- package/dist/chart-types/histogram/index.js +0 -3
- package/dist/chart-types/histogram/index.js.map +0 -1
- package/dist/chart-types/line-chart/index.d.ts +0 -3
- package/dist/chart-types/line-chart/index.d.ts.map +0 -1
- package/dist/chart-types/line-chart/index.js +0 -3
- package/dist/chart-types/line-chart/index.js.map +0 -1
- package/dist/chart-types/registry.d.ts +0 -5
- package/dist/chart-types/registry.d.ts.map +0 -1
- package/dist/chart-types/registry.js +0 -28
- package/dist/chart-types/registry.js.map +0 -1
- package/dist/dashboard/MosaicDashboardProfilerPanelRenderer.d.ts.map +0 -1
- package/dist/dashboard/MosaicDashboardProfilerPanelRenderer.js.map +0 -1
- package/dist/dashboard/MosaicDashboardVgPlotHeaderActions.d.ts +0 -4
- package/dist/dashboard/MosaicDashboardVgPlotHeaderActions.d.ts.map +0 -1
- package/dist/dashboard/MosaicDashboardVgPlotHeaderActions.js +0 -29
- package/dist/dashboard/MosaicDashboardVgPlotHeaderActions.js.map +0 -1
- package/dist/dashboard/MosaicDashboardVgPlotPanelRenderer.d.ts +0 -3
- package/dist/dashboard/MosaicDashboardVgPlotPanelRenderer.d.ts.map +0 -1
- package/dist/dashboard/MosaicDashboardVgPlotPanelRenderer.js +0 -68
- package/dist/dashboard/MosaicDashboardVgPlotPanelRenderer.js.map +0 -1
- package/dist/dashboard/VgPlotSpecPopoverEditor.d.ts +0 -8
- package/dist/dashboard/VgPlotSpecPopoverEditor.d.ts.map +0 -1
- package/dist/dashboard/VgPlotSpecPopoverEditor.js +0 -40
- package/dist/dashboard/VgPlotSpecPopoverEditor.js.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettings.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettings.js +0 -90
- package/dist/dashboard/chart-settings/ChartSettings.js.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettingsContext.d.ts +0 -20
- package/dist/dashboard/chart-settings/ChartSettingsContext.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettingsContext.js +0 -14
- package/dist/dashboard/chart-settings/ChartSettingsContext.js.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettingsPanel.d.ts +0 -11
- package/dist/dashboard/chart-settings/ChartSettingsPanel.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/ChartSettingsPanel.js +0 -8
- package/dist/dashboard/chart-settings/ChartSettingsPanel.js.map +0 -1
- package/dist/dashboard/chart-settings/ChartTypeSelector.d.ts +0 -11
- package/dist/dashboard/chart-settings/ChartTypeSelector.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/ChartTypeSelector.js +0 -17
- package/dist/dashboard/chart-settings/ChartTypeSelector.js.map +0 -1
- package/dist/dashboard/chart-settings/DynamicChartSettings.d.ts +0 -11
- package/dist/dashboard/chart-settings/DynamicChartSettings.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/DynamicChartSettings.js +0 -19
- package/dist/dashboard/chart-settings/DynamicChartSettings.js.map +0 -1
- package/dist/dashboard/chart-settings/index.d.ts +0 -6
- package/dist/dashboard/chart-settings/index.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/index.js +0 -6
- package/dist/dashboard/chart-settings/index.js.map +0 -1
- package/dist/dashboard/chart-settings/useTableColumns.d.ts.map +0 -1
- package/dist/dashboard/chart-settings/useTableColumns.js.map +0 -1
- package/dist/dashboard/generateMosaicChartSpec.d.ts +0 -15
- package/dist/dashboard/generateMosaicChartSpec.d.ts.map +0 -1
- package/dist/dashboard/generateMosaicChartSpec.js +0 -30
- package/dist/dashboard/generateMosaicChartSpec.js.map +0 -1
- /package/dist/{dashboard → chart}/chart-settings/useTableColumns.d.ts +0 -0
|
@@ -1,51 +1,59 @@
|
|
|
1
1
|
// Re-export base types
|
|
2
2
|
export * from './base-types';
|
|
3
|
-
// Re-export
|
|
4
|
-
export * from './
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
3
|
+
// Re-export error classes for chart definitions
|
|
4
|
+
export * from './errors';
|
|
5
|
+
// CRITICAL: Export ChartConfig FIRST, before importing Settings components
|
|
6
|
+
// Export ChartConfig from separate file to avoid circular dependencies
|
|
7
|
+
// (chart-types/index imports Settings components, which import ChartSettingsContext,
|
|
8
|
+
// which imports ChartConfig)
|
|
9
|
+
export { ChartConfig } from './chart-config';
|
|
10
|
+
// Re-export schemas
|
|
11
|
+
export * from './histogram/schema';
|
|
12
|
+
export * from './line-chart/schema';
|
|
13
|
+
export * from './count-plot/schema';
|
|
14
|
+
export * from './heatmap/schema';
|
|
15
|
+
export * from './box-plot/schema';
|
|
16
|
+
export * from './bubble-chart/schema';
|
|
17
|
+
export * from './custom-spec/schema';
|
|
18
|
+
// Re-export Settings components
|
|
19
|
+
export { HistogramSettingsComponent } from './histogram/HistogramSettings';
|
|
20
|
+
export { LineChartSettingsComponent } from './line-chart/LineChartSettings';
|
|
21
|
+
export { CountPlotSettingsComponent } from './count-plot/CountPlotSettings';
|
|
22
|
+
export { HeatmapSettingsComponent } from './heatmap/HeatmapSettings';
|
|
23
|
+
export { BoxPlotSettingsComponent } from './box-plot/BoxPlotSettings';
|
|
24
|
+
export { BubbleChartSettingsComponent } from './bubble-chart/BubbleChartSettings';
|
|
25
|
+
export { CustomSpecSettingsComponent } from './custom-spec/CustomSpecSettings';
|
|
26
|
+
// Re-export definitions
|
|
27
|
+
export * from './histogram/definition';
|
|
28
|
+
export * from './line-chart/definition';
|
|
29
|
+
export * from './count-plot/definition';
|
|
30
|
+
export * from './heatmap/definition';
|
|
31
|
+
export * from './box-plot/definition';
|
|
32
|
+
export * from './bubble-chart/definition';
|
|
33
|
+
export * from './custom-spec/definition';
|
|
34
|
+
// Re-export tool types, schemas, validation, and AI tool creators
|
|
35
|
+
export * from './tool-types';
|
|
36
|
+
export * from './tool-schemas';
|
|
37
|
+
export * from './tool-validation';
|
|
38
|
+
export * from './histogram/tool';
|
|
39
|
+
export * from './line-chart/tool';
|
|
40
|
+
export * from './count-plot/tool';
|
|
41
|
+
export * from './heatmap/tool';
|
|
42
|
+
export * from './bubble-chart/tool';
|
|
43
|
+
export * from './box-plot/tool';
|
|
13
44
|
// Import chart type definitions for legacy exports
|
|
14
|
-
import { histogramChartType } from './histogram';
|
|
15
|
-
import { lineChartChartType } from './line-chart';
|
|
16
|
-
import { countPlotChartType } from './count-plot';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { customSpecChartType } from './custom-spec';
|
|
22
|
-
// Import Zod configs for discriminated union
|
|
23
|
-
import { HistogramChartConfig as HistogramChartConfigSchema } from './histogram';
|
|
24
|
-
import { CountPlotChartConfig as CountPlotChartConfigSchema } from './count-plot';
|
|
25
|
-
import { EcdfChartConfig as EcdfChartConfigSchema } from './ecdf';
|
|
26
|
-
import { LineChartConfig as LineChartConfigSchema } from './line-chart';
|
|
27
|
-
import { BubbleChartConfig as BubbleChartConfigSchema } from './bubble-chart';
|
|
28
|
-
import { HeatmapChartConfig as HeatmapChartConfigSchema } from './heatmap';
|
|
29
|
-
import { BoxPlotChartConfig as BoxPlotChartConfigSchema } from './box-plot';
|
|
30
|
-
import { CustomSpecChartConfig as CustomSpecChartConfigSchema } from './custom-spec';
|
|
31
|
-
import { z } from 'zod';
|
|
32
|
-
// Zod schema for VgPlotChartConfig (discriminated union)
|
|
33
|
-
export const VgPlotChartConfig = z.discriminatedUnion('chartType', [
|
|
34
|
-
HistogramChartConfigSchema,
|
|
35
|
-
CountPlotChartConfigSchema,
|
|
36
|
-
EcdfChartConfigSchema,
|
|
37
|
-
LineChartConfigSchema,
|
|
38
|
-
BubbleChartConfigSchema,
|
|
39
|
-
HeatmapChartConfigSchema,
|
|
40
|
-
BoxPlotChartConfigSchema,
|
|
41
|
-
CustomSpecChartConfigSchema,
|
|
42
|
-
]);
|
|
45
|
+
import { histogramChartType } from './histogram/definition';
|
|
46
|
+
import { lineChartChartType } from './line-chart/definition';
|
|
47
|
+
import { countPlotChartType } from './count-plot/definition';
|
|
48
|
+
import { heatmapChartType } from './heatmap/definition';
|
|
49
|
+
import { boxPlotChartType } from './box-plot/definition';
|
|
50
|
+
import { bubbleChartChartType } from './bubble-chart/definition';
|
|
51
|
+
import { customSpecChartType } from './custom-spec/definition';
|
|
43
52
|
// Legacy compatibility exports
|
|
44
53
|
export const mosaicChartTypes = {
|
|
45
54
|
histogram: histogramChartType,
|
|
46
55
|
countPlot: countPlotChartType,
|
|
47
56
|
lineChart: lineChartChartType,
|
|
48
|
-
ecdf: ecdfChartType,
|
|
49
57
|
heatmap: heatmapChartType,
|
|
50
58
|
boxPlot: boxPlotChartType,
|
|
51
59
|
bubbleChart: bubbleChartChartType,
|
|
@@ -57,7 +65,6 @@ export function createDefaultChartTypes(options) {
|
|
|
57
65
|
histogramChartType,
|
|
58
66
|
countPlotChartType,
|
|
59
67
|
lineChartChartType,
|
|
60
|
-
ecdfChartType,
|
|
61
68
|
heatmapChartType,
|
|
62
69
|
boxPlotChartType,
|
|
63
70
|
bubbleChartChartType,
|
|
@@ -67,4 +74,27 @@ export function createDefaultChartTypes(options) {
|
|
|
67
74
|
}
|
|
68
75
|
return chartTypes;
|
|
69
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Dynamically generate AI tools from chart type definitions.
|
|
79
|
+
*
|
|
80
|
+
* @param chartTypes Array of chart type definitions
|
|
81
|
+
* @param deps Dependencies needed by tool creators (resolveResources, createChart)
|
|
82
|
+
* @param toolNamePrefix Prefix for generated tool names (default: 'create_dashboard_')
|
|
83
|
+
* @returns Record mapping tool names to tool instances
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const chartTypes = createDefaultChartTypes({includeCustomSpec: false});
|
|
87
|
+
* const tools = createChartTools(chartTypes, deps);
|
|
88
|
+
* // Returns: { create_dashboard_histogram: ..., create_dashboard_line_chart: ..., ... }
|
|
89
|
+
*/
|
|
90
|
+
export function createChartTools(chartTypes, deps, toolNamePrefix = 'create_dashboard_') {
|
|
91
|
+
const tools = {};
|
|
92
|
+
for (const chartType of chartTypes) {
|
|
93
|
+
if (chartType.createTool) {
|
|
94
|
+
const toolName = `${toolNamePrefix}${chartType.id.replace(/-/g, '_')}`;
|
|
95
|
+
tools[toolName] = chartType.createTool(deps);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return tools;
|
|
99
|
+
}
|
|
70
100
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chart-types/index.ts"],"names":[],"mappings":"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","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';\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, and AI tool creators\nexport * from './tool-types';\nexport * from './tool-schemas';\nexport * from './tool-validation';\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';\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 {ChartToolDeps} 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 (resolveResources, createChart)\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: ChartToolDeps,\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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Explicit settings component for line chart.
|
|
4
|
+
* Composes primitive and compound components for full control over the UI.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LineChartSettingsComponent: FC;
|
|
7
|
+
//# sourceMappingURL=LineChartSettings.d.ts.map
|
|
@@ -0,0 +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;AAS9B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,EAyCxC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Field } from '../../chart-builders/Field';
|
|
3
|
+
import { ColumnSelector } from '../../chart-builders/ColumnSelector';
|
|
4
|
+
import { TemporalGranularitySelector } from '../../chart-builders/TemporalGranularitySelector';
|
|
5
|
+
import { useChartSettingsContext } from '../../chart/chart-settings/ChartSettingsContext';
|
|
6
|
+
import { MultiFieldSelector } from '../../chart-builders/MultiFieldSelector';
|
|
7
|
+
import { isTemporalType } from '../../chart-builders/constants';
|
|
8
|
+
/**
|
|
9
|
+
* Explicit settings component for line chart.
|
|
10
|
+
* Composes primitive and compound components for full control over the UI.
|
|
11
|
+
*/
|
|
12
|
+
export const LineChartSettingsComponent = () => {
|
|
13
|
+
const { columns, onChangeConfig, config } = useChartSettingsContext('line-chart');
|
|
14
|
+
const xField = columns.find((c) => c.name === config.settings.x);
|
|
15
|
+
const isXFieldTemporal = xField && isTemporalType(xField.type);
|
|
16
|
+
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: {
|
|
17
|
+
gridTemplateColumns: isXFieldTemporal
|
|
18
|
+
? 'minmax(120px, 1fr) 100px'
|
|
19
|
+
: '1fr',
|
|
20
|
+
}, children: [_jsx(ColumnSelector.Quantitative, { value: config.settings.x, onChange: (x) => onChangeConfig('x', x) }), isXFieldTemporal && (_jsx(TemporalGranularitySelector, { value: config.settings.xInterval, onChange: (xInterval) => onChangeConfig('xInterval', xInterval), xFieldType: xField.type }))] }) }), _jsx(Field, { label: "Y Axis", required: true, children: _jsx(MultiFieldSelector.Numeric, { value: config.settings.yFields ?? [], onChange: (yFields) => onChangeConfig('yFields', yFields), showAggregation: Boolean(config.settings.xInterval) }) })] }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=LineChartSettings.js.map
|
|
@@ -0,0 +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;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAO,GAAG,EAAE;IACjD,MAAM,EAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAC,GACrC,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAExC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAG,MAAM,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE/D,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,KAAK,IAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,kBAC5B,eACE,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE;wBACL,mBAAmB,EAAE,gBAAgB;4BACnC,CAAC,CAAC,0BAA0B;4BAC5B,CAAC,CAAC,KAAK;qBACV,aAED,KAAC,cAAc,CAAC,YAAY,IAC1B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GACvC,EACD,gBAAgB,IAAI,CACnB,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';\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 {columns, onChangeConfig, config} =\n useChartSettingsContext('line-chart');\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,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
export declare const lineChartChartType:
|
|
1
|
+
import type { SpecChartTypeDefinition } from '../base-types';
|
|
2
|
+
import { LineChartConfig } from './schema';
|
|
3
|
+
export declare const lineChartChartType: SpecChartTypeDefinition<LineChartConfig>;
|
|
4
4
|
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"
|
|
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;AAS5D,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,eAAe,CAUvE,CAAC"}
|
|
@@ -1,46 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LineChartSettings } from './schema';
|
|
2
2
|
import { titleFromDescription } from '../../chart-builders/chartTypeUtils';
|
|
3
|
-
|
|
3
|
+
import { LineChartSettingsComponent } from './LineChartSettings';
|
|
4
|
+
import { createLineChartAiTool } from './tool';
|
|
5
|
+
import { LineChart } from 'lucide-react';
|
|
6
|
+
import { createLineChartSpec } from './spec';
|
|
4
7
|
const DESCRIPTION = 'Create a line chart of two fields';
|
|
5
8
|
export const lineChartChartType = {
|
|
6
9
|
id: 'line-chart',
|
|
7
10
|
label: 'Line Chart',
|
|
8
11
|
description: DESCRIPTION,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
key: 'x',
|
|
13
|
-
label: 'X Field',
|
|
14
|
-
required: true,
|
|
15
|
-
types: [...QUANTITATIVE_COLUMN_TYPES],
|
|
16
|
-
description: 'Ordered x-axis column, usually time or a quantitative value.',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
key: 'y',
|
|
20
|
-
label: 'Y Field',
|
|
21
|
-
required: true,
|
|
22
|
-
types: [...NUMERIC_COLUMN_TYPES],
|
|
23
|
-
description: 'Numeric measure plotted on the y-axis.',
|
|
24
|
-
},
|
|
25
|
-
],
|
|
12
|
+
icon: LineChart,
|
|
13
|
+
schema: LineChartSettings,
|
|
14
|
+
settingsComponent: LineChartSettingsComponent,
|
|
26
15
|
buildTitle: titleFromDescription(DESCRIPTION),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
mark: 'lineY',
|
|
31
|
-
data: { from: tableName, filterBy: '$brush' },
|
|
32
|
-
x,
|
|
33
|
-
y,
|
|
34
|
-
stroke: FG_COLOR,
|
|
35
|
-
},
|
|
36
|
-
{ select: 'intervalX', as: '$brush' },
|
|
37
|
-
],
|
|
38
|
-
xLabel: x,
|
|
39
|
-
yLabel: y,
|
|
40
|
-
height: 250,
|
|
41
|
-
width: 380,
|
|
42
|
-
margins: { left: 50, right: 20, top: 20, bottom: 50 },
|
|
43
|
-
params: { brush: { select: 'crossfilter' } },
|
|
44
|
-
}),
|
|
16
|
+
createTool: createLineChartAiTool,
|
|
17
|
+
createSpec: createLineChartSpec,
|
|
45
18
|
};
|
|
46
19
|
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/definition.ts"],"names":[],"mappings":"
|
|
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;AAE3C,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,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';\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 createSpec: createLineChartSpec,\n};\n"]}
|
|
@@ -1,16 +1,82 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const TemporalInterval: z.ZodEnum<{
|
|
3
|
+
second: "second";
|
|
4
|
+
minute: "minute";
|
|
5
|
+
hour: "hour";
|
|
6
|
+
day: "day";
|
|
7
|
+
week: "week";
|
|
8
|
+
month: "month";
|
|
9
|
+
quarter: "quarter";
|
|
10
|
+
year: "year";
|
|
11
|
+
}>;
|
|
12
|
+
export type TemporalInterval = z.infer<typeof TemporalInterval>;
|
|
13
|
+
export declare const AggregateFunction: z.ZodEnum<{
|
|
14
|
+
sum: "sum";
|
|
15
|
+
max: "max";
|
|
16
|
+
min: "min";
|
|
17
|
+
avg: "avg";
|
|
18
|
+
}>;
|
|
19
|
+
export type AggregateFunction = z.infer<typeof AggregateFunction>;
|
|
20
|
+
export declare const YFieldConfig: z.ZodObject<{
|
|
21
|
+
field: z.ZodString;
|
|
22
|
+
color: z.ZodOptional<z.ZodString>;
|
|
23
|
+
aggregate: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
sum: "sum";
|
|
25
|
+
max: "max";
|
|
26
|
+
min: "min";
|
|
27
|
+
avg: "avg";
|
|
28
|
+
}>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type YFieldConfig = z.infer<typeof YFieldConfig>;
|
|
2
31
|
export declare const LineChartSettings: z.ZodObject<{
|
|
3
32
|
x: z.ZodOptional<z.ZodString>;
|
|
4
|
-
|
|
33
|
+
xInterval: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
second: "second";
|
|
35
|
+
minute: "minute";
|
|
36
|
+
hour: "hour";
|
|
37
|
+
day: "day";
|
|
38
|
+
week: "week";
|
|
39
|
+
month: "month";
|
|
40
|
+
quarter: "quarter";
|
|
41
|
+
year: "year";
|
|
42
|
+
}>>;
|
|
43
|
+
yFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
field: z.ZodString;
|
|
45
|
+
color: z.ZodOptional<z.ZodString>;
|
|
46
|
+
aggregate: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
sum: "sum";
|
|
48
|
+
max: "max";
|
|
49
|
+
min: "min";
|
|
50
|
+
avg: "avg";
|
|
51
|
+
}>>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
5
53
|
}, z.core.$strip>;
|
|
6
54
|
export type LineChartSettings = z.infer<typeof LineChartSettings>;
|
|
7
55
|
export declare const LineChartConfig: z.ZodObject<{
|
|
8
56
|
chartType: z.ZodLiteral<"line-chart">;
|
|
9
57
|
settings: z.ZodObject<{
|
|
10
58
|
x: z.ZodOptional<z.ZodString>;
|
|
11
|
-
|
|
59
|
+
xInterval: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
second: "second";
|
|
61
|
+
minute: "minute";
|
|
62
|
+
hour: "hour";
|
|
63
|
+
day: "day";
|
|
64
|
+
week: "week";
|
|
65
|
+
month: "month";
|
|
66
|
+
quarter: "quarter";
|
|
67
|
+
year: "year";
|
|
68
|
+
}>>;
|
|
69
|
+
yFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
field: z.ZodString;
|
|
71
|
+
color: z.ZodOptional<z.ZodString>;
|
|
72
|
+
aggregate: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
sum: "sum";
|
|
74
|
+
max: "max";
|
|
75
|
+
min: "min";
|
|
76
|
+
avg: "avg";
|
|
77
|
+
}>>>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
12
79
|
}, z.core.$strip>;
|
|
13
|
-
vgplot: z.ZodUnknown;
|
|
14
80
|
settingsOpen: z.ZodOptional<z.ZodBoolean>;
|
|
15
81
|
}, z.core.$strip>;
|
|
16
82
|
export type LineChartConfig = z.infer<typeof LineChartConfig>;
|
|
@@ -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;AAGtB,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;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
// Temporal interval enum
|
|
3
|
+
export const TemporalInterval = z.enum([
|
|
4
|
+
'year',
|
|
5
|
+
'quarter',
|
|
6
|
+
'month',
|
|
7
|
+
'week',
|
|
8
|
+
'day',
|
|
9
|
+
'hour',
|
|
10
|
+
'minute',
|
|
11
|
+
'second',
|
|
12
|
+
]);
|
|
13
|
+
// Aggregate function enum
|
|
14
|
+
export const AggregateFunction = z.enum(['sum', 'avg', 'min', 'max']);
|
|
15
|
+
// Y-field configuration
|
|
16
|
+
export const YFieldConfig = z.object({
|
|
17
|
+
field: z.string().describe('Numeric column name to plot on Y axis'),
|
|
18
|
+
color: z.string().optional().describe('Optional color for this line'),
|
|
19
|
+
aggregate: AggregateFunction.optional()
|
|
20
|
+
.default('sum')
|
|
21
|
+
.describe('Aggregation function: sum, avg, min, or max'),
|
|
22
|
+
});
|
|
2
23
|
export const LineChartSettings = z.object({
|
|
3
|
-
x: z
|
|
4
|
-
|
|
24
|
+
x: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Column for X axis, typically temporal (date/time)'),
|
|
28
|
+
xInterval: TemporalInterval.optional().describe('Temporal binning interval: year, month, day, hour, etc.'),
|
|
29
|
+
yFields: z
|
|
30
|
+
.array(YFieldConfig)
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Array of Y fields to plot, supports multiple lines'),
|
|
5
33
|
});
|
|
6
34
|
export const LineChartConfig = z.object({
|
|
7
35
|
chartType: z.literal('line-chart'),
|
|
8
36
|
settings: LineChartSettings,
|
|
9
|
-
vgplot: z.unknown(),
|
|
10
37
|
settingsOpen: z.boolean().optional(),
|
|
11
38
|
});
|
|
12
39
|
//# 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;AAEtB,MAAM,CAAC,MAAM,
|
|
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;AAEtB,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;CACrC,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\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});\n\nexport type LineChartConfig = z.infer<typeof LineChartConfig>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/chart-types/line-chart/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAuB3C,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,EAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,iBAAiB,GACzC,IAAI,CAkFN"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { SpecGenerationError } from '../errors';
|
|
2
|
+
// Chart color palette matching theme colors from tailwind-preset.css
|
|
3
|
+
const CHART_COLORS = [
|
|
4
|
+
'#ea7c5c', // chart-1: hsl(12, 76%, 61%)
|
|
5
|
+
'#2a9d8f', // chart-2: hsl(173, 58%, 39%)
|
|
6
|
+
'#264653', // chart-3: hsl(197, 37%, 24%)
|
|
7
|
+
'#e9c46a', // chart-4: hsl(43, 74%, 66%)
|
|
8
|
+
'#f4a261', // chart-5: hsl(27, 87%, 67%)
|
|
9
|
+
];
|
|
10
|
+
function getLineColor(fieldConfig, index) {
|
|
11
|
+
if (fieldConfig.color) {
|
|
12
|
+
return fieldConfig.color;
|
|
13
|
+
}
|
|
14
|
+
// CHART_COLORS is non-empty, so this is always defined
|
|
15
|
+
return CHART_COLORS[index % CHART_COLORS.length];
|
|
16
|
+
}
|
|
17
|
+
export function createLineChartSpec(tableName, { x, yFields, xInterval }) {
|
|
18
|
+
if (!x) {
|
|
19
|
+
throw new SpecGenerationError('X field is required for line chart');
|
|
20
|
+
}
|
|
21
|
+
if (!yFields || yFields.length === 0) {
|
|
22
|
+
throw new SpecGenerationError('At least one Y field is required for line chart');
|
|
23
|
+
}
|
|
24
|
+
const plotMarks = [];
|
|
25
|
+
// When temporal aggregation is active, use SQL binning
|
|
26
|
+
const dataSource = xInterval
|
|
27
|
+
? {
|
|
28
|
+
from: tableName,
|
|
29
|
+
filterBy: '$brush',
|
|
30
|
+
}
|
|
31
|
+
: { from: tableName, filterBy: '$brush' };
|
|
32
|
+
// Generate lineY and text marks for each Y field
|
|
33
|
+
yFields.forEach((fieldConfig, index) => {
|
|
34
|
+
const color = getLineColor(fieldConfig, index);
|
|
35
|
+
const aggregate = fieldConfig.aggregate || 'sum';
|
|
36
|
+
// When temporal aggregation is active, use bin for X and aggregation for Y
|
|
37
|
+
if (xInterval) {
|
|
38
|
+
// Use bin syntax for temporal aggregation
|
|
39
|
+
plotMarks.push({
|
|
40
|
+
mark: 'lineY',
|
|
41
|
+
data: dataSource,
|
|
42
|
+
x: { bin: x, interval: xInterval },
|
|
43
|
+
y: { [aggregate]: fieldConfig.field },
|
|
44
|
+
stroke: color,
|
|
45
|
+
});
|
|
46
|
+
// Text label with aggregation info
|
|
47
|
+
plotMarks.push({
|
|
48
|
+
mark: 'text',
|
|
49
|
+
data: dataSource,
|
|
50
|
+
x: { bin: x, interval: xInterval },
|
|
51
|
+
y: { [aggregate]: fieldConfig.field },
|
|
52
|
+
text: [`${fieldConfig.field} (${aggregate})`],
|
|
53
|
+
fill: color,
|
|
54
|
+
dx: 5,
|
|
55
|
+
dy: -5,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// No aggregation - direct field references
|
|
60
|
+
plotMarks.push({
|
|
61
|
+
mark: 'lineY',
|
|
62
|
+
data: dataSource,
|
|
63
|
+
x,
|
|
64
|
+
y: fieldConfig.field,
|
|
65
|
+
stroke: color,
|
|
66
|
+
});
|
|
67
|
+
plotMarks.push({
|
|
68
|
+
mark: 'text',
|
|
69
|
+
data: dataSource,
|
|
70
|
+
x,
|
|
71
|
+
y: fieldConfig.field,
|
|
72
|
+
text: [fieldConfig.field],
|
|
73
|
+
fill: color,
|
|
74
|
+
dx: 5,
|
|
75
|
+
dy: -5,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
// Add brush
|
|
80
|
+
plotMarks.push({ select: 'intervalX', as: '$brush' });
|
|
81
|
+
return {
|
|
82
|
+
plot: plotMarks,
|
|
83
|
+
xLabel: x,
|
|
84
|
+
yLabel: undefined,
|
|
85
|
+
height: 250,
|
|
86
|
+
width: 380,
|
|
87
|
+
margins: { left: 50, right: 20, top: 20, bottom: 50 },
|
|
88
|
+
params: { brush: { select: 'crossfilter' } },
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/chart-types/line-chart/spec.ts"],"names":[],"mappings":"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","sourcesContent":["import type {Spec} from '@uwdata/mosaic-spec';\nimport {LineChartSettings} from './schema';\nimport {SpecGenerationError} from '../errors';\n\n// Chart color palette matching theme colors from tailwind-preset.css\nconst CHART_COLORS = [\n '#ea7c5c', // chart-1: hsl(12, 76%, 61%)\n '#2a9d8f', // chart-2: hsl(173, 58%, 39%)\n '#264653', // chart-3: hsl(197, 37%, 24%)\n '#e9c46a', // chart-4: hsl(43, 74%, 66%)\n '#f4a261', // chart-5: hsl(27, 87%, 67%)\n];\n\nfunction getLineColor(\n fieldConfig: {field: string; color?: string},\n index: number,\n): string {\n if (fieldConfig.color) {\n return fieldConfig.color;\n }\n // CHART_COLORS is non-empty, so this is always defined\n return CHART_COLORS[index % CHART_COLORS.length]!;\n}\n\nexport function createLineChartSpec(\n tableName: string,\n {x, yFields, xInterval}: LineChartSettings,\n): Spec {\n if (!x) {\n throw new SpecGenerationError('X field is required for line chart');\n }\n if (!yFields || yFields.length === 0) {\n throw new SpecGenerationError(\n 'At least one Y field is required for line chart',\n );\n }\n\n const plotMarks: any[] = [];\n\n // When temporal aggregation is active, use SQL binning\n const dataSource = xInterval\n ? {\n from: tableName,\n filterBy: '$brush',\n }\n : {from: tableName, filterBy: '$brush'};\n\n // Generate lineY and text marks for each Y field\n yFields.forEach((fieldConfig, index) => {\n const color = getLineColor(fieldConfig, index);\n const aggregate = fieldConfig.aggregate || 'sum';\n\n // When temporal aggregation is active, use bin for X and aggregation for Y\n if (xInterval) {\n // Use bin syntax for temporal aggregation\n plotMarks.push({\n mark: 'lineY',\n data: dataSource,\n x: {bin: x, interval: xInterval},\n y: {[aggregate]: fieldConfig.field},\n stroke: color,\n });\n\n // Text label with aggregation info\n plotMarks.push({\n mark: 'text',\n data: dataSource,\n x: {bin: x, interval: xInterval},\n y: {[aggregate]: fieldConfig.field},\n text: [`${fieldConfig.field} (${aggregate})`],\n fill: color,\n dx: 5,\n dy: -5,\n });\n } else {\n // No aggregation - direct field references\n plotMarks.push({\n mark: 'lineY',\n data: dataSource,\n x,\n y: fieldConfig.field,\n stroke: color,\n });\n\n plotMarks.push({\n mark: 'text',\n data: dataSource,\n x,\n y: fieldConfig.field,\n text: [fieldConfig.field],\n fill: color,\n dx: 5,\n dy: -5,\n });\n }\n });\n\n // Add brush\n plotMarks.push({select: 'intervalX', as: '$brush'});\n\n return {\n plot: plotMarks,\n xLabel: x,\n yLabel: undefined,\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"]}
|