function draw_trajectories(svg) {
svg.append("g").selectAll("path").data(viz_data).join("path")
.attr("class", d => `${d.country_code}`)
.attr("stroke", d => color(d.region)).attr("fill", "none")
.attr("stroke-opacity", params.opac_weak)
.attr("d", d => get_path(d[y_type]))
.on("mouseover", onMouseOver).on("mouseout", onMouseOut);;
svg.append("g").selectAll("circle").data(viz_data).join("circle")
.attr("class", d => `${d.country_code}`)
.attr("fill", d => color(d.region)).attr("fill-opacity", params.opac_weak)
.attr("cx", d => x(d[y_type][d[y_type].length-1][1]))
.attr("cy", d => y(d[y_type][d[y_type].length-1][2]))
.attr("r", 3)
.on("mouseover", onMouseOver).on("mouseout", onMouseOut);;
const countries_to_label = ['USA', 'ITA','CHN', 'KOR', 'IRN', 'SGP', 'GBR',
'DNK', 'JPN', "CA", "NY", "NJ", "IN", 'ESP',
]
svg.append("g").selectAll("text")
.data(viz_data.filter(d => countries_to_label.includes(d.country_code))).join("text")
.text(d => d.country_name)
.attr("class", d => d.country_code)
.attr("fill", d => color(d.region)).attr("fill-opacity", params.opac_weak)
.attr("x", d => x(d[y_type][d[y_type].length-1][1]))
.attr("y",d => y(d[y_type][d[y_type].length-1][2]))
.on("mouseover", onMouseOver).on("mouseout", onMouseOut);
}