{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "chart-bubble",
  "framework": "react",
  "type": "registry:component",
  "component": "Chart",
  "variant": "bubble",
  "dependencies": [
    "@syncfusion/ej2-react-charts"
  ],
  "description": "Bubble chart comparing internet adoption and growth for global markets.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/chart-bubble.md"
  },
  "files": [
    {
      "target": "src/components/chart-bubble/Chart.tsx",
      "content": "\nimport { useRef } from 'react';\nimport {\n    ChartComponent,\n    SeriesCollectionDirective,\n    SeriesDirective,\n    Inject,\n    BubbleSeries,\n    Tooltip,\n    Legend,\n    type IPointRenderEventArgs,\n    type ILegendRenderEventArgs,\n    DataLabel\n} from '@syncfusion/ej2-react-charts';\nimport { Browser } from '@syncfusion/ej2-base';\n\ninterface CountryData {\n    x: number;\n    y: number;\n    size: number;\n    country: string;\n    text: string;\n    region: string;\n    tooltip: string;\n}\n\ninterface RegionStyle {\n    fill: string;\n    border: string;\n    start: string;\n    end: string;\n}\n\nconst data: CountryData[] = [\n    { x: 92.2, y: 7.8, size: 1.41, country: 'China', text: 'China', region: 'Asia', tooltip: 'China' },\n    { x: 74.0, y: 6.5, size: 1.45, country: 'India', text: 'India', region: 'Asia', tooltip: 'India' },\n    { x: 90.4, y: 6.0, size: 0.28, country: 'Indonesia', text: 'Indonesia', region: 'Asia', tooltip: 'Indonesia' },\n    { x: 99.4, y: 2.2, size: 0.34, country: 'United States', text: 'US', region: 'North America', tooltip: 'United States' },\n    { x: 88.6, y: 1.3, size: 0.21, country: 'Brazil', text: 'Brazil', region: 'South America', tooltip: 'Brazil' },\n    { x: 99.0, y: 0.7, size: 0.084, country: 'Germany', text: 'Germany', region: 'Europe', tooltip: 'Germany' },\n    { x: 72.0, y: 2.0, size: 0.114, country: 'Egypt', text: 'Egypt', region: 'Africa', tooltip: 'Egypt' },\n    { x: 99.6, y: 3.4, size: 0.144, country: 'Russia', text: 'Russia', region: 'Europe', tooltip: 'Russia' },\n    { x: 96.5, y: 0.2, size: 0.123, country: 'Japan', text: 'Japan', region: 'Asia', tooltip: 'Japan' },\n    { x: 86.1, y: 4.0, size: 0.024, country: 'Mali', text: 'MLI', region: 'Africa', tooltip: 'Mali' },\n    { x: 92.6, y: 5.2, size: 0.117, country: 'Philippines', text: 'PH', region: 'Asia', tooltip: 'Philippines' },\n    { x: 61.3, y: 1.45, size: 0.232, country: 'Nigeria', text: 'Nigeria', region: 'Africa', tooltip: 'Nigeria' },\n    { x: 82.2, y: 3.97, size: 0.0075, country: 'Hong Kong', text: 'Hong Kong', region: 'Asia', tooltip: 'Hong Kong' },\n    { x: 79.2, y: 4.9, size: 0.018, country: 'Netherlands', text: 'NL', region: 'Europe', tooltip: 'Netherlands' },\n    { x: 72.5, y: 4.5, size: 0.011, country: 'Jordan', text: 'Jordan', region: 'Asia', tooltip: 'Jordan' },\n    { x: 81.0, y: 2.5, size: 0.027, country: 'Australia', text: 'Australia', region: 'Oceania', tooltip: 'Australia' },\n    { x: 66.8, y: 3.9, size: 0.0035, country: 'Mongolia', text: 'MN', region: 'Asia', tooltip: 'Mongolia' },\n    { x: 78.4, y: 2.9, size: 0.023, country: 'Taiwan', text: 'Taiwan', region: 'Asia', tooltip: 'Taiwan' }\n];\n\nconst regionStyles: Record<string, RegionStyle> = {\n    Asia: {\n        fill: '#A7E3DF',\n        border: '#0F766E',\n        start: '#E0F7F4',\n        end: '#70CEC4'\n    },\n    Europe: {\n        fill: '#FFD6A5',\n        border: '#C2410C',\n        start: '#FFF0D9',\n        end: '#FDBA74'\n    },\n    Africa: {\n        fill: '#FFBFC3',\n        border: '#BE123C',\n        start: '#FFE4E6',\n        end: '#FDA4AF'\n    },\n    'North America': {\n        fill: '#BFDBFE',\n        border: '#1D4ED8',\n        start: '#EFF6FF',\n        end: '#93C5FD'\n    },\n    'South America': {\n        fill: '#FBCFE8',\n        border: '#BE185D',\n        start: '#FCE7F3',\n        end: '#F9A8D4'\n    },\n    Oceania: {\n        fill: '#DDD6FE',\n        border: '#6D28D9',\n        start: '#F3E8FF',\n        end: '#C4B5FD'\n    }\n};\n\nconst legendTemplate: string =\n    '<div style=\"display:flex;align-items:center;gap:' +\n    (Browser.isDevice ? '4px' : '8px') +\n    ';white-space:nowrap;opacity:1;padding:4px 8px;\">' +\n    '<span style=\"display:inline-block;width:12px;height:12px;flex-shrink:0;' +\n    'border-radius:50%;border:2px solid;box-sizing:border-box;\"></span>' +\n    '<span class=\"legend-label\" style=\"display:inline-block;font-size:' +\n    (Browser.isDevice ? '9px' : '13px') +\n    ';white-space:nowrap;\"></span>' +\n    '</div>';\n\nconst SAMPLE_CSS = `\n    .country-development {\n        width: 100%;\n        padding: 16px;\n        box-sizing: border-box;\n        background: #ffffff;\n        border: 1px solid #e2e8f0;\n        border-radius: 12px;\n        font-family: Arial, sans-serif;\n    }\n\n    .country-development .sample-title {\n        text-align: center;\n        color: #1e293b;\n        font-size: 23px;\n        font-weight: 600;\n        margin: 8px 0 4px;\n    }\n\n    .country-development .sample-subtitle {\n        text-align: center;\n        color: #64748b;\n        font-size: 13px;\n        margin-bottom: 12px;\n    }\n\n    .country-development .sample-footer {\n        text-align: center;\n        color: #64748b;\n        font-size: 11px;\n        margin-top: 8px;\n    }\n\n    @media (max-width: 600px) {\n        .country-development {\n            padding: 8px;\n        }\n\n        .country-development .sample-title {\n            font-size: 18px;\n        }\n    }\n`;\n\nconst Bubble = () => {\n    const chartRef = useRef<ChartComponent | null>(null);\n\n    const loaded = (): void => {\n        const chart = document.getElementById('country-development-chart');\n\n        if (chart) {\n            chart.setAttribute('title', '');\n        }\n\n        addBubbleGradients();\n    };\n\n    // Create SVG gradients inside the chart SVG.\n    const addBubbleGradients = (): void => {\n        const chartElement = document.getElementById('country-development-chart');\n        const svg = chartElement?.querySelector('svg');\n\n        if (!svg) {\n            return;\n        }\n\n        const existingDefs = svg.querySelector('#country-bubble-gradients');\n\n        if (existingDefs) {\n            existingDefs.remove();\n        }\n\n        const svgNS = 'http://www.w3.org/2000/svg';\n        const defs = document.createElementNS(svgNS, 'defs');\n        defs.setAttribute('id', 'country-bubble-gradients');\n\n        Object.entries(regionStyles).forEach(([, style], index) => {\n            const gradient = document.createElementNS(svgNS, 'linearGradient');\n            const gradientId = `country-gradient-${index}`;\n\n            gradient.setAttribute('id', gradientId);\n            gradient.setAttribute('x1', '0%');\n            gradient.setAttribute('y1', '0%');\n            gradient.setAttribute('x2', '100%');\n            gradient.setAttribute('y2', '100%');\n\n            const start = document.createElementNS(svgNS, 'stop');\n            start.setAttribute('offset', '0%');\n            start.setAttribute('stop-color', style.start);\n\n            const end = document.createElementNS(svgNS, 'stop');\n            end.setAttribute('offset', '100%');\n            end.setAttribute('stop-color', style.end);\n\n            gradient.appendChild(start);\n            gradient.appendChild(end);\n            defs.appendChild(gradient);\n        });\n\n        svg.insertBefore(defs, svg.firstChild);\n    };\n\n    const pointRender = (args: IPointRenderEventArgs): void => {\n        const point = data[args.point.index];\n\n        if (!point) {\n            return;\n        }\n\n        const style = regionStyles[point.region];\n        const regionIndex = Object.keys(regionStyles).indexOf(point.region);\n\n        args.fill = `url(#country-gradient-${regionIndex})`;\n        args.border = {\n            color: style.border,\n            width: 2\n        };\n    };\n\n    // Customize the legend template.\n    const legendRender = (args: ILegendRenderEventArgs): void => {\n        const chart = chartRef.current;\n        const matchedSeries = chart && chart.series\n            ? chart.series.find((series) => series.name === args.text)\n            : null;\n\n        const opacity = matchedSeries && !matchedSeries.visible ? '0.5' : '1';\n\n        if (!args.template) {\n            return;\n        }\n\n        args.template = args.template\n            .replace('opacity:1;', 'opacity:' + opacity + ';')\n            .replace(\n                'border:2px solid;',\n                'background:linear-gradient(135deg, #E0F7F4, #70CEC4);' +\n                'border:2px solid #0F766E;'\n            )\n            .replace(\n                '<span class=\"legend-label\" style=\"display:inline-block;font-size:' +\n                (Browser.isDevice ? '9px' : '13px') +\n                ';white-space:nowrap;\"></span>',\n                '<span class=\"legend-label\" style=\"display:inline-block;' +\n                'font-size:' + (Browser.isDevice ? '9px' : '13px') +\n                ';white-space:nowrap;color:#0F766E;font-weight:bold;\">' +\n                args.text + '</span>'\n            );\n    };\n\n    return (\n        <div className=\"control-pane country-development\">\n            <style>{SAMPLE_CSS}</style>\n\n            <div className=\"sample-title\">\n                Global Country Development and Economic Analysis\n            </div>\n\n            <div className=\"sample-subtitle\">\n                Internet penetration, GDP growth and population comparison\n            </div>\n\n            <div className=\"control-section\">\n                <ChartComponent\n                    id=\"country-development-chart\"\n                    ref={(chart: ChartComponent | null) => {\n                        chartRef.current = chart;\n                    }}\n                    style={{ textAlign: 'center' }}\n                    width=\"100%\"\n                    height=\"480px\"\n                    loaded={loaded}\n                    pointRender={pointRender}\n                    legendRender={legendRender}\n                    primaryXAxis={{\n                        minimum: 65,\n                        maximum: 102,\n                        interval: 5,\n                        title: 'Internet Penetration (%)',\n                        labelFormat: '{value}%',\n                        majorGridLines: {\n                            width: 1,\n                            color: '#e2e8f0'\n                        },\n                        lineStyle: {\n                            width: 1,\n                            color: '#cbd5e1'\n                        }\n                    }}\n                    primaryYAxis={{\n                        minimum: 0,\n                        maximum: 10,\n                        interval: 2.5,\n                        title: 'GDP Growth (%)',\n                        labelFormat: '{value}%',\n                        majorGridLines: {\n                            width: 1,\n                            color: '#e2e8f0'\n                        },\n                        lineStyle: {\n                            width: 1,\n                            color: '#cbd5e1'\n                        }\n                    }}\n                    legendSettings={{\n                        visible: true,\n                        position: 'Top',\n                        template: legendTemplate\n                    }}\n                    tooltip={{\n                        enable: true,\n                        enableMarker: false,\n                        header: '<b>${point.tooltip}</b>',\n                        format:\n                            'Internet Penetration: <b>${point.x}</b><br/>' +\n                            'GDP Growth: <b>${point.y}</b><br/>' +\n                            'Population: <b>${point.size} Billion</b>'\n                    }}\n                    chartArea={{\n                        border: { width: 0 }\n                    }}\n                    background=\"transparent\"\n                >\n                    <Inject services={[\n                        BubbleSeries,\n                        Tooltip,\n                        Legend,\n                        DataLabel\n                    ]} />\n\n                    <SeriesCollectionDirective>\n                        <SeriesDirective\n                            dataSource={data}\n                            name=\"Countries\"\n                            type=\"Bubble\"\n                            xName=\"x\"\n                            yName=\"y\"\n                            size=\"size\"\n                            minRadius={3}\n                            maxRadius={8}\n                            tooltipMappingName=\"tooltip\"\n                            border={{\n                                width: 2\n                            }}\n                            marker={{\n                                dataLabel: {\n                                    visible: true,\n                                    name: 'text',\n                                    position: 'Middle',\n                                    font: {\n                                        fontWeight: '600',\n                                        color: '#263449',\n                                        size: '11px'\n                                    }\n                                }\n                            }}\n                        />\n                    </SeriesCollectionDirective>\n                </ChartComponent>\n            </div>\n\n            <div className=\"sample-footer\">\n                Bubble size represents population. Gradient colors represent geographic regions.\n            </div>\n        </div>\n    );\n};\n\nexport default Bubble;\n"
    }
  ]
}