Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#1 d3.csv to [{x:~},{y:~}]
var makeData = function(d,country){
var list = [];
d.forEach(function(datum){
var obj = {};
obj["x"]= parseInt(datum.id);
obj["y"] = parseInt(datum[country]);
list.push(obj);
})
return list;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment