function mergeData3(countries) {
countries.features = countries.features.filter(feature => {
return europe_energy_types_hydro1.some(row => row.country === feature.properties.name);
});
countries.features = countries.features.map(feature => {
const matchedState = europe_energy_types_hydro1.find(row => row.country == feature.properties.name);
if (matchedState) {
feature.properties.energy_2018 = matchedState.energy_2018;
feature.properties.energy_2018_char = matchedState.energy_2018_char;
feature.properties.type = matchedState.type;
feature.properties.energy_change = matchedState.energy_change;
feature.properties.energy_change_perc = matchedState.energy_change_perc;
feature.properties.energy_change_perc_char = matchedState.energy_change_perc_char;
}
return feature;
});
return countries
}