{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "chart-bubble",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Chart",
  "variant": "bubble",
  "dependencies": [
    "@syncfusion/ej2-charts"
  ],
  "description": "Bubble chart comparing internet penetration, GDP, and population across world regions.",
  "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/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/chart-bubble.md"
  },
  "files": [
    {
      "target": "src/components/chart-bubble/index.html",
      "content": "<div class=\"control-pane country-development\">\n    <div class=\"sample-title\">\n        Global Country Development and Economic Analysis\n    </div>\n\n    <div class=\"sample-subtitle\">\n        Internet penetration, GDP growth and population comparison\n    </div>\n\n    <div class=\"control-section\">\n        <div id=\"country-development-chart\" style=\"text-align: center;\"></div>\n    </div>\n\n    <div class=\"sample-footer\">\n        Bubble size represents population. Gradient colors represent geographic regions.\n    </div>\n</div>\n\n<style>\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</style>\n"
    },
    {
      "target": "src/components/chart-bubble/index.ts",
      "content": "import {\n    Chart,\n    BubbleSeries,\n    Tooltip,\n    Legend,\n    DataLabel,\n    type IPointRenderEventArgs,\n    type ILoadedEventArgs,\n    type ILegendRenderEventArgs,\n    type SeriesModel\n} from '@syncfusion/ej2-charts';\nimport { Browser } from '@syncfusion/ej2-base';\n\nChart.Inject(BubbleSeries, Tooltip, Legend, DataLabel);\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: { fill: '#A7E3DF', border: '#0F766E', start: '#E0F7F4', end: '#70CEC4' },\n    Europe: { fill: '#FFD6A5', border: '#C2410C', start: '#FFF0D9', end: '#FDBA74' },\n    Africa: { fill: '#FFBFC3', border: '#BE123C', start: '#FFE4E6', end: '#FDA4AF' },\n    'North America': { fill: '#BFDBFE', border: '#1D4ED8', start: '#EFF6FF', end: '#93C5FD' },\n    'South America': { fill: '#FBCFE8', border: '#BE185D', start: '#FCE7F3', end: '#F9A8D4' },\n    Oceania: { fill: '#DDD6FE', border: '#6D28D9', start: '#F3E8FF', end: '#C4B5FD' }\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\n// Create SVG gradients inside the chart SVG.\nconst addBubbleGradients = (): void => {\n    const chartElement: HTMLElement | null = document.getElementById('country-development-chart');\n    const svg: SVGSVGElement | null | undefined = chartElement?.querySelector('svg');\n\n    if (!svg) {\n        return;\n    }\n\n    const existingDefs: Element | null = svg.querySelector('#country-bubble-gradients');\n\n    if (existingDefs) {\n        existingDefs.remove();\n    }\n\n    const svgNS: string = 'http://www.w3.org/2000/svg';\n    const defs: Element = document.createElementNS(svgNS, 'defs');\n    defs.setAttribute('id', 'country-bubble-gradients');\n\n    Object.keys(regionStyles).forEach((region: string, index: number) => {\n        const style: RegionStyle = regionStyles[region];\n        const gradient: Element = document.createElementNS(svgNS, 'linearGradient');\n\n        gradient.setAttribute('id', 'country-gradient-' + index);\n        gradient.setAttribute('x1', '0%');\n        gradient.setAttribute('y1', '0%');\n        gradient.setAttribute('x2', '100%');\n        gradient.setAttribute('y2', '100%');\n\n        const start: Element = document.createElementNS(svgNS, 'stop');\n        start.setAttribute('offset', '0%');\n        start.setAttribute('stop-color', style.start);\n\n        const end: Element = 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\nconst chart: Chart = new Chart({\n    width: '100%',\n    height: '480px',\n    primaryXAxis: {\n        minimum: 65,\n        maximum: 102,\n        interval: 5,\n        title: 'Internet Penetration (%)',\n        labelFormat: '{value}%',\n        majorGridLines: { width: 1, color: '#e2e8f0' },\n        lineStyle: { width: 1, color: '#cbd5e1' }\n    },\n    primaryYAxis: {\n        minimum: 0,\n        maximum: 10,\n        interval: 2.5,\n        title: 'GDP Growth (%)',\n        labelFormat: '{value}%',\n        majorGridLines: { width: 1, color: '#e2e8f0' },\n        lineStyle: { width: 1, color: '#cbd5e1' }\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: { border: { width: 0 } },\n    background: 'transparent',\n    series: [\n        {\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: { width: 2 },\n            marker: {\n                dataLabel: {\n                    visible: true,\n                    name: 'text',\n                    position: 'Middle',\n                    font: { fontWeight: '600', color: '#263449', size: '11px' }\n                }\n            }\n        }\n    ],\n    loaded: (args: ILoadedEventArgs): void => {\n        const chartElement: HTMLElement | null = document.getElementById('country-development-chart');\n\n        if (chartElement) {\n            chartElement.setAttribute('title', '');\n        }\n\n        addBubbleGradients();\n    },\n    pointRender: (args: IPointRenderEventArgs): void => {\n        const point: CountryData = data[args.point.index];\n\n        if (!point) {\n            return;\n        }\n\n        const style: RegionStyle = regionStyles[point.region];\n        const regionIndex: number = Object.keys(regionStyles).indexOf(point.region);\n\n        args.fill = 'url(#country-gradient-' + regionIndex + ')';\n        args.border = { color: style.border, width: 2 };\n    },\n    // Legend template customization following the Olympic Medal sample.\n    legendRender: (args: ILegendRenderEventArgs): void => {\n        const matchedSeries: SeriesModel | undefined = chart && chart.series\n            ? chart.series.find((series: SeriesModel) => series.name === args.text)\n            : undefined;\n\n        const opacity: string = matchedSeries && !matchedSeries.visible ? '0.5' : '1';\n\n        args.template = (args.template as string)\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});\nchart.appendTo('#country-development-chart');\n"
    }
  ]
}