// see https://github.com/quarto-dev/quarto-cli/issues/8823
value_box1 = filtered_last.filter(function(x) {
return x.indicator == "Under 20 years old"})[0]["value"]
% of births from mother aged under 20
value_box2 = filtered_last.filter(function(x) {
return x.indicator == "Less than 2.5kg"})[0]["value"]
% of babies borned under 2.5kg
value_box3 = filtered_last.filter(function(x) {
return x.indicator == "Before 37 weeks"})[0]["value"]
% of births before 37 weeks
Births by mother age - comparison across areas
// todo : function
// barcode with value
Plot.plot({
x: {label: "%"},
y: {label: null,
domain:["Under 20 years old",
"20-24 years old",
"25-29 years old",
"30-34 years old",
"35-39 years old",
"40 years old and above"]},
marginLeft: 130,
marks : [
Plot.tickX(data_last.filter(function(x) {
return x.isd == "Births according to mother age"}), {x: "value", y: "indicator", stroke:"lightgrey", channels: {Area: "code_geo"}, tip: true}),
Plot.tickX(filtered_last.filter(function(x) {
return x.isd == "Births according to mother age"}), {x: "value", y: "indicator", stroke:"red"})
]
})
Births by mother age - change over time
// ajouter plus grande valeur ou derniere
Plot.plot({
x:{label: "Year", domain: [2012, 2022], tickFormat: ""},
y:{label: "Difference to France (in %)"},
color: {
legend: true,
type: "categorical",
domain:["Under 20 years old",
"20-24 years old",
"25-29 years old",
"30-34 years old",
"35-39 years old",
"40 years old and above"]
},
marks : [
Plot.ruleY(filtered_c24, {x1: 2012, x2: 2022, y: 0, stroke: "grey"}),
Plot.lineY(filtered_c24, {x: "annee", y: "diff", stroke: "indicator", marker: "circle", tip: true})
]
})