/* * @license * chartjs-plugin-deferred * http://chartjs.org/ * Version: 1.0.0 * * Copyright 2018 Simon Brunel * Released under the MIT license * https://github.com/chartjs/chartjs-plugin-deferred/blob/master/LICENSE.md */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],t):t(e.Chart)}(this,function(e){"use strict";var t=(e=e&&e.hasOwnProperty("default")?e.default:e).helpers,n="$chartjs_deferred",r="$deferred";function a(e,n){n?window.setTimeout(e,n):t.requestAnimFrame.call(window,e)}function i(e,t){var n=parseInt(e,10);return isNaN(n)?0:"string"==typeof e&&-1!==e.indexOf("%")?n/100*t:n}function o(e){var t=e[r].options,n=e.chart.canvas;if(!n||null===n.offsetParent)return!1;var a=n.getBoundingClientRect(),o=i(t.yOffset||0,a.height),d=i(t.xOffset||0,a.width);return a.right-d>=0&&a.bottom-o>=0&&a.left+d<=window.innerWidth&&a.top+o<=window.innerHeight}function d(e){var t=e.target[n];t.ticking||(t.ticking=!0,a(function(){var e,n,a=t.charts.slice(),i=a.length;for(n=0;n0)return n.delayed=!0,a(function(){n.delayed=!1,e.update()},t.delay),!1}if(n.delayed)return!1},destroy:function(e){l(e)}})});