fix aggregateBy func, fix #498

This commit is contained in:
Alexander Zobnin
2017-12-20 12:50:27 +03:00
parent 8edbae7aa1
commit 63a2594cf3
8 changed files with 116 additions and 8 deletions

View File

@@ -65,8 +65,10 @@ System.register(['lodash', './utils', './timeseries'], function (_export, _conte
function aggregateByWrapper(interval, aggregateFunc, datapoints) {
// Flatten all points in frame and then just use groupBy()
var flattenedPoints = _.flatten(datapoints, true);
// groupBy_perf works with sorted series only
var sortedPoints = ts.sortByTime(flattenedPoints);
var groupByCallback = aggregationFunctions[aggregateFunc];
return groupBy(flattenedPoints, interval, groupByCallback);
return groupBy(sortedPoints, interval, groupByCallback);
}
function aggregateWrapper(groupByCallback, interval, datapoints) {