incomingPlot = {
const sortedCountries = countryData[countrySelect].incoming.stats.source_countries
.sort((a, b) => b.count - a.count)
.map((d) => d.country);
const result = Plot.plot({
width: width,
height: width * (1/2),
marginLeft: 150,
style: {
fontSize: "18px"
},
x: {
grid: true,
ticks: 5
},
y: {
label: null,
domain: sortedCountries
},
marks: [
Plot.barX(
countryData[countrySelect].incoming.stats.source_countries, {
x: "count",
y: "country",
fill: "#303d4e",
tip: true
})
]
})
return(result);
}