1/**! 2 * easyPieChart 3 * Lightweight plugin to render simple, animated and retina optimized pie charts 4 * 5 * @license Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 6 * @author Robert Fleischmann <[email protected]> (http://robert-fleischmann.de) 7 * @version 2.1.3 8 **/ 9! function (a, b) { 10 "object" == typeof exports ? module.exports = b(require("jquery")) : "function" == typeof define && define.amd ? define("EasyPieChart", ["jquery"], b) : b(a.jQuery) 11}(this, function (a) { 12 var b = function (a, b) { 13 var c, d = document.createElement("canvas"); 14 "undefined" != typeof G_vmlCanvasManager && G_vmlCanvasManager.initElement(d); 15 var e = d.getContext("2d"); 16 d.width = d.height = b.size, a.appendChild(d); 17 var f = 1; 18 window.devicePixelRatio > 1 && (f = window.devicePixelRatio, d.style.width = d.style.height = [b.size, "px"].join(""), d.width = d.height = b.size * f, e.scale(f, f)), e.translate(b.size / 2, b.size / 2), e.rotate((-0.5 + b.rotate / 180) * Math.PI); 19 var g = (b.size - b.lineWidth) / 2; 20 b.scaleColor && b.scaleLength && (g -= b.scaleLength + 2), Date.now = Date.now || function () { 21 return +new Date 22 }; 23 var h = function (a, b, c) { 24 c = Math.min(Math.max(-1, c || 0), 1); 25 var d = 0 >= c ? !0 : !1; 26 e.beginPath(), e.arc(0, 0, g, 0, 2 * Math.PI * c, d), e.strokeStyle = a, e.lineWidth = b, e.stroke() 27 }, i = function () { 28 var a, c, d = 24; 29 e.lineWidth = 1, e.fillStyle = b.scaleColor, e.save(); 30 for (var d = 24; d > 0; --d) 0 === d % 6 ? (c = b.scaleLength, a = 0) : (c = .6 * b.scaleLength, a = b.scaleLength - c), e.fillRect(-b.size / 2 + a, 0, c, 1), e.rotate(Math.PI / 12); 31 e.restore() 32 }, j = function () { 33 return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (a) { 34 window.setTimeout(a, 1e3 / 60) 35 } 36 }(), 37 k = function () { 38 b.scaleColor && i(), b.trackColor && h(b.trackColor, b.lineWidth, 1) 39 }; 40 this.clear = function () { 41 e.clearRect(b.size / -2, b.size / -2, b.size, b.size) 42 }, this.draw = function (a) { 43 b.scaleColor || b.trackColor ? e.getImageData && e.putImageData ? c ? e.putImageData(c, 0, 0) : (k(), c = e.getImageData(0, 0, b.size * f, b.size * f)) : (this.clear(), k()) : this.clear(), e.lineCap = b.lineCap; 44 var d; 45 d = "function" == typeof b.barColor ? b.barColor(a) : b.barColor, h(d, b.lineWidth, a / 100) 46 }.bind(this), this.animate = function (a, c) { 47 var d = Date.now(); 48 b.onStart(a, c); 49 var e = function () { 50 var f = Math.min(Date.now() - d, b.animate), 51 g = b.easing(this, f, a, c - a, b.animate); 52 this.draw(g), b.onStep(a, c, g), f >= b.animate ? b.onStop(a, c) : j(e) 53 }.bind(this); 54 j(e) 55 }.bind(this) 56 }, c = function (a, c) { 57 var d = { 58 barColor: "#2b96cc", 59 trackColor: "#ecece9", 60 //scaleColor: "#dfe0e0", 61 scaleLength: 5, 62 //lineCap: "round", 63 lineWidth: 20, 64 size: 181, 65 rotate: 0, 66 animate: 1e3, 67 easing: function (a, b, c, d, e) { 68 return b /= e / 2, 1 > b ? d / 2 * b * b + c : -d / 2 * (--b * (b - 2) - 1) + c 69 }, 70 onStart: function () {}, 71 onStep: function () {}, 72 onStop: function () {} 73 }; 74 if ("undefined" != typeof b) d.renderer = b; 75 else { 76 if ("undefined" == typeof SVGRenderer) throw new Error("Please load either the SVG- or the CanvasRenderer"); 77 d.renderer = SVGRenderer 78 } 79 var e = {}, f = 0, 80 g = function () { 81 this.el = a, this.options = e; 82 for (var b in d) d.hasOwnProperty(b) && (e[b] = c && "undefined" != typeof c[b] ? c[b] : d[b], "function" == typeof e[b] && (e[b] = e[b].bind(this))); 83 e.easing = "string" == typeof e.easing && "undefined" != typeof jQuery && jQuery.isFunction(jQuery.easing[e.easing]) ? jQuery.easing[e.easing] : d.easing, this.renderer = new e.renderer(a, e), this.renderer.draw(f), a.dataset && a.dataset.percent ? this.update(parseFloat(a.dataset.percent)) : a.getAttribute && a.getAttribute("data-percent") && this.update(parseFloat(a.getAttribute("data-percent"))) 84 }.bind(this); 85 this.update = function (a) { 86 return a = parseFloat(a), e.animate ? this.renderer.animate(f, a) : this.renderer.draw(a), f = a, this 87 }.bind(this), g() 88 }; 89 a.fn.easyPieChart = function (b) { 90 return this.each(function () { 91 var d; 92 a.data(this, "easyPieChart") || (d = a.extend({}, b, a(this).data()), a.data(this, "easyPieChart", new c(this, d))) 93 }) 94 } 95});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.