wheresrhys / keen-query

Terse, cypher-esque querying for keen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better time and dimension

wheresrhys opened this issue · comments

As soon as data arrives call tabulate, but if there are time labels somewhere note in a property which dimension they occupy.

Tables should store their dimension: 0, 1, 2... instead of single, simple or cross

This will then

  • render most of the convoluted stuff around passing timeFormat around redundant, as timeFormat can then always be the last step before the final render
  • aggregators can be nested, chained etc as all they would care about is being passed tables of n-dimension.
  • #16 can be achieved via something like group(prop)->filter(not in)->reduce(count, max or min... [other functions probably invalidated])
  • would be possible to combine with data from other sources as long as an n-dimensional table is given

Probably best to give Table a propotype

table(rawData, kq) => normailze it then new Table(normalizedData, options)
Table has methods such as concat, reduce etc

aggregators simply create multiple tables, then call their methods. Almost feels like it shoudl be a standalone library in itself

table.dimensions = []
x = table.rows
while (typeof x = array) {
 dimensions.push(x.length)
x = x[0]
}
table.dimension = dimensions.lenght

Also print should be a mixin accessible by anyting which e.g. has __data attribute and/or can be coerced to a table

mostly done in #22