import type { VisualizationOptions } from '../types'; import type { AreaConfig } from '../vis/area'; import type { BarConfig } from '../vis/bar'; import type { BoxplotConfig } from '../vis/boxplot'; import type { ColumnConfig } from '../vis/column'; import type { DualAxesConfig } from '../vis/dual-axes'; import type { FishboneDiagramConfig } from '../vis/fishbone-diagram'; import type { FlowDiagramConfig } from '../vis/flow-diagram'; import type { FunnelConfig } from '../vis/funnel'; import type { HistogramConfig } from '../vis/histogram'; import type { IndentedTreeConfig } from '../vis/indented-tree'; import type { LineConfig } from '../vis/line'; import type { LiquidConfig } from '../vis/liquid'; import type { MindmapConfig } from '../vis/mindmap'; import type { NetworkGraphConfig } from '../vis/network-graph'; import type { OrganizationChartConfig } from '../vis/organization-chart'; import type { PieConfig } from '../vis/pie'; import type { RadarConfig } from '../vis/radar'; import type { SankeyConfig } from '../vis/sankey'; import type { ScatterConfig } from '../vis/scatter'; import type { SummaryConfig } from '../vis/summary'; import type { TableConfig } from '../vis/table'; import type { TreemapConfig } from '../vis/treemap'; import type { VennConfig } from '../vis/venn'; import type { ViolinConfig } from '../vis/violin'; import type { WaterfallConfig } from '../vis/waterfall'; import type { WordCloudConfig } from '../vis/word-cloud'; /** * Union type for all supported chart configurations */ export type GPTVisConfig = AreaConfig | BarConfig | BoxplotConfig | ColumnConfig | DualAxesConfig | FlowDiagramConfig | FunnelConfig | HistogramConfig | IndentedTreeConfig | LineConfig | LiquidConfig | MindmapConfig | NetworkGraphConfig | OrganizationChartConfig | PieConfig | RadarConfig | SankeyConfig | ScatterConfig | SummaryConfig | TableConfig | TreemapConfig | VennConfig | ViolinConfig | WaterfallConfig | WordCloudConfig | FishboneDiagramConfig; /** * GPTVis is the unified API for all chart types. * It provides a simple interface to render different types of visualizations. * * @example * ```ts * import { GPTVis } from '@antv/gpt-vis'; * * const g = new GPTVis({ * container: '#container', * width: 600, * height: 400, * theme: 'academy', // Optional theme * wrapper: true, // Enable wrapper with tabs and controls (default: false) * }); * * // Render with config object * g.render({ * type: 'pie', * data: [ * { category: '分类一', value: 27 }, * { category: '分类二', value: 25 }, * ], * innerRadius: 0.6, * }); * * // Or render with syntax string * g.render(` * vis pie * data * - category 分类一 * value 27 * - category 分类二 * value 25 * innerRadius: 0.6 * `); * * g.destroy(); * ``` */ export declare class GPTVis { private options; private currentChart; private currentChartType; private wrapperInstance; /** * Chart type registry mapping type strings to factory functions */ private static readonly chartRegistry; /** * Constructor * @param options - Visualization options containing container, dimensions, and optional theme */ constructor(options: VisualizationOptions); /** * Render a chart based on the provided configuration or syntax string. * * @param config - Chart configuration object (with type field) or syntax string (starting with 'vis [type]') * * @example * ```ts * // With config object * g.render({ * type: 'pie', * data: [{ category: 'A', value: 30 }, { category: 'B', value: 70 }] * }); * * // With syntax string * g.render(` * vis pie * data * - category A * value 30 * - category B * value 70 * `); * ``` */ render(config: string | Record): void; /** * Destroy the current chart instance and clean up resources */ destroy(): void; }