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

.where should take a function where context is row #107

Closed iros closed 12 years ago

iros commented 12 years ago

Instead of:

ds.where({
  rows : function(row) {
    return row.one === true;
  }
);

Could be:

ds.where(function() {
  return this.one === true;
});

Per @rwldrn's suggestion.

cowboy commented 12 years ago

Not sure I like .where assuming rows because it would be easy to forget if it's rows or columns. It's like passing boolean arguments into functions, you never remember what the argument was!

rwaldron commented 12 years ago

@cowboy agreed and now that I know rows(function() {.. }); exists, I think this is a non-starter