From a641e715043ab032815014b7f6e858971ad95d06 Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Tue, 25 Oct 2016 13:25:26 +0800 Subject: [PATCH 1/4] Add options.scaleDensity & options.scaleBulge --- Readme.md | 16 +++++++++++++--- dist/angular.easypiechart.js | 10 ++++++---- dist/angular.easypiechart.min.js | 2 +- dist/easypiechart.js | 8 +++++--- dist/easypiechart.min.js | 2 +- dist/jquery.easypiechart.js | 10 ++++++---- dist/jquery.easypiechart.min.js | 2 +- docs/get-started.md | 21 ++++++++++++++++++--- docs/options.md | 10 ++++++++++ easy-pie-chart.sublime-project | 11 +++++++++++ easy-pie-chart.sublime-workspace | 1 + src/renderer/canvas.js | 8 +++++--- 12 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 easy-pie-chart.sublime-project create mode 100644 easy-pie-chart.sublime-workspace diff --git a/Readme.md b/Readme.md index f673944..3943713 100644 --- a/Readme.md +++ b/Readme.md @@ -127,6 +127,16 @@ You can pass these options to the initialize function to set a custom look and f 5 Length of the scale lines (reduces the radius of the chart). + + scaleDensity + 24 + Density of the scale lines 360/density. + + + scaleBulge + 0.6 + Bulge offset length relative to options.scaleLength each 6 scale lines. + lineCap round @@ -221,8 +231,8 @@ chart.enableAnimation(); ```javascript new EasyPieChart(element, { barColor: function(percent) { - var ctx = this.renderer.getCtx(); - var canvas = this.renderer.getCanvas(); + var ctx = this.renderer.ctx(); + var canvas = this.renderer.canvas(); var gradient = ctx.createLinearGradient(0,0,canvas.width,0); gradient.addColorStop(0, "#ffe57e"); gradient.addColorStop(1, "#de5900"); @@ -265,4 +275,4 @@ Thanks to [Rafal Bromirski](http://www.paranoida.com/) for designing [this dribb ## Copyright -Copyright (c) 2015 Robert Fleischmann, contributors. Released under the MIT, GPL licenses +Copyright (c) 2016 Robert Fleischmann, contributors. Released under the MIT, GPL licenses diff --git a/dist/angular.easypiechart.js b/dist/angular.easypiechart.js index b071510..6b8fbfe 100644 --- a/dist/angular.easypiechart.js +++ b/dist/angular.easypiechart.js @@ -19,7 +19,7 @@ // like Node. module.exports = factory(require("angular")); } else { - factory(angular); + factory(root["angular"]); } }(this, function (angular) { @@ -141,21 +141,23 @@ var CanvasRenderer = function(el, options) { var drawScale = function() { var offset; var length; + var density = options.scaleDensity || 24; + var bulge = options.scaleBulge || 0.6; ctx.lineWidth = 1; ctx.fillStyle = options.scaleColor; ctx.save(); - for (var i = 24; i > 0; --i) { + for (var i = density; i > 0; --i) { if (i % 6 === 0) { length = options.scaleLength; offset = 0; } else { - length = options.scaleLength * 0.6; + length = options.scaleLength * bulge; offset = options.scaleLength - length; } ctx.fillRect(-options.size/2 + offset, 0, length, 1); - ctx.rotate(Math.PI / 12); + ctx.rotate(Math.PI / (density / 2)); } ctx.restore(); }; diff --git a/dist/angular.easypiechart.min.js b/dist/angular.easypiechart.min.js index 4e6bcea..4c3d3f4 100644 --- a/dist/angular.easypiechart.min.js +++ b/dist/angular.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(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);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(a.angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file diff --git a/dist/easypiechart.js b/dist/easypiechart.js index 7ffbe0d..87e441c 100644 --- a/dist/easypiechart.js +++ b/dist/easypiechart.js @@ -92,21 +92,23 @@ var CanvasRenderer = function(el, options) { var drawScale = function() { var offset; var length; + var density = options.scaleDensity || 24; + var bulge = options.scaleBulge || 0.6; ctx.lineWidth = 1; ctx.fillStyle = options.scaleColor; ctx.save(); - for (var i = 24; i > 0; --i) { + for (var i = density; i > 0; --i) { if (i % 6 === 0) { length = options.scaleLength; offset = 0; } else { - length = options.scaleLength * 0.6; + length = options.scaleLength * bulge; offset = options.scaleLength - length; } ctx.fillRect(-options.size/2 + offset, 0, length, 1); - ctx.rotate(Math.PI / 12); + ctx.rotate(Math.PI / (density / 2)); } ctx.restore(); }; diff --git a/dist/easypiechart.min.js b/dist/easypiechart.min.js index 4c638e7..e90ba91 100644 --- a/dist/easypiechart.min.js +++ b/dist/easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(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);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file diff --git a/dist/jquery.easypiechart.js b/dist/jquery.easypiechart.js index 5ac3dc1..bfcd66b 100644 --- a/dist/jquery.easypiechart.js +++ b/dist/jquery.easypiechart.js @@ -19,7 +19,7 @@ // like Node. module.exports = factory(require("jquery")); } else { - factory(jQuery); + factory(root["jQuery"]); } }(this, function ($) { @@ -92,21 +92,23 @@ var CanvasRenderer = function(el, options) { var drawScale = function() { var offset; var length; + var density = options.scaleDensity || 24; + var bulge = options.scaleBulge || 0.6; ctx.lineWidth = 1; ctx.fillStyle = options.scaleColor; ctx.save(); - for (var i = 24; i > 0; --i) { + for (var i = density; i > 0; --i) { if (i % 6 === 0) { length = options.scaleLength; offset = 0; } else { - length = options.scaleLength * 0.6; + length = options.scaleLength * bulge; offset = options.scaleLength - length; } ctx.fillRect(-options.size/2 + offset, 0, length, 1); - ctx.rotate(Math.PI / 12); + ctx.rotate(Math.PI / (density / 2)); } ctx.restore(); }; diff --git a/dist/jquery.easypiechart.min.js b/dist/jquery.easypiechart.min.js index efa45d0..612df31 100644 --- a/dist/jquery.easypiechart.min.js +++ b/dist/jquery.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(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);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file diff --git a/docs/get-started.md b/docs/get-started.md index 8b0b440..7e7daaa 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -34,9 +34,22 @@ If you don't want to use jQuery, implement the Vanilla JS version without any de ``` @@ -60,6 +73,8 @@ If you don't want to use jQuery, implement the Vanilla JS version without any de }, barColor:'#2C3E50', scaleColor:false, + scaleDensity: 48, + scaleBulge: 0.6, lineWidth:20, lineCap:'circle' }; diff --git a/docs/options.md b/docs/options.md index 9165d01..1969321 100644 --- a/docs/options.md +++ b/docs/options.md @@ -26,6 +26,16 @@ You can pass these options to the initialize function to set a custom look and f 5 Length of the scale lines (reduces the radius of the chart). + + scaleDensity + 24 + Density of the scale lines 360/density. + + + scaleBulge + 0.6 + Bulge offset length relative to options.scaleLength each 6 scale lines. + lineCap round diff --git a/easy-pie-chart.sublime-project b/easy-pie-chart.sublime-project new file mode 100644 index 0000000..43359b0 --- /dev/null +++ b/easy-pie-chart.sublime-project @@ -0,0 +1,11 @@ +{ + "folders": [ + { + "follow_symlinks": true, + "file_exclude_patterns": [ + ".fuse_hidden*" + ], + "path": "." + } + ] +} \ No newline at end of file diff --git a/easy-pie-chart.sublime-workspace b/easy-pie-chart.sublime-workspace new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/easy-pie-chart.sublime-workspace @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/renderer/canvas.js b/src/renderer/canvas.js index f27adc9..82589c1 100644 --- a/src/renderer/canvas.js +++ b/src/renderer/canvas.js @@ -67,21 +67,23 @@ var CanvasRenderer = function(el, options) { var drawScale = function() { var offset; var length; + var density = options.scaleDensity || 24; + var bulge = options.scaleBulge || 0.6; ctx.lineWidth = 1; ctx.fillStyle = options.scaleColor; ctx.save(); - for (var i = 24; i > 0; --i) { + for (var i = density; i > 0; --i) { if (i % 6 === 0) { length = options.scaleLength; offset = 0; } else { - length = options.scaleLength * 0.6; + length = options.scaleLength * bulge; offset = options.scaleLength - length; } ctx.fillRect(-options.size/2 + offset, 0, length, 1); - ctx.rotate(Math.PI / 12); + ctx.rotate(Math.PI / (density / 2)); } ctx.restore(); }; From 872b784dc3140cd5f8378b2e4f61477cf7dc329a Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Tue, 25 Oct 2016 13:29:53 +0800 Subject: [PATCH 2/4] Edit /docs/get-started.md && /Readme.md: add npm installation description. --- Readme.md | 27 ++++++++++++++++++++++++--- docs/get-started.md | 6 ++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 3943713..74df197 100644 --- a/Readme.md +++ b/Readme.md @@ -35,6 +35,12 @@ You can also use [bower](http://bower.io) to install the component: $ bower install jquery.easy-pie-chart ``` +or use `npm` to install this component: + +``` +$ npm install easy-pie-chart +``` + #### jQuery To use the easy pie chart plugin you need to load the current version of jQuery (> 1.6.4) and the source of the plugin. @@ -63,9 +69,22 @@ If you don't want to use jQuery, implement the Vanilla JS version without any de ``` @@ -89,6 +108,8 @@ If you don't want to use jQuery, implement the Vanilla JS version without any de }, barColor:'#2C3E50', scaleColor:false, + scaleDensity: 48, + scaleBulge: 0.6, lineWidth:20, lineCap:'circle' }; diff --git a/docs/get-started.md b/docs/get-started.md index 7e7daaa..8a8917f 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -6,6 +6,12 @@ You can also use [bower](http://bower.io) to install the component: $ bower install jquery.easy-pie-chart ``` +or use `npm` to install this component: + +``` +$ npm install easy-pie-chart +``` + ### jQuery To use the easy pie chart plugin you need to load the current version of jQuery (> 1.6.4) and the source of the plugin. From a34bebe8921b907959385e95238e80bff735db61 Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Tue, 25 Oct 2016 14:00:17 +0800 Subject: [PATCH 3/4] Add defaultOptions.scaleDensity & defaultOptions.scaleBulge --- dist/angular.easypiechart.js | 2 + dist/angular.easypiechart.min.js | 2 +- dist/easypiechart.js | 2 + dist/easypiechart.min.js | 2 +- dist/jquery.easypiechart.js | 2 + dist/jquery.easypiechart.min.js | 2 +- easy-pie-chart.sublime-workspace | 1093 +++++++++++++++++++++++++++++- src/easypiechart.js | 2 + 8 files changed, 1103 insertions(+), 4 deletions(-) diff --git a/dist/angular.easypiechart.js b/dist/angular.easypiechart.js index 6b8fbfe..3b97a96 100644 --- a/dist/angular.easypiechart.js +++ b/dist/angular.easypiechart.js @@ -271,6 +271,8 @@ var EasyPieChart = function(el, opts) { trackColor: '#f9f9f9', scaleColor: '#dfe0e0', scaleLength: 5, + scaleDensity: 24, + scaleBugle: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/angular.easypiechart.min.js b/dist/angular.easypiechart.min.js index 4c3d3f4..4aaaefa 100644 --- a/dist/angular.easypiechart.min.js +++ b/dist/angular.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(a.angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(a.angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file diff --git a/dist/easypiechart.js b/dist/easypiechart.js index 87e441c..ba3f917 100644 --- a/dist/easypiechart.js +++ b/dist/easypiechart.js @@ -222,6 +222,8 @@ var EasyPieChart = function(el, opts) { trackColor: '#f9f9f9', scaleColor: '#dfe0e0', scaleLength: 5, + scaleDensity: 24, + scaleBugle: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/easypiechart.min.js b/dist/easypiechart.min.js index e90ba91..525c5fc 100644 --- a/dist/easypiechart.min.js +++ b/dist/easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file diff --git a/dist/jquery.easypiechart.js b/dist/jquery.easypiechart.js index bfcd66b..525a8e5 100644 --- a/dist/jquery.easypiechart.js +++ b/dist/jquery.easypiechart.js @@ -222,6 +222,8 @@ var EasyPieChart = function(el, opts) { trackColor: '#f9f9f9', scaleColor: '#dfe0e0', scaleLength: 5, + scaleDensity: 24, + scaleBugle: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/jquery.easypiechart.min.js b/dist/jquery.easypiechart.min.js index 612df31..ccae3c1 100644 --- a/dist/jquery.easypiechart.min.js +++ b/dist/jquery.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file diff --git a/easy-pie-chart.sublime-workspace b/easy-pie-chart.sublime-workspace index 9e26dfe..a8981dc 100644 --- a/easy-pie-chart.sublime-workspace +++ b/easy-pie-chart.sublime-workspace @@ -1 +1,1092 @@ -{} \ No newline at end of file +{ + "auto_complete": + { + "selected_items": + [ + [ + "scaleB", + "scaleBulge\t(canvas.js)" + ], + [ + "url", + "urlpath" + ], + [ + "prox", + "proxyOptions" + ], + [ + "rote", + "routers" + ], + [ + "fo", + "forEach\tMeteor: cursor.forEach(callback)" + ], + [ + "expo", + "export\t(index.js)" + ], + [ + "sc", + "scripts" + ], + [ + "jque", + "jquery" + ], + [ + "out", + "outputFile" + ], + [ + "we", + "webpack" + ], + [ + "build", + "build/" + ], + [ + "char", + "chartOptions" + ], + [ + "defa", + "defaults" + ], + [ + "pie", + "pie-chart\t(PieChat.vue)" + ], + [ + "material", + "material.min.js\t(package.json)" + ], + [ + "file", + "filename" + ], + [ + "foma", + "formatter" + ], + [ + "layout", + "layout-pages" + ], + [ + "curr", + "curr" + ], + [ + "type", + "typeof" + ], + [ + "cur", + "curr" + ], + [ + "page", + "pageLoader\t(pageloader.js)" + ], + [ + "Page", + "Pageloader" + ], + [ + "que", + "queryParams" + ], + [ + "par", + "params" + ], + [ + "fil", + "filters" + ], + [ + "ser", + "serialize\t(dialog.js)" + ], + [ + "pars", + "parsed" + ], + [ + "pa", + "params" + ], + [ + "para", + "params" + ], + [ + "me", + "method" + ], + [ + "reg", + "regExp" + ], + [ + "pre", + "preventDefault" + ], + [ + "disa", + "disableMultiTools" + ], + [ + "gene", + "generatorApartMenu" + ], + [ + "new", + "newLeft" + ], + [ + "mou", + "mousedown\t(dialog.js)" + ], + [ + "tra", + "transition" + ], + [ + "bl", + "block" + ], + [ + "text-", + "text-overflow" + ], + [ + "over", + "overflow" + ], + [ + "word", + "word-break" + ], + [ + "wid", + "width" + ], + [ + "white", + "white-space\t(dataTables.bootstrap.css)" + ], + [ + "sty", + "style" + ], + [ + "no", + "nowrap" + ], + [ + "whi", + "white-space" + ], + [ + "wi", + "width" + ], + [ + "get", + "getModal" + ], + [ + "Boot", + "BootstrapDialog" + ], + [ + "layou", + "layout-pages\t(layout.html)" + ], + [ + "css", + "cssClass" + ], + [ + "quer", + "queryParams" + ], + [ + "row", + "rowid" + ], + [ + "getR", + "getDataByRowId" + ], + [ + "res", + "result" + ], + [ + "list", + "listLength" + ], + [ + "sele", + "selected" + ], + [ + "conte", + "container" + ], + [ + "dele", + "deleteUrl" + ], + [ + "edit", + "editable" + ], + [ + "check", + "checkbox" + ], + [ + "che", + "checkbox" + ], + [ + "sta", + "status" + ], + [ + "status", + "statusContainer\t(jquery.pagination.js)" + ], + [ + "eve", + "event" + ], + [ + "load", + "loadData" + ], + [ + "pag", + "pagination" + ], + [ + "param", + "paramKeys" + ], + [ + "old", + "oldCurrPage" + ], + [ + "call", + "callbacks" + ], + [ + "inser", + "insertLayout" + ], + [ + "prev", + "prevPage" + ], + [ + "proto", + "prototype" + ], + [ + "total", + "totalNum" + ], + [ + "te", + "textStatus" + ], + [ + "li", + "limit2" + ], + [ + "option", + "options" + ], + [ + "limi", + "limit1" + ], + [ + "ins", + "instance" + ], + [ + "gri", + "grid_1_pg" + ], + [ + "con", + "container" + ], + [ + "ignor", + "ignoring_files" + ], + [ + "th", + "thumbs\t(语义化版本2-0-0.md)" + ], + [ + "thu", + "thumbnail\t(语义化版本2-0-0.md)" + ], + [ + "thum", + "thumbs\t(九月的村庄.md)" + ], + [ + "met", + "metro1.jpg" + ], + [ + "im", + "imgs" + ], + [ + "cons", + "console" + ], + [ + "str", + "stringify\tMeteor: EJSON.stringify(val)" + ], + [ + "back", + "backgroung-size" + ], + [ + "ex", + "existsSync" + ], + [ + "down", + "downloadImg" + ], + [ + "mat", + "matchImgs" + ], + [ + "com", + "completeDomain" + ], + [ + "fun", + "function" + ], + [ + "p", + "padding" + ], + [ + "border-sty", + "border-style" + ], + [ + "inl", + "inline-block" + ], + [ + "in", + "inline-block" + ], + [ + "test", + "testHeightTicket" + ], + [ + "fu", + "function" + ], + [ + "z", + "z-index" + ], + [ + "re", + "relative" + ], + [ + "he", + "height" + ], + [ + "pro", + "property" + ], + [ + "do", + "document" + ], + [ + "P", + "Projects/" + ] + ] + }, + "buffers": + [ + { + "file": "src/renderer/canvas.js", + "settings": + { + "buffer_size": 5105, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "docs/get-started.md", + "settings": + { + "buffer_size": 2101, + "encoding": "UTF-8", + "line_ending": "Unix" + } + } + ], + "build_system": "", + "build_system_choices": + [ + ], + "build_varint": "", + "command_palette": + { + "height": 400.0, + "last_filter": "ip", + "selected_items": + [ + [ + "ip", + "Package Control: Install Package" + ], + [ + "pac", + "Package Control: Install Package" + ] + ], + "width": 601.0 + }, + "console": + { + "height": 0.0, + "history": + [ + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/Users/colin/Projects/github/easy-pie-chart", + "/Users/colin/Projects/github/easy-pie-chart/docs", + "/Users/colin/Projects/github/easy-pie-chart/src", + "/Users/colin/Projects/github/easy-pie-chart/src/renderer", + "/Users/colin/Projects/github/easy-pie-chart/test/unit" + ], + "file_history": + [ + "/Users/colin/Projects/github/easy-pie-chart/docs/options.md", + "/Users/colin/Projects/github/easy-pie-chart/Readme.md", + "/Users/colin/yidou/yidou-webapp/node_modules/easy-pie-chart/dist/easypiechart.back.js", + "/Users/colin/yidou/yidou-webapp/src/styles.js", + "/Users/colin/yidou/yidou-webapp/dist/styles.js", + "/Users/colin/yidou/yidou-webapp/dist/views/home2.html", + "/Users/colin/yidou/yidou-webapp/build/webpack.config.js", + "/Users/colin/yidou/yidou-webapp/src/views/home.html", + "/Users/colin/yidou/yidou-webapp/.eslintrc", + "/Users/colin/yidou/yidou-webapp/.editorconfig", + "/Users/colin/yidou/yidou-webapp/dist/index.html", + "/Users/colin/yidou/yidou-webapp/dist/index-1.html", + "/Users/colin/yidou/yidou-webapp/dist/views/home.html", + "/Users/colin/yidou/yidou-webapp/package.json", + "/Users/colin/yidou/yidou-webapp/src/index.js", + "/Users/colin/yidou/yidou-webapp/src/scripts/jquery-export.js", + "/Users/colin/yidou/yidou-webapp/.babelrc", + "/Users/colin/yidou/yidou-webapp/build/webpack.config.dev.js", + "/Users/colin/Projects/music-beauty/package.json", + "/Users/colin/Projects/music-beauty/app/src/scripts/components/image-search/baidu-image.jsx", + "/Users/colin/Projects/music-beauty/app/src/scripts/components/image-engine/baidu-image.jsx", + "/Users/colin/yidou/webapp-react/webpack.base.conf.js", + "/Users/colin/yidou/yidou-webapp/src/assets/css/material-theme.min.css", + "/Users/colin/yidou/yidou-webapp/build/webpack.base.conf.js", + "/Users/colin/yidou/yidou-webapp/src/App.vue", + "/Users/colin/yidou/yidou-webapp/index.html", + "/Users/colin/yidou/yidou-webapp/build/webpack.dev.conf.js", + "/Users/colin/yidou/yidou-webapp/build/webpack.prod.conf.js", + "/Users/colin/yidou/yidou-webapp/src/components/Dropdown.vue", + "/Users/colin/yidou/yidou-webapp/src/components/Hello.vue", + "/Users/colin/yidou/yidou-webapp/src/views/Home/index.vue", + "/Users/colin/yidou/yidou-webapp/src/views/Home/Jumbotron.vue", + "/Users/colin/yidou/backstage/.gitignore", + "/Users/colin/yidou/backstage/dist/css/AdminLTE.min.css", + "/Users/colin/yidou/backstage/dist/css/AdminLTE.css", + "/Users/colin/yidou/backstage/plugins/dialog/bootstrap-dialog.js", + "/Users/colin/yidou/backstage/plugins/dialog/bootstrap-dialog.min.js", + "/Users/colin/yidou/backstage/plugins/dialog/bootstrap-dialog.css", + "/Users/colin/yidou/backstage/plugins/dialog/bootstrap-dialog.min.css", + "/Users/colin/yidou/backstage/plugins/dialog/jquery.dialog.js", + "/Users/colin/yidou/backstage/index.html", + "/Users/colin/yidou/backstage/layout.html", + "/Users/colin/yidou/backstage/Gruntfile.js", + "/Users/colin/Projects/blog/themes/xhueman/source/css/style.styl", + "/Users/colin/Projects/blog/themes/xhueman/source/css/_partial/header.styl", + "/Users/colin/Projects/github/hexo-qiniu-sync/README.md", + "/Users/colin/Projects/github/hexo-qiniu-sync/.gitignore", + "/Users/colin/Projects/blog/package.json", + "/Users/colin/Projects/blog/scaffolds/post.md", + "/Users/colin/Projects/blog/scaffolds/page.md", + "/Users/colin/Projects/blog/scaffolds/draft.md", + "/Users/colin/Projects/blog/scaffolds/photo.md", + "/Users/colin/Projects/blog/_config.yml", + "/Users/colin/Projects/blog/themes/hueman/_config.yml", + "/Users/colin/.qiniu", + "/Users/colin/Projects/blog/source/_posts/彻底放弃node-sass改用Ruby-Sass.md", + "/Users/colin/Projects/blog/source/_posts/Sass.md", + "/Users/colin/Projects/blog/source/_posts/列车.md", + "/Users/colin/Projects/blog/source/_posts/魔都沦陷.md", + "/Users/colin/Projects/blog/source/_posts/网站-Blog支持Gravatar.md", + "/Users/colin/Projects/blog/source/_posts/实现修改Actionscript文件后不必重新发布swf.md", + "/Users/colin/Projects/blog/source/_posts/语义化版本2-0-0.md", + "/Users/colin/Projects/blog/source/_posts/UIDesigner-3-0架构设计总结.md", + "/Users/colin/Projects/blog/source/_posts/潇湘大地.md", + "/Users/colin/Projects/blog/source/_posts/感谢有你.md", + "/Users/colin/Projects/blog/source/_posts/天地荒老.md", + "/Users/colin/Projects/blog/source/_posts/夏夜.md", + "/Users/colin/Projects/blog/source/_posts/地铁.md", + "/Users/colin/Projects/blog/source/_posts/一半.md", + "/Users/colin/Library/Application Support/Sublime Text 3/Packages/AutoFileName/autofilename.sublime-settings", + "/Users/colin/Projects/blog/source/_posts/移动Web实现摇一摇.md", + "/Users/colin/Projects/blog/source/_posts/九月的村庄.md", + "/Users/colin/Projects/blog/source/_posts/晚归.md", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/package.json", + "/Users/colin/Projects/blog/themes/hueman/languages/zh-CN.yml", + "/Users/colin/Projects/blog/source/_posts/廣州日報第6屆【港澳優質誠信商號】推選活動.md", + "/Users/colin/Projects/blog/source/_posts/恒江网站.md", + "/Users/colin/Projects/blog/source/_posts/档案管理系统-景鸿移民顾问有限公司.md", + "/Users/colin/Projects/blog/source/_posts/环球医生门诊系统及门户网站.md", + "/Users/colin/Projects/blog/source/_posts/磨碟沙.md", + "/Users/colin/Projects/blog/source/_posts/为触摸而设计.md", + "/Users/colin/Projects/blog/source/_posts/唯有前行.md", + "/Users/colin/Projects/blog/source/_posts/Bower支持Packages多版本共存.md", + "/Users/colin/Projects/blog/source/_posts/让Yeoman生成器的默认Grunt预览服务器支持随机端口.md", + "/Users/colin/Projects/blog/source/_posts/NodeJS版本的Gitlab-API.md", + "/Users/colin/Projects/blog/source/_posts/Metro风格设计指南.md", + "/Users/colin/Projects/blog/source/_posts/解决iframe在iPad内不能滚动的问题.md", + "/Users/colin/Projects/blog/source/_posts/实验性项目IMIS系统(类WebQQ).md", + "/Users/colin/Projects/blog/source/_posts/三清山初行记.md", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/README.md", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/LICENSE", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/.npmignore", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/.gitignore", + "/Users/colin/Projects/blog/source/_posts/Dr-kong客户关系管理系统登录界面.md", + "/Users/colin/Projects/blog/source/imgs/恒江网站/hengjing_1-300x218.jpg", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/index.js", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/img-download.js", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpressimg/map301.js", + "/Users/colin/Projects/blog/node_modules/hexo/lib/hexo/post.js", + "/Users/colin/Projects/blog/301.json", + "/Users/colin/Projects/blog/db.json", + "/Users/colin/Projects/blog/themes/hueman/source/css/_partial/header.styl", + "/Users/colin/Projects/blog/themes/hueman/source/css/_variables.styl", + "/Users/colin/Projects/blog/themes/hueman/source/css/_partial/nav.styl", + "/Users/colin/Projects/blog/themes/icarus/_config.yml", + "/Users/colin/Projects/blog/source/_posts/转-–-php5将xml转换成json最简单的办法.md", + "/Users/colin/Projects/blog/themes/next/_config.yml", + "/Users/colin/Projects/blog/source/_posts/广东省道路信息服务系统.md", + "/Users/colin/Projects/blog/source/_posts/互联网用户常见心理特征.md", + "/Users/colin/Projects/blog/source/_posts/e5-ae-9e-e9-aa-8c-e6-80-a7-e9-a1-b9-e7-9b-aeimis-e7-b3-bb-e7-bb-9f-1.md", + "/Users/colin/Projects/blog/node_modules/moment/moment.d.ts", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpress-img/index.js", + "/Users/colin/Projects/blog/node_modules/hexo-migrator-wordpress-img/img-download.js", + "/Users/colin/Projects/blog/hexo-site.sublime-project", + "/Users/colin/www/blog/node_modules/hexo/lib/plugins/helper/index.js", + "/Users/colin/www/blog/node_modules/hexo/lib/plugins/helper/open_graph.js", + "/Users/colin/www/blog/themes/icarus/layout/widget/recent_posts.ejs", + "/Users/colin/www/blog/themes/icarus/languages/zh-CN.yml", + "/Users/colin/www/blog/themes/icarus/languages/zh.yml", + "/Users/colin/www/blog/themes/icarus/source/js/main.js", + "/Users/colin/www/blog/themes/icarus/layout/common/head.ejs", + "/Users/colin/www/blog/db.json", + "/Users/colin/www/blog/themes/hueman/_config.yml", + "/Users/colin/www/blog/themes/hueman/layout/layout.ejs", + "/Users/colin/www/blog/themes/hueman/layout/common/scripts.ejs", + "/Users/colin/www/blog/themes/hueman/layout/comment/scripts.ejs", + "/Users/colin/www/blog/themes/hueman/layout/common/header.ejs", + "/Users/colin/www/blog/themes/hueman/layout/common/footer.ejs" + ], + "find": + { + "height": 39.0 + }, + "find_in_files": + { + "height": 106.0, + "where_history": + [ + "", + "/Users/colin/Projects/blog/source/_posts", + "./" + ] + }, + "find_state": + { + "case_sensitive": true, + "find_history": + [ + "options.scaleLength", + "file", + "url", + "eslint", + "utils.assetsPath", + "10", + "percent", + "pieChart", + "pie", + "-c", + "filter", + "Filter", + "pagination", + "dialog", + "categoryId", + "catogoryId", + "debugger", + "redirect", + "this.container", + "redirect", + "renderF", + "serializeArray", + "replaceUrlParams", + "setUrlParams", + "https://cdnjs.cloudflare.com/ajax/libs", + "filter", + "generatorApartMenu", + "googleapis", + "batchAction", + "{\n icon: 'fa-pencil',\n title: '编辑',\n style: 'default', // default, primary, success, info, warning, danger, link\n action: function(data, button, grid) {\n var url = grid.options.addPageUrl + \"?id=\" + data.id;\n $.get(url)\n .success(function(html) {\n\n Dialog.show({\n title: '编辑'+ data.moduleName,\n message: $(html),\n submitDataType: 'json', // json, form\n submit: function(data, dialog) {\n\n $.post('layout-pages/add-page.html', data)\n .success(function() {\n Dialog.alert({message:'保存成功。', size:'size-small', type:'type-success'});\n grid.reload(); //刷新表格\n dialog.close();\n })\n .error(function() {\n Dialog.alert({message:'提交失败。', size:'size-small', type:'type-danger'});\n });\n },\n buttons: [{\n label: '取消',\n action: function(dialog) {\n dialog.close();\n }\n }, {\n label: '保存',\n cssClass: 'btn-primary',\n action: function(dialog) {\n dialog.submit();\n }\n }]\n });\n });\n console.log(data);\n }\n }, ", + "Math.min(", + "bindEvents", + "table-wrap", + "模块名称", + "name", + "multiToolAction", + "getSelected", + "handleMultiToolAction", + "Multi", + "handleMultiToolAction", + "generatorMultiMenu", + "TYPE_DANGER", + "SIZE_SMALL", + ".title", + "makeModalDraggable", + "realize", + ".open", + "BootstrapDialog", + "Title 2", + "Title 1", + "add-page.html", + ",,", + ",", + "\n", + "", + "$tools", + "tools", + "multiDelete", + "toggleMultiDeleteButton", + "disableMultiDeleteButton", + "enableMultiDeleteButton", + "multi", + "generatorMultiMenu", + "getSelected", + "\n\n handleToolAction: function(targetElement) {\n var options = this.options;\n var toolIndex = targetElement.attr('data-toolindex');\n var tool = options.tools[toolIndex];\n var action = tool.action;\n var rowid = targetElement.attr('data-id');\n var row = this.getDataByRowId(rowid);\n\n if ($.isFunction(action)) {\n action.call(this, row, targetElement, this);\n }\n },", + "Information", + "BootstrapDialog.DEFAULT_TEXTS", + "Information", + "modal-dialog", + "status", + "Status", + "status", + "body", + "__\"", + "'", + "\"", + "dataUrl", + "rowData", + "loadData", + "pagination", + "Pagination", + "pagination", + "Pagination", + "high", + "generatorRowMenu", + "col.filter", + "filter", + "row[options.idField]", + "action", + "this", + "this.role", + "align:", + "'', ", + "'',", + "update", + "delete", + "rows", + "row.push", + "Feild", + "rows", + "table", + "render", + "status", + "Status", + "status", + "render", + "buildList", + "render", + "insertLayout", + "}", + "{", + "https://cdnjs.cloudflare.com/ajax/libs", + ">/\n", + "data", + "this.options", + "this.options.container", + "containe", + ":", + "'\n", + "[type]", + "currentPage", + "pageCount", + "pageSize", + "this.options", + "tabindex=\"0\" aria-controls=\"example1\" rowspan=\"1\" colspan=\"1\" aria-label=\"Browser: activate to sort column ascending\"", + "}", + "{", + "pagination" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": true, + "replace_history": + [ + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 1, + "sheets": + [ + { + "buffer": 0, + "file": "src/renderer/canvas.js", + "semi_transient": false, + "settings": + { + "buffer_size": 5105, + "regions": + { + }, + "selection": + [ + [ + 1990, + 2000 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "auto_complete": false, + "bh_regions": + [ + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content" + ], + "color_scheme": "Packages/User/Color Highlighter/themes/glacier.tmTheme", + "editorconfig": true, + "ensure_newline_at_eof_on_save": true, + "incomplete_sync": null, + "remote_loading": false, + "synced": false, + "syntax": "Packages/JavaScriptNext - ES6 Syntax/JavaScriptNext.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 1075.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 1, + "file": "docs/get-started.md", + "semi_transient": false, + "settings": + { + "buffer_size": 2101, + "regions": + { + }, + "selection": + [ + [ + 709, + 709 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "auto_complete": false, + "bh_regions": + [ + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content" + ], + "editorconfig": true, + "ensure_newline_at_eof_on_save": true, + "incomplete_sync": null, + "remote_loading": false, + "synced": false, + "syntax": "Packages/MarkdownEditing/Markdown.tmLanguage", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 27.0 + }, + "input": + { + "height": 38.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.find_results": + { + "height": 0.0 + }, + "output.sftp": + { + "height": 0.0 + }, + "pinned_build_system": "", + "project": "easy-pie-chart.sublime-project", + "replace": + { + "height": 50.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + [ + "sass", + "source/_posts/彻底放弃node-sass改用Ruby-Sass.md" + ], + [ + "列车", + "source/_posts/列车.md" + ] + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 380.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 269.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/src/easypiechart.js b/src/easypiechart.js index 0dc3822..845cbf3 100644 --- a/src/easypiechart.js +++ b/src/easypiechart.js @@ -4,6 +4,8 @@ var EasyPieChart = function(el, opts) { trackColor: '#f9f9f9', scaleColor: '#dfe0e0', scaleLength: 5, + scaleDensity: 24, + scaleBugle: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, From c83d891ecbc68c0e562c75b1d623d3ac3e449784 Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Tue, 25 Oct 2016 14:11:51 +0800 Subject: [PATCH 4/4] Add defaultOptions.scaleDensity & defaultOptions.scaleBulge --- dist/angular.easypiechart.js | 2 +- dist/angular.easypiechart.min.js | 2 +- dist/easypiechart.js | 2 +- dist/easypiechart.min.js | 2 +- dist/jquery.easypiechart.js | 2 +- dist/jquery.easypiechart.min.js | 2 +- easy-pie-chart.sublime-workspace | 111 +++++++++++++++++++++++++++++-- src/easypiechart.js | 2 +- 8 files changed, 114 insertions(+), 11 deletions(-) diff --git a/dist/angular.easypiechart.js b/dist/angular.easypiechart.js index 3b97a96..6bb9c8e 100644 --- a/dist/angular.easypiechart.js +++ b/dist/angular.easypiechart.js @@ -272,7 +272,7 @@ var EasyPieChart = function(el, opts) { scaleColor: '#dfe0e0', scaleLength: 5, scaleDensity: 24, - scaleBugle: 0.6, + scaleBulge: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/angular.easypiechart.min.js b/dist/angular.easypiechart.min.js index 4aaaefa..3325245 100644 --- a/dist/angular.easypiechart.min.js +++ b/dist/angular.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(a.angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(a.angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBulge:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}}); \ No newline at end of file diff --git a/dist/easypiechart.js b/dist/easypiechart.js index ba3f917..8ade534 100644 --- a/dist/easypiechart.js +++ b/dist/easypiechart.js @@ -223,7 +223,7 @@ var EasyPieChart = function(el, opts) { scaleColor: '#dfe0e0', scaleLength: 5, scaleDensity: 24, - scaleBugle: 0.6, + scaleBulge: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/easypiechart.min.js b/dist/easypiechart.min.js index 525c5fc..5bab995 100644 --- a/dist/easypiechart.min.js +++ b/dist/easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.EasyPieChart=b()}):"object"==typeof exports?module.exports=b():a.EasyPieChart=b()}(this,function(){var a=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},b=function(b,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBulge:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof a)d.renderer=a;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=b,this.options=e;for(var a in d)d.hasOwnProperty(a)&&(e[a]=c&&"undefined"!=typeof c[a]?c[a]:d[a],"function"==typeof e[a]&&(e[a]=e[a].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(b,e),this.renderer.draw(f),b.dataset&&b.dataset.percent?this.update(parseFloat(b.dataset.percent)):b.getAttribute&&b.getAttribute("data-percent")&&this.update(parseFloat(b.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};return b}); \ No newline at end of file diff --git a/dist/jquery.easypiechart.js b/dist/jquery.easypiechart.js index 525a8e5..29d6c8a 100644 --- a/dist/jquery.easypiechart.js +++ b/dist/jquery.easypiechart.js @@ -223,7 +223,7 @@ var EasyPieChart = function(el, opts) { scaleColor: '#dfe0e0', scaleLength: 5, scaleDensity: 24, - scaleBugle: 0.6, + scaleBulge: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined, diff --git a/dist/jquery.easypiechart.min.js b/dist/jquery.easypiechart.min.js index ccae3c1..74fa561 100644 --- a/dist/jquery.easypiechart.min.js +++ b/dist/jquery.easypiechart.min.js @@ -6,4 +6,4 @@ * @author Robert Fleischmann (http://robert-fleischmann.de) * @version 2.1.7 **/ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBugle:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;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((-.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=c<=0;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=b.scaleDensity||24,f=b.scaleBulge||.6;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var g=d;g>0;--g)g%6===0?(c=b.scaleLength,a=0):(c=b.scaleLength*f,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/(d/2));e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){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;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,scaleDensity:24,scaleBulge:.6,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,b<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;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)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),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")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); \ No newline at end of file diff --git a/easy-pie-chart.sublime-workspace b/easy-pie-chart.sublime-workspace index a8981dc..57fa493 100644 --- a/easy-pie-chart.sublime-workspace +++ b/easy-pie-chart.sublime-workspace @@ -456,6 +456,15 @@ "encoding": "UTF-8", "line_ending": "Unix" } + }, + { + "file": "src/easypiechart.js", + "settings": + { + "buffer_size": 3337, + "encoding": "UTF-8", + "line_ending": "Unix" + } } ], "build_system": "", @@ -501,8 +510,7 @@ "/Users/colin/Projects/github/easy-pie-chart", "/Users/colin/Projects/github/easy-pie-chart/docs", "/Users/colin/Projects/github/easy-pie-chart/src", - "/Users/colin/Projects/github/easy-pie-chart/src/renderer", - "/Users/colin/Projects/github/easy-pie-chart/test/unit" + "/Users/colin/Projects/github/easy-pie-chart/src/renderer" ], "file_history": [ @@ -799,7 +807,7 @@ "groups": [ { - "selected": 1, + "selected": 2, "sheets": [ { @@ -894,7 +902,7 @@ "translation.y": 1075.0, "zoom_level": 1.0 }, - "stack_index": 1, + "stack_index": 2, "type": "text" }, { @@ -989,6 +997,101 @@ "translation.y": 0.0, "zoom_level": 1.0 }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 2, + "file": "src/easypiechart.js", + "semi_transient": false, + "settings": + { + "buffer_size": 3337, + "regions": + { + }, + "selection": + [ + [ + 177, + 187 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "auto_complete": false, + "bh_regions": + [ + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_square_content", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_double_quote_content", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_default_content", + "bh_c_define", + "bh_c_define_center", + "bh_c_define_open", + "bh_c_define_close", + "bh_c_define_content", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_curly_content", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_regex_content", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_angle_content", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_tag_content", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_unmatched_content", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_single_quote_content", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_round_content" + ], + "color_scheme": "Packages/User/Color Highlighter/themes/glacier.tmTheme", + "editorconfig": true, + "ensure_newline_at_eof_on_save": true, + "incomplete_sync": null, + "remote_loading": false, + "synced": false, + "syntax": "Packages/JavaScriptNext - ES6 Syntax/JavaScriptNext.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, "stack_index": 0, "type": "text" } diff --git a/src/easypiechart.js b/src/easypiechart.js index 845cbf3..2785e56 100644 --- a/src/easypiechart.js +++ b/src/easypiechart.js @@ -5,7 +5,7 @@ var EasyPieChart = function(el, opts) { scaleColor: '#dfe0e0', scaleLength: 5, scaleDensity: 24, - scaleBugle: 0.6, + scaleBulge: 0.6, lineCap: 'round', lineWidth: 3, trackWidth: undefined,