XY bubble chart with variable-radius circles — pure SVG, zero JS.
Like scatter chart but the :size field on each data point controls
the rendered bubble radius (scaled relative to the maximum :size).
Examples
<.bubble_chart data={[
%{x: 10, y: 30, size: 20, label: "A"},
%{x: 40, y: 60, size: 80, label: "B"},
%{x: 70, y: 45, size: 40, label: "C"}
]} />
<.bubble_chart
data={[%{x: 5, y: 2, size: 10}, %{x: 30, y: 50, size: 100}]}
color="oklch(0.65 0.22 30)"
max_bubble_size={24}
/>
Summary
Functions
Attributes
data(:list) (required) - List of%{x, y, size}(and optional:label).color(:string) - Bubble fill color. Defaults tonil.max_bubble_size(:integer) - Maximum rendered bubble radius in px. Defaults to20.show_grid(:boolean) - Defaults totrue.show_labels(:boolean) - Defaults totrue.animate(:boolean) - Defaults totrue.animation_duration(:integer) - Defaults to600.theme(:map) - Chart theme overrides. Defaults to%{}.id(:string) - Unique ID for the chart (auto-generated if not provided). Defaults tonil.title(:string) - Chart title rendered above the visualization. Defaults tonil.description(:string) - Chart description for context (rendered below title). Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.