viewof multiple_histograms = vegaEmbed({
vconcat: [
{
title : "Low Income Countries",
repeat: {
column: ["Sum_Inflow", "Sum_Outflow", "Total_Stock", "Inflow_Asylum", "Stock_Foreign", "Acquisition_Nationality", "Stock_Foreign_Born_Labour", "Stock_Foreign_Labour"]
},
spec: {
data: {values: z.filter(x=>x.Income_Group=="Low income", df_summed)},
mark: "bar",
encoding: {
x: {field: {"repeat": "column"}, bin: {"maxbins": 12}},
y: {aggregate: "count",type: "quantitative"},
},
value: "grey"
}
},
{
title : "Upper middle income countries",
repeat: {
column: ["Sum_Inflow", "Sum_Outflow", "Total_Stock", "Inflow_Asylum", "Stock_Foreign", "Acquisition_Nationality", "Stock_Foreign_Born_Labour", "Stock_Foreign_Labour"]
},
spec: {
data: {values: z.filter(x=>x.Income_Group=="Upper middle income", df_summed)},
mark: "bar",
encoding: {
x: {field: {"repeat": "column"}, bin: {"maxbins": 12}},
y: {aggregate: "count",type: "quantitative"},
},
value: "grey"
}
},
{
title : "High Income Countries",
repeat: {
column: ["Sum_Inflow", "Sum_Outflow", "Total_Stock", "Inflow_Asylum", "Stock_Foreign", "Acquisition_Nationality", "Stock_Foreign_Born_Labour", "Stock_Foreign_Labour"]
},
spec: {
data: {values: z.filter(x=>x.Income_Group=="High income", df_summed)},
mark: "bar",
encoding: {
x: {field: {"repeat": "column"}, bin: {"maxbins": 12}},
y: {aggregate: "count",type: "quantitative"},
},
value: "grey"
}
},
{
title : "Lower middle income countries",
repeat: {
column: ["Sum_Inflow", "Sum_Outflow", "Total_Stock", "Inflow_Asylum", "Stock_Foreign", "Acquisition_Nationality", "Stock_Foreign_Born_Labour", "Stock_Foreign_Labour"]
},
spec: {
data: {values: z.filter(x=>x.Income_Group=="Lower middle income", df_summed)},
mark: "bar",
encoding: {
x: {field: {"repeat": "column"}, bin: {"maxbins": 12}},
y: {aggregate: "count",type: "quantitative"},
},
value: "grey"
}
},
{
title : "undefined",
repeat: {
column: ["Sum_Inflow", "Sum_Outflow", "Total_Stock", "Inflow_Asylum", "Stock_Foreign", "Acquisition_Nationality", "Stock_Foreign_Born_Labour", "Stock_Foreign_Labour"]
},
spec: {
data: {values: z.filter(x=>x.Income_Group=="undefined", df_summed)},
mark: "bar",
encoding: {
x: {field: {"repeat": "column"}, bin: {"maxbins": 12}},
y: {aggregate: "count",type: "quantitative"},
},
value: "grey"
}
},
]})