Parliament chart — pure SVG, zero JS.
Semicircle of dots representing parliamentary seats. Seats are distributed in concentric semicircular rows from inner to outer arc. Each party fills seats sequentially so the semicircle is visually grouped by faction.
Examples
<.parliament_chart data={[
%{label: "Party A", value: 120},
%{label: "Party B", value: 80},
%{label: "Party C", value: 30},
%{label: "Independent", value: 10}
]} />
<.parliament_chart
data={[%{label: "Yes", value: 60}, %{label: "No", value: 40}]}
colors={["oklch(0.60 0.20 240)", "oklch(0.60 0.25 0)"]}
seat_radius={4}
/>
Summary
Functions
Attributes
data(:list) - Party data:[%{label, value}]where value = seat count. Defaults to[].colors(:list) - Override default palette. CSS color strings. Defaults to[].seat_radius(:integer) - Radius of each seat dot in pixels. Defaults to5.animate(:boolean) - Enable entrance animations. Defaults totrue.animation_duration(:integer) - Animation duration in ms. Defaults to600.theme(:map) - Chart theme overrides (see ChartTheme). 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.