misoproject / dataset

JavaScript library that makes managing the data behind client-side visualisations easy
http://misoproject.com
GNU General Public License v2.0
1.18k stars 99 forks source link

add an addColumn method #25

Closed iros closed 12 years ago

iros commented 12 years ago
// adds empty column
dataset.addColumn("name");

// adds a column with data
dataset.addColumn("name", [1,2,3,4,5]);

// another way to add data to a column
dataset.addColumn("name").each(function(row) {
  row.name = 12;
});

Should return reference to dataset so we can further chain awesomeness.

rwaldron commented 12 years ago

What about allowing for default "fill"?

dataset.addColumn("name", { def: "" });

or...

dataset.addColumn({ col: "name", def: "" });

Would fill all rows under "name" with ""

Just a thought.