I'm having an issue trying to assign a key to elements on a d3 map. Despite using a key function, the keys are still showing as 0, 1, 2, etc. What mistake am I making?
d3.csv("data/words.csv").then(function(data) {
// clean data
const formattedData = data.map(yearWord => {
//yearWord.key = yearWord.year + ":" + yearWord.word
yearWord.count = Number(yearWord.count)
return yearWord
}, function(d) { return d.year + ":" + d.word; })