"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface BubblePoint { id: string; x: number; y: number; size: number; label?: string; } export interface BubbleChartProps extends React.HTMLAttributes { points: BubblePoint[]; height?: number; } /** Bubble chart: x/y positioning + sized circles with hover focus. */ export function BubbleChart({ points, height = 240, className, ...props }: BubbleChartProps) { const [hover, setHover] = React.useState(null); const maxSize = Math.max(...points.map((p) => p.size), 1); return ( setHover(null)} {...props}> {/* Izgara */} {[20, 40, 60, 80].map((x) => )} {[20, 40].map((y) => )} {points.map((p, idx) => { const r = 2 + (p.size / maxSize) * 6; const isHover = hover === p.id; return ( setHover(p.id)} style={{ animation: "bcPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both", animationDelay: `${idx * 70}ms`, transformOrigin: `${p.x}px ${p.y}px` }} > {p.label ?? ""} ); })} ); }