Plot = import("https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6.14/+esm");
import { aq, op } from "https://cdn.jsdelivr.net/npm/arquero@5.4.0/+esm"
/* source data*/
radar_data = FileAttachment("data/radar_data.csv").csv({ "typed": true });
radar_grid = FileAttachment("data/radar_grid.csv").csv({ "typed": true });
radar_axes = FileAttachment("data/radar_axes.csv").csv({ "typed": true });
output_table = FileAttachment("data/incise2019_full_output.csv").csv({ "typed": true });
narrative_data = FileAttachment("data/country_narratives.csv").csv({ "typed": true });
/* country selectors */
country_codes = [
"AUS", "AUT", "BEL", "BGR", "CAN", "CHL", "HRV", "CZE", "DNK", "EST", "FIN",
"FRA", "DEU", "GRC", "HUN", "ISL", "IRL", "ISR", "ITA", "JPN", "LVA", "LTU",
"MEX", "NLD", "NZL", "NOR", "POL", "PRT", "ROU", "SVK", "SVN", "KOR", "ESP",
"SWE", "CHE", "TUR", "GBR", "USA"
];
countries = [
"Australia", "Austria", "Belgium", "Bulgaria", "Canada", "Chile", "Croatia",
"Czechia", "Denmark", "Estonia", "Finland", "France", "Germany", "Greece",
"Hungary", "Iceland", "Ireland", "Israel", "Italy", "Japan", "Latvia",
"Lithuania", "Mexico", "Netherlands", "New Zealand", "Norway", "Poland",
"Portugal", "Romania", "Slovakia", "Slovenia", "South Korea", "Spain",
"Sweden", "Switzerland", "Turkey", "United Kingdom",
"United States of America"
];
/* country selectors */
bar_vars = [
"incise_index", "ind_cap", "ind_crm", "ind_dig", "ind_ffm", "ind_hrm",
"ind_inc", "ind_int", "ind_opn", "ind_pol", "ind_pro", "ind_reg", "ind_tax"
];
radar_groups = [
"0_indicators", "cap", "crm", "dig", "ffm", "hrm", "inc", "int", "opn",
"pol", "pro", "reg", "tax"
];
indicators = [
"InCiSE Index", "Capabilities", "Crisis and risk management",
"Digital services", "Fiscal and financial management", "HR management",
"Inclusiveness", "Integrity", "Openness", "Policy making", "Procurement",
"Regulation", "Tax administration"
];
/* methodology pages */
method_pages = [
"https://incise-project.github.io/incise2019-techreport/02_index.html",
"https://incise-project.github.io/incise2019-techreport/03_03_capabilities.html",
"https://incise-project.github.io/incise2019-techreport/03_08_crisis_risk.html",
"https://incise-project.github.io/incise2019-techreport/03_12_digital.html",
"https://incise-project.github.io/incise2019-techreport/03_06_fiscal_financial.html",
"https://incise-project.github.io/incise2019-techreport/03_10_hrm.html",
"https://incise-project.github.io/incise2019-techreport/03_04_inclusiveness.html",
"https://incise-project.github.io/incise2019-techreport/03_01_integrity.html",
"https://incise-project.github.io/incise2019-techreport/03_02_openness.html",
"https://incise-project.github.io/incise2019-techreport/03_05_policy_making.html",
"https://incise-project.github.io/incise2019-techreport/03_09_procurement.html",
"https://incise-project.github.io/incise2019-techreport/03_07_regulation.html",
"https://incise-project.github.io/incise2019-techreport/03_11_tax.html"
];
method_labels = [
"calculation of the InCiSE Index",
"source data and calculation of the Capabilities indicator",
"source data and calculation of the Crisis and risk management indicator",
"source data and calculation of the Digital services indicator",
"source data and calculation of the Fiscal and financial management indicator",
"source data and calculation of the HR management indicator",
"source data and calculation of the Inclusiveness indicator",
"source data and calculation of the Integrity indicator",
"source data and calculation of the Openness indicator",
"source data and calculation of the Policy making indicator",
"source data and calculation of the Procurement indicator",
"source data and calculation of the Regulation indicator",
"source data and calculation of the Tax administration indicator"
];
bar_data = radar_data.filter(function(df) {
return my_bar == df.metric;
});
incise_bar = bar_data.filter(function(df) {
return "InCiSE" == df.cc_iso3c;
});
country_bar = bar_data.filter(function(df) {
return my_country == df.cc_iso3c;
});
incise_radar = radar_data.filter(function(df) {
return my_radar == df.group && "InCiSE" == df.cc_iso3c;
});
country_radar = radar_data.filter(function(df) {
return my_radar == df.group && my_country == df.cc_iso3c;
});
country_points = country_radar.filter(function(df) {
return df.value != null
});
country_imputed = country_radar.filter(function(df) {
return df.imputed != null
});
my_grid = radar_grid.filter(function(df) {
return my_radar == df.group
});
my_axes = radar_axes.filter(function(df) {
return my_radar == df.group
});
my_narrative = narrative_data.filter(function(df){
return my_country == df.cc_iso3c
})[0];
country_table = output_table.filter(function(df) {
return my_country == df.cc_iso3c && (my_radar == df.group || my_bar == df.metric)
});
set_val = function(input, value) {
input.value = value;
input.dispatchEvent(new Event("input"))
};
bar_plot.addEventListener("mousedown", (event) => {
if (bar_plot.value != null) {
if (bar_plot.value.cc_iso3c == "InCiSE") {
return null
}
var sel_country = countries[country_codes.indexOf(bar_plot.value.cc_iso3c)]
set_val(viewof usr_country, sel_country)
}
});
country_codes = Array(38) ["AUS", "AUT", "BEL", "BGR", "CAN", "CHL", "HRV", "CZE", "DNK", "EST", "FIN", "FRA", "DEU", "GRC", "HUN", "ISL", "IRL", "ISR", "ITA", "JPN", …]
countries = Array(38) ["Australia", "Austria", "Belgium", "Bulgaria", "Canada", "Chile", "Croatia", "Czechia", "Denmark", "Estonia", "Finland", "France", "Germany", "Greece", "Hungary", "Iceland", "Ireland", "Israel", "Italy", "Japan", …]
bar_vars = Array(13) ["incise_index", "ind_cap", "ind_crm", "ind_dig", "ind_ffm", "ind_hrm", "ind_inc", "ind_int", "ind_opn", "ind_pol", "ind_pro", "ind_reg", "ind_tax"]
radar_groups = Array(13) ["0_indicators", "cap", "crm", "dig", "ffm", "hrm", "inc", "int", "opn", "pol", "pro", "reg", "tax"]
indicators = Array(13) ["InCiSE Index", "Capabilities", "Crisis and risk management", "Digital services", "Fiscal and financial management", "HR management", "Inclusiveness", "Integrity", "Openness", "Policy making", "Procurement", "Regulation", "Tax administration"]
method_pages = Array(13) ["https://incise-project.github.io/incise2019-techreport/02_index.html", "https://incise-project.github.io/incise2019-techreport/03_03_capabilities.html", "https://incise-project.github.io/incise2019-techreport/03_08_crisis_risk.html", "https://incise-project.github.io/incise2019-techreport/03_12_digital.html", "https://incise-project.github.io/incise2019-techreport/03_06_fiscal_financial.html", "https://incise-project.github.io/incise2019-techreport/03_10_hrm.html", "https://incise-project.github.io/incise2019-techreport/03_04_inclusiveness.html", "https://incise-project.github.io/incise2019-techreport/03_01_integrity.html", "https://incise-project.github.io/incise2019-techreport/03_02_openness.html", "https://incise-project.github.io/incise2019-techreport/03_05_policy_making.html", "https://incise-project.github.io/incise2019-techreport/03_09_procurement.html", "https://incise-project.github.io/incise2019-techreport/03_07_regulation.html", "https://incise-project.github.io/incise2019-techreport/03_11_tax.html"]
method_labels = Array(13) ["calculation of the InCiSE Index", "source data and calculation of the Capabilities indicator", "source data and calculation of the Crisis and risk management indicator", "source data and calculation of the Digital services indicator", "source data and calculation of the Fiscal and financial management indicator", "source data and calculation of the HR management indicator", "source data and calculation of the Inclusiveness indicator", "source data and calculation of the Integrity indicator", "source data and calculation of the Openness indicator", "source data and calculation of the Policy making indicator", "source data and calculation of the Procurement indicator", "source data and calculation of the Regulation indicator", "source data and calculation of the Tax administration indicator"]
set_val = ƒ(input, value)
my_bar = bar_vars[indicators.indexOf(usr_indicator)];
my_radar = radar_groups[indicators.indexOf(usr_indicator)];
my_country = country_codes[countries.indexOf(usr_country)];
my_method = method_pages[indicators.indexOf(usr_indicator)];