Constructor
new GPTVis(options: VisualizationOptions)Creates a new GPTVis instance. Parameters:
- container:
string | HTMLElement— container element or CSS selector (required) - width?: number — chart width in pixels (optional)
- height?: number — chart height in pixels (optional)
- theme?: 'default' | 'light' | 'dark' | 'academy' | ThemeSpec — built-in theme name or reusable custom theme object (default: 'default'). See custom themes.
- wrapper?: boolean — enable wrapper UI with tabs, download and copy controls (default: false)
- locale?: string — locale for wrapper labels (default: 'zh-CN')
render()
gptVis.render(config: string | GPTVisConfig): voidRenders a visualization. Accepts either:
- A string — GPT-Vis markdown-like syntax starting with vis [chart-type] · Syntax Guide →
- A GPTVisConfig object — plain config object with a type field and chart data · JSON Config →
destroy()
gptVis.destroy(): voidDestroys the GPTVis instance and cleans up all allocated resources.