import { z } from 'zod'; import { ToolBubble, type LangGraphTool } from '../../types/tool-bubble-class.js'; import type { BubbleContext } from '../../types/bubble.js'; import { CredentialType } from '@bubblelab/shared-schemas'; declare const ChartJSToolParamsSchema: z.ZodObject<{ data: z.ZodArray, "many">; chartType: z.ZodEnum<["line", "bar", "pie", "doughnut", "radar", "scatter", "bubble", "polarArea", "table"]>; xColumn: z.ZodOptional; yColumn: z.ZodOptional; groupByColumn: z.ZodOptional; options: z.ZodOptional; xAxisLabel: z.ZodOptional; yAxisLabel: z.ZodOptional; colorScheme: z.ZodDefault>; responsive: z.ZodDefault; maintainAspectRatio: z.ZodDefault; showLegend: z.ZodDefault; showTooltips: z.ZodDefault; stacked: z.ZodDefault; }, "strip", z.ZodTypeAny, { colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical"; responsive: boolean; maintainAspectRatio: boolean; showLegend: boolean; showTooltips: boolean; stacked: boolean; title?: string | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; }, { title?: string | undefined; colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; responsive?: boolean | undefined; maintainAspectRatio?: boolean | undefined; showLegend?: boolean | undefined; showTooltips?: boolean | undefined; stacked?: boolean | undefined; }>>; advancedConfig: z.ZodOptional>; reasoning: z.ZodString; generateFile: z.ZodDefault; filePath: z.ZodOptional; fileName: z.ZodOptional; width: z.ZodDefault>; height: z.ZodDefault>; credentials: z.ZodOptional, z.ZodString>>; config: z.ZodOptional>; }, "strip", z.ZodTypeAny, { reasoning: string; data: Record[]; width: number; height: number; chartType: "table" | "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea"; generateFile: boolean; options?: { colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical"; responsive: boolean; maintainAspectRatio: boolean; showLegend: boolean; showTooltips: boolean; stacked: boolean; title?: string | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; } | undefined; credentials?: Partial> | undefined; config?: Record | undefined; fileName?: string | undefined; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; advancedConfig?: Record | undefined; filePath?: string | undefined; }, { reasoning: string; data: Record[]; chartType: "table" | "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea"; options?: { title?: string | undefined; colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; responsive?: boolean | undefined; maintainAspectRatio?: boolean | undefined; showLegend?: boolean | undefined; showTooltips?: boolean | undefined; stacked?: boolean | undefined; } | undefined; credentials?: Partial> | undefined; config?: Record | undefined; width?: number | undefined; height?: number | undefined; fileName?: string | undefined; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; advancedConfig?: Record | undefined; generateFile?: boolean | undefined; filePath?: string | undefined; }>; type ChartJSToolParamsInput = z.input; type ChartJSToolParams = z.output; type ChartJSToolResult = z.output; declare const ChartJSToolResultSchema: z.ZodObject<{ chartConfig: z.ZodRecord; chartType: z.ZodString; datasetCount: z.ZodNumber; dataPointCount: z.ZodNumber; suggestedSize: z.ZodObject<{ width: z.ZodNumber; height: z.ZodNumber; }, "strip", z.ZodTypeAny, { width: number; height: number; }, { width: number; height: number; }>; metadata: z.ZodObject<{ xColumn: z.ZodOptional; yColumn: z.ZodOptional; groupByColumn: z.ZodOptional; colorScheme: z.ZodString; generatedAt: z.ZodString; }, "strip", z.ZodTypeAny, { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }, { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }>; imageBase64: z.ZodOptional; tableData: z.ZodOptional; rows: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { headers: string[]; rows: string[][]; }, { headers: string[]; rows: string[][]; }>>; filePath: z.ZodOptional; fileExists: z.ZodOptional; fileSize: z.ZodOptional; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; metadata: { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }; chartType: string; chartConfig: Record; datasetCount: number; dataPointCount: number; suggestedSize: { width: number; height: number; }; fileSize?: number | undefined; filePath?: string | undefined; imageBase64?: string | undefined; tableData?: { headers: string[]; rows: string[][]; } | undefined; fileExists?: boolean | undefined; }, { error: string; success: boolean; metadata: { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }; chartType: string; chartConfig: Record; datasetCount: number; dataPointCount: number; suggestedSize: { width: number; height: number; }; fileSize?: number | undefined; filePath?: string | undefined; imageBase64?: string | undefined; tableData?: { headers: string[]; rows: string[][]; } | undefined; fileExists?: boolean | undefined; }>; /** * ChartJSTool - Generate Chart.js configurations from data * * This tool bubble converts data (typically from SQL queries) into Chart.js * configuration objects that can be used to render interactive charts. */ export declare class ChartJSTool extends ToolBubble { static readonly type: "tool"; static readonly bubbleName = "chart-js-tool"; static readonly schema: z.ZodObject<{ data: z.ZodArray, "many">; chartType: z.ZodEnum<["line", "bar", "pie", "doughnut", "radar", "scatter", "bubble", "polarArea", "table"]>; xColumn: z.ZodOptional; yColumn: z.ZodOptional; groupByColumn: z.ZodOptional; options: z.ZodOptional; xAxisLabel: z.ZodOptional; yAxisLabel: z.ZodOptional; colorScheme: z.ZodDefault>; responsive: z.ZodDefault; maintainAspectRatio: z.ZodDefault; showLegend: z.ZodDefault; showTooltips: z.ZodDefault; stacked: z.ZodDefault; }, "strip", z.ZodTypeAny, { colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical"; responsive: boolean; maintainAspectRatio: boolean; showLegend: boolean; showTooltips: boolean; stacked: boolean; title?: string | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; }, { title?: string | undefined; colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; responsive?: boolean | undefined; maintainAspectRatio?: boolean | undefined; showLegend?: boolean | undefined; showTooltips?: boolean | undefined; stacked?: boolean | undefined; }>>; advancedConfig: z.ZodOptional>; reasoning: z.ZodString; generateFile: z.ZodDefault; filePath: z.ZodOptional; fileName: z.ZodOptional; width: z.ZodDefault>; height: z.ZodDefault>; credentials: z.ZodOptional, z.ZodString>>; config: z.ZodOptional>; }, "strip", z.ZodTypeAny, { reasoning: string; data: Record[]; width: number; height: number; chartType: "table" | "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea"; generateFile: boolean; options?: { colorScheme: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical"; responsive: boolean; maintainAspectRatio: boolean; showLegend: boolean; showTooltips: boolean; stacked: boolean; title?: string | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; } | undefined; credentials?: Partial> | undefined; config?: Record | undefined; fileName?: string | undefined; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; advancedConfig?: Record | undefined; filePath?: string | undefined; }, { reasoning: string; data: Record[]; chartType: "table" | "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea"; options?: { title?: string | undefined; colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined; xAxisLabel?: string | undefined; yAxisLabel?: string | undefined; responsive?: boolean | undefined; maintainAspectRatio?: boolean | undefined; showLegend?: boolean | undefined; showTooltips?: boolean | undefined; stacked?: boolean | undefined; } | undefined; credentials?: Partial> | undefined; config?: Record | undefined; width?: number | undefined; height?: number | undefined; fileName?: string | undefined; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; advancedConfig?: Record | undefined; generateFile?: boolean | undefined; filePath?: string | undefined; }>; static readonly resultSchema: z.ZodObject<{ chartConfig: z.ZodRecord; chartType: z.ZodString; datasetCount: z.ZodNumber; dataPointCount: z.ZodNumber; suggestedSize: z.ZodObject<{ width: z.ZodNumber; height: z.ZodNumber; }, "strip", z.ZodTypeAny, { width: number; height: number; }, { width: number; height: number; }>; metadata: z.ZodObject<{ xColumn: z.ZodOptional; yColumn: z.ZodOptional; groupByColumn: z.ZodOptional; colorScheme: z.ZodString; generatedAt: z.ZodString; }, "strip", z.ZodTypeAny, { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }, { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }>; imageBase64: z.ZodOptional; tableData: z.ZodOptional; rows: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { headers: string[]; rows: string[][]; }, { headers: string[]; rows: string[][]; }>>; filePath: z.ZodOptional; fileExists: z.ZodOptional; fileSize: z.ZodOptional; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; metadata: { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }; chartType: string; chartConfig: Record; datasetCount: number; dataPointCount: number; suggestedSize: { width: number; height: number; }; fileSize?: number | undefined; filePath?: string | undefined; imageBase64?: string | undefined; tableData?: { headers: string[]; rows: string[][]; } | undefined; fileExists?: boolean | undefined; }, { error: string; success: boolean; metadata: { colorScheme: string; generatedAt: string; xColumn?: string | undefined; yColumn?: string | undefined; groupByColumn?: string | undefined; }; chartType: string; chartConfig: Record; datasetCount: number; dataPointCount: number; suggestedSize: { width: number; height: number; }; fileSize?: number | undefined; filePath?: string | undefined; imageBase64?: string | undefined; tableData?: { headers: string[]; rows: string[][]; } | undefined; fileExists?: boolean | undefined; }>; static readonly shortDescription = "Generate Chart.js configurations from data for interactive visualizations"; static readonly longDescription = "\n A tool bubble that converts data into Chart.js configuration objects for creating\n interactive charts and visualizations.\n \n Features:\n - Support for multiple chart types (line, bar, pie, scatter, etc.)\n - Automatic data column detection and mapping\n - Smart color scheme selection\n - Responsive chart configurations\n - Support for grouped data and multiple series\n - Advanced customization through Chart.js config\n \n Chart Types:\n - Line charts: Time series, trends, continuous data\n - Bar charts: Categorical comparisons, counts\n - Pie/Doughnut: Parts of a whole, percentages\n - Scatter: Correlation analysis, x-y relationships\n - Radar: Multi-dimensional comparisons\n - Bubble: Three-dimensional data visualization\n \n Use cases:\n - Converting SQL query results into visual charts\n - Creating dashboards and reports\n - Data analysis and presentation\n - Interactive data exploration\n "; static readonly alias = "chart"; constructor(params: ChartJSToolParamsInput, context?: BubbleContext); /** * Override toolAgent to strip implementation details from the agent-facing schema */ static toolAgent(credentials?: Partial>, config?: Record, context?: BubbleContext): LangGraphTool; performAction(context?: BubbleContext): Promise; /** * Auto-detect appropriate columns for X and Y axes */ private detectColumns; /** * Generate complete Chart.js configuration */ private generateChartConfig; /** * Prepare data in Chart.js format */ private prepareChartData; /** * Prepare single series data */ private prepareSingleSeriesData; /** * Prepare grouped data (multiple series) */ private prepareGroupedData; /** * Generate Chart.js options */ private generateChartOptions; /** * Get color palette based on scheme */ private getColorPalette; /** * Calculate total data point count */ private calculateDataPointCount; /** * Get suggested canvas size based on chart type and data */ private getSuggestedSize; /** * Render chart to PNG buffer (no disk I/O) */ private renderToBuffer; /** * Write a chart buffer to disk (opt-in via generateFile) */ private writeChartFile; } export {}; //# sourceMappingURL=chart-js-tool.d.ts.map