Chart Compiler Gallery
ChartSpec data compiles into resolved scales, layer specs, glyph definitions, scene graph nodes, and a single SVG renderer.
Population Pyramid
Age cohorts derive diverging bar segments so both sides share one symmetric quantitative axis.
Data Sources
7
Fields
19
Scales
3
Layers
10
Glyphs
82
line 16 / rect 38 / text 28
Data Flow Diagram
Select a glyph to highlight its complete source path.
Scope
Roles
No matching flow nodes
Adjust search, scope, or role filters.
Available Data
Raw age population by sex
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
Full parameter lineage for the active compiler surface.
x-grid
x-axis
x-tick-marks
center-line
population-bars
x-labels
y-labels
side-legend-swatches
side-legend-labels
side-legend-title
Glyph Inspector
Select a glyph in the chart to inspect resolved params and lineage.