Replace native map() and forEach() methods by lodash.

This commit is contained in:
Alexander Zobnin
2017-03-05 10:09:47 +03:00
parent 24b63f89aa
commit 5192e8648d
16 changed files with 36 additions and 19 deletions

View File

@@ -265,14 +265,14 @@ function findNearestLeft(series, point) {
function timeShift(interval, range) {
let shift = utils.parseTimeShiftInterval(interval) / 1000;
return range.map(time => {
return _.map(range, time => {
return time - shift;
});
}
function unShiftTimeSeries(interval, datapoints) {
let unshift = utils.parseTimeShiftInterval(interval);
return datapoints.map(dp => {
return _.map(datapoints, dp => {
return [
dp[0],
dp[1] + unshift