diff --git a/dist/vue-chartjs.js b/dist/vue-chartjs.js index 812344f..599ae39 100644 --- a/dist/vue-chartjs.js +++ b/dist/vue-chartjs.js @@ -65,31 +65,31 @@ return /******/ (function(modules) { // webpackBootstrap var _Bar2 = _interopRequireDefault(_Bar); - var _Doughnut = __webpack_require__(380); + var _Doughnut = __webpack_require__(382); var _Doughnut2 = _interopRequireDefault(_Doughnut); - var _Line = __webpack_require__(381); + var _Line = __webpack_require__(383); var _Line2 = _interopRequireDefault(_Line); - var _Pie = __webpack_require__(382); + var _Pie = __webpack_require__(384); var _Pie2 = _interopRequireDefault(_Pie); - var _PolarArea = __webpack_require__(383); + var _PolarArea = __webpack_require__(385); var _PolarArea2 = _interopRequireDefault(_PolarArea); - var _Radar = __webpack_require__(384); + var _Radar = __webpack_require__(386); var _Radar2 = _interopRequireDefault(_Radar); - var _Bubble = __webpack_require__(385); + var _Bubble = __webpack_require__(387); var _Bubble2 = _interopRequireDefault(_Bubble); - var _index = __webpack_require__(386); + var _index = __webpack_require__(388); var _index2 = _interopRequireDefault(_index); @@ -135,7 +135,7 @@ return /******/ (function(modules) { // webpackBootstrap var _chart2 = _interopRequireDefault(_chart); - var _options = __webpack_require__(160); + var _options = __webpack_require__(162); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6619,7 +6619,6 @@ return /******/ (function(modules) { // webpackBootstrap __webpack_require__(6)(Chart); __webpack_require__(12)(Chart); - __webpack_require__(13)(Chart); __webpack_require__(14)(Chart); __webpack_require__(15)(Chart); __webpack_require__(16)(Chart); @@ -6632,35 +6631,37 @@ return /******/ (function(modules) { // webpackBootstrap __webpack_require__(23)(Chart); __webpack_require__(24)(Chart); __webpack_require__(25)(Chart); - __webpack_require__(26)(Chart); __webpack_require__(27)(Chart); + __webpack_require__(28)(Chart); __webpack_require__(29)(Chart); - __webpack_require__(30)(Chart); __webpack_require__(31)(Chart); + __webpack_require__(32)(Chart); __webpack_require__(33)(Chart); __webpack_require__(34)(Chart); __webpack_require__(35)(Chart); + __webpack_require__(36)(Chart); + __webpack_require__(37)(Chart); // Controllers must be loaded after elements // See Chart.core.datasetController.dataElementType - __webpack_require__(147)(Chart); - __webpack_require__(148)(Chart); __webpack_require__(149)(Chart); __webpack_require__(150)(Chart); __webpack_require__(151)(Chart); __webpack_require__(152)(Chart); - __webpack_require__(153)(Chart); __webpack_require__(154)(Chart); + __webpack_require__(155)(Chart); __webpack_require__(156)(Chart); __webpack_require__(157)(Chart); __webpack_require__(158)(Chart); __webpack_require__(159)(Chart); + __webpack_require__(160)(Chart); + __webpack_require__(161)(Chart); window.Chart = module.exports = Chart; @@ -6970,6 +6971,10 @@ return /******/ (function(modules) { // webpackBootstrap helpers.almostEquals = function(x, y, epsilon) { return Math.abs(x - y) < epsilon; }; + helpers.almostWhole = function(x, epsilon) { + var rounded = Math.round(x); + return (((rounded - epsilon) < x) && ((rounded + epsilon) > x)); + }; helpers.max = function(array) { return array.reduce(function(max, value) { if (!isNaN(value)) { @@ -7094,7 +7099,10 @@ return /******/ (function(modules) { // webpackBootstrap pointBefore = i > 0 ? pointsWithTangents[i - 1] : null; pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null; if (pointAfter && !pointAfter.model.skip) { - pointCurrent.deltaK = (pointAfter.model.y - pointCurrent.model.y) / (pointAfter.model.x - pointCurrent.model.x); + var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x); + + // In the case of two points that appear at the same x pixel, slopeDeltaX is 0 + pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0; } if (!pointBefore || pointBefore.model.skip) { @@ -7404,16 +7412,6 @@ return /******/ (function(modules) { // webpackBootstrap return window.setTimeout(callback, 1000 / 60); }; }()); - helpers.cancelAnimFrame = (function() { - return window.cancelAnimationFrame || - window.webkitCancelAnimationFrame || - window.mozCancelAnimationFrame || - window.oCancelAnimationFrame || - window.msCancelAnimationFrame || - function(callback) { - return window.clearTimeout(callback, 1000 / 60); - }; - }()); // -- DOM methods helpers.getRelativePosition = function(evt, chart) { var mouseX, mouseY; @@ -7470,23 +7468,6 @@ return /******/ (function(modules) { // webpackBootstrap node['on' + eventType] = helpers.noop; } }; - helpers.bindEvents = function(chartInstance, arrayOfEvents, handler) { - // Create the events object if it's not already present - var events = chartInstance.events = chartInstance.events || {}; - - helpers.each(arrayOfEvents, function(eventName) { - events[eventName] = function() { - handler.apply(chartInstance, arguments); - }; - helpers.addEvent(chartInstance.chart.canvas, eventName, events[eventName]); - }); - }; - helpers.unbindEvents = function(chartInstance, arrayOfEvents) { - var canvas = chartInstance.chart.canvas; - helpers.each(arrayOfEvents, function(handler, eventName) { - helpers.removeEvent(canvas, eventName, handler); - }); - }; // Private helper function to convert max-width/max-height values that may be percentages into a number function parseMaxStyle(styleValue, node, parentProperty) { @@ -7677,73 +7658,6 @@ return /******/ (function(modules) { // webpackBootstrap return color(c); }; - helpers.addResizeListener = function(node, callback) { - var iframe = document.createElement('iframe'); - iframe.className = 'chartjs-hidden-iframe'; - iframe.style.cssText = - 'display:block;'+ - 'overflow:hidden;'+ - 'border:0;'+ - 'margin:0;'+ - 'top:0;'+ - 'left:0;'+ - 'bottom:0;'+ - 'right:0;'+ - 'height:100%;'+ - 'width:100%;'+ - 'position:absolute;'+ - 'pointer-events:none;'+ - 'z-index:-1;'; - - // Prevent the iframe to gain focus on tab. - // https://github.com/chartjs/Chart.js/issues/3090 - iframe.tabIndex = -1; - - // Let's keep track of this added iframe and thus avoid DOM query when removing it. - var stub = node._chartjs = { - resizer: iframe, - ticking: false - }; - - // Throttle the callback notification until the next animation frame. - var notify = function() { - if (!stub.ticking) { - stub.ticking = true; - helpers.requestAnimFrame.call(window, function() { - if (stub.resizer) { - stub.ticking = false; - return callback(); - } - }); - } - }; - - // If the iframe is re-attached to the DOM, the resize listener is removed because the - // content is reloaded, so make sure to install the handler after the iframe is loaded. - // https://github.com/chartjs/Chart.js/issues/3521 - helpers.addEvent(iframe, 'load', function() { - helpers.addEvent(iframe.contentWindow || iframe, 'resize', notify); - - // The iframe size might have changed while loading, which can also - // happen if the size has been changed while detached from the DOM. - notify(); - }); - - node.insertBefore(iframe, node.firstChild); - }; - helpers.removeResizeListener = function(node) { - if (!node || !node._chartjs) { - return; - } - - var iframe = node._chartjs.resizer; - if (iframe) { - iframe.parentNode.removeChild(iframe); - node._chartjs.resizer = null; - } - - delete node._chartjs; - }; helpers.isArray = Array.isArray? function(obj) { return Array.isArray(obj); @@ -9463,6 +9377,364 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 12 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + // By default, select the browser (DOM) platform. + // @TODO Make possible to select another platform at build time. + var implementation = __webpack_require__(13); + + module.exports = function(Chart) { + /** + * @namespace Chart.platform + * @see https://chartjs.gitbooks.io/proposals/content/Platform.html + * @since 2.4.0 + */ + Chart.platform = { + /** + * Called at chart construction time, returns a context2d instance implementing + * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}. + * @param {*} item - The native item from which to acquire context (platform specific) + * @param {Object} options - The chart options + * @returns {CanvasRenderingContext2D} context2d instance + */ + acquireContext: function() {}, + + /** + * Called at chart destruction time, releases any resources associated to the context + * previously returned by the acquireContext() method. + * @param {CanvasRenderingContext2D} context - The context2d instance + * @returns {Boolean} true if the method succeeded, else false + */ + releaseContext: function() {}, + + /** + * Registers the specified listener on the given chart. + * @param {Chart} chart - Chart from which to listen for event + * @param {String} type - The ({@link IEvent}) type to listen for + * @param {Function} listener - Receives a notification (an object that implements + * the {@link IEvent} interface) when an event of the specified type occurs. + */ + addEventListener: function() {}, + + /** + * Removes the specified listener previously registered with addEventListener. + * @param {Chart} chart -Chart from which to remove the listener + * @param {String} type - The ({@link IEvent}) type to remove + * @param {Function} listener - The listener function to remove from the event target. + */ + removeEventListener: function() {} + }; + + /** + * @interface IPlatform + * Allows abstracting platform dependencies away from the chart + * @borrows Chart.platform.acquireContext as acquireContext + * @borrows Chart.platform.releaseContext as releaseContext + * @borrows Chart.platform.addEventListener as addEventListener + * @borrows Chart.platform.removeEventListener as removeEventListener + */ + + /** + * @interface IEvent + * @prop {String} type - The event type name, possible values are: + * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout', + * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize' + * @prop {*} native - The original native event (null for emulated events, e.g. 'resize') + * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events) + * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events) + */ + + Chart.helpers.extend(Chart.platform, implementation(Chart)); + }; + + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + 'use strict'; + + // Chart.Platform implementation for targeting a web browser + module.exports = function(Chart) { + var helpers = Chart.helpers; + + // DOM event types -> Chart.js event types. + // Note: only events with different types are mapped. + // https://developer.mozilla.org/en-US/docs/Web/Events + var eventTypeMap = { + // Touch events + touchstart: 'mousedown', + touchmove: 'mousemove', + touchend: 'mouseup', + + // Pointer events + pointerenter: 'mouseenter', + pointerdown: 'mousedown', + pointermove: 'mousemove', + pointerup: 'mouseup', + pointerleave: 'mouseout', + pointerout: 'mouseout' + }; + + /** + * The "used" size is the final value of a dimension property after all calculations have + * been performed. This method uses the computed style of `element` but returns undefined + * if the computed style is not expressed in pixels. That can happen in some cases where + * `element` has a size relative to its parent and this last one is not yet displayed, + * for example because of `display: none` on a parent node. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value + * @returns {Number} Size in pixels or undefined if unknown. + */ + function readUsedSize(element, property) { + var value = helpers.getStyle(element, property); + var matches = value && value.match(/(\d+)px/); + return matches? Number(matches[1]) : undefined; + } + + /** + * Initializes the canvas style and render size without modifying the canvas display size, + * since responsiveness is handled by the controller.resize() method. The config is used + * to determine the aspect ratio to apply in case no explicit height has been specified. + */ + function initCanvas(canvas, config) { + var style = canvas.style; + + // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it + // returns null or '' if no explicit value has been set to the canvas attribute. + var renderHeight = canvas.getAttribute('height'); + var renderWidth = canvas.getAttribute('width'); + + // Chart.js modifies some canvas values that we want to restore on destroy + canvas._chartjs = { + initial: { + height: renderHeight, + width: renderWidth, + style: { + display: style.display, + height: style.height, + width: style.width + } + } + }; + + // Force canvas to display as block to avoid extra space caused by inline + // elements, which would interfere with the responsive resize process. + // https://github.com/chartjs/Chart.js/issues/2538 + style.display = style.display || 'block'; + + if (renderWidth === null || renderWidth === '') { + var displayWidth = readUsedSize(canvas, 'width'); + if (displayWidth !== undefined) { + canvas.width = displayWidth; + } + } + + if (renderHeight === null || renderHeight === '') { + if (canvas.style.height === '') { + // If no explicit render height and style height, let's apply the aspect ratio, + // which one can be specified by the user but also by charts as default option + // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2. + canvas.height = canvas.width / (config.options.aspectRatio || 2); + } else { + var displayHeight = readUsedSize(canvas, 'height'); + if (displayWidth !== undefined) { + canvas.height = displayHeight; + } + } + } + + return canvas; + } + + function createEvent(type, chart, x, y, native) { + return { + type: type, + chart: chart, + native: native || null, + x: x !== undefined? x : null, + y: y !== undefined? y : null, + }; + } + + function fromNativeEvent(event, chart) { + var type = eventTypeMap[event.type] || event.type; + var pos = helpers.getRelativePosition(event, chart); + return createEvent(type, chart, pos.x, pos.y, event); + } + + function createResizer(handler) { + var iframe = document.createElement('iframe'); + iframe.className = 'chartjs-hidden-iframe'; + iframe.style.cssText = + 'display:block;'+ + 'overflow:hidden;'+ + 'border:0;'+ + 'margin:0;'+ + 'top:0;'+ + 'left:0;'+ + 'bottom:0;'+ + 'right:0;'+ + 'height:100%;'+ + 'width:100%;'+ + 'position:absolute;'+ + 'pointer-events:none;'+ + 'z-index:-1;'; + + // Prevent the iframe to gain focus on tab. + // https://github.com/chartjs/Chart.js/issues/3090 + iframe.tabIndex = -1; + + // If the iframe is re-attached to the DOM, the resize listener is removed because the + // content is reloaded, so make sure to install the handler after the iframe is loaded. + // https://github.com/chartjs/Chart.js/issues/3521 + helpers.addEvent(iframe, 'load', function() { + helpers.addEvent(iframe.contentWindow || iframe, 'resize', handler); + + // The iframe size might have changed while loading, which can also + // happen if the size has been changed while detached from the DOM. + handler(); + }); + + return iframe; + } + + function addResizeListener(node, listener, chart) { + var stub = node._chartjs = { + ticking: false + }; + + // Throttle the callback notification until the next animation frame. + var notify = function() { + if (!stub.ticking) { + stub.ticking = true; + helpers.requestAnimFrame.call(window, function() { + if (stub.resizer) { + stub.ticking = false; + return listener(createEvent('resize', chart)); + } + }); + } + }; + + // Let's keep track of this added iframe and thus avoid DOM query when removing it. + stub.resizer = createResizer(notify); + + node.insertBefore(stub.resizer, node.firstChild); + } + + function removeResizeListener(node) { + if (!node || !node._chartjs) { + return; + } + + var resizer = node._chartjs.resizer; + if (resizer) { + resizer.parentNode.removeChild(resizer); + node._chartjs.resizer = null; + } + + delete node._chartjs; + } + + return { + acquireContext: function(item, config) { + if (typeof item === 'string') { + item = document.getElementById(item); + } else if (item.length) { + // Support for array based queries (such as jQuery) + item = item[0]; + } + + if (item && item.canvas) { + // Support for any object associated to a canvas (including a context2d) + item = item.canvas; + } + + if (item instanceof HTMLCanvasElement) { + // To prevent canvas fingerprinting, some add-ons undefine the getContext + // method, for example: https://github.com/kkapsner/CanvasBlocker + // https://github.com/chartjs/Chart.js/issues/2807 + var context = item.getContext && item.getContext('2d'); + if (context instanceof CanvasRenderingContext2D) { + initCanvas(item, config); + return context; + } + } + + return null; + }, + + releaseContext: function(context) { + var canvas = context.canvas; + if (!canvas._chartjs) { + return; + } + + var initial = canvas._chartjs.initial; + ['height', 'width'].forEach(function(prop) { + var value = initial[prop]; + if (value === undefined || value === null) { + canvas.removeAttribute(prop); + } else { + canvas.setAttribute(prop, value); + } + }); + + helpers.each(initial.style || {}, function(value, key) { + canvas.style[key] = value; + }); + + // The canvas render size might have been changed (and thus the state stack discarded), + // we can't use save() and restore() to restore the initial state. So make sure that at + // least the canvas context is reset to the default state by setting the canvas width. + // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html + canvas.width = canvas.width; + + delete canvas._chartjs; + }, + + addEventListener: function(chart, type, listener) { + var canvas = chart.chart.canvas; + if (type === 'resize') { + // Note: the resize event is not supported on all browsers. + addResizeListener(canvas.parentNode, listener, chart.chart); + return; + } + + var stub = listener._chartjs || (listener._chartjs = {}); + var proxies = stub.proxies || (stub.proxies = {}); + var proxy = proxies[chart.id + '_' + type] = function(event) { + listener(fromNativeEvent(event, chart.chart)); + }; + + helpers.addEvent(canvas, type, proxy); + }, + + removeEventListener: function(chart, type, listener) { + var canvas = chart.chart.canvas; + if (type === 'resize') { + // Note: the resize event is not supported on all browsers. + removeResizeListener(canvas.parentNode, listener); + return; + } + + var stub = listener._chartjs || {}; + var proxies = stub.proxies || {}; + var proxy = proxies[chart.id + '_' + type]; + if (!proxy) { + return; + } + + helpers.removeEvent(canvas, type, proxy); + } + }; + }; + + +/***/ }, +/* 14 */ /***/ function(module, exports) { 'use strict'; @@ -9510,6 +9782,14 @@ return /******/ (function(modules) { // webpackBootstrap ctx.fillRect(x - size, y - size, 2 * size, 2 * size); ctx.strokeRect(x - size, y - size, 2 * size, 2 * size); break; + case 'rectRounded': + var offset = radius / Math.SQRT2; + var leftX = x - offset; + var topY = y - offset; + var sideSize = Math.SQRT2 * radius; + Chart.helpers.drawRoundedRectangle(ctx, leftX, topY, sideSize, sideSize, radius / 2); + ctx.fill(); + break; case 'rectRot': size = 1 / Math.SQRT2 * radius; ctx.beginPath(); @@ -9568,11 +9848,354 @@ return /******/ (function(modules) { // webpackBootstrap ctx.stroke(); }; + + helpers.clipArea = function(ctx, clipArea) { + ctx.save(); + ctx.beginPath(); + ctx.rect(clipArea.left, clipArea.top, clipArea.right - clipArea.left, clipArea.bottom - clipArea.top); + ctx.clip(); + }; + + helpers.unclipArea = function(ctx) { + ctx.restore(); + }; + }; /***/ }, -/* 13 */ +/* 15 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function(Chart) { + + var helpers = Chart.helpers; + + Chart.defaults.global.plugins = {}; + + /** + * The plugin service singleton + * @namespace Chart.plugins + * @since 2.1.0 + */ + Chart.plugins = { + /** + * Globally registered plugins. + * @private + */ + _plugins: [], + + /** + * This identifier is used to invalidate the descriptors cache attached to each chart + * when a global plugin is registered or unregistered. In this case, the cache ID is + * incremented and descriptors are regenerated during following API calls. + * @private + */ + _cacheId: 0, + + /** + * Registers the given plugin(s) if not already registered. + * @param {Array|Object} plugins plugin instance(s). + */ + register: function(plugins) { + var p = this._plugins; + ([]).concat(plugins).forEach(function(plugin) { + if (p.indexOf(plugin) === -1) { + p.push(plugin); + } + }); + + this._cacheId++; + }, + + /** + * Unregisters the given plugin(s) only if registered. + * @param {Array|Object} plugins plugin instance(s). + */ + unregister: function(plugins) { + var p = this._plugins; + ([]).concat(plugins).forEach(function(plugin) { + var idx = p.indexOf(plugin); + if (idx !== -1) { + p.splice(idx, 1); + } + }); + + this._cacheId++; + }, + + /** + * Remove all registered plugins. + * @since 2.1.5 + */ + clear: function() { + this._plugins = []; + this._cacheId++; + }, + + /** + * Returns the number of registered plugins? + * @returns {Number} + * @since 2.1.5 + */ + count: function() { + return this._plugins.length; + }, + + /** + * Returns all registered plugin instances. + * @returns {Array} array of plugin objects. + * @since 2.1.5 + */ + getAll: function() { + return this._plugins; + }, + + /** + * Calls enabled plugins for `chart` on the specified hook and with the given args. + * This method immediately returns as soon as a plugin explicitly returns false. The + * returned value can be used, for instance, to interrupt the current action. + * @param {Object} chart - The chart instance for which plugins should be called. + * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate'). + * @param {Array} [args] - Extra arguments to apply to the hook call. + * @returns {Boolean} false if any of the plugins return false, else returns true. + */ + notify: function(chart, hook, args) { + var descriptors = this.descriptors(chart); + var ilen = descriptors.length; + var i, descriptor, plugin, params, method; + + for (i=0; i tickWidth && labelRotation < tickOpts.maxRotation) { + var angleRadians = helpers.toRadians(labelRotation); + cosRotation = Math.cos(angleRadians); + sinRotation = Math.sin(angleRadians); + + if (sinRotation * originalLabelWidth > me.maxHeight) { + // go back one step + labelRotation--; + break; } - var originalLabelWidth = helpers.longestText(context, tickLabelFont, me.ticks, me.longestTextCache); - var labelWidth = originalLabelWidth; - var cosRotation; - var sinRotation; - // Allow 3 pixels x2 padding either side for label readability - // only the index matters for a dataset scale, but we want a consistent interface between scales - var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6; - - // Max label rotation can be set or default to 90 - also act as a loop counter - while (labelWidth > tickWidth && me.labelRotation < optionTicks.maxRotation) { - cosRotation = Math.cos(helpers.toRadians(me.labelRotation)); - sinRotation = Math.sin(helpers.toRadians(me.labelRotation)); - - firstRotated = cosRotation * firstWidth; - - // We're right aligning the text now. - if (firstRotated + tickFontSize / 2 > me.yLabelWidth) { - me.paddingLeft = firstRotated + tickFontSize / 2; - } - - me.paddingRight = tickFontSize / 2; - - if (sinRotation * originalLabelWidth > me.maxHeight) { - // go back one step - me.labelRotation--; - break; - } - - me.labelRotation++; - labelWidth = cosRotation * originalLabelWidth; - } + labelRotation++; + labelWidth = cosRotation * originalLabelWidth; } } - if (me.margins) { - me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0); - me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0); - } + me.labelRotation = labelRotation; }, afterCalculateTickRotation: function() { helpers.callCallback(this.options.afterCalculateTickRotation, [this]); @@ -11949,20 +12429,14 @@ return /******/ (function(modules) { // webpackBootstrap }; var opts = me.options; - var globalDefaults = Chart.defaults.global; var tickOpts = opts.ticks; var scaleLabelOpts = opts.scaleLabel; var gridLineOpts = opts.gridLines; var display = opts.display; var isHorizontal = me.isHorizontal(); - var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize); - var tickFontStyle = helpers.getValueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle); - var tickFontFamily = helpers.getValueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily); - var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily); - - var scaleLabelFontSize = helpers.getValueOrDefault(scaleLabelOpts.fontSize, globalDefaults.defaultFontSize); - + var tickFont = parseFontOptions(tickOpts); + var scaleLabelFontSize = parseFontOptions(scaleLabelOpts).size * 1.5; var tickMarkLength = opts.gridLines.tickMarkLength; // Width @@ -11983,78 +12457,84 @@ return /******/ (function(modules) { // webpackBootstrap // Are we showing a title for the scale? if (scaleLabelOpts.display && display) { if (isHorizontal) { - minSize.height += (scaleLabelFontSize * 1.5); + minSize.height += scaleLabelFontSize; } else { - minSize.width += (scaleLabelFontSize * 1.5); + minSize.width += scaleLabelFontSize; } } + // Don't bother fitting the ticks if we are not showing them if (tickOpts.display && display) { - // Don't bother fitting the ticks if we are not showing them - if (!me.longestTextCache) { - me.longestTextCache = {}; - } - - var largestTextWidth = helpers.longestText(me.ctx, tickLabelFont, me.ticks, me.longestTextCache); + var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, me.ticks, me.longestTextCache); var tallestLabelHeightInLines = helpers.numberOfLabelLines(me.ticks); - var lineSpace = tickFontSize * 0.5; + var lineSpace = tickFont.size * 0.5; if (isHorizontal) { // A horizontal axis is more constrained by the height. me.longestLabelWidth = largestTextWidth; + var angleRadians = helpers.toRadians(me.labelRotation); + var cosRotation = Math.cos(angleRadians); + var sinRotation = Math.sin(angleRadians); + // TODO - improve this calculation - var labelHeight = (Math.sin(helpers.toRadians(me.labelRotation)) * me.longestLabelWidth) + (tickFontSize * tallestLabelHeightInLines) + (lineSpace * tallestLabelHeightInLines); + var labelHeight = (sinRotation * largestTextWidth) + + (tickFont.size * tallestLabelHeightInLines) + + (lineSpace * tallestLabelHeightInLines); minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight); - me.ctx.font = tickLabelFont; + me.ctx.font = tickFont.font; - var firstLabelWidth = me.ctx.measureText(me.ticks[0]).width; - var lastLabelWidth = me.ctx.measureText(me.ticks[me.ticks.length - 1]).width; + var firstTick = me.ticks[0]; + var firstLabelWidth = computeTextSize(me.ctx, firstTick, tickFont.font); + + var lastTick = me.ticks[me.ticks.length - 1]; + var lastLabelWidth = computeTextSize(me.ctx, lastTick, tickFont.font); // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned which means that the right padding is dominated // by the font height - var cosRotation = Math.cos(helpers.toRadians(me.labelRotation)); - var sinRotation = Math.sin(helpers.toRadians(me.labelRotation)); - me.paddingLeft = me.labelRotation !== 0 ? (cosRotation * firstLabelWidth) + 3 : firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges - me.paddingRight = me.labelRotation !== 0 ? (sinRotation * (tickFontSize / 2)) + 3 : lastLabelWidth / 2 + 3; // when rotated + if (me.labelRotation !== 0) { + me.paddingLeft = opts.position === 'bottom'? (cosRotation * firstLabelWidth) + 3: (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges + me.paddingRight = opts.position === 'bottom'? (cosRotation * lineSpace) + 3: (cosRotation * lastLabelWidth) + 3; + } else { + me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges + me.paddingRight = lastLabelWidth / 2 + 3; + } } else { // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first - var maxLabelWidth = me.maxWidth - minSize.width; - // Account for padding - var mirror = tickOpts.mirror; - if (!mirror) { - largestTextWidth += me.options.ticks.padding; - } else { - // If mirrored text is on the inside so don't expand + + if (tickOpts.mirror) { largestTextWidth = 0; - } - - if (largestTextWidth < maxLabelWidth) { - // We don't need all the room - minSize.width += largestTextWidth; } else { - // Expand to max size - minSize.width = me.maxWidth; + largestTextWidth += me.options.ticks.padding; } - - me.paddingTop = tickFontSize / 2; - me.paddingBottom = tickFontSize / 2; + minSize.width += largestTextWidth; + me.paddingTop = tickFont.size / 2; + me.paddingBottom = tickFont.size / 2; } } + me.handleMargins(); + + me.width = minSize.width; + me.height = minSize.height; + }, + + /** + * Handle margins and padding interactions + * @private + */ + handleMargins: function() { + var me = this; if (me.margins) { me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0); me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0); me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0); me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0); } - - me.width = minSize.width; - me.height = minSize.height; - }, + afterFit: function() { helpers.callCallback(this.options.afterFit, [this]); }, @@ -12134,15 +12614,18 @@ return /******/ (function(modules) { // webpackBootstrap }, getBasePixel: function() { + return this.getPixelForValue(this.getBaseValue()); + }, + + getBaseValue: function() { var me = this; var min = me.min; var max = me.max; - return me.getPixelForValue( - me.beginAtZero? 0: + return me.beginAtZero ? 0: min < 0 && max < 0? max : min > 0 && max > 0? min : - 0); + 0; }, // Actually draw the scale on the canvas @@ -12172,19 +12655,14 @@ return /******/ (function(modules) { // webpackBootstrap } var tickFontColor = helpers.getValueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor); - var tickFontSize = helpers.getValueOrDefault(optionTicks.fontSize, globalDefaults.defaultFontSize); - var tickFontStyle = helpers.getValueOrDefault(optionTicks.fontStyle, globalDefaults.defaultFontStyle); - var tickFontFamily = helpers.getValueOrDefault(optionTicks.fontFamily, globalDefaults.defaultFontFamily); - var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily); - var tl = gridLines.tickMarkLength; + var tickFont = parseFontOptions(optionTicks); + + var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0; var borderDash = helpers.getValueOrDefault(gridLines.borderDash, globalDefaults.borderDash); var borderDashOffset = helpers.getValueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset); var scaleLabelFontColor = helpers.getValueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor); - var scaleLabelFontSize = helpers.getValueOrDefault(scaleLabel.fontSize, globalDefaults.defaultFontSize); - var scaleLabelFontStyle = helpers.getValueOrDefault(scaleLabel.fontStyle, globalDefaults.defaultFontStyle); - var scaleLabelFontFamily = helpers.getValueOrDefault(scaleLabel.fontFamily, globalDefaults.defaultFontFamily); - var scaleLabelFont = helpers.fontString(scaleLabelFontSize, scaleLabelFontStyle, scaleLabelFontFamily); + var scaleLabelFont = parseFontOptions(scaleLabel); var labelRotationRadians = helpers.toRadians(me.labelRotation); var cosRotation = Math.cos(labelRotationRadians); @@ -12260,15 +12738,21 @@ return /******/ (function(modules) { // webpackBootstrap var textBaseline = 'middle'; if (isHorizontal) { - if (!isRotated) { - textBaseline = options.position === 'top' ? 'bottom' : 'top'; - } - textAlign = isRotated ? 'right' : 'center'; + if (options.position === 'bottom') { + // bottom + textBaseline = !isRotated? 'top':'middle'; + textAlign = !isRotated? 'center': 'right'; + labelY = me.top + tl; + } else { + // top + textBaseline = !isRotated? 'bottom':'middle'; + textAlign = !isRotated? 'center': 'left'; + labelY = me.bottom - tl; + } var xLineValue = me.getPixelForTick(index) + helpers.aliasPixel(lineWidth); // xvalues for grid lines labelX = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option) - labelY = (isRotated) ? me.top + 12 : options.position === 'top' ? me.bottom - tl : me.top + tl; tx1 = tx2 = x1 = x2 = xLineValue; ty1 = yTickStart; @@ -12276,23 +12760,20 @@ return /******/ (function(modules) { // webpackBootstrap y1 = chartArea.top; y2 = chartArea.bottom; } else { - if (options.position === 'left') { - if (optionTicks.mirror) { - labelX = me.right + optionTicks.padding; - textAlign = 'left'; - } else { - labelX = me.right - optionTicks.padding; - textAlign = 'right'; - } - // right side - } else if (optionTicks.mirror) { - labelX = me.left - optionTicks.padding; - textAlign = 'right'; + var isLeft = options.position === 'left'; + var tickPadding = optionTicks.padding; + var labelXOffset; + + if (optionTicks.mirror) { + textAlign = isLeft ? 'left' : 'right'; + labelXOffset = tickPadding; } else { - labelX = me.left + optionTicks.padding; - textAlign = 'left'; + textAlign = isLeft ? 'right' : 'left'; + labelXOffset = tl + tickPadding; } + labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset; + var yLineValue = me.getPixelForTick(index); // xvalues for grid lines yLineValue += helpers.aliasPixel(lineWidth); labelY = me.getPixelForTick(index, gridLines.offsetGridLines); @@ -12357,17 +12838,17 @@ return /******/ (function(modules) { // webpackBootstrap context.save(); context.translate(itemToDraw.labelX, itemToDraw.labelY); context.rotate(itemToDraw.rotation); - context.font = tickLabelFont; + context.font = tickFont.font; context.textBaseline = itemToDraw.textBaseline; context.textAlign = itemToDraw.textAlign; var label = itemToDraw.label; if (helpers.isArray(label)) { - for (var i = 0, y = -(label.length - 1)*tickFontSize*0.75; i < label.length; ++i) { + for (var i = 0, y = 0; i < label.length; ++i) { // We just make sure the multiline element is a string here.. context.fillText('' + label[i], 0, y); // apply same lineSpacing as calculated @ L#320 - y += (tickFontSize * 1.5); + y += (tickFont.size * 1.5); } } else { context.fillText(label, 0, 0); @@ -12384,10 +12865,10 @@ return /******/ (function(modules) { // webpackBootstrap if (isHorizontal) { scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width - scaleLabelY = options.position === 'bottom' ? me.bottom - (scaleLabelFontSize / 2) : me.top + (scaleLabelFontSize / 2); + scaleLabelY = options.position === 'bottom' ? me.bottom - (scaleLabelFont.size / 2) : me.top + (scaleLabelFont.size / 2); } else { var isLeft = options.position === 'left'; - scaleLabelX = isLeft ? me.left + (scaleLabelFontSize / 2) : me.right - (scaleLabelFontSize / 2); + scaleLabelX = isLeft ? me.left + (scaleLabelFont.size / 2) : me.right - (scaleLabelFont.size / 2); scaleLabelY = me.top + ((me.bottom - me.top) / 2); rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI; } @@ -12398,7 +12879,7 @@ return /******/ (function(modules) { // webpackBootstrap context.textAlign = 'center'; context.textBaseline = 'middle'; context.fillStyle = scaleLabelFontColor; // render in correct colour - context.font = scaleLabelFont; + context.font = scaleLabelFont.font; context.fillText(scaleLabel.labelString, 0, 0); context.restore(); } @@ -12434,7 +12915,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 22 */ +/* 24 */ /***/ function(module, exports) { 'use strict'; @@ -12461,7 +12942,6 @@ return /******/ (function(modules) { // webpackBootstrap initialize: function(config) { var me = this; helpers.extend(me, config); - me.options = helpers.configMerge(Chart.defaults.global.title, config.options); // Contains hit boxes for each dataset (in dataset order) me.legendHitBoxes = []; @@ -12469,12 +12949,7 @@ return /******/ (function(modules) { // webpackBootstrap // These methods are ordered by lifecycle. Utilities then follow. - beforeUpdate: function() { - var chartOpts = this.chart.options; - if (chartOpts && chartOpts.title) { - this.options = helpers.configMerge(Chart.defaults.global.title, chartOpts.title); - } - }, + beforeUpdate: noop, update: function(maxWidth, maxHeight, margins) { var me = this; @@ -12626,20 +13101,39 @@ return /******/ (function(modules) { // webpackBootstrap } }); + function createNewTitleBlockAndAttach(chartInstance, titleOpts) { + var title = new Chart.Title({ + ctx: chartInstance.chart.ctx, + options: titleOpts, + chart: chartInstance + }); + chartInstance.titleBlock = title; + Chart.layoutService.addBox(chartInstance, title); + } + // Register the title plugin Chart.plugins.register({ beforeInit: function(chartInstance) { - var opts = chartInstance.options; - var titleOpts = opts.title; + var titleOpts = chartInstance.options.title; if (titleOpts) { - chartInstance.titleBlock = new Chart.Title({ - ctx: chartInstance.chart.ctx, - options: titleOpts, - chart: chartInstance - }); + createNewTitleBlockAndAttach(chartInstance, titleOpts); + } + }, + beforeUpdate: function(chartInstance) { + var titleOpts = chartInstance.options.title; - Chart.layoutService.addBox(chartInstance, chartInstance.titleBlock); + if (titleOpts) { + titleOpts = helpers.configMerge(Chart.defaults.global.title, titleOpts); + + if (chartInstance.titleBlock) { + chartInstance.titleBlock.options = titleOpts; + } else { + createNewTitleBlockAndAttach(chartInstance, titleOpts); + } + } else { + Chart.layoutService.removeBox(chartInstance, chartInstance.titleBlock); + delete chartInstance.titleBlock; } } }); @@ -12647,7 +13141,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 23 */ +/* 25 */ /***/ function(module, exports) { 'use strict'; @@ -12814,10 +13308,20 @@ return /******/ (function(modules) { // webpackBootstrap beforeBuildLabels: noop, buildLabels: function() { var me = this; - me.legendItems = me.options.labels.generateLabels.call(me, me.chart); - if (me.options.reverse) { - me.legendItems.reverse(); + var labelOpts = me.options.labels; + var legendItems = labelOpts.generateLabels.call(me, me.chart); + + if (labelOpts.filter) { + legendItems = legendItems.filter(function(item) { + return labelOpts.filter(item, me.chart.data); + }); } + + if (me.options.reverse) { + legendItems.reverse(); + } + + me.legendItems = legendItems; }, afterBuildLabels: noop, @@ -13056,7 +13560,7 @@ return /******/ (function(modules) { // webpackBootstrap } } else if (y + itemHeight > me.bottom) { x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding; - y = cursor.y = me.top; + y = cursor.y = me.top + labelOpts.padding; cursor.line++; } @@ -13081,7 +13585,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Handle an event * @private - * @param e {Event} the event to handle + * @param {IEvent} event - The event to handle * @return {Boolean} true if a change occured */ handleEvent: function(e) { @@ -13102,9 +13606,9 @@ return /******/ (function(modules) { // webpackBootstrap return; } - var position = helpers.getRelativePosition(e, me.chart.chart), - x = position.x, - y = position.y; + // Chart event already has relative position in it + var x = e.x, + y = e.y; if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) { // See if we are touching one of the dataset boxes @@ -13115,11 +13619,13 @@ return /******/ (function(modules) { // webpackBootstrap if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) { // Touching an element if (type === 'click') { - opts.onClick.call(me, e, me.legendItems[i]); + // use e.native for backwards compatibility + opts.onClick.call(me, e.native, me.legendItems[i]); changed = true; break; } else if (type === 'mousemove') { - opts.onHover.call(me, e, me.legendItems[i]); + // use e.native for backwards compatibility + opts.onHover.call(me, e.native, me.legendItems[i]); changed = true; break; } @@ -13131,20 +13637,45 @@ return /******/ (function(modules) { // webpackBootstrap } }); + function createNewLegendAndAttach(chartInstance, legendOpts) { + var legend = new Chart.Legend({ + ctx: chartInstance.chart.ctx, + options: legendOpts, + chart: chartInstance + }); + chartInstance.legend = legend; + Chart.layoutService.addBox(chartInstance, legend); + } + // Register the legend plugin Chart.plugins.register({ beforeInit: function(chartInstance) { - var opts = chartInstance.options; - var legendOpts = opts.legend; + var legendOpts = chartInstance.options.legend; if (legendOpts) { - chartInstance.legend = new Chart.Legend({ - ctx: chartInstance.chart.ctx, - options: legendOpts, - chart: chartInstance - }); + createNewLegendAndAttach(chartInstance, legendOpts); + } + }, + beforeUpdate: function(chartInstance) { + var legendOpts = chartInstance.options.legend; - Chart.layoutService.addBox(chartInstance, chartInstance.legend); + if (legendOpts) { + legendOpts = helpers.configMerge(Chart.defaults.global.legend, legendOpts); + + if (chartInstance.legend) { + chartInstance.legend.options = legendOpts; + } else { + createNewLegendAndAttach(chartInstance, legendOpts); + } + } else { + Chart.layoutService.removeBox(chartInstance, chartInstance.legend); + delete chartInstance.legend; + } + }, + afterEvent: function(chartInstance, e) { + var legend = chartInstance.legend; + if (legend) { + legend.handleEvent(e); } } }); @@ -13152,7 +13683,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 24 */ +/* 26 */ /***/ function(module, exports) { 'use strict'; @@ -13160,6 +13691,23 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = function(Chart) { var helpers = Chart.helpers; + /** + * Helper function to get relative position for an event + * @param {Event|IEvent} event - The event to get the position for + * @param {Chart} chart - The chart + * @returns {Point} the event position + */ + function getRelativePosition(e, chart) { + if (e.native) { + return { + x: e.x, + y: e.y + }; + } + + return helpers.getRelativePosition(e, chart); + } + /** * Helper function to traverse all of the visible elements in the chart * @param chart {chart} the chart @@ -13239,7 +13787,7 @@ return /******/ (function(modules) { // webpackBootstrap } function indexMode(chart, e, options) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var distanceMetric = function(pt1, pt2) { return Math.abs(pt1.x - pt2.x); }; @@ -13275,14 +13823,14 @@ return /******/ (function(modules) { // webpackBootstrap */ /** - * @namespace Chart.Interaction * Contains interaction related functions + * @namespace Chart.Interaction */ Chart.Interaction = { // Helper function for different modes modes: { single: function(chart, e) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var elements = []; parseVisibleItems(chart, function(element) { @@ -13323,7 +13871,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned */ dataset: function(chart, e, options) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false); if (items.length > 0) { @@ -13350,7 +13898,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned */ point: function(chart, e) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); return getIntersectItems(chart, position); }, @@ -13363,7 +13911,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned */ nearest: function(chart, e, options) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var nearestItems = getNearestItems(chart, position, options.intersect); // We have multiple items at the same distance from the event. Now sort by smallest @@ -13395,7 +13943,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned */ x: function(chart, e, options) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var items = []; var intersectsItem = false; @@ -13426,7 +13974,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned */ y: function(chart, e, options) { - var position = helpers.getRelativePosition(e, chart.chart); + var position = getRelativePosition(e, chart.chart); var items = []; var intersectsItem = false; @@ -13453,7 +14001,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 25 */ +/* 27 */ /***/ function(module, exports) { 'use strict'; @@ -14221,7 +14769,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Handle an event * @private - * @param e {Event} the event to handle + * @param {IEvent} event - The event to handle * @returns {Boolean} true if the tooltip changed */ handleEvent: function(e) { @@ -14243,7 +14791,10 @@ return /******/ (function(modules) { // webpackBootstrap me._lastActive = me._active; if (options.enabled || options.custom) { - me._eventPosition = helpers.getRelativePosition(e, me._chart); + me._eventPosition = { + x: e.x, + y: e.y + }; var model = me._model; me.update(true); @@ -14336,7 +14887,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 26 */ +/* 28 */ /***/ function(module, exports) { 'use strict'; @@ -14446,7 +14997,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 27 */ +/* 29 */ /***/ function(module, exports) { 'use strict'; @@ -14636,7 +15187,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 28 */ +/* 30 */ /***/ function(module, exports) { 'use strict'; @@ -14697,13 +15248,17 @@ return /******/ (function(modules) { // webpackBootstrap padding: vm.radius + vm.borderWidth }; }, - draw: function() { + draw: function(chartArea) { var vm = this._view; + var model = this._model; var ctx = this._chart.ctx; var pointStyle = vm.pointStyle; var radius = vm.radius; var x = vm.x; var y = vm.y; + var color = Chart.helpers.color; + var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.) + var ratio = 0; if (vm.skip) { return; @@ -14713,6 +15268,24 @@ return /******/ (function(modules) { // webpackBootstrap ctx.lineWidth = helpers.getValueOrDefault(vm.borderWidth, globalOpts.elements.point.borderWidth); ctx.fillStyle = vm.backgroundColor || defaultColor; + // Cliping for Points. + // going out from inner charArea? + if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right*errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom*errMargin < model.y))) { + // Point fade out + if (model.x < chartArea.left) { + ratio = (x - model.x) / (chartArea.left - model.x); + } else if (chartArea.right*errMargin < model.x) { + ratio = (model.x - x) / (model.x - chartArea.right); + } else if (model.y < chartArea.top) { + ratio = (y - model.y) / (chartArea.top - model.y); + } else if (chartArea.bottom*errMargin < model.y) { + ratio = (model.y - y) / (model.y - chartArea.bottom); + } + ratio = Math.round(ratio*100) / 100; + ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString(); + ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString(); + } + Chart.canvasHelpers.drawPoint(ctx, pointStyle, radius, x, y); } }); @@ -14720,7 +15293,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 29 */ +/* 31 */ /***/ function(module, exports) { 'use strict'; @@ -14778,39 +15351,71 @@ return /******/ (function(modules) { // webpackBootstrap draw: function() { var ctx = this._chart.ctx; var vm = this._view; + var left, right, top, bottom, signX, signY, borderSkipped; + var borderWidth = vm.borderWidth; - var halfWidth = vm.width / 2, - leftX = vm.x - halfWidth, - rightX = vm.x + halfWidth, - top = vm.base - (vm.base - vm.y), - halfStroke = vm.borderWidth / 2; + if (!vm.horizontal) { + // bar + left = vm.x - vm.width / 2; + right = vm.x + vm.width / 2; + top = vm.y; + bottom = vm.base; + signX = 1; + signY = bottom > top? 1: -1; + borderSkipped = vm.borderSkipped || 'bottom'; + } else { + // horizontal bar + left = vm.base; + right = vm.x; + top = vm.y - vm.height / 2; + bottom = vm.y + vm.height / 2; + signX = right > left? 1: -1; + signY = 1; + borderSkipped = vm.borderSkipped || 'left'; + } // Canvas doesn't allow us to stroke inside the width so we can // adjust the sizes to fit if we're setting a stroke on the line - if (vm.borderWidth) { - leftX += halfStroke; - rightX -= halfStroke; - top += halfStroke; + if (borderWidth) { + // borderWidth shold be less than bar width and bar height. + var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom)); + borderWidth = borderWidth > barSize? barSize: borderWidth; + var halfStroke = borderWidth / 2; + // Adjust borderWidth when bar top position is near vm.base(zero). + var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0); + var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0); + var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0); + var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0); + // not become a vertical line? + if (borderLeft !== borderRight) { + top = borderTop; + bottom = borderBottom; + } + // not become a horizontal line? + if (borderTop !== borderBottom) { + left = borderLeft; + right = borderRight; + } } ctx.beginPath(); ctx.fillStyle = vm.backgroundColor; ctx.strokeStyle = vm.borderColor; - ctx.lineWidth = vm.borderWidth; + ctx.lineWidth = borderWidth; // Corner points, from bottom-left to bottom-right clockwise // | 1 2 | // | 0 3 | var corners = [ - [leftX, vm.base], - [leftX, top], - [rightX, top], - [rightX, vm.base] + [left, bottom], + [left, top], + [right, top], + [right, bottom] ]; // Find first (starting) corner with fallback to 'bottom' var borders = ['bottom', 'left', 'top', 'right']; - var startCorner = borders.indexOf(vm.borderSkipped, 0); + var startCorner = borders.indexOf(borderSkipped, 0); if (startCorner === -1) { startCorner = 0; } @@ -14829,7 +15434,7 @@ return /******/ (function(modules) { // webpackBootstrap } ctx.fill(); - if (vm.borderWidth) { + if (borderWidth) { ctx.stroke(); } }, @@ -14902,7 +15507,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 30 */ +/* 32 */ /***/ function(module, exports) { 'use strict'; @@ -15006,7 +15611,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 31 */ +/* 33 */ /***/ function(module, exports) { 'use strict'; @@ -15065,10 +15670,10 @@ return /******/ (function(modules) { // webpackBootstrap var data = me.chart.data; var isHorizontal = me.isHorizontal(); - if ((data.xLabels && isHorizontal) || (data.yLabels && !isHorizontal)) { + if (data.yLabels && !isHorizontal) { return me.getRightValue(data.datasets[datasetIndex].data[index]); } - return me.ticks[index]; + return me.ticks[index - me.minIndex]; }, // Used to get data value locations. Value can either be an index or a numerical value @@ -15084,9 +15689,8 @@ return /******/ (function(modules) { // webpackBootstrap } if (me.isHorizontal()) { - var innerWidth = me.width - (me.paddingLeft + me.paddingRight); - var valueWidth = innerWidth / offsetAmt; - var widthOffset = (valueWidth * (index - me.minIndex)) + me.paddingLeft; + var valueWidth = me.width / offsetAmt; + var widthOffset = (valueWidth * (index - me.minIndex)); if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) { widthOffset += (valueWidth / 2); @@ -15094,9 +15698,8 @@ return /******/ (function(modules) { // webpackBootstrap return me.left + Math.round(widthOffset); } - var innerHeight = me.height - (me.paddingTop + me.paddingBottom); - var valueHeight = innerHeight / offsetAmt; - var heightOffset = (valueHeight * (index - me.minIndex)) + me.paddingTop; + var valueHeight = me.height / offsetAmt; + var heightOffset = (valueHeight * (index - me.minIndex)); if (me.options.gridLines.offsetGridLines && includeOffset) { heightOffset += (valueHeight / 2); @@ -15112,15 +15715,13 @@ return /******/ (function(modules) { // webpackBootstrap var value; var offsetAmt = Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1); var horz = me.isHorizontal(); - var innerDimension = horz ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom); - var valueDimension = innerDimension / offsetAmt; + var valueDimension = (horz ? me.width : me.height) / offsetAmt; pixel -= horz ? me.left : me.top; if (me.options.gridLines.offsetGridLines) { pixel -= (valueDimension / 2); } - pixel -= horz ? me.paddingLeft : me.paddingTop; if (pixel <= 0) { value = 0; @@ -15141,7 +15742,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 32 */ +/* 34 */ /***/ function(module, exports) { 'use strict'; @@ -15174,21 +15775,43 @@ return /******/ (function(modules) { // webpackBootstrap me.min = null; me.max = null; - if (opts.stacked) { - var valuesPerType = {}; + var hasStacks = opts.stacked; + if (hasStacks === undefined) { + helpers.each(datasets, function(dataset, datasetIndex) { + if (hasStacks) { + return; + } + + var meta = chart.getDatasetMeta(datasetIndex); + if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) && + meta.stack !== undefined) { + hasStacks = true; + } + }); + } + + if (opts.stacked || hasStacks) { + var valuesPerStack = {}; helpers.each(datasets, function(dataset, datasetIndex) { var meta = chart.getDatasetMeta(datasetIndex); - if (valuesPerType[meta.type] === undefined) { - valuesPerType[meta.type] = { + var key = [ + meta.type, + // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined + ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''), + meta.stack + ].join('.'); + + if (valuesPerStack[key] === undefined) { + valuesPerStack[key] = { positiveValues: [], negativeValues: [] }; } // Store these per type - var positiveValues = valuesPerType[meta.type].positiveValues; - var negativeValues = valuesPerType[meta.type].negativeValues; + var positiveValues = valuesPerStack[key].positiveValues; + var negativeValues = valuesPerStack[key].negativeValues; if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) { helpers.each(dataset.data, function(rawValue, index) { @@ -15211,7 +15834,7 @@ return /******/ (function(modules) { // webpackBootstrap } }); - helpers.each(valuesPerType, function(valuesForType) { + helpers.each(valuesPerStack, function(valuesForType) { var values = valuesForType.positiveValues.concat(valuesForType.negativeValues); var minVal = helpers.min(values); var maxVal = helpers.max(values); @@ -15278,31 +15901,25 @@ return /******/ (function(modules) { // webpackBootstrap // This must be called after fit has been run so that // this.left, this.top, this.right, and this.bottom have been defined var me = this; - var paddingLeft = me.paddingLeft; - var paddingBottom = me.paddingBottom; var start = me.start; var rightValue = +me.getRightValue(value); var pixel; - var innerDimension; var range = me.end - start; if (me.isHorizontal()) { - innerDimension = me.width - (paddingLeft + me.paddingRight); - pixel = me.left + (innerDimension / range * (rightValue - start)); - return Math.round(pixel + paddingLeft); + pixel = me.left + (me.width / range * (rightValue - start)); + return Math.round(pixel); } - innerDimension = me.height - (me.paddingTop + paddingBottom); - pixel = (me.bottom - paddingBottom) - (innerDimension / range * (rightValue - start)); + + pixel = me.bottom - (me.height / range * (rightValue - start)); return Math.round(pixel); }, getValueForPixel: function(pixel) { var me = this; var isHorizontal = me.isHorizontal(); - var paddingLeft = me.paddingLeft; - var paddingBottom = me.paddingBottom; - var innerDimension = isHorizontal ? me.width - (paddingLeft + me.paddingRight) : me.height - (me.paddingTop + paddingBottom); - var offset = (isHorizontal ? pixel - me.left - paddingLeft : me.bottom - paddingBottom - pixel) / innerDimension; + var innerDimension = isHorizontal ? me.width : me.height; + var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension; return me.start + ((me.end - me.start) * offset); }, getPixelForTick: function(index) { @@ -15315,7 +15932,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 33 */ +/* 35 */ /***/ function(module, exports) { 'use strict'; @@ -15352,18 +15969,40 @@ return /******/ (function(modules) { // webpackBootstrap me.max = null; me.minNotZero = null; - if (opts.stacked) { - var valuesPerType = {}; + var hasStacks = opts.stacked; + if (hasStacks === undefined) { + helpers.each(datasets, function(dataset, datasetIndex) { + if (hasStacks) { + return; + } + + var meta = chart.getDatasetMeta(datasetIndex); + if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) && + meta.stack !== undefined) { + hasStacks = true; + } + }); + } + + if (opts.stacked || hasStacks) { + var valuesPerStack = {}; helpers.each(datasets, function(dataset, datasetIndex) { var meta = chart.getDatasetMeta(datasetIndex); + var key = [ + meta.type, + // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined + ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''), + meta.stack + ].join('.'); + if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) { - if (valuesPerType[meta.type] === undefined) { - valuesPerType[meta.type] = []; + if (valuesPerStack[key] === undefined) { + valuesPerStack[key] = []; } helpers.each(dataset.data, function(rawValue, index) { - var values = valuesPerType[meta.type]; + var values = valuesPerStack[key]; var value = +me.getRightValue(rawValue); if (isNaN(value) || meta.data[index].hidden) { return; @@ -15381,7 +16020,7 @@ return /******/ (function(modules) { // webpackBootstrap } }); - helpers.each(valuesPerType, function(valuesForType) { + helpers.each(valuesPerStack, function(valuesForType) { var minVal = helpers.min(valuesForType); var maxVal = helpers.max(valuesForType); me.min = me.min === null ? minVal : Math.min(me.min, minVal); @@ -15482,46 +16121,42 @@ return /******/ (function(modules) { // webpackBootstrap var start = me.start; var newVal = +me.getRightValue(value); var range; - var paddingTop = me.paddingTop; - var paddingBottom = me.paddingBottom; - var paddingLeft = me.paddingLeft; var opts = me.options; var tickOpts = opts.ticks; if (me.isHorizontal()) { range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0 if (newVal === 0) { - pixel = me.left + paddingLeft; + pixel = me.left; } else { - innerDimension = me.width - (paddingLeft + me.paddingRight); + innerDimension = me.width; pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start))); - pixel += paddingLeft; } } else { // Bottom - top since pixels increase downward on a screen - innerDimension = me.height - (paddingTop + paddingBottom); + innerDimension = me.height; if (start === 0 && !tickOpts.reverse) { range = helpers.log10(me.end) - helpers.log10(me.minNotZero); if (newVal === start) { - pixel = me.bottom - paddingBottom; + pixel = me.bottom; } else if (newVal === me.minNotZero) { - pixel = me.bottom - paddingBottom - innerDimension * 0.02; + pixel = me.bottom - innerDimension * 0.02; } else { - pixel = me.bottom - paddingBottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero))); + pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero))); } } else if (me.end === 0 && tickOpts.reverse) { range = helpers.log10(me.start) - helpers.log10(me.minNotZero); if (newVal === me.end) { - pixel = me.top + paddingTop; + pixel = me.top; } else if (newVal === me.minNotZero) { - pixel = me.top + paddingTop + innerDimension * 0.02; + pixel = me.top + innerDimension * 0.02; } else { - pixel = me.top + paddingTop + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero))); + pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero))); } } else { range = helpers.log10(me.end) - helpers.log10(start); - innerDimension = me.height - (paddingTop + paddingBottom); - pixel = (me.bottom - paddingBottom) - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start))); + innerDimension = me.height; + pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start))); } } return pixel; @@ -15532,11 +16167,11 @@ return /******/ (function(modules) { // webpackBootstrap var value, innerDimension; if (me.isHorizontal()) { - innerDimension = me.width - (me.paddingLeft + me.paddingRight); - value = me.start * Math.pow(10, (pixel - me.left - me.paddingLeft) * range / innerDimension); + innerDimension = me.width; + value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension); } else { // todo: if start === 0 - innerDimension = me.height - (me.paddingTop + me.paddingBottom); - value = Math.pow(10, (me.bottom - me.paddingBottom - pixel) * range / innerDimension) / me.start; + innerDimension = me.height; + value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start; } return value; } @@ -15547,7 +16182,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 34 */ +/* 36 */ /***/ function(module, exports) { 'use strict'; @@ -15599,10 +16234,266 @@ return /******/ (function(modules) { // webpackBootstrap } }; + function getValueCount(scale) { + return !scale.options.lineArc ? scale.chart.data.labels.length : 0; + } + + function getPointLabelFontOptions(scale) { + var pointLabelOptions = scale.options.pointLabels; + var fontSize = helpers.getValueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize); + var fontStyle = helpers.getValueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle); + var fontFamily = helpers.getValueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily); + var font = helpers.fontString(fontSize, fontStyle, fontFamily); + + return { + size: fontSize, + style: fontStyle, + family: fontFamily, + font: font + }; + } + + function measureLabelSize(ctx, fontSize, label) { + if (helpers.isArray(label)) { + return { + w: helpers.longestText(ctx, ctx.font, label), + h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize) + }; + } + + return { + w: ctx.measureText(label).width, + h: fontSize + }; + } + + function determineLimits(angle, pos, size, min, max) { + if (angle === min || angle === max) { + return { + start: pos - (size / 2), + end: pos + (size / 2) + }; + } else if (angle < min || angle > max) { + return { + start: pos - size - 5, + end: pos + }; + } + + return { + start: pos, + end: pos + size + 5 + }; + } + + /** + * Helper function to fit a radial linear scale with point labels + */ + function fitWithPointLabels(scale) { + /* + * Right, this is really confusing and there is a lot of maths going on here + * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9 + * + * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif + * + * Solution: + * + * We assume the radius of the polygon is half the size of the canvas at first + * at each index we check if the text overlaps. + * + * Where it does, we store that angle and that index. + * + * After finding the largest index and angle we calculate how much we need to remove + * from the shape radius to move the point inwards by that x. + * + * We average the left and right distances to get the maximum shape radius that can fit in the box + * along with labels. + * + * Once we have that, we can find the centre point for the chart, by taking the x text protrusion + * on each side, removing that from the size, halving it and adding the left x protrusion width. + * + * This will mean we have a shape fitted to the canvas, as large as it can be with the labels + * and position it in the most space efficient manner + * + * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif + */ + + var plFont = getPointLabelFontOptions(scale); + + // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width. + // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points + var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2); + var furthestLimits = { + l: scale.width, + r: 0, + t: scale.height, + b: 0 + }; + var furthestAngles = {}; + var i; + var textSize; + var pointPosition; + + scale.ctx.font = plFont.font; + scale._pointLabelSizes = []; + + var valueCount = getValueCount(scale); + for (i = 0; i < valueCount; i++) { + pointPosition = scale.getPointPosition(i, largestPossibleRadius); + textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || ''); + scale._pointLabelSizes[i] = textSize; + + // Add quarter circle to make degree 0 mean top of circle + var angleRadians = scale.getIndexAngle(i); + var angle = helpers.toDegrees(angleRadians) % 360; + var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180); + var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270); + + if (hLimits.start < furthestLimits.l) { + furthestLimits.l = hLimits.start; + furthestAngles.l = angleRadians; + } + + if (hLimits.end > furthestLimits.r) { + furthestLimits.r = hLimits.end; + furthestAngles.r = angleRadians; + } + + if (vLimits.start < furthestLimits.t) { + furthestLimits.t = vLimits.start; + furthestAngles.t = angleRadians; + } + + if (vLimits.end > furthestLimits.b) { + furthestLimits.b = vLimits.end; + furthestAngles.b = angleRadians; + } + } + + scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles); + } + + /** + * Helper function to fit a radial linear scale with no point labels + */ + function fit(scale) { + var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2); + scale.drawingArea = Math.round(largestPossibleRadius); + scale.setCenterPoint(0, 0, 0, 0); + } + + function getTextAlignForAngle(angle) { + if (angle === 0 || angle === 180) { + return 'center'; + } else if (angle < 180) { + return 'left'; + } + + return 'right'; + } + + function fillText(ctx, text, position, fontSize) { + if (helpers.isArray(text)) { + var y = position.y; + var spacing = 1.5 * fontSize; + + for (var i = 0; i < text.length; ++i) { + ctx.fillText(text[i], position.x, y); + y+= spacing; + } + } else { + ctx.fillText(text, position.x, position.y); + } + } + + function adjustPointPositionForLabelHeight(angle, textSize, position) { + if (angle === 90 || angle === 270) { + position.y -= (textSize.h / 2); + } else if (angle > 270 || angle < 90) { + position.y -= textSize.h; + } + } + + function drawPointLabels(scale) { + var ctx = scale.ctx; + var getValueOrDefault = helpers.getValueOrDefault; + var opts = scale.options; + var angleLineOpts = opts.angleLines; + var pointLabelOpts = opts.pointLabels; + + ctx.lineWidth = angleLineOpts.lineWidth; + ctx.strokeStyle = angleLineOpts.color; + + var outerDistance = scale.getDistanceFromCenterForValue(opts.reverse ? scale.min : scale.max); + + // Point Label Font + var plFont = getPointLabelFontOptions(scale); + + ctx.textBaseline = 'top'; + + for (var i = getValueCount(scale) - 1; i >= 0; i--) { + if (angleLineOpts.display) { + var outerPosition = scale.getPointPosition(i, outerDistance); + ctx.beginPath(); + ctx.moveTo(scale.xCenter, scale.yCenter); + ctx.lineTo(outerPosition.x, outerPosition.y); + ctx.stroke(); + ctx.closePath(); + } + // Extra 3px out for some label spacing + var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5); + + // Keep this in loop since we may support array properties here + var pointLabelFontColor = getValueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor); + ctx.font = plFont.font; + ctx.fillStyle = pointLabelFontColor; + + var angleRadians = scale.getIndexAngle(i); + var angle = helpers.toDegrees(angleRadians); + ctx.textAlign = getTextAlignForAngle(angle); + adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition); + fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size); + } + } + + function drawRadiusLine(scale, gridLineOpts, radius, index) { + var ctx = scale.ctx; + ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1); + ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1); + + if (scale.options.lineArc) { + // Draw circular arcs between the points + ctx.beginPath(); + ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2); + ctx.closePath(); + ctx.stroke(); + } else { + // Draw straight lines connecting each index + var valueCount = getValueCount(scale); + + if (valueCount === 0) { + return; + } + + ctx.beginPath(); + var pointPosition = scale.getPointPosition(0, radius); + ctx.moveTo(pointPosition.x, pointPosition.y); + + for (var i = 1; i < valueCount; i++) { + pointPosition = scale.getPointPosition(i, radius); + ctx.lineTo(pointPosition.x, pointPosition.y); + } + + ctx.closePath(); + ctx.stroke(); + } + } + + function numberOrZero(param) { + return helpers.isNumber(param) ? param : 0; + } + var LinearRadialScale = Chart.LinearScaleBase.extend({ - getValueCount: function() { - return this.chart.data.labels.length; - }, setDimensions: function() { var me = this; var opts = me.options; @@ -15620,9 +16511,8 @@ return /******/ (function(modules) { // webpackBootstrap determineDataLimits: function() { var me = this; var chart = me.chart; - me.min = null; - me.max = null; - + var min = Number.POSITIVE_INFINITY; + var max = Number.NEGATIVE_INFINITY; helpers.each(chart.data.datasets, function(dataset, datasetIndex) { if (chart.isDatasetVisible(datasetIndex)) { @@ -15634,21 +16524,15 @@ return /******/ (function(modules) { // webpackBootstrap return; } - if (me.min === null) { - me.min = value; - } else if (value < me.min) { - me.min = value; - } - - if (me.max === null) { - me.max = value; - } else if (value > me.max) { - me.max = value; - } + min = Math.min(value, min); + max = Math.max(value, max); }); } }); + me.min = (min === Number.POSITIVE_INFINITY ? 0 : min); + me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max); + // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero me.handleTickRangeOptions(); }, @@ -15668,122 +16552,46 @@ return /******/ (function(modules) { // webpackBootstrap return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]); }, fit: function() { - /* - * Right, this is really confusing and there is a lot of maths going on here - * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9 - * - * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif - * - * Solution: - * - * We assume the radius of the polygon is half the size of the canvas at first - * at each index we check if the text overlaps. - * - * Where it does, we store that angle and that index. - * - * After finding the largest index and angle we calculate how much we need to remove - * from the shape radius to move the point inwards by that x. - * - * We average the left and right distances to get the maximum shape radius that can fit in the box - * along with labels. - * - * Once we have that, we can find the centre point for the chart, by taking the x text protrusion - * on each side, removing that from the size, halving it and adding the left x protrusion width. - * - * This will mean we have a shape fitted to the canvas, as large as it can be with the labels - * and position it in the most space efficient manner - * - * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif - */ - - var pointLabels = this.options.pointLabels; - var pointLabelFontSize = helpers.getValueOrDefault(pointLabels.fontSize, globalDefaults.defaultFontSize); - var pointLabeFontStyle = helpers.getValueOrDefault(pointLabels.fontStyle, globalDefaults.defaultFontStyle); - var pointLabeFontFamily = helpers.getValueOrDefault(pointLabels.fontFamily, globalDefaults.defaultFontFamily); - var pointLabeFont = helpers.fontString(pointLabelFontSize, pointLabeFontStyle, pointLabeFontFamily); - - // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width. - // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points - var largestPossibleRadius = helpers.min([(this.height / 2 - pointLabelFontSize - 5), this.width / 2]), - pointPosition, - i, - textWidth, - halfTextWidth, - furthestRight = this.width, - furthestRightIndex, - furthestRightAngle, - furthestLeft = 0, - furthestLeftIndex, - furthestLeftAngle, - xProtrusionLeft, - xProtrusionRight, - radiusReductionRight, - radiusReductionLeft; - this.ctx.font = pointLabeFont; - - for (i = 0; i < this.getValueCount(); i++) { - // 5px to space the text slightly out - similar to what we do in the draw function. - pointPosition = this.getPointPosition(i, largestPossibleRadius); - textWidth = this.ctx.measureText(this.pointLabels[i] ? this.pointLabels[i] : '').width + 5; - - // Add quarter circle to make degree 0 mean top of circle - var angleRadians = this.getIndexAngle(i) + (Math.PI / 2); - var angle = (angleRadians * 360 / (2 * Math.PI)) % 360; - - if (angle === 0 || angle === 180) { - // At angle 0 and 180, we're at exactly the top/bottom - // of the radar chart, so text will be aligned centrally, so we'll half it and compare - // w/left and right text sizes - halfTextWidth = textWidth / 2; - if (pointPosition.x + halfTextWidth > furthestRight) { - furthestRight = pointPosition.x + halfTextWidth; - furthestRightIndex = i; - } - if (pointPosition.x - halfTextWidth < furthestLeft) { - furthestLeft = pointPosition.x - halfTextWidth; - furthestLeftIndex = i; - } - } else if (angle < 180) { - // Less than half the values means we'll left align the text - if (pointPosition.x + textWidth > furthestRight) { - furthestRight = pointPosition.x + textWidth; - furthestRightIndex = i; - } - // More than half the values means we'll right align the text - } else if (pointPosition.x - textWidth < furthestLeft) { - furthestLeft = pointPosition.x - textWidth; - furthestLeftIndex = i; - } + if (this.options.lineArc) { + fit(this); + } else { + fitWithPointLabels(this); } - - xProtrusionLeft = furthestLeft; - xProtrusionRight = Math.ceil(furthestRight - this.width); - - furthestRightAngle = this.getIndexAngle(furthestRightIndex); - furthestLeftAngle = this.getIndexAngle(furthestLeftIndex); - - radiusReductionRight = xProtrusionRight / Math.sin(furthestRightAngle + Math.PI / 2); - radiusReductionLeft = xProtrusionLeft / Math.sin(furthestLeftAngle + Math.PI / 2); - - // Ensure we actually need to reduce the size of the chart - radiusReductionRight = (helpers.isNumber(radiusReductionRight)) ? radiusReductionRight : 0; - radiusReductionLeft = (helpers.isNumber(radiusReductionLeft)) ? radiusReductionLeft : 0; - - this.drawingArea = Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2); - this.setCenterPoint(radiusReductionLeft, radiusReductionRight); }, - setCenterPoint: function(leftMovement, rightMovement) { + /** + * Set radius reductions and determine new radius and center point + * @private + */ + setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) { + var me = this; + var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l); + var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r); + var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t); + var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b); + + radiusReductionLeft = numberOrZero(radiusReductionLeft); + radiusReductionRight = numberOrZero(radiusReductionRight); + radiusReductionTop = numberOrZero(radiusReductionTop); + radiusReductionBottom = numberOrZero(radiusReductionBottom); + + me.drawingArea = Math.min( + Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2), + Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2)); + me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom); + }, + setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) { var me = this; var maxRight = me.width - rightMovement - me.drawingArea, - maxLeft = leftMovement + me.drawingArea; + maxLeft = leftMovement + me.drawingArea, + maxTop = topMovement + me.drawingArea, + maxBottom = me.height - bottomMovement - me.drawingArea; me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left); - // Always vertically in the centre as the text height doesn't change - me.yCenter = Math.round((me.height / 2) + me.top); + me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top); }, getIndexAngle: function(index) { - var angleMultiplier = (Math.PI * 2) / this.getValueCount(); + var angleMultiplier = (Math.PI * 2) / getValueCount(this); var startAngle = this.chart.options && this.chart.options.startAngle ? this.chart.options.startAngle : 0; @@ -15791,7 +16599,7 @@ return /******/ (function(modules) { // webpackBootstrap var startAngleRadians = startAngle * Math.PI * 2 / 360; // Start from the top instead of right, so remove a quarter of the circle - return index * angleMultiplier - (Math.PI / 2) + startAngleRadians; + return index * angleMultiplier + startAngleRadians; }, getDistanceFromCenterForValue: function(value) { var me = this; @@ -15809,7 +16617,7 @@ return /******/ (function(modules) { // webpackBootstrap }, getPointPosition: function(index, distanceFromCenter) { var me = this; - var thisAngle = me.getIndexAngle(index); + var thisAngle = me.getIndexAngle(index) - (Math.PI / 2); return { x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter, y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter @@ -15836,8 +16644,6 @@ return /******/ (function(modules) { // webpackBootstrap var opts = me.options; var gridLineOpts = opts.gridLines; var tickOpts = opts.ticks; - var angleLineOpts = opts.angleLines; - var pointLabelOpts = opts.pointLabels; var getValueOrDefault = helpers.getValueOrDefault; if (opts.display) { @@ -15857,29 +16663,7 @@ return /******/ (function(modules) { // webpackBootstrap // Draw circular lines around the scale if (gridLineOpts.display && index !== 0) { - ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1); - ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1); - - if (opts.lineArc) { - // Draw circular arcs between the points - ctx.beginPath(); - ctx.arc(me.xCenter, me.yCenter, yCenterOffset, 0, Math.PI * 2); - ctx.closePath(); - ctx.stroke(); - } else { - // Draw straight lines connecting each index - ctx.beginPath(); - for (var i = 0; i < me.getValueCount(); i++) { - var pointPosition = me.getPointPosition(i, yCenterOffset); - if (i === 0) { - ctx.moveTo(pointPosition.x, pointPosition.y); - } else { - ctx.lineTo(pointPosition.x, pointPosition.y); - } - } - ctx.closePath(); - ctx.stroke(); - } + drawRadiusLine(me, gridLineOpts, yCenterOffset, index); } if (tickOpts.display) { @@ -15906,59 +16690,7 @@ return /******/ (function(modules) { // webpackBootstrap }); if (!opts.lineArc) { - ctx.lineWidth = angleLineOpts.lineWidth; - ctx.strokeStyle = angleLineOpts.color; - - var outerDistance = me.getDistanceFromCenterForValue(opts.reverse ? me.min : me.max); - - // Point Label Font - var pointLabelFontSize = getValueOrDefault(pointLabelOpts.fontSize, globalDefaults.defaultFontSize); - var pointLabeFontStyle = getValueOrDefault(pointLabelOpts.fontStyle, globalDefaults.defaultFontStyle); - var pointLabeFontFamily = getValueOrDefault(pointLabelOpts.fontFamily, globalDefaults.defaultFontFamily); - var pointLabeFont = helpers.fontString(pointLabelFontSize, pointLabeFontStyle, pointLabeFontFamily); - - for (var i = me.getValueCount() - 1; i >= 0; i--) { - if (angleLineOpts.display) { - var outerPosition = me.getPointPosition(i, outerDistance); - ctx.beginPath(); - ctx.moveTo(me.xCenter, me.yCenter); - ctx.lineTo(outerPosition.x, outerPosition.y); - ctx.stroke(); - ctx.closePath(); - } - // Extra 3px out for some label spacing - var pointLabelPosition = me.getPointPosition(i, outerDistance + 5); - - // Keep this in loop since we may support array properties here - var pointLabelFontColor = getValueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor); - ctx.font = pointLabeFont; - ctx.fillStyle = pointLabelFontColor; - - var pointLabels = me.pointLabels; - - // Add quarter circle to make degree 0 mean top of circle - var angleRadians = this.getIndexAngle(i) + (Math.PI / 2); - var angle = (angleRadians * 360 / (2 * Math.PI)) % 360; - - if (angle === 0 || angle === 180) { - ctx.textAlign = 'center'; - } else if (angle < 180) { - ctx.textAlign = 'left'; - } else { - ctx.textAlign = 'right'; - } - - // Set the correct text baseline based on outer positioning - if (angle === 90 || angle === 270) { - ctx.textBaseline = 'middle'; - } else if (angle > 270 || angle < 90) { - ctx.textBaseline = 'bottom'; - } else { - ctx.textBaseline = 'top'; - } - - ctx.fillText(pointLabels[i] ? pointLabels[i] : '', pointLabelPosition.x, pointLabelPosition.y); - } + drawPointLabels(me); } } } @@ -15969,13 +16701,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 35 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { /* global window: false */ 'use strict'; - var moment = __webpack_require__(36); + var moment = __webpack_require__(38); moment = typeof(moment) === 'function' ? moment : window.moment; module.exports = function(Chart) { @@ -16214,7 +16946,7 @@ return /******/ (function(modules) { // webpackBootstrap me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, 1); } else { // Determine the smallest needed unit of the time - var innerWidth = me.isHorizontal() ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom); + var innerWidth = me.isHorizontal() ? me.width : me.height; // Crude approximation of what the label length might be var tempFirstLabel = me.tickFormatFunction(me.firstTick, 0, []); @@ -16298,7 +17030,7 @@ return /******/ (function(modules) { // webpackBootstrap me.ticks.push(me.firstTick.clone()); // For every unit in between the first and last moment, create a moment and add it to the ticks tick - for (var i = 1; i <= me.scaleSizeInUnits; ++i) { + for (var i = me.unitScale; i <= me.scaleSizeInUnits; i += me.unitScale) { var newTick = roundedStart.clone().add(i, me.tickUnit); // Are we greater than the max time @@ -16306,9 +17038,7 @@ return /******/ (function(modules) { // webpackBootstrap break; } - if (i % me.unitScale === 0) { - me.ticks.push(newTick); - } + me.ticks.push(newTick); } // Always show the right tick @@ -16334,9 +17064,10 @@ return /******/ (function(modules) { // webpackBootstrap getLabelForIndex: function(index, datasetIndex) { var me = this; var label = me.chart.data.labels && index < me.chart.data.labels.length ? me.chart.data.labels[index] : ''; + var value = me.chart.data.datasets[datasetIndex].data[index]; - if (typeof me.chart.data.datasets[datasetIndex].data[0] === 'object') { - label = me.getRightValue(me.chart.data.datasets[datasetIndex].data[index]); + if (value !== null && typeof value === 'object') { + label = me.getRightValue(value); } // Format nicely @@ -16383,14 +17114,11 @@ return /******/ (function(modules) { // webpackBootstrap var decimal = offset !== 0 ? offset / me.scaleSizeInUnits : offset; if (me.isHorizontal()) { - var innerWidth = me.width - (me.paddingLeft + me.paddingRight); - var valueOffset = (innerWidth * decimal) + me.paddingLeft; - + var valueOffset = (me.width * decimal); return me.left + Math.round(valueOffset); } - var innerHeight = me.height - (me.paddingTop + me.paddingBottom); - var heightOffset = (innerHeight * decimal) + me.paddingTop; + var heightOffset = (me.height * decimal); return me.top + Math.round(heightOffset); } }, @@ -16399,8 +17127,8 @@ return /******/ (function(modules) { // webpackBootstrap }, getValueForPixel: function(pixel) { var me = this; - var innerDimension = me.isHorizontal() ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom); - var offset = (pixel - (me.isHorizontal() ? me.left + me.paddingLeft : me.top + me.paddingTop)) / innerDimension; + var innerDimension = me.isHorizontal() ? me.width : me.height; + var offset = (pixel - (me.isHorizontal() ? me.left : me.top)) / innerDimension; offset *= me.scaleSizeInUnits; return me.firstTick.clone().add(moment.duration(offset, me.tickUnit).asSeconds(), 'seconds'); }, @@ -16435,7 +17163,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 36 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {//! moment.js @@ -18252,7 +18980,7 @@ return /******/ (function(modules) { // webpackBootstrap module && module.exports) { try { oldLocale = globalLocale._abbr; - __webpack_require__(38)("./" + name); + __webpack_require__(40)("./" + name); // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales getSetGlobalLocale(oldLocale); @@ -20740,10 +21468,10 @@ return /******/ (function(modules) { // webpackBootstrap }))); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(37)(module))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module))) /***/ }, -/* 37 */ +/* 39 */ /***/ function(module, exports) { module.exports = function(module) { @@ -20759,226 +21487,226 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 38 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { var map = { - "./af": 39, - "./af.js": 39, - "./ar": 40, - "./ar-dz": 41, - "./ar-dz.js": 41, - "./ar-ly": 42, - "./ar-ly.js": 42, - "./ar-ma": 43, - "./ar-ma.js": 43, - "./ar-sa": 44, - "./ar-sa.js": 44, - "./ar-tn": 45, - "./ar-tn.js": 45, - "./ar.js": 40, - "./az": 46, - "./az.js": 46, - "./be": 47, - "./be.js": 47, - "./bg": 48, - "./bg.js": 48, - "./bn": 49, - "./bn.js": 49, - "./bo": 50, - "./bo.js": 50, - "./br": 51, - "./br.js": 51, - "./bs": 52, - "./bs.js": 52, - "./ca": 53, - "./ca.js": 53, - "./cs": 54, - "./cs.js": 54, - "./cv": 55, - "./cv.js": 55, - "./cy": 56, - "./cy.js": 56, - "./da": 57, - "./da.js": 57, - "./de": 58, - "./de-at": 59, - "./de-at.js": 59, - "./de.js": 58, - "./dv": 60, - "./dv.js": 60, - "./el": 61, - "./el.js": 61, - "./en-au": 62, - "./en-au.js": 62, - "./en-ca": 63, - "./en-ca.js": 63, - "./en-gb": 64, - "./en-gb.js": 64, - "./en-ie": 65, - "./en-ie.js": 65, - "./en-nz": 66, - "./en-nz.js": 66, - "./eo": 67, - "./eo.js": 67, - "./es": 68, - "./es-do": 69, - "./es-do.js": 69, - "./es.js": 68, - "./et": 70, - "./et.js": 70, - "./eu": 71, - "./eu.js": 71, - "./fa": 72, - "./fa.js": 72, - "./fi": 73, - "./fi.js": 73, - "./fo": 74, - "./fo.js": 74, - "./fr": 75, - "./fr-ca": 76, - "./fr-ca.js": 76, - "./fr-ch": 77, - "./fr-ch.js": 77, - "./fr.js": 75, - "./fy": 78, - "./fy.js": 78, - "./gd": 79, - "./gd.js": 79, - "./gl": 80, - "./gl.js": 80, - "./he": 81, - "./he.js": 81, - "./hi": 82, - "./hi.js": 82, - "./hr": 83, - "./hr.js": 83, - "./hu": 84, - "./hu.js": 84, - "./hy-am": 85, - "./hy-am.js": 85, - "./id": 86, - "./id.js": 86, - "./is": 87, - "./is.js": 87, - "./it": 88, - "./it.js": 88, - "./ja": 89, - "./ja.js": 89, - "./jv": 90, - "./jv.js": 90, - "./ka": 91, - "./ka.js": 91, - "./kk": 92, - "./kk.js": 92, - "./km": 93, - "./km.js": 93, - "./ko": 94, - "./ko.js": 94, - "./ky": 95, - "./ky.js": 95, - "./lb": 96, - "./lb.js": 96, - "./lo": 97, - "./lo.js": 97, - "./lt": 98, - "./lt.js": 98, - "./lv": 99, - "./lv.js": 99, - "./me": 100, - "./me.js": 100, - "./mi": 101, - "./mi.js": 101, - "./mk": 102, - "./mk.js": 102, - "./ml": 103, - "./ml.js": 103, - "./mr": 104, - "./mr.js": 104, - "./ms": 105, - "./ms-my": 106, - "./ms-my.js": 106, - "./ms.js": 105, - "./my": 107, - "./my.js": 107, - "./nb": 108, - "./nb.js": 108, - "./ne": 109, - "./ne.js": 109, - "./nl": 110, - "./nl-be": 111, - "./nl-be.js": 111, - "./nl.js": 110, - "./nn": 112, - "./nn.js": 112, - "./pa-in": 113, - "./pa-in.js": 113, - "./pl": 114, - "./pl.js": 114, - "./pt": 115, - "./pt-br": 116, - "./pt-br.js": 116, - "./pt.js": 115, - "./ro": 117, - "./ro.js": 117, - "./ru": 118, - "./ru.js": 118, - "./se": 119, - "./se.js": 119, - "./si": 120, - "./si.js": 120, - "./sk": 121, - "./sk.js": 121, - "./sl": 122, - "./sl.js": 122, - "./sq": 123, - "./sq.js": 123, - "./sr": 124, - "./sr-cyrl": 125, - "./sr-cyrl.js": 125, - "./sr.js": 124, - "./ss": 126, - "./ss.js": 126, - "./sv": 127, - "./sv.js": 127, - "./sw": 128, - "./sw.js": 128, - "./ta": 129, - "./ta.js": 129, - "./te": 130, - "./te.js": 130, - "./tet": 131, - "./tet.js": 131, - "./th": 132, - "./th.js": 132, - "./tl-ph": 133, - "./tl-ph.js": 133, - "./tlh": 134, - "./tlh.js": 134, - "./tr": 135, - "./tr.js": 135, - "./tzl": 136, - "./tzl.js": 136, - "./tzm": 137, - "./tzm-latn": 138, - "./tzm-latn.js": 138, - "./tzm.js": 137, - "./uk": 139, - "./uk.js": 139, - "./uz": 140, - "./uz.js": 140, - "./vi": 141, - "./vi.js": 141, - "./x-pseudo": 142, - "./x-pseudo.js": 142, - "./yo": 143, - "./yo.js": 143, - "./zh-cn": 144, - "./zh-cn.js": 144, - "./zh-hk": 145, - "./zh-hk.js": 145, - "./zh-tw": 146, - "./zh-tw.js": 146 + "./af": 41, + "./af.js": 41, + "./ar": 42, + "./ar-dz": 43, + "./ar-dz.js": 43, + "./ar-ly": 44, + "./ar-ly.js": 44, + "./ar-ma": 45, + "./ar-ma.js": 45, + "./ar-sa": 46, + "./ar-sa.js": 46, + "./ar-tn": 47, + "./ar-tn.js": 47, + "./ar.js": 42, + "./az": 48, + "./az.js": 48, + "./be": 49, + "./be.js": 49, + "./bg": 50, + "./bg.js": 50, + "./bn": 51, + "./bn.js": 51, + "./bo": 52, + "./bo.js": 52, + "./br": 53, + "./br.js": 53, + "./bs": 54, + "./bs.js": 54, + "./ca": 55, + "./ca.js": 55, + "./cs": 56, + "./cs.js": 56, + "./cv": 57, + "./cv.js": 57, + "./cy": 58, + "./cy.js": 58, + "./da": 59, + "./da.js": 59, + "./de": 60, + "./de-at": 61, + "./de-at.js": 61, + "./de.js": 60, + "./dv": 62, + "./dv.js": 62, + "./el": 63, + "./el.js": 63, + "./en-au": 64, + "./en-au.js": 64, + "./en-ca": 65, + "./en-ca.js": 65, + "./en-gb": 66, + "./en-gb.js": 66, + "./en-ie": 67, + "./en-ie.js": 67, + "./en-nz": 68, + "./en-nz.js": 68, + "./eo": 69, + "./eo.js": 69, + "./es": 70, + "./es-do": 71, + "./es-do.js": 71, + "./es.js": 70, + "./et": 72, + "./et.js": 72, + "./eu": 73, + "./eu.js": 73, + "./fa": 74, + "./fa.js": 74, + "./fi": 75, + "./fi.js": 75, + "./fo": 76, + "./fo.js": 76, + "./fr": 77, + "./fr-ca": 78, + "./fr-ca.js": 78, + "./fr-ch": 79, + "./fr-ch.js": 79, + "./fr.js": 77, + "./fy": 80, + "./fy.js": 80, + "./gd": 81, + "./gd.js": 81, + "./gl": 82, + "./gl.js": 82, + "./he": 83, + "./he.js": 83, + "./hi": 84, + "./hi.js": 84, + "./hr": 85, + "./hr.js": 85, + "./hu": 86, + "./hu.js": 86, + "./hy-am": 87, + "./hy-am.js": 87, + "./id": 88, + "./id.js": 88, + "./is": 89, + "./is.js": 89, + "./it": 90, + "./it.js": 90, + "./ja": 91, + "./ja.js": 91, + "./jv": 92, + "./jv.js": 92, + "./ka": 93, + "./ka.js": 93, + "./kk": 94, + "./kk.js": 94, + "./km": 95, + "./km.js": 95, + "./ko": 96, + "./ko.js": 96, + "./ky": 97, + "./ky.js": 97, + "./lb": 98, + "./lb.js": 98, + "./lo": 99, + "./lo.js": 99, + "./lt": 100, + "./lt.js": 100, + "./lv": 101, + "./lv.js": 101, + "./me": 102, + "./me.js": 102, + "./mi": 103, + "./mi.js": 103, + "./mk": 104, + "./mk.js": 104, + "./ml": 105, + "./ml.js": 105, + "./mr": 106, + "./mr.js": 106, + "./ms": 107, + "./ms-my": 108, + "./ms-my.js": 108, + "./ms.js": 107, + "./my": 109, + "./my.js": 109, + "./nb": 110, + "./nb.js": 110, + "./ne": 111, + "./ne.js": 111, + "./nl": 112, + "./nl-be": 113, + "./nl-be.js": 113, + "./nl.js": 112, + "./nn": 114, + "./nn.js": 114, + "./pa-in": 115, + "./pa-in.js": 115, + "./pl": 116, + "./pl.js": 116, + "./pt": 117, + "./pt-br": 118, + "./pt-br.js": 118, + "./pt.js": 117, + "./ro": 119, + "./ro.js": 119, + "./ru": 120, + "./ru.js": 120, + "./se": 121, + "./se.js": 121, + "./si": 122, + "./si.js": 122, + "./sk": 123, + "./sk.js": 123, + "./sl": 124, + "./sl.js": 124, + "./sq": 125, + "./sq.js": 125, + "./sr": 126, + "./sr-cyrl": 127, + "./sr-cyrl.js": 127, + "./sr.js": 126, + "./ss": 128, + "./ss.js": 128, + "./sv": 129, + "./sv.js": 129, + "./sw": 130, + "./sw.js": 130, + "./ta": 131, + "./ta.js": 131, + "./te": 132, + "./te.js": 132, + "./tet": 133, + "./tet.js": 133, + "./th": 134, + "./th.js": 134, + "./tl-ph": 135, + "./tl-ph.js": 135, + "./tlh": 136, + "./tlh.js": 136, + "./tr": 137, + "./tr.js": 137, + "./tzl": 138, + "./tzl.js": 138, + "./tzm": 139, + "./tzm-latn": 140, + "./tzm-latn.js": 140, + "./tzm.js": 139, + "./uk": 141, + "./uk.js": 141, + "./uz": 142, + "./uz.js": 142, + "./vi": 143, + "./vi.js": 143, + "./x-pseudo": 144, + "./x-pseudo.js": 144, + "./yo": 145, + "./yo.js": 145, + "./zh-cn": 146, + "./zh-cn.js": 146, + "./zh-hk": 147, + "./zh-hk.js": 147, + "./zh-tw": 148, + "./zh-tw.js": 148 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); @@ -20991,11 +21719,11 @@ return /******/ (function(modules) { // webpackBootstrap }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; - webpackContext.id = 38; + webpackContext.id = 40; /***/ }, -/* 39 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21003,7 +21731,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Werner Mollentze : https://github.com/wernerm ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21073,7 +21801,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 40 */ +/* 42 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21083,7 +21811,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : forabi https://github.com/forabi ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21220,7 +21948,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 41 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21228,7 +21956,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Noureddine LOUAHEDJ : https://github.com/noureddineme ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21284,7 +22012,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 42 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21292,7 +22020,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Ali Hmer: https://github.com/kikoanis ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21415,7 +22143,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 43 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21424,7 +22152,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21480,7 +22208,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 44 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21488,7 +22216,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Suhail Alkowaileet : https://github.com/xsoh ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21590,7 +22318,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 45 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21598,7 +22326,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Nader Toukabri : https://github.com/naderio ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21654,7 +22382,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 46 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21662,7 +22390,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : topchiyev : https://github.com/topchiyev ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21764,7 +22492,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 47 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21774,7 +22502,7 @@ return /******/ (function(modules) { // webpackBootstrap //! Author : Menelion Elensúle : https://github.com/Oire ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21903,7 +22631,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 48 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -21911,7 +22639,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Krasen Borisov : https://github.com/kraz ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -21998,7 +22726,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 49 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22006,7 +22734,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Kaushik Gandhi : https://github.com/kaushikgandhi ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22122,7 +22850,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 50 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22130,7 +22858,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Thupten N. Chakrishar : https://github.com/vajradog ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22246,7 +22974,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 51 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22254,7 +22982,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22359,7 +23087,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 52 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22368,7 +23096,7 @@ return /******/ (function(modules) { // webpackBootstrap //! based on (hr) translation by Bojan Marković ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22507,7 +23235,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 53 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22515,7 +23243,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Juan G. Hurtado : https://github.com/juanghurtado ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22593,7 +23321,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 54 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22601,7 +23329,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : petrbela : https://github.com/petrbela ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22770,7 +23498,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 55 */ +/* 57 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22778,7 +23506,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Anatoly Mironov : https://github.com/mirontoli ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22838,7 +23566,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 56 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22847,7 +23575,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : https://github.com/ryangreaves ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22924,7 +23652,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 57 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22932,7 +23660,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Ulrik Nielsen : https://github.com/mrbase ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -22989,7 +23717,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 58 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -22999,7 +23727,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23072,7 +23800,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 59 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23083,7 +23811,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23156,7 +23884,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 60 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23164,7 +23892,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jawish Hameed : https://github.com/jawish ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23261,7 +23989,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 61 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23269,7 +23997,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Aggelos Karalias : https://github.com/mehiel ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23364,7 +24092,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 62 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23372,7 +24100,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jared Morse : https://github.com/jarcoal ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23436,7 +24164,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 63 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23444,7 +24172,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jonathan Abourbih : https://github.com/jonbca ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23504,7 +24232,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 64 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23512,7 +24240,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Chris Gedrim : https://github.com/chrisgedrim ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23576,7 +24304,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 65 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23584,7 +24312,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Chris Cartlidge : https://github.com/chriscartlidge ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23648,7 +24376,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 66 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23656,7 +24384,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Luke McGregor : https://github.com/lukemcgregor ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23720,7 +24448,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 67 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23730,7 +24458,7 @@ return /******/ (function(modules) { // webpackBootstrap //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23798,7 +24526,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 68 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23806,7 +24534,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Julio Napurí : https://github.com/julionc ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23884,14 +24612,14 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 69 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish (Dominican Republic) [es-do] ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -23969,7 +24697,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 70 */ +/* 72 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -23978,7 +24706,7 @@ return /******/ (function(modules) { // webpackBootstrap //! improvements : Illimar Tambek : https://github.com/ragulka ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24054,7 +24782,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 71 */ +/* 73 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24062,7 +24790,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Eneko Illarramendi : https://github.com/eillarra ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24125,7 +24853,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 72 */ +/* 74 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24133,7 +24861,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Ebrahim Byagowi : https://github.com/ebraminio ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24237,7 +24965,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 73 */ +/* 75 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24245,7 +24973,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Tarmo Aidantausta : https://github.com/bleadof ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24349,7 +25077,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 74 */ +/* 76 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24357,7 +25085,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Ragnar Johannesen : https://github.com/ragnar123 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24414,7 +25142,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 75 */ +/* 77 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24422,7 +25150,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : John Fischer : https://github.com/jfroffice ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24483,7 +25211,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 76 */ +/* 78 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24491,7 +25219,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jonathan Abourbih : https://github.com/jonbca ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24548,7 +25276,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 77 */ +/* 79 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24556,7 +25284,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Gaspard Bucher : https://github.com/gaspard ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24617,7 +25345,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 78 */ +/* 80 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24625,7 +25353,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Robin van der Vliet : https://github.com/robin0van0der0v ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24695,7 +25423,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 79 */ +/* 81 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24703,7 +25431,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jon Ashdown : https://github.com/jonashdown ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24776,7 +25504,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 80 */ +/* 82 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24784,7 +25512,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Juan G. Hurtado : https://github.com/juanghurtado ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24858,7 +25586,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 81 */ +/* 83 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24868,7 +25596,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Tal Ater : https://github.com/TalAter ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -24962,7 +25690,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 82 */ +/* 84 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -24970,7 +25698,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Mayank Singhal : https://github.com/mayanksinghal ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25091,7 +25819,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 83 */ +/* 85 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25099,7 +25827,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Bojan Marković : https://github.com/bmarkovic ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25241,7 +25969,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 84 */ +/* 86 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25249,7 +25977,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Adam Brunner : https://github.com/adambrunner ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25355,7 +26083,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 85 */ +/* 87 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25363,7 +26091,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Armendarabyan : https://github.com/armendarabyan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25455,7 +26183,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 86 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25464,7 +26192,7 @@ return /******/ (function(modules) { // webpackBootstrap //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25543,7 +26271,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 87 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25551,7 +26279,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25675,7 +26403,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 88 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25684,7 +26412,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author: Mattia Larentis: https://github.com/nostalgiaz ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25750,7 +26478,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 89 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25758,7 +26486,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : LI Long : https://github.com/baryon ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25831,7 +26559,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 90 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25840,7 +26568,7 @@ return /******/ (function(modules) { // webpackBootstrap //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -25919,7 +26647,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 91 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -25927,7 +26655,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26013,7 +26741,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 92 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26021,7 +26749,7 @@ return /******/ (function(modules) { // webpackBootstrap //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26105,7 +26833,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 93 */ +/* 95 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26113,7 +26841,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Kruy Vanna : https://github.com/kruyvanna ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26168,7 +26896,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 94 */ +/* 96 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26177,7 +26905,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jeeeyul Lee ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26238,7 +26966,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 95 */ +/* 97 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26246,7 +26974,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Chyngyz Arystan uulu : https://github.com/chyngyz ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26331,7 +27059,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 96 */ +/* 98 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26340,7 +27068,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : David Raison : https://github.com/kwisatz ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26473,7 +27201,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 97 */ +/* 99 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26481,7 +27209,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Ryan Hart : https://github.com/ryanhart2 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26548,7 +27276,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 98 */ +/* 100 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26556,7 +27284,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Mindaugas Mozūras : https://github.com/mmozuras ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26670,7 +27398,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 99 */ +/* 101 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26679,7 +27407,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jānis Elmeris : https://github.com/JanisE ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26772,7 +27500,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 100 */ +/* 102 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26780,7 +27508,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Miodrag Nikač : https://github.com/miodragnikac ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26888,7 +27616,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 101 */ +/* 103 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26896,7 +27624,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : John Corrigan : https://github.com/johnideal ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -26957,7 +27685,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 102 */ +/* 104 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -26965,7 +27693,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Borislav Mickov : https://github.com/B0k0 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27052,7 +27780,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 103 */ +/* 105 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27060,7 +27788,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Floyd Pink : https://github.com/floydpink ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27138,7 +27866,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 104 */ +/* 106 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27147,7 +27875,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Vivek Athalye : https://github.com/vnathalye ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27302,7 +28030,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 105 */ +/* 107 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27310,7 +28038,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Weldan Jamili : https://github.com/weldan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27389,7 +28117,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 106 */ +/* 108 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27398,7 +28126,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Weldan Jamili : https://github.com/weldan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27477,7 +28205,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 107 */ +/* 109 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27487,7 +28215,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Tin Aung Lin : https://github.com/thanyawzinmin ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27578,7 +28306,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 108 */ +/* 110 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27587,7 +28315,7 @@ return /******/ (function(modules) { // webpackBootstrap //! Sigurd Gartmann : https://github.com/sigurdga ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27646,7 +28374,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 109 */ +/* 111 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27654,7 +28382,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : suvash : https://github.com/suvash ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27774,7 +28502,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 110 */ +/* 112 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27783,7 +28511,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jacob Middag : https://github.com/middagj ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27865,7 +28593,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 111 */ +/* 113 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27874,7 +28602,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jacob Middag : https://github.com/middagj ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -27956,7 +28684,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 112 */ +/* 114 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -27964,7 +28692,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : https://github.com/mechuwind ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28021,7 +28749,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 113 */ +/* 115 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28029,7 +28757,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28150,7 +28878,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 114 */ +/* 116 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28158,7 +28886,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Rafal Hirsz : https://github.com/evoL ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28260,7 +28988,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 115 */ +/* 117 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28268,7 +28996,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jefferson : https://github.com/jalex79 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28330,7 +29058,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 116 */ +/* 118 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28338,7 +29066,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28396,7 +29124,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 117 */ +/* 119 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28405,7 +29133,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Valentin Agachi : https://github.com/avaly ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28476,7 +29204,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 118 */ +/* 120 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28486,7 +29214,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Коренберг Марк : https://github.com/socketpair ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28664,7 +29392,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 119 */ +/* 121 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28672,7 +29400,7 @@ return /******/ (function(modules) { // webpackBootstrap //! authors : Bård Rolstad Henriksen : https://github.com/karamell ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28730,7 +29458,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 120 */ +/* 122 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28738,7 +29466,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Sampath Sitinamaluwa : https://github.com/sampathsris ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28806,7 +29534,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 121 */ +/* 123 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28815,7 +29543,7 @@ return /******/ (function(modules) { // webpackBootstrap //! based on work of petrbela : https://github.com/petrbela ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -28961,7 +29689,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 122 */ +/* 124 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -28969,7 +29697,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Robert Sedovšek : https://github.com/sedovsek ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29128,7 +29856,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 123 */ +/* 125 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29138,7 +29866,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Oerd Cukalla : https://github.com/oerd ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29203,7 +29931,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 124 */ +/* 126 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29211,7 +29939,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Milan Janačković : https://github.com/milan-j ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29318,7 +30046,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 125 */ +/* 127 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29326,7 +30054,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Milan Janačković : https://github.com/milan-j ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29433,7 +30161,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 126 */ +/* 128 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29441,7 +30169,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Nicolai Davies : https://github.com/nicolaidavies ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29527,7 +30255,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 127 */ +/* 129 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29535,7 +30263,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Jens Alm : https://github.com/ulmus ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29601,7 +30329,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 128 */ +/* 130 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29609,7 +30337,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Fahad Kassim : https://github.com/fadsel ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29665,7 +30393,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 129 */ +/* 131 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29673,7 +30401,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29800,7 +30528,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 130 */ +/* 132 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29808,7 +30536,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Krishna Chaitanya Thota : https://github.com/kcthota ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29894,7 +30622,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 131 */ +/* 133 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29903,7 +30631,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Onorio De J. Afonso : https://github.com/marobo ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -29967,7 +30695,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 132 */ +/* 134 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -29975,7 +30703,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Kridsada Thanabulpong : https://github.com/sirn ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30039,7 +30767,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 133 */ +/* 135 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30047,7 +30775,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Dan Hagman : https://github.com/hagmandan ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30106,7 +30834,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 134 */ +/* 136 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30114,7 +30842,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Dominika Kruk : https://github.com/amaranthrose ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30231,7 +30959,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 135 */ +/* 137 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30240,7 +30968,7 @@ return /******/ (function(modules) { // webpackBootstrap //! Burak Yiğit Kaya: https://github.com/BYK ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30326,7 +31054,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 136 */ +/* 138 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30335,7 +31063,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Iustì Canun ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30422,7 +31150,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 137 */ +/* 139 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30430,7 +31158,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30485,7 +31213,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 138 */ +/* 140 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30493,7 +31221,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30548,7 +31276,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 139 */ +/* 141 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30557,7 +31285,7 @@ return /******/ (function(modules) { // webpackBootstrap //! Author : Menelion Elensúle : https://github.com/Oire ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30699,7 +31427,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 140 */ +/* 142 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30707,7 +31435,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Sardor Muminov : https://github.com/muminoff ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30762,7 +31490,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 141 */ +/* 143 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30770,7 +31498,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Bang Nguyen : https://github.com/bangnk ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30846,7 +31574,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 142 */ +/* 144 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30854,7 +31582,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Andrew Hood : https://github.com/andrewhood125 ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30919,7 +31647,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 143 */ +/* 145 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30927,7 +31655,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -30984,7 +31712,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 144 */ +/* 146 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -30993,7 +31721,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Zeno Zeng : https://github.com/zenozeng ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -31116,7 +31844,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 145 */ +/* 147 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -31126,7 +31854,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Konstantin : https://github.com/skfd ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -31226,7 +31954,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 146 */ +/* 148 */ /***/ function(module, exports, __webpack_require__) { //! moment.js locale configuration @@ -31235,7 +31963,7 @@ return /******/ (function(modules) { // webpackBootstrap //! author : Chris Lam : https://github.com/hehachris ;(function (global, factory) { - true ? factory(__webpack_require__(36)) : + true ? factory(__webpack_require__(38)) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; @@ -31335,7 +32063,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 147 */ +/* 149 */ /***/ function(module, exports) { 'use strict'; @@ -31375,21 +32103,33 @@ return /******/ (function(modules) { // webpackBootstrap initialize: function(chart, datasetIndex) { Chart.DatasetController.prototype.initialize.call(this, chart, datasetIndex); + var me = this; + var meta = me.getMeta(); + var dataset = me.getDataset(); + + meta.stack = dataset.stack; // Use this to indicate that this is a bar dataset. - this.getMeta().bar = true; + meta.bar = true; }, - // Get the number of datasets that display bars. We use this to correctly calculate the bar width - getBarCount: function() { + // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible + getStackCount: function() { var me = this; - var barCount = 0; + var meta = me.getMeta(); + var yScale = me.getScaleForId(meta.yAxisID); + + var stacks = []; helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) { - var meta = me.chart.getDatasetMeta(datasetIndex); - if (meta.bar && me.chart.isDatasetVisible(datasetIndex)) { - ++barCount; + var dsMeta = me.chart.getDatasetMeta(datasetIndex); + if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) && + (yScale.options.stacked === false || + (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) || + (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) { + stacks.push(dsMeta.stack); } }, me); - return barCount; + + return stacks.length; }, update: function(reset) { @@ -31414,7 +32154,7 @@ return /******/ (function(modules) { // webpackBootstrap rectangle._datasetIndex = me.index; rectangle._index = index; - var ruler = me.getRuler(index); + var ruler = me.getRuler(index); // The index argument for compatible rectangle._model = { x: me.calculateBarX(index, me.index, ruler), y: reset ? scaleBase : me.calculateBarY(index, me.index), @@ -31424,6 +32164,7 @@ return /******/ (function(modules) { // webpackBootstrap datasetLabel: dataset.label, // Appearance + horizontal: false, base: reset ? scaleBase : me.calculateBarBase(me.index, index), width: me.calculateBarWidth(ruler), backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor), @@ -31439,9 +32180,11 @@ return /******/ (function(modules) { // webpackBootstrap var me = this; var meta = me.getMeta(); var yScale = me.getScaleForId(meta.yAxisID); - var base = 0; + var base = yScale.getBaseValue(); + var original = base; - if (yScale.options.stacked) { + if ((yScale.options.stacked === true) || + (yScale.options.stacked === undefined && meta.stack !== undefined)) { var chart = me.chart; var datasets = chart.data.datasets; var value = Number(datasets[datasetIndex].data[index]); @@ -31449,9 +32192,10 @@ return /******/ (function(modules) { // webpackBootstrap for (var i = 0; i < datasetIndex; i++) { var currentDs = datasets[i]; var currentDsMeta = chart.getDatasetMeta(i); - if (currentDsMeta.bar && currentDsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) { + if (currentDsMeta.bar && currentDsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i) && + meta.stack === currentDsMeta.stack) { var currentVal = Number(currentDs.data[index]); - base += value < 0 ? Math.min(currentVal, 0) : Math.max(currentVal, 0); + base += value < 0 ? Math.min(currentVal, original) : Math.max(currentVal, original); } } @@ -31461,34 +32205,22 @@ return /******/ (function(modules) { // webpackBootstrap return yScale.getBasePixel(); }, - getRuler: function(index) { + getRuler: function() { var me = this; var meta = me.getMeta(); var xScale = me.getScaleForId(meta.xAxisID); - var datasetCount = me.getBarCount(); + var stackCount = me.getStackCount(); - var tickWidth; - - if (xScale.options.type === 'category') { - tickWidth = xScale.getPixelForTick(index + 1) - xScale.getPixelForTick(index); - } else { - // Average width - tickWidth = xScale.width / xScale.ticks.length; - } + var tickWidth = xScale.width / xScale.ticks.length; var categoryWidth = tickWidth * xScale.options.categoryPercentage; var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2; - var fullBarWidth = categoryWidth / datasetCount; - - if (xScale.ticks.length !== me.chart.data.labels.length) { - var perc = xScale.ticks.length / me.chart.data.labels.length; - fullBarWidth = fullBarWidth * perc; - } + var fullBarWidth = categoryWidth / stackCount; var barWidth = fullBarWidth * xScale.options.barPercentage; var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage); return { - datasetCount: datasetCount, + stackCount: stackCount, tickWidth: tickWidth, categoryWidth: categoryWidth, categorySpacing: categorySpacing, @@ -31499,46 +32231,50 @@ return /******/ (function(modules) { // webpackBootstrap }, calculateBarWidth: function(ruler) { - var xScale = this.getScaleForId(this.getMeta().xAxisID); + var me = this; + var meta = me.getMeta(); + var xScale = me.getScaleForId(meta.xAxisID); if (xScale.options.barThickness) { return xScale.options.barThickness; } - return xScale.options.stacked ? ruler.categoryWidth : ruler.barWidth; + return ruler.barWidth; }, - // Get bar index from the given dataset index accounting for the fact that not all bars are visible - getBarIndex: function(datasetIndex) { - var barIndex = 0; - var meta, j; + // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible + getStackIndex: function(datasetIndex) { + var me = this; + var meta = me.chart.getDatasetMeta(datasetIndex); + var yScale = me.getScaleForId(meta.yAxisID); + var dsMeta, j; + var stacks = [meta.stack]; for (j = 0; j < datasetIndex; ++j) { - meta = this.chart.getDatasetMeta(j); - if (meta.bar && this.chart.isDatasetVisible(j)) { - ++barIndex; + dsMeta = this.chart.getDatasetMeta(j); + if (dsMeta.bar && this.chart.isDatasetVisible(j) && + (yScale.options.stacked === false || + (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) || + (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) { + stacks.push(dsMeta.stack); } } - return barIndex; + return stacks.length - 1; }, calculateBarX: function(index, datasetIndex, ruler) { var me = this; var meta = me.getMeta(); var xScale = me.getScaleForId(meta.xAxisID); - var barIndex = me.getBarIndex(datasetIndex); + var stackIndex = me.getStackIndex(datasetIndex); var leftTick = xScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo); leftTick -= me.chart.isCombo ? (ruler.tickWidth / 2) : 0; - if (xScale.options.stacked) { - return leftTick + (ruler.categoryWidth / 2) + ruler.categorySpacing; - } - return leftTick + (ruler.barWidth / 2) + ruler.categorySpacing + - (ruler.barWidth * barIndex) + + (ruler.barWidth * stackIndex) + (ruler.barSpacing / 2) + - (ruler.barSpacing * barIndex); + (ruler.barSpacing * stackIndex); }, calculateBarY: function(index, datasetIndex) { @@ -31547,15 +32283,17 @@ return /******/ (function(modules) { // webpackBootstrap var yScale = me.getScaleForId(meta.yAxisID); var value = Number(me.getDataset().data[index]); - if (yScale.options.stacked) { - - var sumPos = 0, - sumNeg = 0; + if (yScale.options.stacked || + (yScale.options.stacked === undefined && meta.stack !== undefined)) { + var base = yScale.getBaseValue(); + var sumPos = base, + sumNeg = base; for (var i = 0; i < datasetIndex; i++) { var ds = me.chart.data.datasets[i]; var dsMeta = me.chart.getDatasetMeta(i); - if (dsMeta.bar && dsMeta.yAxisID === yScale.id && me.chart.isDatasetVisible(i)) { + if (dsMeta.bar && dsMeta.yAxisID === yScale.id && me.chart.isDatasetVisible(i) && + meta.stack === dsMeta.stack) { var stackedVal = Number(ds.data[index]); if (stackedVal < 0) { sumNeg += stackedVal || 0; @@ -31581,12 +32319,14 @@ return /******/ (function(modules) { // webpackBootstrap var dataset = me.getDataset(); var i, len; + Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea); for (i = 0, len = metaData.length; i < len; ++i) { var d = dataset.data[i]; if (d !== null && d !== undefined && !isNaN(d)) { metaData[i].transition(easingDecimal).draw(); } } + Chart.canvasHelpers.unclipArea(me.chart.chart.ctx); }, setHoverStyle: function(rectangle) { @@ -31671,6 +32411,27 @@ return /******/ (function(modules) { // webpackBootstrap }; Chart.controllers.horizontalBar = Chart.controllers.bar.extend({ + + // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible + getStackCount: function() { + var me = this; + var meta = me.getMeta(); + var xScale = me.getScaleForId(meta.xAxisID); + + var stacks = []; + helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) { + var dsMeta = me.chart.getDatasetMeta(datasetIndex); + if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) && + (xScale.options.stacked === false || + (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) || + (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) { + stacks.push(dsMeta.stack); + } + }, me); + + return stacks.length; + }, + updateElement: function(rectangle, index, reset) { var me = this; var meta = me.getMeta(); @@ -31686,7 +32447,7 @@ return /******/ (function(modules) { // webpackBootstrap rectangle._datasetIndex = me.index; rectangle._index = index; - var ruler = me.getRuler(index); + var ruler = me.getRuler(index); // The index argument for compatible rectangle._model = { x: reset ? scaleBase : me.calculateBarX(index, me.index), y: me.calculateBarY(index, me.index, ruler), @@ -31696,6 +32457,7 @@ return /******/ (function(modules) { // webpackBootstrap datasetLabel: dataset.label, // Appearance + horizontal: true, base: reset ? scaleBase : me.calculateBarBase(me.index, index), height: me.calculateBarHeight(ruler), backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor), @@ -31703,62 +32465,6 @@ return /******/ (function(modules) { // webpackBootstrap borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor), borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth) }; - rectangle.draw = function() { - var ctx = this._chart.ctx; - var vm = this._view; - - var halfHeight = vm.height / 2, - topY = vm.y - halfHeight, - bottomY = vm.y + halfHeight, - right = vm.base - (vm.base - vm.x), - halfStroke = vm.borderWidth / 2; - - // Canvas doesn't allow us to stroke inside the width so we can - // adjust the sizes to fit if we're setting a stroke on the line - if (vm.borderWidth) { - topY += halfStroke; - bottomY -= halfStroke; - right += halfStroke; - } - - ctx.beginPath(); - - ctx.fillStyle = vm.backgroundColor; - ctx.strokeStyle = vm.borderColor; - ctx.lineWidth = vm.borderWidth; - - // Corner points, from bottom-left to bottom-right clockwise - // | 1 2 | - // | 0 3 | - var corners = [ - [vm.base, bottomY], - [vm.base, topY], - [right, topY], - [right, bottomY] - ]; - - // Find first (starting) corner with fallback to 'bottom' - var borders = ['bottom', 'left', 'top', 'right']; - var startCorner = borders.indexOf(vm.borderSkipped, 0); - if (startCorner === -1) { - startCorner = 0; - } - - function cornerAt(cornerIndex) { - return corners[(startCorner + cornerIndex) % 4]; - } - - // Draw rectangle from 'startCorner' - ctx.moveTo.apply(ctx, cornerAt(0)); - for (var i = 1; i < 4; i++) { - ctx.lineTo.apply(ctx, cornerAt(i)); - } - - ctx.fill(); - if (vm.borderWidth) { - ctx.stroke(); - } - }; rectangle.pivot(); }, @@ -31767,9 +32473,11 @@ return /******/ (function(modules) { // webpackBootstrap var me = this; var meta = me.getMeta(); var xScale = me.getScaleForId(meta.xAxisID); - var base = 0; + var base = xScale.getBaseValue(); + var originalBase = base; - if (xScale.options.stacked) { + if (xScale.options.stacked || + (xScale.options.stacked === undefined && meta.stack !== undefined)) { var chart = me.chart; var datasets = chart.data.datasets; var value = Number(datasets[datasetIndex].data[index]); @@ -31777,9 +32485,10 @@ return /******/ (function(modules) { // webpackBootstrap for (var i = 0; i < datasetIndex; i++) { var currentDs = datasets[i]; var currentDsMeta = chart.getDatasetMeta(i); - if (currentDsMeta.bar && currentDsMeta.xAxisID === xScale.id && chart.isDatasetVisible(i)) { + if (currentDsMeta.bar && currentDsMeta.xAxisID === xScale.id && chart.isDatasetVisible(i) && + meta.stack === currentDsMeta.stack) { var currentVal = Number(currentDs.data[index]); - base += value < 0 ? Math.min(currentVal, 0) : Math.max(currentVal, 0); + base += value < 0 ? Math.min(currentVal, originalBase) : Math.max(currentVal, originalBase); } } @@ -31789,33 +32498,22 @@ return /******/ (function(modules) { // webpackBootstrap return xScale.getBasePixel(); }, - getRuler: function(index) { + getRuler: function() { var me = this; var meta = me.getMeta(); var yScale = me.getScaleForId(meta.yAxisID); - var datasetCount = me.getBarCount(); + var stackCount = me.getStackCount(); - var tickHeight; - if (yScale.options.type === 'category') { - tickHeight = yScale.getPixelForTick(index + 1) - yScale.getPixelForTick(index); - } else { - // Average width - tickHeight = yScale.width / yScale.ticks.length; - } + var tickHeight = yScale.height / yScale.ticks.length; var categoryHeight = tickHeight * yScale.options.categoryPercentage; var categorySpacing = (tickHeight - (tickHeight * yScale.options.categoryPercentage)) / 2; - var fullBarHeight = categoryHeight / datasetCount; - - if (yScale.ticks.length !== me.chart.data.labels.length) { - var perc = yScale.ticks.length / me.chart.data.labels.length; - fullBarHeight = fullBarHeight * perc; - } + var fullBarHeight = categoryHeight / stackCount; var barHeight = fullBarHeight * yScale.options.barPercentage; var barSpacing = fullBarHeight - (fullBarHeight * yScale.options.barPercentage); return { - datasetCount: datasetCount, + stackCount: stackCount, tickHeight: tickHeight, categoryHeight: categoryHeight, categorySpacing: categorySpacing, @@ -31827,11 +32525,33 @@ return /******/ (function(modules) { // webpackBootstrap calculateBarHeight: function(ruler) { var me = this; - var yScale = me.getScaleForId(me.getMeta().yAxisID); + var meta = me.getMeta(); + var yScale = me.getScaleForId(meta.yAxisID); if (yScale.options.barThickness) { return yScale.options.barThickness; } - return yScale.options.stacked ? ruler.categoryHeight : ruler.barHeight; + return ruler.barHeight; + }, + + // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible + getStackIndex: function(datasetIndex) { + var me = this; + var meta = me.chart.getDatasetMeta(datasetIndex); + var xScale = me.getScaleForId(meta.xAxisID); + var dsMeta, j; + var stacks = [meta.stack]; + + for (j = 0; j < datasetIndex; ++j) { + dsMeta = this.chart.getDatasetMeta(j); + if (dsMeta.bar && this.chart.isDatasetVisible(j) && + (xScale.options.stacked === false || + (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) || + (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) { + stacks.push(dsMeta.stack); + } + } + + return stacks.length - 1; }, calculateBarX: function(index, datasetIndex) { @@ -31840,15 +32560,17 @@ return /******/ (function(modules) { // webpackBootstrap var xScale = me.getScaleForId(meta.xAxisID); var value = Number(me.getDataset().data[index]); - if (xScale.options.stacked) { - - var sumPos = 0, - sumNeg = 0; + if (xScale.options.stacked || + (xScale.options.stacked === undefined && meta.stack !== undefined)) { + var base = xScale.getBaseValue(); + var sumPos = base, + sumNeg = base; for (var i = 0; i < datasetIndex; i++) { var ds = me.chart.data.datasets[i]; var dsMeta = me.chart.getDatasetMeta(i); - if (dsMeta.bar && dsMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i)) { + if (dsMeta.bar && dsMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i) && + meta.stack === dsMeta.stack) { var stackedVal = Number(ds.data[index]); if (stackedVal < 0) { sumNeg += stackedVal || 0; @@ -31871,27 +32593,23 @@ return /******/ (function(modules) { // webpackBootstrap var me = this; var meta = me.getMeta(); var yScale = me.getScaleForId(meta.yAxisID); - var barIndex = me.getBarIndex(datasetIndex); + var stackIndex = me.getStackIndex(datasetIndex); var topTick = yScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo); topTick -= me.chart.isCombo ? (ruler.tickHeight / 2) : 0; - if (yScale.options.stacked) { - return topTick + (ruler.categoryHeight / 2) + ruler.categorySpacing; - } - return topTick + (ruler.barHeight / 2) + ruler.categorySpacing + - (ruler.barHeight * barIndex) + + (ruler.barHeight * stackIndex) + (ruler.barSpacing / 2) + - (ruler.barSpacing * barIndex); + (ruler.barSpacing * stackIndex); } }); }; /***/ }, -/* 148 */ +/* 150 */ /***/ function(module, exports) { 'use strict'; @@ -32019,7 +32737,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 149 */ +/* 151 */ /***/ function(module, exports) { 'use strict'; @@ -32207,7 +32925,7 @@ return /******/ (function(modules) { // webpackBootstrap chart.borderWidth = me.getMaxBorderWidth(meta.data); chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0); - chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 1, 0); + chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0); chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount(); chart.offsetX = offset.x * chart.outerRadius; chart.offsetY = offset.y * chart.outerRadius; @@ -32215,7 +32933,7 @@ return /******/ (function(modules) { // webpackBootstrap meta.total = me.calculateTotal(); me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index)); - me.innerRadius = me.outerRadius - chart.radiusLength; + me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0); helpers.each(meta.data, function(arc, index) { me.updateElement(arc, index, reset); @@ -32328,7 +33046,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 150 */ +/* 152 */ /***/ function(module, exports) { 'use strict'; @@ -32472,11 +33190,11 @@ return /******/ (function(modules) { // webpackBootstrap var dataset = this.getDataset(); var custom = point.custom || {}; - if (custom.borderWidth) { + if (!isNaN(custom.borderWidth)) { borderWidth = custom.borderWidth; - } else if (dataset.pointBorderWidth) { + } else if (!isNaN(dataset.pointBorderWidth)) { borderWidth = helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth); - } else if (dataset.borderWidth) { + } else if (!isNaN(dataset.borderWidth)) { borderWidth = dataset.borderWidth; } @@ -32625,14 +33343,16 @@ return /******/ (function(modules) { // webpackBootstrap points[i].transition(easingDecimal); } + Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea); // Transition and Draw the line if (lineEnabled(me.getDataset(), me.chart.options)) { meta.dataset.transition(easingDecimal).draw(); } + Chart.canvasHelpers.unclipArea(me.chart.chart.ctx); // Draw the points for (i=0, ilen=points.length; i", "repository": {