Skip to content

Instantly share code, notes, and snippets.

@squarednob
Last active January 1, 2016 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squarednob/8111877 to your computer and use it in GitHub Desktop.
Save squarednob/8111877 to your computer and use it in GitHub Desktop.
#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