Skip to content

Instantly share code, notes, and snippets.

View gavi's full-sized avatar
🎯
Focusing

Gavi Narra gavi

🎯
Focusing
View GitHub Profile
@gavi
gavi / columns.js
Created March 31, 2014 20:09
Get Column names from csv data using D3
/*
As you read the data, use Object.keys() method to extract the column names. Might be useful for binding dropdowns.
*/
var columns=null;
d3.csv('nutdata.csv').row(function(row){
if(columns==null){
columns=Object.keys(row);
columns=columns.slice(2,48); //Optional - to remove columns you dont need
}