How to use the tui-code-snippet.filter function in tui-code-snippet

To help you get started, weโ€™ve selected a few tui-code-snippet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.chart / src / js / models / data / rawDataHandler.js View on Github external
snippet.forEachArray(stacks, function(stack) {
            var filtered = snippet.filter(seriesData, function(datum) {
                return (datum.stack || chartConst.DEFAULT_STACK) === stack;
            });
            newSeriesData = newSeriesData.concat(filtered);
        });
github nhn / tui.chart / src / js / plugins / raphaelBarChart.js View on Github external
_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);
    }
github nhn / tui.chart / src / js / models / scaleData / axisDataMaker.js View on Github external
_makeFilteredLabelsByInterval: function(labels, startIndex, interval) {
        return snippet.filter(labels.slice(startIndex), function(label, index) {
            return index % interval === 0;
        });
    },
github nhn / tui.chart / src / js / models / data / dataProcessor.js View on Github external
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;
    }
github nhn / tui.chart / src / js / models / data / rawDataHandler.js View on Github external
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];
                    });
                }
            });
        }
github nhn / tui.chart / src / js / helpers / calculator.js View on Github external
sumPlusValues(values) {
        const plusValues = snippet.filter(values, value => value > 0);

        return calculator.sum(plusValues);
    },
github nhn / tui.chart / src / js / helpers / calculator.js View on Github external
sumMinusValues(values) {
        const minusValues = snippet.filter(values, value => value < 0);

        return calculator.sum(minusValues);
    },
github nhn / tui.chart / src / js / models / data / dataProcessor.js View on Github external
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;
    }