Population Pyramid

Age cohorts derive diverging bar segments so both sides share one symmetric quantitative axis.

Population Pyramid

Data Sources

7

Fields

19

Scales

3

Layers

10

Glyphs

82

line 16 / rect 38 / text 28

85+ / Male: 0.3185+ / Female: 0.4880-84 / Male: 0.4280-84 / Female: 0.5575-79 / Male: 0.5875-79 / Female: 0.6870-74 / Male: 0.8270-74 / Female: 0.9165-69 / Male: 1.0565-69 / Female: 1.1260-64 / Male: 1.2260-64 / Female: 1.2655-59 / Male: 1.3555-59 / Female: 1.3850-54 / Male: 1.4250-54 / Female: 1.4345-49 / Male: 1.4845-49 / Female: 1.4740-44 / Male: 1.5640-44 / Female: 1.5235-39 / Male: 1.6635-39 / Female: 1.5830-34 / Male: 1.8230-34 / Female: 1.7225-29 / Male: 1.7425-29 / Female: 1.6620-24 / Male: 1.6220-24 / Female: 1.5515-19 / Male: 1.5815-19 / Female: 1.5110-14 / Male: 1.6110-14 / Female: 1.545-9 / Male: 1.685-9 / Female: 1.60-4 / Male: 1.650-4 / Female: 1.582.5M1.7M0.8M0M0.8M1.7M2.5M85+80-8475-7970-7465-6960-6455-5950-5445-4940-4435-3930-3425-2920-2415-1910-145-90-4MaleFemalePopulation

Data Flow Diagram

0/752 nodes
0/1516 edges
752 hidden

Select a glyph to highlight its complete source path.

Scope

Roles

source
transform
field
scale
layer
param
glyph

No matching flow nodes

Adjust search, scope, or role filters.

Available Data

7 tables
1 transforms

Raw age population by sex

age-population
raw
5 columns
feeds age-diverging-bars

ChartSpec

{
  "id": "catalogue.population-pyramid",
  "data": [
    {
      "id": "age-population",
      "rows": 18
    },
    {
      "id": "pyramid-segments",
      "rows": 36
    },
    {
      "id": "__guide.x-grid",
      "rows": 7
    },
    {
      "id": "__guide.x",
      "rows": 7
    },
    {
      "id": "__guide.y",
      "rows": 18
    },
    {
      "id": "__guide.side-legend",
      "rows": 2
    },
    {
      "id": "__guide.side-legend.title",
      "rows": 1
    }
  ],
  "transforms": [
    {
      "id": "age-diverging-bars",
      "type": "layout",
      "input": "age-population",
      "output": "pyramid-segments",
      "options": {
        "layoutKind": "divergingBars",
        "groupBy": [
          "ageGroup"
        ],
        "leftField": "male",
        "rightField": "female",
        "leftLabel": "Male",
        "rightLabel": "Female"
      }
    }
  ],
  "axes": [
    {
      "id": "x",
      "scale": "x",
      "orientation": "bottom",
      "tickFormat": {
        "style": "absolute",
        "suffix": "M",
        "maximumFractionDigits": 1
      }
    },
    {
      "id": "y",
      "scale": "y",
      "orientation": "left"
    }
  ],
  "grids": [
    {
      "id": "x-grid",
      "scale": "x",
      "orientation": "x"
    }
  ],
  "legends": [
    {
      "id": "side-legend",
      "scale": "color",
      "kind": "color",
      "title": "Population"
    }
  ],
  "fields": [
    "male",
    "female",
    "ageGroup",
    "side",
    "value",
    "signedValue",
    "start",
    "end",
    "formatted",
    "tooltip",
    "direction",
    "label",
    "x",
    "y",
    "symbolX",
    "symbolY",
    "labelX",
    "labelY",
    "text"
  ],
  "scales": [
    {
      "id": "x",
      "type": "linear",
      "domain": {
        "source": "field",
        "data": "pyramid-segments",
        "field": "signedValue",
        "includeZero": true,
        "padding": 0.08,
        "symmetric": true
      }
    },
    {
      "id": "y",
      "type": "band",
      "domain": {
        "source": "field",
        "data": "pyramid-segments",
        "field": "ageGroup"
      }
    },
    {
      "id": "color",
      "type": "ordinal",
      "domain": {
        "source": "field",
        "data": "pyramid-segments",
        "field": "side"
      }
    }
  ],
  "layers": [
    {
      "id": "x-grid",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "x-axis",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "x-tick-marks",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "x-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "y-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "side-legend-swatches",
      "mark": "rect",
      "role": "guide"
    },
    {
      "id": "side-legend-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "side-legend-title",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "center-line",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "population-bars",
      "mark": "rect",
      "role": "data"
    }
  ]
}

Resolved SceneGraph

{
  "scene": "catalogue.population-pyramid.scene",
  "scales": [
    {
      "id": "x",
      "type": "linear",
      "domain": [
        -2.5,
        2.5
      ],
      "range": [
        72,
        718
      ],
      "ticks": [
        -2.5,
        -1.6666666666666665,
        -0.8333333333333333,
        0,
        0.8333333333333335,
        1.666666666666667,
        2.5
      ]
    },
    {
      "id": "y",
      "type": "band",
      "domain": [
        "85+",
        "80-84",
        "75-79",
        "70-74",
        "65-69",
        "60-64",
        "55-59",
        "50-54",
        "45-49",
        "40-44",
        "35-39",
        "30-34",
        "25-29",
        "20-24",
        "15-19",
        "10-14",
        "5-9",
        "0-4"
      ],
      "range": [
        42,
        386
      ],
      "bandwidth": 16.855233853006684
    },
    {
      "id": "color",
      "type": "ordinal",
      "domain": [
        "Male",
        "Female"
      ],
      "range": [
        "var(--colors-blue-9)",
        "var(--colors-red-8)"
      ]
    }
  ],
  "layers": [
    {
      "id": "x-grid",
      "role": "guide",
      "zIndex": 0,
      "glyphs": 7
    },
    {
      "id": "x-axis",
      "role": "guide",
      "zIndex": 0,
      "glyphs": 1
    },
    {
      "id": "x-tick-marks",
      "role": "guide",
      "zIndex": 5,
      "glyphs": 7
    },
    {
      "id": "center-line",
      "role": "guide",
      "zIndex": 5,
      "glyphs": 1
    },
    {
      "id": "population-bars",
      "role": "data",
      "zIndex": 10,
      "glyphs": 36
    },
    {
      "id": "x-labels",
      "role": "guide",
      "zIndex": 20,
      "glyphs": 7
    },
    {
      "id": "y-labels",
      "role": "guide",
      "zIndex": 20,
      "glyphs": 18
    },
    {
      "id": "side-legend-swatches",
      "role": "guide",
      "zIndex": 30,
      "glyphs": 2
    },
    {
      "id": "side-legend-labels",
      "role": "guide",
      "zIndex": 31,
      "glyphs": 2
    },
    {
      "id": "side-legend-title",
      "role": "guide",
      "zIndex": 32,
      "glyphs": 1
    }
  ]
}

Glyph Data Tree

10 layers

Full parameter lineage for the active compiler surface.

x-grid

7

x-axis

1

x-tick-marks

7

center-line

1

population-bars

36

x-labels

7

y-labels

18

side-legend-swatches

2

side-legend-labels

2

side-legend-title

1

Glyph Inspector

none

Select a glyph in the chart to inspect resolved params and lineage.