gpt-vis
uiboxplotsource: ok · refreshed
GPT-Vis Boxplot Chart
A boxplot chart component for @antv/gpt-vis. Compare statistical distributions across categories.
npx shadcn add "https://gpt-vis.antv.vision/r/boxplot.json"free
Where it goes
stats
Interaction
animated-counter
Tags auto-generated by rules on 9/24/2026 — empty means no evidence, not lack of support.
Dependencies
Bundle weight · light@antv/gpt-visclsxtailwind-merge
Files2 · source cached 10/8/2026, 4:09:05 AM
cn/block/gpt-vis/gpt-vis.tsx
'use client';
import { GPTVis as GPTVisCore, type VisualizationOptions } from '@antv/gpt-vis';
import { clsx, type ClassValue } from 'clsx';
import { useEffect, useRef, useState } from 'react';
import { twMerge } from 'tailwind-merge';
function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export interface GPTVisProps extends Omit<VisualizationOptions, 'container'> {
content: string | Record<string, unknown>;
className?: string;
containerStyle?: React.CSSProperties;
}
export function GPTVis({
content,
width,
height,
theme,
wrapper,
locale,
className,
containerStyle,
}: GPTVisProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [instance, setInstance] = useState<GPTVisCore | null>(null);
useEffect(() => {
if (!containerRef.current) return;
const inst = new GPTVisCore({
container: containerRef.current,
width,
height,
theme,
wrapper,
locale,
});
setInstance(inst);
return () => {
inst.destroy();
setInstance(null);
};
}, [width, height, theme, wrapper, locale]);
const contentDeps = typeof content === 'string' ? content : JSON.stringify(content);
useEffect(() => {
instance?.render(content);
}, [instance, contentDeps]);
return (
<div
ref={containerRef}
className={cn('w-full min-h-[300px]', className)}
style={containerStyle}
/>
);
}
cn/block/gpt-vis/boxplot.tsx
'use client';
import type { BoxplotConfig } from '@antv/gpt-vis';
import { GPTVis, type GPTVisProps } from './gpt-vis';
export interface BoxplotProps extends Omit<GPTVisProps, 'content'> {
config: Omit<BoxplotConfig, 'type'>;
}
export function Boxplot({ config, ...props }: BoxplotProps) {
return <GPTVis content={{ type: 'boxplot', ...config }} {...props} />;
}