// Merge data from the second CSV into the original data array
dataJoined = data.map(d => {
const matchingRow = legalityData.find(row => row.country === d.country);
// Add the new property 'when_legal' based on the additional data
return {
...d,
when_legal: matchingRow ? +matchingRow.Year : null
}
});
// Now, each object in the output array has a new 'when_legal' property based on the legality data
instead of constant color pink for checkmarks i suggest using a function depending on mean homo data, so that checkmark can have a contrast in all situations
remember that color (hue only) doesn't matter for feature resolution, you need a luminous difference against the background. or a contrast border .style("stroke", color).style("paint-order", "stroke")
paint-order is a trick to draw the stroke *behind* the text, look it up
more problem: somehow the symbols only appear if i re-run the cell
World Map V8: Laws/Legality change data objects | Final Project | Observable