{"version":3,"file":"chart_axis.min.js","sources":["../src/chart_axis.js"],"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 axis.\n *\n * @module core/chart_axis\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n\n /**\n * Chart axis class.\n *\n * This is used to represent an axis, whether X or Y.\n *\n * @class core/chart_axis\n */\n function Axis() {\n // Please eslint no-empty-function.\n }\n\n /**\n * Default axis position.\n * @const {Null}\n */\n Axis.prototype.POS_DEFAULT = null;\n\n /**\n * Bottom axis position.\n * @const {String}\n */\n Axis.prototype.POS_BOTTOM = 'bottom';\n\n /**\n * Left axis position.\n * @const {String}\n */\n Axis.prototype.POS_LEFT = 'left';\n\n /**\n * Right axis position.\n * @const {String}\n */\n Axis.prototype.POS_RIGHT = 'right';\n\n /**\n * Top axis position.\n * @const {String}\n */\n Axis.prototype.POS_TOP = 'top';\n\n /**\n * Label of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._label = null;\n\n /**\n * Labels of the ticks.\n * @type {String[]}\n * @protected\n */\n Axis.prototype._labels = null;\n\n /**\n * Maximum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._max = null;\n\n /**\n * Minimum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._min = null;\n\n /**\n * Position of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._position = null;\n\n /**\n * Steps on the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._stepSize = null;\n\n /**\n * Create a new instance of an axis from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the axis.\n * @return {module:core/chart_axis}\n */\n Axis.prototype.create = function(obj) {\n var s = new Axis();\n s.setPosition(obj.position);\n s.setLabel(obj.label);\n s.setStepSize(obj.stepSize);\n s.setMax(obj.max);\n s.setMin(obj.min);\n s.setLabels(obj.labels);\n return s;\n };\n\n /**\n * Get the label of the axis.\n *\n * @method getLabel\n * @return {String}\n */\n Axis.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get the labels of the ticks of the axis.\n *\n * @method getLabels\n * @return {String[]}\n */\n Axis.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get the maximum value of the axis.\n *\n * @method getMax\n * @return {Number}\n */\n Axis.prototype.getMax = function() {\n return this._max;\n };\n\n /**\n * Get the minimum value of the axis.\n *\n * @method getMin\n * @return {Number}\n */\n Axis.prototype.getMin = function() {\n return this._min;\n };\n\n /**\n * Get the position of the axis.\n *\n * @method getPosition\n * @return {String}\n */\n Axis.prototype.getPosition = function() {\n return this._position;\n };\n\n /*