Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/lib/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/lib/amd/build/chart_pie.min.js.map

{"version":3,"sources":["../src/chart_pie.js"],"names":["define","Base","Pie","prototype","constructor","apply","arguments","Object","create","TYPE","_doughnut","Klass","data","chart","setDoughnut","doughnut","addSeries","series","getColor","colors","configColorSet","getConfigColorSet","COLORSET","i","getCount","push","length","setColors","getDoughnut","_validateSeries","_series","Error"],"mappings":"AAuBAA,OAAM,kBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CASvC,QAASC,CAAAA,CAAT,EAAe,CACXD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAG,CAACC,SAAJ,CAAgBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAhB,CAGAD,CAAG,CAACC,SAAJ,CAAcM,IAAd,CAAqB,KAArB,CAQAP,CAAG,CAACC,SAAJ,CAAcO,SAAd,CAA0B,IAA1B,CAGAR,CAAG,CAACC,SAAJ,CAAcK,MAAd,CAAuB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CACzC,GAAIC,CAAAA,CAAK,CAAGZ,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAO,CAAK,CAACC,WAAN,CAAkBF,CAAI,CAACG,QAAvB,EACA,MAAOF,CAAAA,CACV,CAJD,CAWAX,CAAG,CAACC,SAAJ,CAAca,SAAd,CAA0B,SAASC,CAAT,CAAiB,CACvC,GAA0B,IAAtB,GAAAA,CAAM,CAACC,QAAP,EAAJ,CAAgC,CAG5B,OAFIC,CAAAA,CAAM,CAAG,EAEb,CADIC,CAAc,CAAG,KAAKC,iBAAL,IAA4BpB,CAAI,CAACE,SAAL,CAAemB,QAChE,CAASC,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGN,CAAM,CAACO,QAAP,EAApB,CAAuCD,CAAC,EAAxC,CAA4C,CACxCJ,CAAM,CAACM,IAAP,CAAYL,CAAc,CAACG,CAAC,CAAGH,CAAc,CAACM,MAApB,CAA1B,CACH,CACDT,CAAM,CAACU,SAAP,CAAiBR,CAAjB,CACH,CACD,MAAOlB,CAAAA,CAAI,CAACE,SAAL,CAAea,SAAf,CAAyBX,KAAzB,CAA+B,IAA/B,CAAqCC,SAArC,CACV,CAVD,CAkBAJ,CAAG,CAACC,SAAJ,CAAcyB,WAAd,CAA4B,UAAW,CACnC,MAAO,MAAKlB,SACf,CAFD,CAUAR,CAAG,CAACC,SAAJ,CAAcW,WAAd,CAA4B,SAASC,CAAT,CAAmB,CAC3C,KAAKL,SAAL,GAAyBK,CAC5B,CAFD,CAYAb,CAAG,CAACC,SAAJ,CAAc0B,eAAd,CAAgC,UAAW,CACvC,GAA2B,CAAvB,OAAKC,OAAL,CAAaJ,MAAjB,CAA8B,CAC1B,KAAM,IAAIK,CAAAA,KAAJ,CAAU,oCAAV,CACT,CACD,MAAO9B,CAAAA,CAAI,CAACE,SAAL,CAAe0B,eAAf,CAA+BxB,KAA/B,CAAqC,IAArC,CAA2CC,SAA3C,CACV,CALD,CAOA,MAAOJ,CAAAA,CAEV,CAtFK,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 pie.\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_pie\n */\ndefine(['core/chart_base'], function(Base) {\n\n    /**\n     * Pie chart.\n     *\n     * @class\n     * @alias module:core/chart_pie\n     * @extends {module:core/chart_base}\n     */\n    function Pie() {\n        Base.prototype.constructor.apply(this, arguments);\n    }\n    Pie.prototype = Object.create(Base.prototype);\n\n    /** @override */\n    Pie.prototype.TYPE = 'pie';\n\n    /**\n     * Whether the chart should be displayed as doughnut or not.\n     *\n     * @type {Bool}\n     * @protected\n     */\n    Pie.prototype._doughnut = null;\n\n    /** @override */\n    Pie.prototype.create = function(Klass, data) {\n        var chart = Base.prototype.create.apply(this, arguments);\n        chart.setDoughnut(data.doughnut);\n        return chart;\n    };\n\n    /**\n     * Overridden to add appropriate colors to the series.\n     *\n     * @override\n     */\n    Pie.prototype.addSeries = function(series) {\n        if (series.getColor() === null) {\n            var colors = [];\n            var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n            for (var i = 0; i < series.getCount(); i++) {\n                colors.push(configColorSet[i % configColorSet.length]);\n            }\n            series.setColors(colors);\n        }\n        return Base.prototype.addSeries.apply(this, arguments);\n    };\n\n    /**\n     * Get whether the chart should be displayed as doughnut or not.\n     *\n     * @method getDoughnut\n     * @returns {Bool}\n     */\n    Pie.prototype.getDoughnut = function() {\n        return this._doughnut;\n    };\n\n    /**\n     * Set whether the chart should be displayed as doughnut or not.\n     *\n     * @method setDoughnut\n     * @param {Bool} doughnut True for doughnut type, false for pie.\n     */\n    Pie.prototype.setDoughnut = function(doughnut) {\n        this._doughnut = Boolean(doughnut);\n    };\n\n    /**\n     * Validate a series.\n     *\n     * Overrides parent implementation to validate that there is only\n     * one series per chart instance.\n     *\n     * @override\n     */\n    Pie.prototype._validateSeries = function() {\n        if (this._series.length >= 1) {\n            throw new Error('Pie charts only support one serie.');\n        }\n        return Base.prototype._validateSeries.apply(this, arguments);\n    };\n\n    return Pie;\n\n});\n"],"file":"chart_pie.min.js"}