KeenQuery.wrapData(opts)
Properties of opts
Name to give the query. If listed in the alias spreadsheet this will be read from there
For the purposes of formatting dates it's useful to say what the interval bewteen the data points is (e.g. minute, day). Not essential
Name for what the values mean e.g. count, average
An array defining the axes of the table. Each item in the array defines an entire axis
e.g
[
{
name: 'page.location.search',
values: ['apples', 'pears']
},
{
name: 'timeframe',
values: [
{
start: 'an ISO string',
end: 'an ISO string'
},
{
start: 'an ISO string',
end: 'an ISO string'
},
{
start: 'an ISO string',
end: 'an ISO string'
}
]
}
]
How the data is organised. Default 'nested'
-
'nested' The data is held in a series of nested arrays. For the most common case, a 2 dimensional table, this is an array of arrays.
-
'flat' An object holding a flattened representation of an array of arrays. e.g. say
data[3][5][1] = 12, then the corresponding entry in the flattened obejct would bedata['3,5,1'] = 12 -
'bucket' The easiest to read of the formats, this is identical to the data structure returned by keen: an array of objects which have a value for each axis and for the result e.g.
{
'page.location.search': 'apples',
timeframe: {
start: 'an ISO string',
end: 'an ISO string'
},
result: 12
}
The actual data