Static documentation

Data Visualisation Catalogue Gallery

Rendered markdown notes for the catalogue review, compiler mapping, implementation tracker, and chart method specs.

38 chart methods
10 with reference assets
43 documents

Population Pyramid

Source: Data Visualisation Catalogue - Population Pyramid

Why This Belongs In The Compiler Gallery

The catalogue population pyramid is a practical test for diverging bar charts. It needs ordinary rect marks, but it also needs compiler-owned signed geometry so left and right cohorts share one symmetric scale and one zero spine.

Data Contract

Each raw row represents one age cohort with two positive measures.

FieldTypePurpose
ageGroupordinalCohort label shown on the y axis.
malequantitativeLeft-side population measure.
femalequantitativeRight-side population measure.
sidecategorical, derivedOutput side label.
valuequantitative, derivedPositive cohort value.
signedValuequantitative, derivedNegative left value or positive right value for symmetric domains.
startquantitative, derivedRect start bound on the diverging x scale.
endquantitative, derivedRect end bound on the diverging x scale.

Expected Visual

The faithful catalogue version should show two mirrored horizontal bars for every age cohort. Left and right bars meet at a shared zero centerline, and x-axis labels should read as absolute values instead of negative values on the left.

ElementExpected treatment
Cohort barsRects using start and end bounds from the diverging layout transform.
CenterlineVertical guide line at zero.
X axisSymmetric quantitative scale with absolute tick labels.
Y axisAge cohort labels in input order.
ColorSide-based categorical encoding.

Compiler Mapping

Compiler partMapping
Data sourceage-population raw cohort table and derived pyramid-segments table.
Transformlayout with layoutKind: "divergingBars" derives left/right segment rows.
Scalesx: linear with symmetric and padding, y: band, color: ordinal.
GuidesGenerated x grid/axis, generated y labels, generated side legend, and an explicit zero centerline.
LayersRect bars plus guide layers.
InteractionHover exposes age cohort, side, value, and source row.

Faithfulness Notes

The core chart is compiler-owned now, including the side legend generated from the color scale. Remaining polish includes optional percent-of-total formatting and richer demographic axis policies for very dense age bands.