Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/chart_series.min.js.map |
{"version":3,"sources":["../src/chart_series.js"],"names":["define","Series","label","values","Error","length","_colors","_label","_values","prototype","TYPE_DEFAULT","TYPE_LINE","_fill","_labels","_smooth","_type","_xaxis","_yaxis","create","obj","s","setType","type","setXAxis","axes","x","setYAxis","y","setLabels","labels","colors","setColors","setColor","setFill","fill","setSmooth","smooth","getColor","getColors","getCount","getFill","getLabel","getLabels","getSmooth","getType","getValues","getXAxis","getYAxis","hasColoredValues","color","_validateLabels","index"],"mappings":"mSAuBAA,OAAM,qBAAC,EAAD,CAAK,UAAW,CAUlB,QAASC,CAAAA,CAAT,CAAgBC,CAAhB,CAAuBC,CAAvB,CAA+B,CAC3B,GAAqB,QAAjB,QAAOD,CAAAA,CAAX,CAA+B,CAC3B,KAAM,IAAIE,CAAAA,KAAJ,CAAU,2BAAV,CAET,CAHD,IAGO,IAAsB,QAAlB,WAAOD,CAAP,CAAJ,CAAgC,CACnC,KAAM,IAAIC,CAAAA,KAAJ,CAAU,uCAAV,CAET,CAHM,IAGA,IAAoB,CAAhB,CAAAD,CAAM,CAACE,MAAX,CAAuB,CAC1B,KAAM,IAAID,CAAAA,KAAJ,CAAU,qCAAV,CACT,CAED,KAAKE,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAcL,CAAd,CACA,KAAKM,OAAL,CAAeL,CAClB,CAQDF,CAAM,CAACQ,SAAP,CAAiBC,YAAjB,CAAgC,IAAhC,CAQAT,CAAM,CAACQ,SAAP,CAAiBE,SAAjB,CAA6B,MAA7B,CAQAV,CAAM,CAACQ,SAAP,CAAiBH,OAAjB,CAA2B,IAA3B,CAQAL,CAAM,CAACQ,SAAP,CAAiBG,KAAjB,IAQAX,CAAM,CAACQ,SAAP,CAAiBF,MAAjB,CAA0B,IAA1B,CAQCN,CAAM,CAACQ,SAAP,CAAiBI,OAAjB,CAA2B,I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AACQ,SAAP,CAAiByC,eAAjB,CAAmC,SAASrB,CAAT,CAAiB,CAChD,GAAIA,CAAM,EAAoB,CAAhB,CAAAA,CAAM,CAACxB,MAAjB,EAA+BwB,CAAM,CAACxB,MAAP,EAAiB,KAAKkC,QAAL,EAApD,CAAqE,CACjE,KAAM,IAAInC,CAAAA,KAAJ,CAAU,yCAAV,CACT,CACJ,CAJD,CAMA,MAAOH,CAAAA,CAEV,CA3VK,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 series.\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_series\n */\ndefine([], function() {\n\n /**\n * Chart data series.\n *\n * @class\n * @alias module:core/chart_series\n * @param {String} label The series label.\n * @param {Number[]} values The values.\n */\n function Series(label, values) {\n if (typeof label !== 'string') {\n throw new Error('Invalid label for series.');\n\n } else if (typeof values !== 'object') {\n throw new Error('Values for a series must be an array.');\n\n } else if (values.length < 1) {\n throw new Error('Invalid values received for series.');\n }\n\n this._colors = [];\n this._label = label;\n this._values = values;\n }\n\n /**\n * The default type of series.\n *\n * @type {Null}\n * @const\n */\n Series.prototype.TYPE_DEFAULT = null;\n\n /**\n * Type of series 'line'.\n *\n * @type {String}\n * @const\n */\n Series.prototype.TYPE_LINE = 'line';\n\n /**\n * The colors of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._colors = null;\n\n /**\n * The fill mode of the series.\n *\n * @type {Object}\n * @protected\n */\n Series.prototype._fill = false;\n\n /**\n * The label of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._label = null;\n\n /**\n * The labels for the values of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._labels = null;\n\n /**\n * Whether the line of the serie should be smooth or not.\n *\n * @type {Bool}\n * @protected\n */\n Series.prototype._smooth = false;\n\n /**\n * The type of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._type = Series.prototype.TYPE_DEFAULT;\n\n /**\n * The values in the series.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._values = null;\n\n /**\n * The index of the X axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._xaxis = null;\n\n /**\n * The index of the Y axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._yaxis = null;\n\n /**\n * Create a new instance of a series from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the series.\n * @return {module:core/chart_series}\n */\n Series.prototype.create = function(obj) {\n var s = new Series(obj.label, obj.values);\n s.setType(obj.type);\n s.setXAxis(obj.axes.x);\n s.setYAxis(obj.axes.y);\n s.setLabels(obj.labels);\n\n // Colors are exported as an array with 1, or n values.\n if (obj.colors && obj.colors.length > 1) {\n s.setColors(obj.colors);\n } else {\n s.setColor(obj.colors[0]);\n }\n\n s.setFill(obj.fill);\n s.setSmooth(obj.smooth);\n return s;\n };\n\n /**\n * Get the color.\n *\n * @return {String}\n */\n Series.prototype.getColor = function() {\n return this._colors[0] || null;\n };\n\n /**\n * Get the colors for each value in the series.\n *\n * @return {String[]}\n */\n Series.prototype.getColors = function() {\n return this._colors;\n };\n\n /**\n * Get the number of values in the series.\n *\n * @return {Number}\n */\n Series.prototype.getCount = function() {\n return this._values.length;\n };\n\n /**\n * Get the fill mode of the series.\n *\n * @return {Object}\n */\n Series.prototype.getFill = function() {\n return this._fill;\n };\n\n /**\n * Get the series label.\n *\n * @return {String}\n */\n Series.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get labels for the values of the series.\n *\n * @return {String[]}\n */\n Series.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get whether the line of the serie should be smooth or not.\n *\n * @returns {Bool}\n */\n Series.prototype.getSmooth = function() {\n return this._smooth;\n };\n\n /**\n * Get the series type.\n *\n * @return {String}\n */\n Series.prototype.getType = function() {\n return this._type;\n };\n\n /**\n * Get the series values.\n *\n * @return {Number[]}\n */\n Series.prototype.getValues = function() {\n return this._values;\n };\n\n /**\n * Get the index of the X axis.\n *\n * @return {Number}\n */\n Series.prototype.getXAxis = function() {\n return this._xaxis;\n };\n\n /**\n * Get the index of the Y axis.\n *\n * @return {Number}\n */\n Series.prototype.getYAxis = function() {\n return this._yaxis;\n };\n\n /**\n * Whether there is a color per value.\n *\n * @return {Bool}\n */\n Series.prototype.hasColoredValues = function() {\n return this._colors.length == this.getCount();\n };\n\n /**\n * Set the series color.\n *\n * @param {String} color A CSS-compatible color.\n */\n Series.prototype.setColor = function(color) {\n this._colors = [color];\n };\n\n /**\n * Set a color for each value in the series.\n *\n * @param {String[]} colors CSS-compatible colors.\n */\n Series.prototype.setColors = function(colors) {\n if (colors && colors.length != this.getCount()) {\n throw new Error('When setting multiple colors there must be one per value.');\n }\n this._colors = colors || [];\n };\n\n /**\n * Set the fill mode for the series.\n *\n * @param {Object} fill\n */\n Series.prototype.setFill = function(fill) {\n this._fill = typeof fill === 'undefined' ? null : fill;\n };\n\n /**\n * Set the labels for the values of the series.\n *\n * @param {String[]} labels the labels of the series values.\n */\n Series.prototype.setLabels = function(labels) {\n this._validateLabels(labels);\n labels = typeof labels === 'undefined' ? null : labels;\n this._labels = labels;\n };\n\n /**\n * Set Whether the line of the serie should be smooth or not.\n *\n * Only applicable for line chart or a line series, if null it assumes the chart default (not smooth).\n *\n * @param {Bool} smooth True if the lines should be smooth, false for tensioned lines.\n */\n Series.prototype.setSmooth = function(smooth) {\n smooth = typeof smooth === 'undefined' ? null : smooth;\n this._smooth = smooth;\n };\n\n /**\n * Set the type of the series.\n *\n * @param {String} type A type constant value.\n */\n Series.prototype.setType = function(type) {\n if (type != this.TYPE_DEFAULT && type != this.TYPE_LINE) {\n throw new Error('Invalid serie type.');\n }\n this._type = type || null;\n };\n\n /**\n * Set the index of the X axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setXAxis = function(index) {\n this._xaxis = index || null;\n };\n\n\n /**\n * Set the index of the Y axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setYAxis = function(index) {\n this._yaxis = index || null;\n };\n\n /**\n * Validate series labels.\n *\n * @protected\n * @param {String[]} labels The labels of the serie.\n */\n Series.prototype._validateLabels = function(labels) {\n if (labels && labels.length > 0 && labels.length != this.getCount()) {\n throw new Error('Series labels must match series values.');\n }\n };\n\n return Series;\n\n});\n"],"file":"chart_series.min.js"}