Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
snippet.forEachArray(stacks, function(stack) {
var filtered = snippet.filter(seriesData, function(datum) {
return (datum.stack || chartConst.DEFAULT_STACK) === stack;
});
newSeriesData = newSeriesData.concat(filtered);
});
_makeBorderLinesPaths(bound, chartType, item) {
const points = this._makeRectPoints(bound);
const paths = {
top: this._makeTopLinePath(points, chartType, item),
right: this._makeRightLinePath(points, chartType, item),
bottom: this._makeBottomLinePath(points, chartType, item),
left: this._makeLeftLinePath(points, chartType, item)
};
return snippet.filter(paths, path => path);
}
_makeFilteredLabelsByInterval: function(labels, startIndex, interval) {
return snippet.filter(labels.slice(startIndex), function(label, index) {
return index % interval === 0;
});
},
const seriesData = this.rawData.series;
let result = {};
let pickerMethod;
if (dataType === 'visibility') {
pickerMethod = this._isVisibleLegend;
} else if (dataType === 'label') {
pickerMethod = this._pickLegendLabel;
}
if (pickerMethod) {
Object.entries(seriesData).forEach(([seriesType, seriesDatum]) => {
result[seriesType] = seriesDatum.map(pickerMethod);
});
result = snippet.filter(result, snippet.isExisty);
}
return result;
}
snippet.forEach(cloneData.series, function(serieses, chartType) {
if (!checkedLegends[chartType]) {
cloneData.series[chartType] = [];
} else if (checkedLegends[chartType].length) {
cloneData.series[chartType] = snippet.filter(serieses, function(series, index) {
return checkedLegends[chartType][index];
});
}
});
}
sumPlusValues(values) {
const plusValues = snippet.filter(values, value => value > 0);
return calculator.sum(plusValues);
},
sumMinusValues(values) {
const minusValues = snippet.filter(values, value => value < 0);
return calculator.sum(minusValues);
},
const seriesData = this.rawData.series;
let result = {};
let pickerMethod;
if (dataType === 'visibility') {
pickerMethod = this._isVisibleLegend;
} else if (dataType === 'label') {
pickerMethod = this._pickLegendLabel;
}
if (pickerMethod) {
Object.entries(seriesData).forEach(([seriesType, seriesDatum]) => {
result[seriesType] = seriesDatum.map(pickerMethod);
});
result = snippet.filter(result, snippet.isExisty);
}
return result;
}