<commit_before>/*
	WebPlotDigitizer - http://arohatgi.info/WebPlotdigitizer

	Copyright 2010-2017 <NAME> <<EMAIL>>

	This file is part of WebPlotDigitizer.

    WebPlotDIgitizer is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    WebPlotDigitizer is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with WebPlotDigitizer.  If not, see <http://www.gnu.org/licenses/>.


*/

var wpd = wpd || {};

// Plot information
wpd.PlotData = (function () {
    var PlotData = function() {

        var activeSeriesIndex = 0,
            autoDetector = new wpd.AutoDetector();
        
        this.topColors = null;
        this.axes = null;
        this.dataSeriesColl = [];
        this.gridData = null;
        this.calibration = null;

        this.angleMeasurementData = null;
        this.distanceMeasurementData = null;
        this.openPathMeasurementData = null;
        this.closedPathMeasurementData = null;
        this.backupImageData = null;

        this.getActiveDataSeries = function() {
            if (this.dataSeriesColl[activeSeriesIndex] == null) {
                this.dataSeriesColl[activeSeriesIndex] = new wpd.DataSeries();
            }
            return this.dataSeriesColl[activeSeriesIndex];
        };

        this.getDataSeriesCount = function() {
            return this.dataSeriesColl.length;
        };

        this.setActiveDataSeriesIndex = function(index) {
            activeSeriesIndex = index;
        };

        this.getActiveDataSeriesIndex = function() {
            return activeSeriesIndex;
        };

        this.getAutoDetector = function() {
            return autoDetector;
        };

        this.getDataSeriesNames = function() {
            var rtnVal = [];
            for(var i = 0; i < this.dataSeriesColl.length; i++) {
                rtnVal[i] = this.dataSeriesColl[i].name;
            }
            return rtnVal;
        };

        this.reset = function() {
            this.axes = null;
            this.angleMeasurementData = null;
            this.distanceMeasurementData = null;
            this.openPathMeasurementData = null;
            this.closedPathMeasurementData = null;
            this.dataSeriesColl = [];
            this.gridData = null;
            this.calibration = null;
            this.backupImageData = null;
            activeSeriesIndex = 0;
            autoDetector = new wpd.AutoDetector();
        };
    };

    return PlotData;
})();

<commit_msg>begin work on adding multi-axes support<commit_after>/*
	WebPlotDigitizer - http://arohatgi.info/WebPlotdigitizer

	Copyright 2010-2017 <NAME> <<EMAIL>>

	This file is part of WebPlotDigitizer.

    WebPlotDIgitizer is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    WebPlotDigitizer is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with WebPlotDigitizer.  If not, see <http://www.gnu.org/licenses/>.


*/

var wpd = wpd || {};

// Plot information

wpd.PlotData = class {
    constructor() {
        this.activeSeriesIndex = 0;
        this.activeAxesIndex = 0;
        this.autoDetector = new wpd.AutoDetector();
        this.topColors = null;
        this.axesColl = [];
        this.axes = null;
        this.dataSeriesColl = [];
        this.gridData = null;
        this.calibration = null;
        this.angleMeasurementData = null;
        this.distanceMeasurementData = null;
        this.openPathMeasurementData = null;
        this.closedPathMeasurementData = null;
        this.backupImageData = null;
        this.objectAxesMap = new Map();
    }

    addAxes(ax) {
        this.axesColl.push(ax);
    }

    removeAxes(ax) {
        this.axesColl = this.axesColl.filter(function(a) {
            a.name !== ax.name;
        });
        
        for(let k in this.objectAxesMap.keys()) {
            this.objectAxesMap.set(k, null);
        }
    }

    getActiveAxes() {        
        return this.axesColl[activeAxesIndex];
    }

    getActiveDataSeries() {
        if (this.dataSeriesColl[activeSeriesIndex] == null) {
            this.dataSeriesColl[activeSeriesIndex] = new wpd.DataSeries();
        }
        return this.dataSeriesColl[activeSeriesIndex];
    };

    getDataSeriesCount() {
        return this.dataSeriesColl.length;
    };

    setActiveDataSeriesIndex(index) {
        activeSeriesIndex = index;
    };

    getActiveDataSeriesIndex() {
        return activeSeriesIndex;
    };

    getAutoDetector() {
        return autoDetector;
    };

    getDataSeriesNames() {
        var rtnVal = [];
        for(var i = 0; i < this.dataSeriesColl.length; i++) {
            rtnVal[i] = this.dataSeriesColl[i].name;
        }
        return rtnVal;
    };

    reset() {
        this.axes = null;
        this.axesColl = [];
        this.objectAxesMap.clear();
        this.angleMeasurementData = null;
        this.distanceMeasurementData = null;
        this.openPathMeasurementData = null;
        this.closedPathMeasurementData = null;
        this.dataSeriesColl = [];
        this.gridData = null;
        this.calibration = null;
        this.backupImageData = null;
        activeSeriesIndex = 0;
        activeAxesIndex = 0;
        autoDetector = new wpd.AutoDetector();
    };
};

{'fraction_non_alphanumeric': 0.09016527573228604, 'fraction_numerical': 0.004254622811323842, 'mean_word_length': 2.1899791231732775, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5192846', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1673, 'n_words': 445}