Your IP : 192.168.165.1


Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/
Upload File :
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/chart_base.min.js.map

{"version":3,"sources":["../src/chart_base.js"],"names":["define","Series","Axis","Base","_series","_labels","_xaxes","_yaxes","_setDefaults","prototype","_legendOptions","_title","COLORSET","_configColorSet","TYPE","addSeries","series","_validateSeries","push","getColor","configColorSet","getConfigColorSet","setColor","length","create","Klass","data","Chart","setConfigColorSet","config_colorset","setLabels","labels","setTitle","title","legend_options","setLegendOptions","forEach","seriesData","axes","x","axisData","i","setXAxis","y","setYAxis","__getAxis","xy","index","createIfNotExists","setAxis","bind","axis","Error","getLabels","getLegendOptions","getSeries","getTitle","getType","getXAxes","getXAxis","getYAxes","getYAxis","colorset","legendOptions","_validateAxis","getCount"],"mappings":"mSAuBAA,OAAM,mBAAC,CAAC,mBAAD,CAAsB,iBAAtB,CAAD,CAA2C,SAASC,CAAT,CAAiBC,CAAjB,CAAuB,CAYpE,QAASC,CAAAA,CAAT,EAAgB,CACZ,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAc,EAAd,CACA,KAAKC,MAAL,CAAc,EAAd,CAEA,KAAKC,YAAL,EACH,CAQDL,CAAI,CAACM,SAAL,CAAeL,OAAf,CAAyB,IAAzB,CAQAD,CAAI,CAACM,SAAL,CAAeJ,OAAf,CAAyB,IAAzB,CAQAF,CAAI,CAACM,SAAL,CAAeC,cAAf,CAAgC,IAAhC,CAQAP,CAAI,CAACM,SAAL,CAAeE,MAAf,CAAwB,IAAxB,CAQAR,CAAI,CAACM,SAAL,CAAeH,MAAf,CAAwB,IAAxB,CAQAH,CAAI,CAACM,SAAL,CAAeF,MAAf,CAAwB,IAAxB,CAQAJ,CAAI,CAACM,SAAL,CAAeG,QAAf,CAA0B,CAAC,SAAD,CAAY,SAAZ,CAAuB,SAAvB,CAAkC,SAAlC,CAA6C,S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0B,CACrDA,CAAK,CAAoB,WAAjB,QAAOA,CAAAA,CAAP,CAA+B,CAA/B,CAAmCA,CAA3C,CACA,GAAY,CAAR,CAAAA,CAAJ,CAAe,CACX,GAAIT,CAAAA,CAAI,CAAS,GAAN,EAAAQ,CAAE,CAAU,KAAKxC,MAAf,CAAwB,KAAKC,MAA1C,CACA,GAA+B,WAA3B,QAAO+B,CAAAA,CAAI,CAACS,CAAK,CAAG,CAAT,CAAf,CAA4C,CACxC,KAAM,IAAIK,CAAAA,KAAJ,CAAU,WAAaN,CAAb,CAAkB,4BAAlB,CAAiDC,CAA3D,CACT,CACJ,CACJ,CARD,CAgBA5C,CAAI,CAACM,SAAL,CAAeQ,eAAf,CAAiC,SAASD,CAAT,CAAiB,CAC9C,GAAI,KAAKZ,OAAL,CAAamB,MAAb,EAAuB,KAAKnB,OAAL,CAAa,CAAb,EAAgB6D,QAAhB,IAA8BjD,CAAM,CAACiD,QAAP,EAAzD,CAA4E,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,+CAAV,CAET,CAHD,IAGO,IAAI,KAAK/C,OAAL,CAAakB,MAAb,EAAuB,KAAKlB,OAAL,CAAakB,MAAb,EAAuBP,CAAM,CAACiD,QAAP,EAAlD,CAAqE,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,iCAAV,CACT,CACJ,CAPD,CASA,MAAOjD,CAAAA,CAEV,CA3YK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Chart base.\n *\n * @package    core\n * @copyright  2016 Frédéric Massart - FMCorz.net\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module     core/chart_base\n */\ndefine(['core/chart_series', 'core/chart_axis'], function(Series, Axis) {\n\n    /**\n     * Chart base.\n     *\n     * The constructor of a chart must never take any argument.\n     *\n     * {@link module:core/chart_base#_setDefault} to set the defaults on instantiation.\n     *\n     * @alias module:core/chart_base\n     * @class\n     */\n    function Base() {\n        this._series = [];\n        this._labels = [];\n        this._xaxes = [];\n        this._yaxes = [];\n\n        this._setDefaults();\n    }\n\n    /**\n     * The series constituting this chart.\n     *\n     * @protected\n     * @type {module:core/chart_series[]}\n     */\n    Base.prototype._series = null;\n\n    /**\n     * The labels of the X axis when categorised.\n     *\n     * @protected\n     * @type {String[]}\n     */\n    Base.prototype._labels = null;\n\n    /**\n     * Options for chart legend display.\n     *\n     * @protected\n     * @type {Object}\n     */\n    Base.prototype._legendOptions = null;\n\n    /**\n     * The title of the chart.\n     *\n     * @protected\n     * @type {String}\n     */\n    Base.prototype._title = null;\n\n    /**\n     * The X axes.\n     *\n     * @protected\n     * @type {module:core/chart_axis[]}\n     */\n    Base.prototype._xaxes = null;\n\n    /**\n     * The Y axes.\n     *\n     * @protected\n     * @type {module:core/chart_axis[]}\n     */\n    Base.prototype._yaxes = null;\n\n    /**\n     * Colours to pick from when automatically assigning them.\n     *\n     * @const\n     * @type {String[]}\n     */\n    Base.prototype.COLORSET = ['#f3c300', '#875692', '#f38400', '#a1caf1', '#be0032', '#c2b280', '#7f180d', '#008856',\n            '#e68fac', '#0067a5'];\n\n    /**\n     * Set of colours defined by setting $CFG->chart_colorset to be picked when automatically assigning them.\n     *\n     * @type {String[]}\n     * @protected\n     */\n    Base.prototype._configColorSet = null;\n\n    /**\n     * The type of chart.\n     *\n     * @abstract\n     * @type {String}\n     * @const\n     */\n    Base.prototype.TYPE = null;\n\n    /**\n     * Add a series to the chart.\n     *\n     * This will automatically assign a color to the series if it does not have one.\n     *\n     * @param {module:core/chart_series} series The series to add.\n     */\n    Base.prototype.addSeries = function(series) {\n        this._validateSeries(series);\n        this._series.push(series);\n\n        // Give a default color from the set.\n        if (series.getColor() === null) {\n            var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n            series.setColor(configColorSet[this._series.length % configColorSet.length]);\n        }\n    };\n\n    /**\n     * Create a new instance of a chart from serialised data.\n     *\n     * the serialised attributes they offer and support.\n     *\n     * @static\n     * @method create\n     * @param {module:core/chart_base} Klass The class oject representing the type of chart to instantiate.\n     * @param {Object} data The data of the chart.\n     * @return {module:core/chart_base}\n     */\n    Base.prototype.create = function(Klass, data) {\n        // TODO Not convinced about the usage of Klass here but I can't figure out a way\n        // to have a reference to the class in the sub classes, in PHP I'd do new self().\n        var Chart = new Klass();\n        Chart.setConfigColorSet(data.config_colorset);\n        Chart.setLabels(data.labels);\n        Chart.setTitle(data.title);\n        if (data.legend_options) {\n            Chart.setLegendOptions(data.legend_options);\n        }\n        data.series.forEach(function(seriesData) {\n            Chart.addSeries(Series.prototype.create(seriesData));\n        });\n        data.axes.x.forEach(function(axisData, i) {\n            Chart.setXAxis(Axis.prototype.create(axisData), i);\n        });\n        data.axes.y.forEach(function(axisData, i) {\n            Chart.setYAxis(Axis.prototype.create(axisData), i);\n        });\n        return Chart;\n    };\n\n    /**\n     * Get an axis.\n     *\n     * @private\n     * @param {String} xy Accepts the values 'x' or 'y'.\n     * @param {Number} [index=0] The index of the axis of its type.\n     * @param {Bool} [createIfNotExists=false] When true, create an instance if it does not exist.\n     * @return {module:core/chart_axis}\n     */\n    Base.prototype.__getAxis = function(xy, index, createIfNotExists) {\n        var axes = xy === 'x' ? this._xaxes : this._yaxes,\n            setAxis = (xy === 'x' ? this.setXAxis : this.setYAxis).bind(this),\n            axis;\n\n        index = typeof index === 'undefined' ? 0 : index;\n        createIfNotExists = typeof createIfNotExists === 'undefined' ? false : createIfNotExists;\n        axis = axes[index];\n\n        if (typeof axis === 'undefined') {\n            if (!createIfNotExists) {\n                throw new Error('Unknown axis.');\n            }\n            axis = new Axis();\n            setAxis(axis, index);\n        }\n\n        return axis;\n    };\n\n    /**\n     * Get colours defined by setting.\n     *\n     * @return {String[]}\n     */\n    Base.prototype.getConfigColorSet = function() {\n        return this._configColorSet;\n    };\n\n    /**\n     * Get the labels of the X axis.\n     *\n     * @return {String[]}\n     */\n    Base.prototype.getLabels = function() {\n        return this._labels;\n    };\n\n    /**\n     * Get whether to display the chart legend.\n     *\n     * @return {Bool}\n     */\n    Base.prototype.getLegendOptions = function() {\n        return this._legendOptions;\n    };\n\n    /**\n     * Get the series.\n     *\n     * @return {module:core/chart_series[]}\n     */\n    Base.prototype.getSeries = function() {\n        return this._series;\n    };\n\n    /**\n     * Get the title of the chart.\n     *\n     * @return {String}\n     */\n    Base.prototype.getTitle = function() {\n        return this._title;\n    };\n\n    /**\n     * Get the type of chart.\n     *\n     * @see module:core/chart_base#TYPE\n     * @return {String}\n     */\n    Base.prototype.getType = function() {\n        if (!this.TYPE) {\n            throw new Error('The TYPE property has not been set.');\n        }\n        return this.TYPE;\n    };\n\n    /**\n     * Get the X axes.\n     *\n     * @return {module:core/chart_axis[]}\n     */\n    Base.prototype.getXAxes = function() {\n        return this._xaxes;\n    };\n\n    /**\n     * Get an X axis.\n     *\n     * @param {Number} [index=0] The index of the axis.\n     * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n     * @return {module:core/chart_axis}\n     */\n    Base.prototype.getXAxis = function(index, createIfNotExists) {\n        return this.__getAxis('x', index, createIfNotExists);\n    };\n\n    /**\n     * Get the Y axes.\n     *\n     * @return {module:core/chart_axis[]}\n     */\n    Base.prototype.getYAxes = function() {\n        return this._yaxes;\n    };\n\n    /**\n     * Get an Y axis.\n     *\n     * @param {Number} [index=0] The index of the axis.\n     * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n     * @return {module:core/chart_axis}\n     */\n    Base.prototype.getYAxis = function(index, createIfNotExists) {\n        return this.__getAxis('y', index, createIfNotExists);\n    };\n\n    /**\n     * Set colours defined by setting.\n     *\n     * @param {String[]} colorset An array of css colours.\n     * @protected\n     */\n    Base.prototype.setConfigColorSet = function(colorset) {\n        this._configColorSet = colorset;\n    };\n\n    /**\n     * Set the defaults for this chart type.\n     *\n     * Child classes can extend this to set defaults values on instantiation.\n     *\n     * emphasize and self-document the defaults values set by the chart type.\n     *\n     * @protected\n     */\n    Base.prototype._setDefaults = function() {\n        // For the children to extend.\n    };\n\n    /**\n     * Set the labels of the X axis.\n     *\n     * This requires for each series to contain strictly as many values as there\n     * are labels.\n     *\n     * @param {String[]} labels The labels.\n     */\n    Base.prototype.setLabels = function(labels) {\n        if (labels.length && this._series.length && this._series[0].length != labels.length) {\n            throw new Error('Series must match label values.');\n        }\n        this._labels = labels;\n    };\n\n    /**\n     * Set options for chart legend display.\n     *\n     * @param {Object} legendOptions\n     */\n    Base.prototype.setLegendOptions = function(legendOptions) {\n        if (typeof legendOptions !== 'object') {\n            throw new Error('Setting legend with non-object value:' + legendOptions);\n        }\n        this._legendOptions = legendOptions;\n    };\n\n    /**\n     * Set the title of the chart.\n     *\n     * @param {String} title The title.\n     */\n    Base.prototype.setTitle = function(title) {\n        this._title = title;\n    };\n\n    /**\n     * Set an X axis.\n     *\n     * Note that this will override any predefined axis without warning.\n     *\n     * @param {module:core/chart_axis} axis The axis.\n     * @param {Number} [index=0] The index of the axis.\n     */\n    Base.prototype.setXAxis = function(axis, index) {\n        index = typeof index === 'undefined' ? 0 : index;\n        this._validateAxis('x', axis, index);\n        this._xaxes[index] = axis;\n    };\n\n    /**\n     * Set a Y axis.\n     *\n     * Note that this will override any predefined axis without warning.\n     *\n     * @param {module:core/chart_axis} axis The axis.\n     * @param {Number} [index=0] The index of the axis.\n     */\n    Base.prototype.setYAxis = function(axis, index) {\n        index = typeof index === 'undefined' ? 0 : index;\n        this._validateAxis('y', axis, index);\n        this._yaxes[index] = axis;\n    };\n\n    /**\n     * Validate an axis.\n     *\n     * @protected\n     * @param {String} xy X or Y axis.\n     * @param {module:core/chart_axis} axis The axis to validate.\n     * @param {Number} [index=0] The index of the axis.\n     */\n    Base.prototype._validateAxis = function(xy, axis, index) {\n        index = typeof index === 'undefined' ? 0 : index;\n        if (index > 0) {\n            var axes = xy == 'x' ? this._xaxes : this._yaxes;\n            if (typeof axes[index - 1] === 'undefined') {\n                throw new Error('Missing ' + xy + ' axis at index lower than ' + index);\n            }\n        }\n    };\n\n    /**\n     * Validate a series.\n     *\n     * @protected\n     * @param {module:core/chart_series} series The series to validate.\n     */\n    Base.prototype._validateSeries = function(series) {\n        if (this._series.length && this._series[0].getCount() != series.getCount()) {\n            throw new Error('Series do not have an equal number of values.');\n\n        } else if (this._labels.length && this._labels.length != series.getCount()) {\n            throw new Error('Series must match label values.');\n        }\n    };\n\n    return Base;\n\n});\n"],"file":"chart_base.min.js"}