diff --git a/CONTRIBUTING b/CONTRIBUTING index c02401a..2f40a15 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -1,3 +1,3 @@ Contributions to this code are covered by the Adobe contributors -license agreeent. Developers must sign and submit the Adobe CLA in -order to contribute to this project. \ No newline at end of file +license agreement. Developers must sign and submit the Adobe CLA in +order to contribute to this project. diff --git a/Gruntfile.js b/Gruntfile.js index 69354a6..783186d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -63,14 +63,28 @@ module.exports = function(grunt) { eslint: { command: "./node_modules/eslint/bin/eslint.js " + core.join(" ") }, + }, + prettify: { + options: { + indent: 4, + indent_char: " ", + wrap_line_length: 80, + brace_style: "expand", + unformatted: ["code", "pre", "script"] + }, + one: { + src: "./doc/reference.html", + dest: "./doc/reference.html" + } } }); grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-exec"); + grunt.loadNpmTasks("grunt-prettify"); - grunt.registerTask("default", ["exec:eslint", "concat", "uglify", "exec:dr"]); + grunt.registerTask("default", ["exec:eslint", "concat", "uglify", "exec:dr", "prettify"]); grunt.registerTask("lint", ["exec:eslint"]); grunt.registerTask("test", ["exec:test"]); }; diff --git a/README.md b/README.md index 9547dc5..570e6bb 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A JavaScript SVG library for the modern web. Learn more at [snapsvg.io](http://s * [About Snap.svg](http://snapsvg.io/about/) * [Getting Started](http://snapsvg.io/start/) * [API Reference](http://snapsvg.io/docs/) -* [Slack Room](https://snapsvg.slack.com/) +* [Slack Room](https://snapsvg.slack.com/). [Invite](https://snapsvg.slack.com/shared_invite/MTM2NTE4MTk3MDYwLTE0ODYwODgzNzUtYjQ0YmM1N2U0Mg) ### Use diff --git a/bower.json b/bower.json index d015466..8fa199d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "Snap.svg", - "version": "0.4.1", + "version": "0.5.0", "homepage": "http://snapsvg.io", "authors": [ "Dmitry Baranovskiy " diff --git a/component.json b/component.json index a9fdee3..298c373 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "Snap.svg", "repo": "adobe-webplatform/Snap.svg", "description": "The JavaScript library for modern SVG graphics.", - "version": "0.3.0", + "version": "0.5.0", "keywords": ["svg", "snap", "js", "javascript"], "dependencies": {}, "development": {}, diff --git a/dist/snap.svg-min.js b/dist/snap.svg-min.js index 9804803..a433f15 100644 --- a/dist/snap.svg-min.js +++ b/dist/snap.svg-min.js @@ -1,4 +1,4 @@ -// Snap.svg 0.4.2dev +// Snap.svg 0.5.0 // // Copyright (c) 2013 – 2017 Adobe Systems Incorporated. All rights reserved. // @@ -14,8 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// build: 2017-02-02 +// build: 2017-02-03 -!function(a){var b,c,d="0.5.0",e="hasOwnProperty",f=/[\.\/]/,g=/\s*,\s*/,h="*",i=function(a,b){return a-b},j={n:{}},k=function(){for(var a=0,b=this.length;b>a;a++)if("undefined"!=typeof this[a])return this[a]},l=function(){for(var a=this.length;--a;)if("undefined"!=typeof this[a])return this[a]},m=Object.prototype.toString,n=String,o=Array.isArray||function(a){return a instanceof Array||"[object Array]"==m.call(a)};eve=function(a,d){var e,f=c,g=Array.prototype.slice.call(arguments,2),h=eve.listeners(a),j=0,m=[],n={},o=[],p=b;o.firstDefined=k,o.lastDefined=l,b=a,c=0;for(var q=0,r=h.length;r>q;q++)"zIndex"in h[q]&&(m.push(h[q].zIndex),h[q].zIndex<0&&(n[h[q].zIndex]=h[q]));for(m.sort(i);m[j]<0;)if(e=n[m[j++]],o.push(e.apply(d,g)),c)return c=f,o;for(q=0;r>q;q++)if(e=h[q],"zIndex"in e)if(e.zIndex==m[j]){if(o.push(e.apply(d,g)),c)break;do if(j++,e=n[m[j]],e&&o.push(e.apply(d,g)),c)break;while(e)}else n[e.zIndex]=e;else if(o.push(e.apply(d,g)),c)break;return c=f,b=p,o},eve._events=j,eve.listeners=function(a){var b,c,d,e,g,i,k,l,m=o(a)?a:a.split(f),n=j,p=[n],q=[];for(e=0,g=m.length;g>e;e++){for(l=[],i=0,k=p.length;k>i;i++)for(n=p[i].n,c=[n[m[e]],n[h]],d=2;d--;)b=c[d],b&&(l.push(b),q=q.concat(b.f||[]));p=l}return q},eve.separator=function(a){a?(a=n(a).replace(/(?=[\.\^\]\[\-])/g,"\\"),a="["+a+"]",f=new RegExp(a)):f=/[\.\/]/},eve.on=function(a,b){if("function"!=typeof b)return function(){};for(var c=o(a)?o(a[0])?a:[a]:n(a).split(g),d=0,e=c.length;e>d;d++)!function(a){for(var c,d=o(a)?a:n(a).split(f),e=j,g=0,h=d.length;h>g;g++)e=e.n,e=e.hasOwnProperty(d[g])&&e[d[g]]||(e[d[g]]={n:{}});for(e.f=e.f||[],g=0,h=e.f.length;h>g;g++)if(e.f[g]==b){c=!0;break}!c&&e.f.push(b)}(c[d]);return function(a){+a==+a&&(b.zIndex=+a)}},eve.f=function(a){var b=[].slice.call(arguments,1);return function(){eve.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},eve.stop=function(){c=1},eve.nt=function(a){var c=o(b)?b.join("."):b;return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(c):c},eve.nts=function(){return o(b)?b:b.split(f)},eve.off=eve.unbind=function(a,b){if(!a)return void(eve._events=j={n:{}});var c=o(a)?o(a[0])?a:[a]:n(a).split(g);if(c.length>1)for(var d=0,i=c.length;i>d;d++)eve.off(c[d],b);else{c=o(a)?a:n(a).split(f);var k,l,m,d,i,p,q,r=[j],s=[];for(d=0,i=c.length;i>d;d++)for(p=0;pd;d++)for(k=r[d];k.n;){if(b){if(k.f){for(p=0,q=k.f.length;q>p;p++)if(k.f[p]==b){k.f.splice(p,1);break}!k.f.length&&delete k.f}for(l in k.n)if(k.n[e](l)&&k.n[l].f){var t=k.n[l].f;for(p=0,q=t.length;q>p;p++)if(t[p]==b){t.splice(p,1);break}!t.length&&delete k.n[l].f}}else{delete k.f;for(l in k.n)k.n[e](l)&&k.n[l].f&&delete k.n[l].f}k=k.n}a:for(d=0,i=s.length;i>d;d++){k=s[d];for(l in k.n[k.name].f)continue a;for(l in k.n[k.name].n)continue a;delete k.n[k.name]}}},eve.once=function(a,b){var c=function(){return eve.off(a,c),b.apply(this,arguments)};return eve.on(a,c)},eve.version=d,eve.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=eve:"function"==typeof define&&define.amd?define("eve",[],function(){return eve}):a.eve=eve}(this),function(a,b){if("function"==typeof define&&define.amd)define(["eve"],function(c){return b(a,c)});else if("undefined"!=typeof exports){var c=require("eve");module.exports=b(a,c)}else b(a,a.eve)}(window||this,function(a,b){var c=function(b){var c,d={},e=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){return setTimeout(a,16,(new Date).getTime()),!0},f=Array.isArray||function(a){return a instanceof Array||"[object Array]"==Object.prototype.toString.call(a)},g=0,h="M"+(+new Date).toString(36),i=function(){return h+(g++).toString(36)},j=Date.now||function(){return+new Date},k=function(a){var b=this;if(null==a)return b.s;var c=b.s-a;b.b+=b.dur*c,b.B+=b.dur*c,b.s=a},l=function(a){var b=this;return null==a?b.spd:void(b.spd=a)},m=function(a){var b=this;return null==a?b.dur:(b.s=b.s*a/b.dur,void(b.dur=a))},n=function(){var a=this;delete d[a.id],a.update(),b("mina.stop."+a.id,a)},o=function(){var a=this;a.pdif||(delete d[a.id],a.update(),a.pdif=a.get()-a.b)},p=function(){var a=this;a.pdif&&(a.b=a.get()-a.pdif,delete a.pdif,d[a.id]=a,r())},q=function(){var a,b=this;if(f(b.start)){a=[];for(var c=0,d=b.start.length;d>c;c++)a[c]=+b.start[c]+(b.end[c]-b.start[c])*b.easing(b.s)}else a=+b.start+(b.end-b.start)*b.easing(b.s);b.set(a)},r=function(a){if(!a)return void(c||(c=e(r)));var f=0;for(var g in d)if(d.hasOwnProperty(g)){var h=d[g],i=h.get();f++,h.s=(i-h.b)/(h.dur/h.spd),h.s>=1&&(delete d[g],h.s=1,f--,function(a){setTimeout(function(){b("mina.finish."+a.id,a)})}(h)),h.update()}c=f?e(r):!1},s=function(a,b,c,e,f,g,h){var j={id:i(),start:a,end:b,b:c,s:0,dur:e-c,spd:1,get:f,set:g,easing:h||s.linear,status:k,speed:l,duration:m,stop:n,pause:o,resume:p,update:q};d[j.id]=j;var t,u=0;for(t in d)if(d.hasOwnProperty(t)&&(u++,2==u))break;return 1==u&&r(),j};return s.time=j,s.getById=function(a){return d[a]||null},s.linear=function(a){return a},s.easeout=function(a){return Math.pow(a,1.7)},s.easein=function(a){return Math.pow(a,.48)},s.easeinout=function(a){if(1==a)return 1;if(0==a)return 0;var b=.48-a/1.04,c=Math.sqrt(.1734+b*b),d=c-b,e=Math.pow(Math.abs(d),1/3)*(0>d?-1:1),f=-c-b,g=Math.pow(Math.abs(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},s.backin=function(a){if(1==a)return 1;var b=1.70158;return a*a*((b+1)*a-b)},s.backout=function(a){if(0==a)return 0;a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},s.elastic=function(a){return a==!!a?a:Math.pow(2,-10*a)*Math.sin((a-.075)*(2*Math.PI)/.3)+1},s.bounce=function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b},a.mina=s,s}("undefined"==typeof b?function(){}:b),d=function(a){function c(a,b){if(a){if(a.nodeType)return w(a);if(e(a,"array")&&c.set)return c.set.apply(c,a);if(a instanceof s)return a;if(null==b)return a=y.doc.querySelector(String(a)),w(a)}return a=null==a?"100%":a,b=null==b?"100%":b,new v(a,b)}function d(a,b){if(b){if("#text"==a&&(a=y.doc.createTextNode(b.text||b["#text"]||"")),"#comment"==a&&(a=y.doc.createComment(b.text||b["#text"]||"")),"string"==typeof a&&(a=d(a)),"string"==typeof b)return 1==a.nodeType?"xlink:"==b.substring(0,6)?a.getAttributeNS(T,b.substring(6)):"xml:"==b.substring(0,4)?a.getAttributeNS(U,b.substring(4)):a.getAttribute(b):"text"==b?a.nodeValue:null;if(1==a.nodeType){for(var c in b)if(b[z](c)){var e=A(b[c]);e?"xlink:"==c.substring(0,6)?a.setAttributeNS(T,c.substring(6),e):"xml:"==c.substring(0,4)?a.setAttributeNS(U,c.substring(4),e):a.setAttribute(c,e):a.removeAttribute(c)}}else"text"in b&&(a.nodeValue=b.text)}else a=y.doc.createElementNS(U,a);return a}function e(a,b){return b=A.prototype.toLowerCase.call(b),"finite"==b?isFinite(a):"array"==b&&(a instanceof Array||Array.isArray&&Array.isArray(a))?!0:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||J.call(a).slice(8,-1).toLowerCase()==b}function f(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=f(a[c]));return b}function h(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function i(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),g=d.cache=d.cache||{},i=d.count=d.count||[];return g[z](f)?(h(i,f),c?c(g[f]):g[f]):(i.length>=1e3&&delete g[i.shift()],i.push(f),g[f]=a.apply(b,e),c?c(g[f]):g[f])}return d}function j(a,b,c,d,e,f){if(null==e){var g=a-c,h=b-d;return g||h?(180+180*D.atan2(-h,-g)/H+360)%360:0}return j(a,b,e,f)-j(c,d,e,f)}function k(a){return a%360*H/180}function l(a){return 180*a/H%360}function m(a){var b=[];return a=a.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(a,c,d){return d=d.split(/\s*,\s*|\s+/),"rotate"==c&&1==d.length&&d.push(0,0),"scale"==c&&(d.length>2?d=d.slice(0,2):2==d.length&&d.push(0,0),1==d.length&&d.push(d[0],0,0)),"skewX"==c?b.push(["m",1,0,D.tan(k(d[0])),1,0,0]):"skewY"==c?b.push(["m",1,D.tan(k(d[0])),0,1,0,0]):b.push([c.charAt(0)].concat(d)),a}),b}function n(a,b){var d=aa(a),e=new c.Matrix;if(d)for(var f=0,g=d.length;g>f;f++){var h,i,j,k,l,m=d[f],n=m.length,o=A(m[0]).toLowerCase(),p=m[0]!=o,q=p?e.invert():0;"t"==o&&2==n?e.translate(m[1],0):"t"==o&&3==n?p?(h=q.x(0,0),i=q.y(0,0),j=q.x(m[1],m[2]),k=q.y(m[1],m[2]),e.translate(j-h,k-i)):e.translate(m[1],m[2]):"r"==o?2==n?(l=l||b,e.rotate(m[1],l.x+l.width/2,l.y+l.height/2)):4==n&&(p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.rotate(m[1],j,k)):e.rotate(m[1],m[2],m[3])):"s"==o?2==n||3==n?(l=l||b,e.scale(m[1],m[n-1],l.x+l.width/2,l.y+l.height/2)):4==n?p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.scale(m[1],m[1],j,k)):e.scale(m[1],m[1],m[2],m[3]):5==n&&(p?(j=q.x(m[3],m[4]),k=q.y(m[3],m[4]),e.scale(m[1],m[2],j,k)):e.scale(m[1],m[2],m[3],m[4])):"m"==o&&7==n&&e.add(m[1],m[2],m[3],m[4],m[5],m[6])}return e}function o(a){var b=a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||a.node.parentNode&&w(a.node.parentNode)||c.select("svg")||c(0,0),d=b.select("defs"),e=null==d?!1:d.node;return e||(e=u("defs",b.node).node),e}function p(a){return a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||c.select("svg")}function q(a,b,c){function e(a){if(null==a)return I;if(a==+a)return a;d(j,{width:a});try{return j.getBBox().width}catch(b){return 0}}function f(a){if(null==a)return I;if(a==+a)return a;d(j,{height:a});try{return j.getBBox().height}catch(b){return 0}}function g(d,e){null==b?i[d]=e(a.attr(d)||0):d==b&&(i=e(null==c?a.attr(d)||0:c))}var h=p(a).node,i={},j=h.querySelector(".svg---mgr");switch(j||(j=d("rect"),d(j,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),h.appendChild(j)),a.type){case"rect":g("rx",e),g("ry",f);case"image":g("width",e),g("height",f);case"text":g("x",e),g("y",f);break;case"circle":g("cx",e),g("cy",f),g("r",e);break;case"ellipse":g("cx",e),g("cy",f),g("rx",e),g("ry",f);break;case"line":g("x1",e),g("x2",e),g("y1",f),g("y2",f);break;case"marker":g("refX",e),g("markerWidth",e),g("refY",f),g("markerHeight",f);break;case"radialGradient":g("fx",e),g("fy",f);break;case"tspan":g("dx",e),g("dy",f);break;default:g(b,e)}return h.removeChild(j),i}function r(a){e(a,"array")||(a=Array.prototype.slice.call(arguments,0));for(var b=0,c=0,d=this.node;this[b];)delete this[b++];for(b=0;bc;c++){var e={type:a[c].type,attr:a[c].attr()},f=a[c].children();b.push(e),f.length&&x(f,e.childNodes=[])}}c.version="0.4.2dev",c.toString=function(){return"Snap v"+this.version},c._={};var y={win:a.window,doc:a.window.document};c._.glob=y;var z="hasOwnProperty",A=String,B=parseFloat,C=parseInt,D=Math,E=D.max,F=D.min,G=D.abs,H=(D.pow,D.PI),I=(D.round,""),J=Object.prototype.toString,K=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,L=(c._.separator=/[,\s]+/,/[\s]*,[\s]*/),M={hs:1,rg:1},N=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,O=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,P=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\s]*,?[\s]*/gi,Q=0,R="S"+(+new Date).toString(36),S=function(a){return(a&&a.type?a.type:I)+R+(Q++).toString(36)},T="http://www.w3.org/1999/xlink",U="http://www.w3.org/2000/svg",V={};c.url=function(a){return"url('#"+a+"')"};c._.$=d,c._.id=S,c.format=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return A(b).replace(a,function(a,b){return c(a,b,d)})}}(),c._.clone=f,c._.cacher=i,c.rad=k,c.deg=l,c.sin=function(a){return D.sin(c.rad(a))},c.tan=function(a){return D.tan(c.rad(a))},c.cos=function(a){return D.cos(c.rad(a))},c.asin=function(a){return c.deg(D.asin(a))},c.acos=function(a){return c.deg(D.acos(a))},c.atan=function(a){return c.deg(D.atan(a))},c.atan2=function(a){return c.deg(D.atan2(a))},c.angle=j,c.len=function(a,b,d,e){return Math.sqrt(c.len2(a,b,d,e))},c.len2=function(a,b,c,d){return(a-c)*(a-c)+(b-d)*(b-d)},c.closestPoint=function(a,b,c){function d(a){var d=a.x-b,e=a.y-c;return d*d+e*e}for(var e,f,g,h,i=a.node,j=i.getTotalLength(),k=j/i.pathSegList.numberOfItems*.125,l=1/0,m=0;j>=m;m+=k)(h=d(g=i.getPointAtLength(m))).5;){var n,o,p,q,r,s;(p=f-k)>=0&&(r=d(n=i.getPointAtLength(p)))f)return b-f;if(f>a-c)return b-f+a}return b},c.getRGB=i(function(a){if(!a||(a=A(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};if("none"==a)return{r:-1,g:-1,b:-1,hex:"none",toString:Z};if(!(M[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=W(a)),!a)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};var b,d,f,g,h,i,j=a.match(K);return j?(j[2]&&(f=C(j[2].substring(5),16),d=C(j[2].substring(3,5),16),b=C(j[2].substring(1,3),16)),j[3]&&(f=C((h=j[3].charAt(3))+h,16),d=C((h=j[3].charAt(2))+h,16),b=C((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=B(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),f=B(i[2]),"%"==i[2].slice(-1)&&(f*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100)),j[5]?(i=j[5].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsb2rgb(b,d,f,g)):j[6]?(i=j[6].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsl2rgb(b,d,f,g)):(b=F(D.round(b),255),d=F(D.round(d),255),f=F(D.round(f),255),g=F(E(g,0),1),j={r:b,g:d,b:f,toString:Z},j.hex="#"+(16777216|f|d<<8|b<<16).toString(16).slice(1),j.opacity=e(g,"finite")?g:1,j)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z}},c),c.hsb=i(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=i(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=i(function(a,b,c,d){if(e(d,"finite")){var f=D.round;return"rgba("+[f(a),f(b),f(c),+d.toFixed(2)]+")"}return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)});var W=function(a){var b=y.doc.getElementsByTagName("head")[0]||y.doc.getElementsByTagName("svg")[0],c="rgb(255, 0, 0)";return(W=i(function(a){if("red"==a.toLowerCase())return c;b.style.color=c,b.style.color=a;var d=y.doc.defaultView.getComputedStyle(b,I).getPropertyValue("color");return d==c?null:d}))(a)},X=function(){return"hsb("+[this.h,this.s,this.b]+")"},Y=function(){return"hsl("+[this.h,this.s,this.l]+")"},Z=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},$=function(a,b,d){if(null==b&&e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&e(a,string)){var f=c.getRGB(a);a=f.r,b=f.g,d=f.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},_=function(a,b,d,f){a=D.round(255*a),b=D.round(255*b),d=D.round(255*d);var g={r:a,g:b,b:d,opacity:e(f,"finite")?f:1,hex:c.rgb(a,b,d),toString:Z};return e(f,"finite")&&(g.opacity=f),g};c.color=function(a){var b;return e(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):e(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):(e(a,"string")&&(a=c.getRGB(a)),e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&!("error"in a)?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1,a.error=1)),a.toString=Z,a},c.hsb2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var f,g,h,i,j;return a=a%360/60,j=c*b,i=j*(1-G(a%2-1)),f=g=h=c-j,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.hsl2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var f,g,h,i,j;return a=a%360/60,j=2*b*(.5>c?c:1-c),i=j*(1-G(a%2-1)),f=g=h=c-j/2,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.rgb2hsb=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=E(a,b,c),g=f-F(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:X}},c.rgb2hsl=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=E(a,b,c),h=F(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:Y}},c.parsePathString=function(a){if(!a)return null;var b=c.path(a);if(b.arr)return c.path.clone(b.arr);var d={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},f=[];return e(a,"array")&&e(a[0],"array")&&(f=c.path.clone(a)),f.length||A(a).replace(N,function(a,b,c){var e=[],g=b.toLowerCase();if(c.replace(P,function(a,b){b&&e.push(+b)}),"m"==g&&e.length>2&&(f.push([b].concat(e.splice(0,2))),g="l",b="m"==b?"l":"L"),"o"==g&&1==e.length&&f.push([b,e[0]]),"r"==g)f.push([b].concat(e));else for(;e.length>=d[g]&&(f.push([b].concat(e.splice(0,d[g]))),d[g]););}),f.toString=c.path.toString,b.arr=c.path.clone(f),f};var aa=c.parseTransformString=function(a){if(!a)return null;var b=[];return e(a,"array")&&e(a[0],"array")&&(b=c.path.clone(a)),b.length||A(a).replace(O,function(a,c,d){var e=[];c.toLowerCase();d.replace(P,function(a,b){b&&e.push(+b)}),b.push([c].concat(e))}),b.toString=c.path.toString,b};c._.svgTransform2string=m,c._.rgTransform=/^[a-z][\s]*-?\.?\d/i,c._.transform2matrix=n,c._unit2px=q;y.doc.contains||y.doc.compareDocumentPosition?function(a,b){var c=9==a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a==d||!(!d||1!=d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b;)if(b=b.parentNode,b==a)return!0;return!1};c._.getSomeDefs=o,c._.getSomeSVG=p,c.select=function(a){return a=A(a).replace(/([^\\]):/g,"$1\\:"),w(y.doc.querySelector(a))},c.selectAll=function(a){for(var b=y.doc.querySelectorAll(a),d=(c.set||Array)(),e=0;ei;i++)h[g[i].nodeName]=g[i].nodeValue;return h}if(e(a,"string")){if(!(arguments.length>1))return b("snap.util.getattr."+a,d).firstDefined();var k={};k[a]=c,a=k}for(var l in a)a[z](l)&&b("snap.util.attr."+l,d,a[l]);return d},c.parse=function(a){var b=y.doc.createDocumentFragment(),c=!0,d=y.doc.createElement("div");if(a=A(a),a.match(/^\s*<\s*svg(?:\s|>)/)||(a=""+a+"",c=!1),d.innerHTML=a,a=d.getElementsByTagName("svg")[0])if(c)b=a;else for(;a.firstChild;)b.appendChild(a.firstChild);return new t(b)},c.fragment=function(){for(var a=Array.prototype.slice.call(arguments,0),b=y.doc.createDocumentFragment(),d=0,e=a.length;e>d;d++){var f=a[d];f.node&&f.node.nodeType&&b.appendChild(f.node),f.nodeType&&b.appendChild(f),"string"==typeof f&&b.appendChild(c.parse(f).node)}return new t(b)},c._.make=u,c._.wrap=w,v.prototype.el=function(a,b){var c=u(a,this.node);return b&&c.attr(b),c},s.prototype.children=function(){for(var a=[],b=this.node.childNodes,d=0,e=b.length;e>d;d++)a[d]=c(b[d]);return a},s.prototype.toJSON=function(){var a=[];return x([this],a),a[0]},b.on("snap.util.getattr",function(){var a=b.nt();a=a.substring(a.lastIndexOf(".")+1);var c=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});return ba[z](c)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(c):d(this.node,a)});var ba={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};b.on("snap.util.attr",function(a){var c=b.nt(),e={};c=c.substring(c.lastIndexOf(".")+1),e[c]=a;var f=c.replace(/-(\w)/gi,function(a,b){return b.toUpperCase()}),g=c.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});ba[z](g)?this.node.style[f]=null==a?I:a:d(this.node,e)}),function(a){}(v.prototype),c.ajax=function(a,c,d,f){var g=new XMLHttpRequest,h=S();if(g){if(e(c,"function"))f=d,d=c,c=null;else if(e(c,"object")){var i=[];for(var j in c)c.hasOwnProperty(j)&&i.push(encodeURIComponent(j)+"="+encodeURIComponent(c[j]));c=i.join("&")}return g.open(c?"POST":"GET",a,!0),c&&(g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.setRequestHeader("Content-type","application/x-www-form-urlencoded")),d&&(b.once("snap.ajax."+h+".0",d),b.once("snap.ajax."+h+".200",d),b.once("snap.ajax."+h+".304",d)),g.onreadystatechange=function(){4==g.readyState&&b("snap.ajax."+h+"."+g.status,f,g)},4==g.readyState?g:(g.send(c),g)}},c.load=function(a,b,d){c.ajax(a,function(a){var e=c.parse(a.responseText);d?b.call(d,e):b(e)})};var ca=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,h=e.clientLeft||d.clientLeft||0,i=b.top+(g.win.pageYOffset||e.scrollTop||d.scrollTop)-f,j=b.left+(g.win.pageXOffset||e.scrollLeft||d.scrollLeft)-h;return{y:i,x:j}};return c.getElementByPoint=function(a,b){var c=this,d=(c.canvas,y.doc.elementFromPoint(a,b));if(y.win.opera&&"svg"==d.tagName){var e=ca(d),f=d.createSVGRect();f.x=a-e.x,f.y=b-e.y,f.width=f.height=1;var g=d.getIntersectionList(f,null);g.length&&(d=g[g.length-1])}return d?w(d):null},c.plugin=function(a){a(c,s,v,y,t)},y.win.Snap=c,c}(a||this);return d.plugin(function(c,d,e,f,g){function h(a,b){if(null==b){var d=!0;if(b="linearGradient"==a.type||"radialGradient"==a.type?a.node.getAttribute("gradientTransform"):"pattern"==a.type?a.node.getAttribute("patternTransform"):a.node.getAttribute("transform"),!b)return new c.Matrix;b=c._.svgTransform2string(b)}else b=c._.rgTransform.test(b)?m(b).replace(/\.{3}|\u2026/g,a._.transform||""):c._.svgTransform2string(b),l(b,"array")&&(b=c.path?c.path.toString.call(b):m(b)),a._.transform=b;var e=c._.transform2matrix(b,a.getBBox(1));return d?e:void(a.matrix=e)}function i(a){function b(a,b){var d=o(a.node,b);d=d&&d.match(g),d=d&&d[2],d&&"#"==d.charAt()&&(d=d.substring(1),d&&(i[d]=(i[d]||[]).concat(function(d){var e={};e[b]=c.url(d),o(a.node,e)})))}function d(a){var b=o(a.node,"xlink:href");b&&"#"==b.charAt()&&(b=b.substring(1),b&&(i[b]=(i[b]||[]).concat(function(b){a.attr("xlink:href","#"+b)})))}for(var e,f=a.selectAll("*"),g=/^\s*url\(("|'|)(.*)\1\)\s*$/,h=[],i={},j=0,k=f.length;k>j;j++){e=f[j],b(e,"fill"),b(e,"stroke"),b(e,"filter"),b(e,"mask"),b(e,"clip-path"),d(e);var l=o(e.node,"id");l&&(o(e.node,{id:e.id}),h.push({old:l,id:e.id}))}for(j=0,k=h.length;k>j;j++){var m=i[h[j].old];if(m)for(var n=0,p=m.length;p>n;n++)m[n](h[j].id)}}function j(a){return function(){var b=a?"<"+this.type:"",c=this.node.attributes,d=this.node.childNodes;if(a)for(var e=0,f=c.length;f>e;e++)b+=" "+c[e].name+'="'+c[e].value.replace(/"/g,'\\"')+'"';if(d.length){for(a&&(b+=">"),e=0,f=d.length;f>e;e++)3==d[e].nodeType?b+=d[e].nodeValue:1==d[e].nodeType&&(b+=s(d[e]).toString());a&&(b+="")}else a&&(b+="/>");return b}}var k=d.prototype,l=c.is,m=String,n=c._unit2px,o=c._.$,p=c._.make,q=c._.getSomeDefs,r="hasOwnProperty",s=c._.wrap;k.getBBox=function(a){if("tspan"==this.type)return c._.box(this.node.getClientRects().item(0));if(!c.Matrix||!c.path)return this.node.getBBox();var b=this,d=new c.Matrix;if(b.removed)return c._.box();for(;"use"==b.type;)if(a||(d=d.add(b.transform().localMatrix.translate(b.attr("x")||0,b.attr("y")||0))),b.original)b=b.original;else{var e=b.attr("xlink:href");b=b.original=b.node.ownerDocument.getElementById(e.substring(e.indexOf("#")+1))}var f=b._,g=c.path.get[b.type]||c.path.get.deflt;try{return a?(f.bboxwt=g?c.path.getBBox(b.realPath=g(b)):c._.box(b.node.getBBox()),c._.box(f.bboxwt)):(b.realPath=g(b),b.matrix=b.transform().localMatrix,f.bbox=c.path.getBBox(c.path.map(b.realPath,d.add(b.matrix))),c._.box(f.bbox))}catch(h){return c._.box()}};var t=function(){return this.string};k.transform=function(a){var b=this._;if(null==a){for(var d,e=this,f=new c.Matrix(this.node.getCTM()),g=h(this),i=[g],j=new c.Matrix,k=g.toTransformString(),l=m(g)==m(this.matrix)?m(b.transform):k;"svg"!=e.type&&(e=e.parent());)i.push(h(e));for(d=i.length;d--;)j.add(i[d]);return{string:l,globalMatrix:f,totalMatrix:j,localMatrix:g,diffMatrix:f.clone().add(g.invert()),global:f.toTransformString(),total:j.toTransformString(),local:k,toString:t}}return a instanceof c.Matrix?(this.matrix=a,this._.transform=a.toTransformString()):h(this,a),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?o(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?o(this.node,{patternTransform:this.matrix}):o(this.node,{transform:this.matrix})),this},k.parent=function(){return s(this.node.parentNode)},k.append=k.add=function(a){if(a){if("set"==a.type){var b=this;return a.forEach(function(a){b.add(a)}),this}a=s(a),this.node.appendChild(a.node),a.paper=this.paper}return this},k.appendTo=function(a){return a&&(a=s(a),a.append(this)),this},k.prepend=function(a){if(a){if("set"==a.type){var b,c=this;return a.forEach(function(a){b?b.after(a):c.prepend(a),b=a}),this}a=s(a);var d=a.parent();this.node.insertBefore(a.node,this.node.firstChild),this.add&&this.add(),a.paper=this.paper,this.parent()&&this.parent().add(),d&&d.add()}return this},k.prependTo=function(a){return a=s(a),a.prepend(this),this},k.before=function(a){if("set"==a.type){var b=this;return a.forEach(function(a){var c=a.parent();b.node.parentNode.insertBefore(a.node,b.node),c&&c.add()}),this.parent().add(),this}a=s(a);var c=a.parent();return this.node.parentNode.insertBefore(a.node,this.node),this.parent()&&this.parent().add(),c&&c.add(),a.paper=this.paper,this},k.after=function(a){a=s(a);var b=a.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(a.node,this.node.nextSibling):this.node.parentNode.appendChild(a.node),this.parent()&&this.parent().add(),b&&b.add(),a.paper=this.paper,this},k.insertBefore=function(a){a=s(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},k.insertAfter=function(a){a=s(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node.nextSibling),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},k.remove=function(){var a=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,a&&a.add(),this},k.select=function(a){return s(this.node.querySelector(a))},k.selectAll=function(a){for(var b=this.node.querySelectorAll(a),d=(c.set||Array)(),e=0;e{contents}',{x:+b.x.toFixed(3),y:+b.y.toFixed(3),width:+b.width.toFixed(3),height:+b.height.toFixed(3),contents:this.outerSVG() -});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))}},g.prototype.select=k.select,g.prototype.selectAll=k.selectAll}),d.plugin(function(a,d,e,f,g){function h(a,b,c){return function(d){var e=d.slice(a,b);return 1==e.length&&(e=e[0]),c?c(e):e}}var i=d.prototype,j=a.is,k=String,l="hasOwnProperty",m=function(a,b,d,e){"function"!=typeof d||d.length||(e=d,d=c.linear),this.attr=a,this.dur=b,d&&(this.easing=d),e&&(this.callback=e)};a._.Animation=m,a.animation=function(a,b,c,d){return new m(a,b,c,d)},i.inAnim=function(){var a=this,b=[];for(var c in a.anims)a.anims[l](c)&&!function(a){b.push({anim:new m(a._attrs,a.dur,a.easing,a._callback),mina:a,curStatus:a.status(),status:function(b){return a.status(b)},stop:function(){a.stop()}})}(a.anims[c]);return b},a.animate=function(a,d,e,f,g,h){"function"!=typeof g||g.length||(h=g,g=c.linear);var i=c.time(),j=c(a,d,i,i+f,c.time,e,g);return h&&b.once("mina.finish."+j.id,h),j},i.stop=function(){for(var a=this.inAnim(),b=0,c=a.length;c>b;b++)a[b].stop();return this},i.animate=function(a,d,e,f){"function"!=typeof e||e.length||(f=e,e=c.linear),a instanceof m&&(f=a.callback,e=a.easing,d=a.dur,a=a.attr);var g,i,n,o,p=[],q=[],r={},s=this;for(var t in a)if(a[l](t)){s.equal?(o=s.equal(t,k(a[t])),g=o.from,i=o.to,n=o.f):(g=+s.attr(t),i=+a[t]);var u=j(g,"array")?g.length:1;r[t]=h(p.length,p.length+u,n),p=p.concat(g),q=q.concat(i)}var v=c.time(),w=c(p,q,v,v+d,c.time,function(a){var b={};for(var c in r)r[l](c)&&(b[c]=r[c](a));s.attr(b)},e);return s.anims[w.id]=w,w._attrs=a,w._callback=f,b("snap.animcreated."+s.id,w),b.once("mina.finish."+w.id,function(){b.off("mina.*."+w.id),delete s.anims[w.id],f&&f.call(s)}),b.once("mina.stop."+w.id,function(){b.off("mina.*."+w.id),delete s.anims[w.id]}),s}}),d.plugin(function(a,b,c,d,e){function f(a,b,c,d,e,f){return null==b&&"[object SVGMatrix]"==g.call(a)?(this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.e=a.e,void(this.f=a.f)):void(null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var g=Object.prototype.toString,h=String,i=Math,j="";!function(b){function c(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var b=i.sqrt(c(a));a[0]&&(a[0]/=b),a[1]&&(a[1]/=b)}b.add=function(a,b,c,d,e,g){if(a&&a instanceof f)return this.add(a.a,a.b,a.c,a.d,a.e,a.f);var h=a*this.a+b*this.c,i=a*this.b+b*this.d;return this.e+=e*this.a+g*this.c,this.f+=e*this.b+g*this.d,this.c=c*this.a+d*this.c,this.d=c*this.b+d*this.d,this.a=h,this.b=i,this},f.prototype.multLeft=function(a,b,c,d,e,g){if(a&&a instanceof f)return this.multLeft(a.a,a.b,a.c,a.d,a.e,a.f);var h=a*this.a+c*this.b,i=a*this.c+c*this.d,j=a*this.e+c*this.f+e;return this.b=b*this.a+d*this.b,this.d=b*this.c+d*this.d,this.f=b*this.e+d*this.f+g,this.a=h,this.c=i,this.e=j,this},b.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new f(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},b.clone=function(){return new f(this.a,this.b,this.c,this.d,this.e,this.f)},b.translate=function(a,b){return this.e+=a*this.a+b*this.c,this.f+=a*this.b+b*this.d,this},b.scale=function(a,b,c,d){return null==b&&(b=a),(c||d)&&this.translate(c,d),this.a*=a,this.b*=a,this.c*=b,this.d*=b,(c||d)&&this.translate(-c,-d),this},b.rotate=function(b,c,d){b=a.rad(b),c=c||0,d=d||0;var e=+i.cos(b).toFixed(9),f=+i.sin(b).toFixed(9);return this.add(e,f,-f,e,c,d),this.add(1,0,0,1,-c,-d)},b.skewX=function(a){return this.skew(a,0)},b.skewY=function(a){return this.skew(0,a)},b.skew=function(b,c){b=b||0,c=c||0,b=a.rad(b),c=a.rad(c);var d=i.tan(b).toFixed(9),e=i.tan(c).toFixed(9);return this.add(1,e,d,1,0,0)},b.x=function(a,b){return a*this.a+b*this.c+this.e},b.y=function(a,b){return a*this.b+b*this.d+this.f},b.get=function(a){return+this[h.fromCharCode(97+a)].toFixed(4)},b.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},b.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},b.determinant=function(){return this.a*this.d-this.b*this.c},b.split=function(){var b={};b.dx=this.e,b.dy=this.f;var e=[[this.a,this.b],[this.c,this.d]];b.scalex=i.sqrt(c(e[0])),d(e[0]),b.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*b.shear,e[1][1]-e[0][1]*b.shear],b.scaley=i.sqrt(c(e[1])),d(e[1]),b.shear/=b.scaley,this.determinant()<0&&(b.scalex=-b.scalex);var f=e[0][1],g=e[1][1];return 0>g?(b.rotate=a.deg(i.acos(g)),0>f&&(b.rotate=360-b.rotate)):b.rotate=a.deg(i.asin(f)),b.isSimple=!(+b.shear.toFixed(9)||b.scalex.toFixed(9)!=b.scaley.toFixed(9)&&b.rotate),b.isSuperSimple=!+b.shear.toFixed(9)&&b.scalex.toFixed(9)==b.scaley.toFixed(9)&&!b.rotate,b.noRotation=!+b.shear.toFixed(9)&&!b.rotate,b},b.toTransformString=function(a){var b=a||this.split();return+b.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[+b.dx.toFixed(4),+b.dy.toFixed(4)]:j)+(b.rotate?"r"+[+b.rotate.toFixed(4),0,0]:j)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:j))}}(f.prototype),a.Matrix=f,a.matrix=function(a,b,c,d,e,g){return new f(a,b,c,d,e,g)}}),d.plugin(function(a,c,d,e,f){function g(d){return function(e){if(b.stop(),e instanceof f&&1==e.node.childNodes.length&&("radialGradient"==e.node.firstChild.tagName||"linearGradient"==e.node.firstChild.tagName||"pattern"==e.node.firstChild.tagName)&&(e=e.node.firstChild,n(this).appendChild(e),e=l(e)),e instanceof c)if("radialGradient"==e.type||"linearGradient"==e.type||"pattern"==e.type){e.node.id||p(e.node,{id:e.id});var g=q(e.node.id)}else g=e.attr(d);else if(g=a.color(e),g.error){var h=a(n(this).ownerSVGElement).gradient(e);h?(h.node.id||p(h.node,{id:h.id}),g=q(h.node.id)):g=e}else g=r(g);var i={};i[d]=g,p(this.node,i),this.node.style[d]=t}}function h(a){b.stop(),a==+a&&(a+="px"),this.node.style.fontSize=a}function i(a){for(var b=[],c=a.childNodes,d=0,e=c.length;e>d;d++){var f=c[d];3==f.nodeType&&b.push(f.nodeValue),"tspan"==f.tagName&&(1==f.childNodes.length&&3==f.firstChild.nodeType?b.push(f.firstChild.nodeValue):b.push(i(f)))}return b}function j(){return b.stop(),this.node.style.fontSize}var k=a._.make,l=a._.wrap,m=a.is,n=a._.getSomeDefs,o=/^url\(#?([^)]+)\)$/,p=a._.$,q=a.url,r=String,s=a._.separator,t="";a.deurl=function(a){return String(a).match(o)[1]},b.on("snap.util.attr.mask",function(a){if(a instanceof c||a instanceof f){if(b.stop(),a instanceof f&&1==a.node.childNodes.length&&(a=a.node.firstChild,n(this).appendChild(a),a=l(a)),"mask"==a.type)var d=a;else d=k("mask",n(this)),d.node.appendChild(a.node);!d.node.id&&p(d.node,{id:d.id}),p(this.node,{mask:q(d.id)})}}),function(a){b.on("snap.util.attr.clip",a),b.on("snap.util.attr.clip-path",a),b.on("snap.util.attr.clipPath",a)}(function(a){if(a instanceof c||a instanceof f){if(b.stop(),"clipPath"==a.type)var d=a;else d=k("clipPath",n(this)),d.node.appendChild(a.node),!d.node.id&&p(d.node,{id:d.id});p(this.node,{"clip-path":q(d.node.id||d.id)})}}),b.on("snap.util.attr.fill",g("fill")),b.on("snap.util.attr.stroke",g("stroke"));var u=/^([lr])(?:\(([^)]*)\))?(.*)$/i;b.on("snap.util.grad.parse",function(a){function b(a,b){for(var c=(b-h)/(a-i),d=i;a>d;d++)f[d].offset=+(+h+c*(d-i)).toFixed(2);i=a,h=b}a=r(a);var c=a.match(u);if(!c)return null;var d=c[1],e=c[2],f=c[3];e=e.split(/\s*,\s*/).map(function(a){return+a==a?+a:a}),1==e.length&&0==e[0]&&(e=[]),f=f.split("-"),f=f.map(function(a){a=a.split(":");var b={color:a[0]};return a[1]&&(b.offset=parseFloat(a[1])),b});var g=f.length,h=0,i=0;g--;for(var j=0;g>j;j++)"offset"in f[j]&&b(j,f[j].offset);return f[g].offset=f[g].offset||100,b(g,f[g].offset),{type:d,params:e,stops:f}}),b.on("snap.util.attr.d",function(c){b.stop(),m(c,"array")&&m(c[0],"array")&&(c=a.path.toString.call(c)),c=r(c),c.match(/[ruo]/i)&&(c=a.path.toAbsolute(c)),p(this.node,{d:c})})(-1),b.on("snap.util.attr.#text",function(a){b.stop(),a=r(a);for(var c=e.doc.createTextNode(a);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(c)})(-1),b.on("snap.util.attr.path",function(a){b.stop(),this.attr({d:a})})(-1),b.on("snap.util.attr.class",function(a){b.stop(),this.node.className.baseVal=a})(-1),b.on("snap.util.attr.viewBox",function(a){var c;c=m(a,"object")&&"x"in a?[a.x,a.y,a.width,a.height].join(" "):m(a,"array")?a.join(" "):a,p(this.node,{viewBox:c}),b.stop()})(-1),b.on("snap.util.attr.transform",function(a){this.transform(a),b.stop()})(-1),b.on("snap.util.attr.r",function(a){"rect"==this.type&&(b.stop(),p(this.node,{rx:a,ry:a}))})(-1),b.on("snap.util.attr.textpath",function(a){if(b.stop(),"text"==this.type){var d,e,f;if(!a&&this.textPath){for(e=this.textPath;e.node.firstChild;)this.node.appendChild(e.node.firstChild);return e.remove(),void delete this.textPath}if(m(a,"string")){var g=n(this),h=l(g.parentNode).path(a);g.appendChild(h.node),d=h.id,h.attr({id:d})}else a=l(a),a instanceof c&&(d=a.attr("id"),d||(d=a.id,a.attr({id:d})));if(d)if(e=this.textPath,f=this.node,e)e.attr({"xlink:href":"#"+d});else{for(e=p("textPath",{"xlink:href":"#"+d});f.firstChild;)e.appendChild(f.firstChild);f.appendChild(e),this.textPath=l(e)}}})(-1),b.on("snap.util.attr.text",function(a){if("text"==this.type){for(var c=this.node,d=function(a){var b=p("tspan");if(m(a,"array"))for(var c=0;c1&&(a=Array.prototype.slice.call(arguments,0));var b={};return i(a,"object")&&!i(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polyline",b)},h.polygon=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b={};return i(a,"object")&&!i(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polygon",b)},function(){function d(){return this.selectAll("stop")}function e(a,b){var d=l("stop"),e={offset:+b+"%"};a=c.color(a),e["stop-color"]=a.hex,a.opacity<1&&(e["stop-opacity"]=a.opacity),l(d,e);for(var f,g=this.stops(),h=0;hb){this.node.insertBefore(d,g[h].node),f=!0;break}}return f||this.node.appendChild(d),this}function f(){if("linearGradient"==this.type){var a=l(this.node,"x1")||0,b=l(this.node,"x2")||1,d=l(this.node,"y1")||0,e=l(this.node,"y2")||0;return c._.box(a,d,math.abs(b-a),math.abs(e-d))}var f=this.node.cx||.5,g=this.node.cy||.5,h=this.node.r||0;return c._.box(f-h,g-h,2*h,2*h)}function g(a){var d=a,e=this.stops();if("string"==typeof a&&(d=b("snap.util.grad.parse",null,"l(0,0,0,1)"+a).firstDefined().stops),c.is(d,"array")){for(var f=0;fh;h++){var i=f[h];d.addStop(i.color,i.offset)}return d}function j(a,b,h,i,j){var k=c._.make("linearGradient",a);return k.stops=d,k.addStop=e,k.getBBox=f,k.setStops=g,null!=b&&l(k.node,{x1:b,y1:h,x2:i,y2:j}),k}function k(a,b,g,h,i,j){var k=c._.make("radialGradient",a);return k.stops=d,k.addStop=e,k.getBBox=f,null!=b&&l(k.node,{cx:b,cy:g,r:h}),null!=i&&null!=j&&l(k.node,{fx:i,fy:j}),k}var l=c._.$;h.gradient=function(a){return i(this.defs,a)},h.gradientLinear=function(a,b,c,d){return j(this.defs,a,b,c,d)},h.gradientRadial=function(a,b,c,d,e){return k(this.defs,a,b,c,d,e)},h.toString=function(){var a,b=this.node.ownerDocument,d=b.createDocumentFragment(),e=b.createElement("div"),f=this.node.cloneNode(!0);return d.appendChild(e),e.appendChild(f),c._.$(f,{xmlns:"http://www.w3.org/2000/svg"}),a=e.innerHTML,d.removeChild(d.firstChild),a},h.toDataURL=function(){return a&&a.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},h.clear=function(){for(var a,b=this.node.firstChild;b;)a=b.nextSibling,"defs"!=b.tagName?b.parentNode.removeChild(b):h.clear.call({node:b}),b=a}}()}),d.plugin(function(a,b,c,d){function e(a){var b=e.ps=e.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[M](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]}function f(a,b,c,d){return null==a&&(a=b=c=d=0),null==b&&(b=a.y,c=a.width,d=a.height,a=a.x),{x:a,y:b,width:c,w:c,height:d,h:d,x2:a+c,y2:b+d,cx:a+c/2,cy:b+d/2,r1:P.min(c,d)/2,r2:P.max(c,d)/2,r0:P.sqrt(c*c+d*d)/2,path:y(a,b,c,d),vb:[a,b,c,d].join(" ")}}function g(){return this.join(",").replace(N,"$1")}function h(a){var b=L(a);return b.toString=g,b}function i(a,b,c,d,e,f,g,h,i){return null==i?p(a,b,c,d,e,f,g,h):k(a,b,c,d,e,f,g,h,q(a,b,c,d,e,f,g,h,i))}function j(c,d){function e(a){return+(+a).toFixed(3)}return a._.cacher(function(a,f,g){a instanceof b&&(a=a.attr("d")),a=G(a);for(var h,j,l,m,n,o="",p={},q=0,r=0,s=a.length;s>r;r++){if(l=a[r],"M"==l[0])h=+l[1],j=+l[2];else{if(m=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6]),q+m>f){if(d&&!p.start){if(n=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6],f-q),o+=["C"+e(n.start.x),e(n.start.y),e(n.m.x),e(n.m.y),e(n.x),e(n.y)],g)return o;p.start=o,o=["M"+e(n.x),e(n.y)+"C"+e(n.n.x),e(n.n.y),e(n.end.x),e(n.end.y),e(l[5]),e(l[6])].join(),q+=m,h=+l[5],j=+l[6];continue}if(!c&&!d)return n=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6],f-q)}q+=m,h=+l[5],j=+l[6]}o+=l.shift()+l}return p.end=o,n=c?q:d?p:k(h,j,l[0],l[1],l[2],l[3],l[4],l[5],1)},null,a._.clone)}function k(a,b,c,d,e,f,g,h,i){var j=1-i,k=T(j,3),l=T(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*P.atan2(q-s,r-t)/Q;return{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}}function l(b,c,d,e,g,h,i,j){a.is(b,"array")||(b=[b,c,d,e,g,h,i,j]);var k=F.apply(null,b);return f(k.min.x,k.min.y,k.max.x-k.min.x,k.max.y-k.min.y)}function m(a,b,c){return b>=a.x&&b<=a.x+a.width&&c>=a.y&&c<=a.y+a.height}function n(a,b){return a=f(a),b=f(b),m(b,a.x,a.y)||m(b,a.x2,a.y)||m(b,a.x,a.y2)||m(b,a.x2,a.y2)||m(a,b.x,b.y)||m(a,b.x2,b.y)||m(a,b.x,b.y2)||m(a,b.x2,b.y2)||(a.xb.x||b.xa.x)&&(a.yb.y||b.ya.y)}function o(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function p(a,b,c,d,e,f,g,h,i){null==i&&(i=1),i=i>1?1:0>i?0:i;for(var j=i/2,k=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0,p=0;k>p;p++){var q=j*l[p]+j,r=o(q,a,c,e,g),s=o(q,b,d,f,h),t=r*r+s*s;n+=m[p]*P.sqrt(t)}return j*n}function q(a,b,c,d,e,f,g,h,i){if(!(0>i||p(a,b,c,d,e,f,g,h)n;)l/=2,m+=(i>j?1:-1)*l,j=p(a,b,c,d,e,f,g,h,m);return m}}function r(a,b,c,d,e,f,g,h){if(!(S(a,c)S(e,g)||S(b,d)S(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+R(a,c).toFixed(2)||n>+S(a,c).toFixed(2)||n<+R(e,g).toFixed(2)||n>+S(e,g).toFixed(2)||o<+R(b,d).toFixed(2)||o>+S(b,d).toFixed(2)||o<+R(f,h).toFixed(2)||o>+S(f,h).toFixed(2)))return{x:l,y:m}}}}function s(a,b,c){var d=l(a),e=l(b);if(!n(d,e))return c?0:[];for(var f=p.apply(0,a),g=p.apply(0,b),h=~~(f/8),i=~~(g/8),j=[],m=[],o={},q=c?0:[],s=0;h+1>s;s++){var t=k.apply(0,a.concat(s/h));j.push({x:t.x,y:t.y,t:s/h})}for(s=0;i+1>s;s++)t=k.apply(0,b.concat(s/i)),m.push({x:t.x,y:t.y,t:s/i});for(s=0;h>s;s++)for(var u=0;i>u;u++){var v=j[s],w=j[s+1],x=m[u],y=m[u+1],z=U(w.x-v.x)<.001?"y":"x",A=U(y.x-x.x)<.001?"y":"x",B=r(v.x,v.y,w.x,w.y,x.x,x.y,y.x,y.y);if(B){if(o[B.x.toFixed(4)]==B.y.toFixed(4))continue;o[B.x.toFixed(4)]=B.y.toFixed(4);var C=v.t+U((B[z]-v[z])/(w[z]-v[z]))*(w.t-v.t),D=x.t+U((B[A]-x[A])/(y[A]-x[A]))*(y.t-x.t);C>=0&&1>=C&&D>=0&&1>=D&&(c?q++:q.push({x:B.x,y:B.y,t1:C,t2:D}))}}return q}function t(a,b){return v(a,b)}function u(a,b){return v(a,b,1)}function v(a,b,c){a=G(a),b=G(b);for(var d,e,f,g,h,i,j,k,l,m,n=c?0:[],o=0,p=a.length;p>o;o++){var q=a[o];if("M"==q[0])d=h=q[1],e=i=q[2];else{"C"==q[0]?(l=[d,e].concat(q.slice(1)),d=l[6],e=l[7]):(l=[d,e,d,e,h,i,h,i],d=h,e=i);for(var r=0,t=b.length;t>r;r++){var u=b[r];if("M"==u[0])f=j=u[1],g=k=u[2];else{"C"==u[0]?(m=[f,g].concat(u.slice(1)),f=m[6],g=m[7]):(m=[f,g,f,g,j,k,j,k],f=j,g=k);var v=s(l,m,c);if(c)n+=v;else{for(var w=0,x=v.length;x>w;w++)v[w].segment1=o,v[w].segment2=r,v[w].bez1=l,v[w].bez2=m;n=n.concat(v)}}}}}return n}function w(a,b,c){var d=x(a);return m(d,b,c)&&v(a,[["M",b,c],["H",d.x2+10]],1)%2==1}function x(a){var b=e(a);if(b.bbox)return L(b.bbox);if(!a)return f();a=G(a);for(var c,d=0,g=0,h=[],i=[],j=0,k=a.length;k>j;j++)if(c=a[j],"M"==c[0])d=c[1],g=c[2],h.push(d),i.push(g);else{var l=F(d,g,c[1],c[2],c[3],c[4],c[5],c[6]);h=h.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),d=c[5],g=c[6]}var m=R.apply(0,h),n=R.apply(0,i),o=S.apply(0,h),p=S.apply(0,i),q=f(m,n,o-m,p-n);return b.bbox=L(q),q}function y(a,b,c,d,e){if(e)return[["M",+a+ +e,b],["l",c-2*e,0],["a",e,e,0,0,1,e,e],["l",0,d-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-c,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-d],["a",e,e,0,0,1,e,-e],["z"]];var f=[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]];return f.toString=g,f}function z(a,b,c,d,e){if(null==e&&null==d&&(d=c),a=+a,b=+b,c=+c,d=+d,null!=e)var f=Math.PI/180,h=a+c*Math.cos(-d*f),i=a+c*Math.cos(-e*f),j=b+c*Math.sin(-d*f),k=b+c*Math.sin(-e*f),l=[["M",h,j],["A",c,c,0,+(e-d>180),0,i,k]];else l=[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]];return l.toString=g,l}function A(b){var c=e(b),d=String.prototype.toLowerCase;if(c.rel)return h(c.rel);a.is(b,"array")&&a.is(b&&b[0],"array")||(b=a.parsePathString(b));var f=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=b[0][1],j=b[0][2],k=i,l=j,m++,f.push(["M",i,j]));for(var n=m,o=b.length;o>n;n++){var p=f[n]=[],q=b[n];if(q[0]!=d.call(q[0]))switch(p[0]=d.call(q[0]),p[0]){case"a":p[1]=q[1],p[2]=q[2],p[3]=q[3],p[4]=q[4],p[5]=q[5],p[6]=+(q[6]-i).toFixed(3),p[7]=+(q[7]-j).toFixed(3);break;case"v":p[1]=+(q[1]-j).toFixed(3);break;case"m":k=q[1],l=q[2];default:for(var r=1,s=q.length;s>r;r++)p[r]=+(q[r]-(r%2?i:j)).toFixed(3)}else{p=f[n]=[],"m"==q[0]&&(k=q[1]+i,l=q[2]+j);for(var t=0,u=q.length;u>t;t++)f[n][t]=q[t]}var v=f[n].length;switch(f[n][0]){case"z":i=k,j=l;break;case"h":i+=+f[n][v-1];break;case"v":j+=+f[n][v-1];break;default:i+=+f[n][v-2],j+=+f[n][v-1]}}return f.toString=g,c.rel=h(f),f}function B(b){var c=e(b);if(c.abs)return h(c.abs);if(K(b,"array")&&K(b&&b[0],"array")||(b=a.parsePathString(b)),!b||!b.length)return[["M",0,0]];var d,f=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=+b[0][1],j=+b[0][2],k=i,l=j,m++,f[0]=["M",i,j]);for(var n,o,p=3==b.length&&"M"==b[0][0]&&"R"==b[1][0].toUpperCase()&&"Z"==b[2][0].toUpperCase(),q=m,r=b.length;r>q;q++){if(f.push(n=[]),o=b[q],d=o[0],d!=d.toUpperCase())switch(n[0]=d.toUpperCase(),n[0]){case"A":n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=+o[6]+i,n[7]=+o[7]+j;break;case"V":n[1]=+o[1]+j;break;case"H":n[1]=+o[1]+i;break;case"R":for(var s=[i,j].concat(o.slice(1)),t=2,u=s.length;u>t;t++)s[t]=+s[t]+i,s[++t]=+s[t]+j;f.pop(),f=f.concat(I(s,p));break;case"O":f.pop(),s=z(i,j,o[1],o[2]),s.push(s[0]),f=f.concat(s);break;case"U":f.pop(),f=f.concat(z(i,j,o[1],o[2],o[3])),n=["U"].concat(f[f.length-1].slice(-2));break;case"M":k=+o[1]+i,l=+o[2]+j;default:for(t=1,u=o.length;u>t;t++)n[t]=+o[t]+(t%2?i:j)}else if("R"==d)s=[i,j].concat(o.slice(1)),f.pop(),f=f.concat(I(s,p)),n=["R"].concat(o.slice(-2));else if("O"==d)f.pop(),s=z(i,j,o[1],o[2]),s.push(s[0]),f=f.concat(s);else if("U"==d)f.pop(),f=f.concat(z(i,j,o[1],o[2],o[3])),n=["U"].concat(f[f.length-1].slice(-2));else for(var v=0,w=o.length;w>v;v++)n[v]=o[v];if(d=d.toUpperCase(),"O"!=d)switch(n[0]){case"Z":i=+k,j=+l;break;case"H":i=n[1];break;case"V":j=n[1];break;case"M":k=n[n.length-2],l=n[n.length-1];default:i=n[n.length-2],j=n[n.length-1]}}return f.toString=g,c.abs=h(f),f}function C(a,b,c,d){return[a,b,c,d,c,d]}function D(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function E(b,c,d,e,f,g,h,i,j,k){var l,m=120*Q/180,n=Q/180*(+f||0),o=[],p=a._.cacher(function(a,b,c){var d=a*P.cos(c)-b*P.sin(c),e=a*P.sin(c)+b*P.cos(c);return{x:d,y:e}});if(!d||!e)return[b,c,i,j,i,j];if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(b,c,-n),b=l.x,c=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(P.cos(Q/180*f),P.sin(Q/180*f),(b-i)/2),r=(c-j)/2,s=q*q/(d*d)+r*r/(e*e);s>1&&(s=P.sqrt(s),d=s*d,e=s*e);var t=d*d,u=e*e,v=(g==h?-1:1)*P.sqrt(U((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*d*r/e+(b+i)/2,x=v*-e*q/d+(c+j)/2,y=P.asin(((c-x)/e).toFixed(9)),z=P.asin(((j-x)/e).toFixed(9));y=w>b?Q-y:y,z=w>i?Q-z:z,0>y&&(y=2*Q+y),0>z&&(z=2*Q+z),h&&y>z&&(y-=2*Q),!h&&z>y&&(z-=2*Q)}var A=z-y;if(U(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+d*P.cos(z),j=x+e*P.sin(z),o=E(i,j,d,e,f,0,h,C,D,[z,B,w,x])}A=z-y;var F=P.cos(y),G=P.sin(y),H=P.cos(z),I=P.sin(z),J=P.tan(A/4),K=4/3*d*J,L=4/3*e*J,M=[b,c],N=[b+K*G,c-L*F],O=[i+K*I,j-L*H],R=[i,j];if(N[0]=2*M[0]-N[0],N[1]=2*M[1]-N[1],k)return[N,O,R].concat(o);o=[N,O,R].concat(o).join().split(",");for(var S=[],T=0,V=o.length;V>T;T++)S[T]=T%2?p(o[T-1],o[T],n).y:p(o[T],o[T+1],n).x;return S}function F(a,b,c,d,e,f,g,h){for(var i,j,k,l,m,n,o,p,q=[],r=[[],[]],s=0;2>s;++s)if(0==s?(j=6*a-12*c+6*e,i=-3*a+9*c-9*e+3*g,k=3*c-3*a):(j=6*b-12*d+6*f,i=-3*b+9*d-9*f+3*h,k=3*d-3*b),U(i)<1e-12){if(U(j)<1e-12)continue;l=-k/j,l>0&&1>l&&q.push(l)}else o=j*j-4*k*i,p=P.sqrt(o),0>o||(m=(-j+p)/(2*i),m>0&&1>m&&q.push(m),n=(-j-p)/(2*i),n>0&&1>n&&q.push(n));for(var t,u=q.length,v=u;u--;)l=q[u],t=1-l,r[0][u]=t*t*t*a+3*t*t*l*c+3*t*l*l*e+l*l*l*g,r[1][u]=t*t*t*b+3*t*t*l*d+3*t*l*l*f+l*l*l*h;return r[0][v]=a,r[1][v]=b,r[0][v+1]=g,r[1][v+1]=h,r[0].length=r[1].length=v+2,{min:{x:R.apply(0,r[0]),y:R.apply(0,r[1])},max:{x:S.apply(0,r[0]),y:S.apply(0,r[1])}}}function G(a,b){var c=!b&&e(a);if(!b&&c.curve)return h(c.curve);for(var d=B(a),f=b&&B(b),g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},j=(function(a,b,c){var d,e;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"].concat(E.apply(0,[b.x,b.y].concat(a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e].concat(a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"].concat(D(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"].concat(D(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"].concat(C(b.x,b.y,a[1],a[2]));break;case"H":a=["C"].concat(C(b.x,b.y,a[1],b.y));break;case"V":a=["C"].concat(C(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"].concat(C(b.x,b.y,b.X,b.Y))}return a}),k=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)m[b]="A",f&&(n[b]="A"),a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),r=S(d.length,f&&f.length||0)}},l=function(a,b,c,e,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",e.x,e.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],r=S(d.length,f&&f.length||0))},m=[],n=[],o="",p="",q=0,r=S(d.length,f&&f.length||0);r>q;q++){d[q]&&(o=d[q][0]),"C"!=o&&(m[q]=o,q&&(p=m[q-1])),d[q]=j(d[q],g,p),"A"!=m[q]&&"C"==o&&(m[q]="C"),k(d,q),f&&(f[q]&&(o=f[q][0]),"C"!=o&&(n[q]=o,q&&(p=n[q-1])),f[q]=j(f[q],i,p),"A"!=n[q]&&"C"==o&&(n[q]="C"),k(f,q)),l(d,f,g,i,q),l(f,d,i,g,q);var s=d[q],t=f&&f[q],u=s.length,v=f&&t.length;g.x=s[u-2],g.y=s[u-1],g.bx=O(s[u-4])||g.x,g.by=O(s[u-3])||g.y,i.bx=f&&(O(t[v-4])||i.x),i.by=f&&(O(t[v-3])||i.y),i.x=f&&t[v-2],i.y=f&&t[v-1]}return f||(c.curve=h(d)),f?[d,f]:d}function H(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=G(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a}function I(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}var J=b.prototype,K=a.is,L=a._.clone,M="hasOwnProperty",N=/,?([a-z]),?/gi,O=parseFloat,P=Math,Q=P.PI,R=P.min,S=P.max,T=P.pow,U=P.abs,V=j(1),W=j(),X=j(0,1),Y=a._unit2px,Z={path:function(a){return a.attr("path")},circle:function(a){var b=Y(a);return z(b.cx,b.cy,b.r)},ellipse:function(a){var b=Y(a);return z(b.cx||0,b.cy||0,b.rx,b.ry)},rect:function(a){var b=Y(a);return y(b.x||0,b.y||0,b.width,b.height,b.rx,b.ry)},image:function(a){ -var b=Y(a);return y(b.x||0,b.y||0,b.width,b.height)},line:function(a){return"M"+[a.attr("x1")||0,a.attr("y1")||0,a.attr("x2"),a.attr("y2")]},polyline:function(a){return"M"+a.attr("points")},polygon:function(a){return"M"+a.attr("points")+"z"},deflt:function(a){var b=a.node.getBBox();return y(b.x,b.y,b.width,b.height)}};a.path=e,a.path.getTotalLength=V,a.path.getPointAtLength=W,a.path.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return X(a,b).end;var d=X(a,c,1);return b?X(d,b).end:d},J.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},J.getPointAtLength=function(a){return W(this.attr("d"),a)},J.getSubpath=function(b,c){return a.path.getSubpath(this.attr("d"),b,c)},a._.box=f,a.path.findDotsAtSegment=k,a.path.bezierBBox=l,a.path.isPointInsideBBox=m,a.closest=function(b,c,d,e){for(var g=100,h=f(b-g/2,c-g/2,g,g),i=[],j=d[0].hasOwnProperty("x")?function(a){return{x:d[a].x,y:d[a].y}}:function(a){return{x:d[a],y:e[a]}},k=0;1e6>=g&&!k;){for(var l=0,n=d.length;n>l;l++){var o=j(l);if(m(h,o.x,o.y)){k++,i.push(o);break}}k||(g*=2,h=f(b-g/2,c-g/2,g,g))}if(1e6!=g){var p,q=1/0;for(l=0,n=i.length;n>l;l++){var r=a.len(b,c,i[l].x,i[l].y);q>r&&(q=r,i[l].len=r,p=i[l])}return p}},a.path.isBBoxIntersect=n,a.path.intersection=t,a.path.intersectionNumber=u,a.path.isPointInside=w,a.path.getBBox=x,a.path.get=Z,a.path.toRelative=A,a.path.toAbsolute=B,a.path.toCubic=G,a.path.map=H,a.path.toString=g,a.path.clone=h}),d.plugin(function(a,d,e,f){var g=Math.max,h=Math.min,i=function(a){if(this.items=[],this.bindings={},this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)a[b]&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},j=i.prototype;j.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],a&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},j.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},j.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this},j.animate=function(d,e,f,g){"function"!=typeof f||f.length||(g=f,f=c.linear),d instanceof a._.Animation&&(g=d.callback,f=d.easing,e=f.dur,d=d.attr);var h=arguments;if(a.is(d,"array")&&a.is(h[h.length-1],"array"))var i=!0;var j,k=function(){j?this.b=j:j=this.b},l=0,m=this,n=g&&function(){++l==m.length&&g.call(this)};return this.forEach(function(a,c){b.once("snap.animcreated."+a.id,k),i?h[c]&&a.animate.apply(a,h[c]):a.animate(d,e,f,n)})},j.remove=function(){for(;this.length;)this.pop().remove();return this},j.bind=function(a,b,c){var d={};if("function"==typeof b)this.bindings[a]=b;else{var e=c||a;this.bindings[a]=function(a){d[e]=a,b.attr(d)}}return this},j.attr=function(a){var b={};for(var c in a)this.bindings[c]?this.bindings[c](a[c]):b[c]=a[c];for(var d=0,e=this.items.length;e>d;d++)this.items[d].attr(b);return this},j.clear=function(){for(;this.length;)this.pop()},j.splice=function(a,b,c){a=0>a?g(this.length+a,0):a,b=g(0,h(this.length-a,b));var d,e=[],f=[],j=[];for(d=2;dd;d++)f.push(this[a+d]);for(;dd?j[d]:e[d-k];for(d=this.items.length=this.length-=b-k;this[d];)delete this[d++];return new i(f)},j.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0;return!1},j.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},j.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=h.apply(0,a),b=h.apply(0,b),c=g.apply(0,c),d=g.apply(0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b,cx:a+(c-a)/2,cy:b+(d-b)/2}},j.clone=function(a){a=new i;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},j.toString=function(){return"Snap‘s set"},j.type="set",a.Set=i,a.set=function(){var a=new i;return arguments.length&&a.push.apply(a,Array.prototype.slice.call(arguments,0)),a}}),d.plugin(function(a,c,d,e){function f(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}}function g(b,c,d){b=b||new a.Matrix,c=c||new a.Matrix,b=a.parseTransformString(b.toTransformString())||[],c=a.parseTransformString(c.toTransformString())||[];for(var e,g,h,i,j=Math.max(b.length,c.length),k=[],n=[],o=0;j>o;o++){if(h=b[o]||f(c[o]),i=c[o]||f(h),h[0]!=i[0]||"r"==h[0].toLowerCase()&&(h[2]!=i[2]||h[3]!=i[3])||"s"==h[0].toLowerCase()&&(h[3]!=i[3]||h[4]!=i[4])){b=a._.transform2matrix(b,d()),c=a._.transform2matrix(c,d()),k=[["m",b.a,b.b,b.c,b.d,b.e,b.f]],n=[["m",c.a,c.b,c.c,c.d,c.e,c.f]];break}for(k[o]=[],n[o]=[],e=0,g=Math.max(h.length,i.length);g>e;e++)e in h&&(k[o][e]=h[e]),e in i&&(n[o][e]=i[e])}return{from:m(k),to:m(n),f:l(k)}}function h(a){return a}function i(a){return function(b){return+b.toFixed(3)+a}}function j(a){return a.join(" ")}function k(b){return a.rgb(b[0],b[1],b[2],b[3])}function l(a){var b,c,d,e,f,g,h=0,i=[];for(b=0,c=a.length;c>b;b++){for(f="[",g=['"'+a[b][0]+'"'],d=1,e=a[b].length;e>d;d++)g[d]="val["+h++ +"]";f+=g+"]",i[b]=f}return Function("val","return Snap.path.toString.call(["+i+"])")}function m(a){for(var b=[],c=0,d=a.length;d>c;c++)for(var e=1,f=a[c].length;f>e;e++)b.push(a[c][e]);return b}function n(a){return isFinite(a)}function o(b,c){return a.is(b,"array")&&a.is(c,"array")?b.toString()==c.toString():!1}var p={},q=/[%a-z]+$/i,r=String;p.stroke=p.fill="colour",c.prototype.equal=function(a,c){return b("snap.util.equal",this,a,c).firstDefined()},b.on("snap.util.equal",function(b,c){var d,e,f=r(this.attr(b)||""),s=this;if("colour"==p[b])return d=a.color(f),e=a.color(c),{from:[d.r,d.g,d.b,d.opacity],to:[e.r,e.g,e.b,e.opacity],f:k};if("viewBox"==b)return d=this.attr(b).vb.split(" ").map(Number),e=c.split(" ").map(Number),{from:d,to:e,f:j};if("transform"==b||"gradientTransform"==b||"patternTransform"==b)return"string"==typeof c&&(c=r(c).replace(/\.{3}|\u2026/g,f)),f=this.matrix,c=a._.rgTransform.test(c)?a._.transform2matrix(c,this.getBBox()):a._.transform2matrix(a._.svgTransform2string(c),this.getBBox()),g(f,c,function(){return s.getBBox(1)});if("d"==b||"path"==b)return d=a.path.toCubic(f,c),{from:m(d[0]),to:m(d[1]),f:l(d[0])};if("points"==b)return d=r(f).split(a._.separator),e=r(c).split(a._.separator),{from:d,to:e,f:function(a){return a}};if(n(f)&&n(c))return{from:parseFloat(f),to:parseFloat(c),f:h};var t=f.match(q),u=r(c).match(q);return t&&o(t,u)?{from:parseFloat(f),to:parseFloat(c),f:i(t)}:{from:this.asPX(b),to:this.asPX(b,c),f:h}})}),d.plugin(function(a,c,d,e){for(var f=c.prototype,g="hasOwnProperty",h=("createTouch"in e.doc),i=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],j={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},k=(function(a,b){var c="y"==a?"scrollTop":"scrollLeft",d=b&&b.node?b.node.ownerDocument:e.doc;return d[c in d.documentElement?"documentElement":"body"][c]}),l=function(){return this.originalEvent.preventDefault()},m=function(){return this.originalEvent.stopPropagation()},n=function(a,b,c,d){var e=h&&j[b]?j[b]:b,f=function(e){var f=k("y",d),i=k("x",d);if(h&&j[g](b))for(var n=0,o=e.targetTouches&&e.targetTouches.length;o>n;n++)if(e.targetTouches[n].target==a||a.contains(e.targetTouches[n].target)){var p=e;e=e.targetTouches[n],e.originalEvent=p,e.preventDefault=l,e.stopPropagation=m;break}var q=e.clientX+i,r=e.clientY+f;return c.call(d,e,q,r)};return b!==e&&a.addEventListener(b,f,!1),a.addEventListener(e,f,!1),function(){return b!==e&&a.removeEventListener(b,f,!1),a.removeEventListener(e,f,!1),!0}},o=[],p=function(a){for(var c,d=a.clientX,e=a.clientY,f=k("y"),g=k("x"),i=o.length;i--;){if(c=o[i],h){for(var j,l=a.touches&&a.touches.length;l--;)if(j=a.touches[l],j.identifier==c.el._drag.id||c.el.node.contains(j.target)){d=j.clientX,e=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var m=c.el.node;m.nextSibling,m.parentNode,m.style.display;d+=g,e+=f,b("snap.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},q=function(c){a.unmousemove(p).unmouseup(q);for(var d,e=o.length;e--;)d=o[e],d.el._drag={},b("snap.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,c),b.off("snap.drag.*."+d.el.id);o=[]},r=i.length;r--;)!function(b){a[b]=f[b]=function(c,d){if(a.is(c,"function"))this.events=this.events||[],this.events.push({name:b,f:c,unbind:n(this.node||document,b,c,d||this)});else for(var e=0,f=this.events.length;f>e;e++)if(this.events[e].name==b)try{this.events[e].f.call(this)}catch(g){}return this},a["un"+b]=f["un"+b]=function(a){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==b&&(c[d].f==a||!a))return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(i[r]);f.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},f.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var s=[];f.drag=function(c,d,e,f,g,h){function i(i,j,l){(i.originalEvent||i).preventDefault(),k._drag.x=j,k._drag.y=l,k._drag.id=i.identifier,!o.length&&a.mousemove(p).mouseup(q),o.push({el:k,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("snap.drag.start."+k.id,d),c&&b.on("snap.drag.move."+k.id,c),e&&b.on("snap.drag.end."+k.id,e),b("snap.drag.start."+k.id,g||f||k,j,l,i)}function j(a,c,d){b("snap.draginit."+k.id,k,a,c,d)}var k=this;if(!arguments.length){var l;return k.drag(function(a,b){this.attr({transform:l+(l?"T":"t")+[a,b]})},function(){l=this.transform().local})}return b.on("snap.draginit."+k.id,i),k._drag={},s.push({el:k,start:i,init:j}),k.mousedown(j),k},f.undrag=function(){for(var c=s.length;c--;)s[c].el==this&&(this.unmousedown(s[c].init),s.splice(c,1),b.unbind("snap.drag.*."+this.id),b.unbind("snap.draginit."+this.id));return!s.length&&a.unmousemove(p).unmouseup(q),this}}),d.plugin(function(a,c,d,e){var f=(c.prototype,d.prototype),g=/^\s*url\((.+)\)/,h=String,i=a._.$;a.filter={},f.filter=function(b){var d=this;"svg"!=d.type&&(d=d.paper);var e=a.parse(h(b)),f=a._.id(),g=(d.node.offsetWidth,d.node.offsetHeight,i("filter"));return i(g,{id:f,filterUnits:"userSpaceOnUse"}),g.appendChild(e.node),d.defs.appendChild(g),new c(g)},b.on("snap.util.getattr.filter",function(){b.stop();var c=i(this.node,"filter");if(c){var d=h(c).match(g);return d&&a.select(d[1])}}),b.on("snap.util.attr.filter",function(d){if(d instanceof c&&"filter"==d.type){b.stop();var e=d.node.id;e||(i(d.node,{id:d.id}),e=d.id),i(this.node,{filter:a.url(e)})}d&&"none"!=d||(b.stop(),this.node.removeAttribute("filter"))}),a.filter.blur=function(b,c){null==b&&(b=2);var d=null==c?b:[b,c];return a.format('',{def:d})},a.filter.blur.toString=function(){return this()},a.filter.shadow=function(b,c,d,e,f){return null==f&&(null==e?(f=d,d=4,e="#000"):(f=e,e=d,d=4)),null==d&&(d=4),null==f&&(f=1),null==b&&(b=0,c=2),null==c&&(c=b),e=a.color(e),a.format('',{color:e,dx:b,dy:c,blur:d,opacity:f})},a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(b){return null==b&&(b=1),a.format('',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(b){return null==b&&(b=1),a.format('',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(b){return null==b&&(b=1),a.format('',{amount:1-b})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(b){return b=b||0,a.format('',{angle:b})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(b){return null==b&&(b=1),a.format('',{amount:b,amount2:1-b})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(b){return null==b&&(b=1),a.format('',{amount:b})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(b){return null==b&&(b=1),a.format('',{amount:b,amount2:.5-b/2})},a.filter.contrast.toString=function(){return this()}}),d.plugin(function(a,b,c,d,e){var f=a._.box,g=a.is,h=/^[^a-z]*([tbmlrc])/i,i=function(){return"T"+this.dx+","+this.dy};b.prototype.getAlign=function(a,b){null==b&&g(a,"string")&&(b=a,a=null),a=a||this.paper;var c=a.getBBox?a.getBBox():f(a),d=this.getBBox(),e={};switch(b=b&&b.match(h),b=b?b[1].toLowerCase():"c"){case"t":e.dx=0,e.dy=c.y-d.y;break;case"b":e.dx=0,e.dy=c.y2-d.y2;break;case"m":e.dx=0,e.dy=c.cy-d.cy;break;case"l":e.dx=c.x-d.x,e.dy=0;break;case"r":e.dx=c.x2-d.x2,e.dy=0;break;default:e.dx=c.cx-d.cx,e.dy=0}return e.toString=i,e},b.prototype.align=function(a,b){return this.transform("..."+this.getAlign(a,b))}}),d.plugin(function(b,c,d,e){function f(a){a=a.split(/(?=#)/);var b=new String(a[5]);return b[50]=a[0],b[100]=a[1],b[200]=a[2],b[300]=a[3],b[400]=a[4],b[500]=a[5],b[600]=a[6],b[700]=a[7],b[800]=a[8],b[900]=a[9],a[10]&&(b.A100=a[10],b.A200=a[11],b.A400=a[12],b.A700=a[13]),b}var g="#ffebee#ffcdd2#ef9a9a#e57373#ef5350#f44336#e53935#d32f2f#c62828#b71c1c#ff8a80#ff5252#ff1744#d50000",h="#FCE4EC#F8BBD0#F48FB1#F06292#EC407A#E91E63#D81B60#C2185B#AD1457#880E4F#FF80AB#FF4081#F50057#C51162",i="#F3E5F5#E1BEE7#CE93D8#BA68C8#AB47BC#9C27B0#8E24AA#7B1FA2#6A1B9A#4A148C#EA80FC#E040FB#D500F9#AA00FF",j="#EDE7F6#D1C4E9#B39DDB#9575CD#7E57C2#673AB7#5E35B1#512DA8#4527A0#311B92#B388FF#7C4DFF#651FFF#6200EA",k="#E8EAF6#C5CAE9#9FA8DA#7986CB#5C6BC0#3F51B5#3949AB#303F9F#283593#1A237E#8C9EFF#536DFE#3D5AFE#304FFE",l="#E3F2FD#BBDEFB#90CAF9#64B5F6#64B5F6#2196F3#1E88E5#1976D2#1565C0#0D47A1#82B1FF#448AFF#2979FF#2962FF",m="#E1F5FE#B3E5FC#81D4FA#4FC3F7#29B6F6#03A9F4#039BE5#0288D1#0277BD#01579B#80D8FF#40C4FF#00B0FF#0091EA",n="#E0F7FA#B2EBF2#80DEEA#4DD0E1#26C6DA#00BCD4#00ACC1#0097A7#00838F#006064#84FFFF#18FFFF#00E5FF#00B8D4",o="#E0F2F1#B2DFDB#80CBC4#4DB6AC#26A69A#009688#00897B#00796B#00695C#004D40#A7FFEB#64FFDA#1DE9B6#00BFA5",p="#E8F5E9#C8E6C9#A5D6A7#81C784#66BB6A#4CAF50#43A047#388E3C#2E7D32#1B5E20#B9F6CA#69F0AE#00E676#00C853",q="#F1F8E9#DCEDC8#C5E1A5#AED581#9CCC65#8BC34A#7CB342#689F38#558B2F#33691E#CCFF90#B2FF59#76FF03#64DD17",r="#F9FBE7#F0F4C3#E6EE9C#DCE775#D4E157#CDDC39#C0CA33#AFB42B#9E9D24#827717#F4FF81#EEFF41#C6FF00#AEEA00",s="#FFFDE7#FFF9C4#FFF59D#FFF176#FFEE58#FFEB3B#FDD835#FBC02D#F9A825#F57F17#FFFF8D#FFFF00#FFEA00#FFD600",t="#FFF8E1#FFECB3#FFE082#FFD54F#FFCA28#FFC107#FFB300#FFA000#FF8F00#FF6F00#FFE57F#FFD740#FFC400#FFAB00",u="#FFF3E0#FFE0B2#FFCC80#FFB74D#FFA726#FF9800#FB8C00#F57C00#EF6C00#E65100#FFD180#FFAB40#FF9100#FF6D00",v="#FBE9E7#FFCCBC#FFAB91#FF8A65#FF7043#FF5722#F4511E#E64A19#D84315#BF360C#FF9E80#FF6E40#FF3D00#DD2C00",w="#EFEBE9#D7CCC8#BCAAA4#A1887F#8D6E63#795548#6D4C41#5D4037#4E342E#3E2723",x="#FAFAFA#F5F5F5#EEEEEE#E0E0E0#BDBDBD#9E9E9E#757575#616161#424242#212121",y="#ECEFF1#CFD8DC#B0BEC5#90A4AE#78909C#607D8B#546E7A#455A64#37474F#263238";b.mui={},b.flat={},b.mui.red=f(g),b.mui.pink=f(h),b.mui.purple=f(i),b.mui.deeppurple=f(j),b.mui.indigo=f(k),b.mui.blue=f(l),b.mui.lightblue=f(m),b.mui.cyan=f(n),b.mui.teal=f(o),b.mui.green=f(p),b.mui.lightgreen=f(q),b.mui.lime=f(r),b.mui.yellow=f(s),b.mui.amber=f(t),b.mui.orange=f(u),b.mui.deeporange=f(v),b.mui.brown=f(w),b.mui.grey=f(x),b.mui.bluegrey=f(y),b.flat.turquoise="#1abc9c",b.flat.greensea="#16a085",b.flat.sunflower="#f1c40f",b.flat.orange="#f39c12",b.flat.emerland="#2ecc71",b.flat.nephritis="#27ae60",b.flat.carrot="#e67e22",b.flat.pumpkin="#d35400",b.flat.peterriver="#3498db",b.flat.belizehole="#2980b9",b.flat.alizarin="#e74c3c",b.flat.pomegranate="#c0392b",b.flat.amethyst="#9b59b6",b.flat.wisteria="#8e44ad",b.flat.clouds="#ecf0f1",b.flat.silver="#bdc3c7",b.flat.wetasphalt="#34495e",b.flat.midnightblue="#2c3e50",b.flat.concrete="#95a5a6",b.flat.asbestos="#7f8c8d",b.importMUIColors=function(){for(var c in b.mui)b.mui.hasOwnProperty(c)&&(a[c]=b.mui[c])}}),d}); \ No newline at end of file +!function(a){var b,c,d="0.5.0",e="hasOwnProperty",f=/[\.\/]/,g=/\s*,\s*/,h="*",i=function(a,b){return a-b},j={n:{}},k=function(){for(var a=0,b=this.length;b>a;a++)if("undefined"!=typeof this[a])return this[a]},l=function(){for(var a=this.length;--a;)if("undefined"!=typeof this[a])return this[a]},m=Object.prototype.toString,n=String,o=Array.isArray||function(a){return a instanceof Array||"[object Array]"==m.call(a)};eve=function(a,d){var e,f=c,g=Array.prototype.slice.call(arguments,2),h=eve.listeners(a),j=0,m=[],n={},o=[],p=b;o.firstDefined=k,o.lastDefined=l,b=a,c=0;for(var q=0,r=h.length;r>q;q++)"zIndex"in h[q]&&(m.push(h[q].zIndex),h[q].zIndex<0&&(n[h[q].zIndex]=h[q]));for(m.sort(i);m[j]<0;)if(e=n[m[j++]],o.push(e.apply(d,g)),c)return c=f,o;for(q=0;r>q;q++)if(e=h[q],"zIndex"in e)if(e.zIndex==m[j]){if(o.push(e.apply(d,g)),c)break;do if(j++,e=n[m[j]],e&&o.push(e.apply(d,g)),c)break;while(e)}else n[e.zIndex]=e;else if(o.push(e.apply(d,g)),c)break;return c=f,b=p,o},eve._events=j,eve.listeners=function(a){var b,c,d,e,g,i,k,l,m=o(a)?a:a.split(f),n=j,p=[n],q=[];for(e=0,g=m.length;g>e;e++){for(l=[],i=0,k=p.length;k>i;i++)for(n=p[i].n,c=[n[m[e]],n[h]],d=2;d--;)b=c[d],b&&(l.push(b),q=q.concat(b.f||[]));p=l}return q},eve.separator=function(a){a?(a=n(a).replace(/(?=[\.\^\]\[\-])/g,"\\"),a="["+a+"]",f=new RegExp(a)):f=/[\.\/]/},eve.on=function(a,b){if("function"!=typeof b)return function(){};for(var c=o(a)?o(a[0])?a:[a]:n(a).split(g),d=0,e=c.length;e>d;d++)!function(a){for(var c,d=o(a)?a:n(a).split(f),e=j,g=0,h=d.length;h>g;g++)e=e.n,e=e.hasOwnProperty(d[g])&&e[d[g]]||(e[d[g]]={n:{}});for(e.f=e.f||[],g=0,h=e.f.length;h>g;g++)if(e.f[g]==b){c=!0;break}!c&&e.f.push(b)}(c[d]);return function(a){+a==+a&&(b.zIndex=+a)}},eve.f=function(a){var b=[].slice.call(arguments,1);return function(){eve.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},eve.stop=function(){c=1},eve.nt=function(a){var c=o(b)?b.join("."):b;return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(c):c},eve.nts=function(){return o(b)?b:b.split(f)},eve.off=eve.unbind=function(a,b){if(!a)return void(eve._events=j={n:{}});var c=o(a)?o(a[0])?a:[a]:n(a).split(g);if(c.length>1)for(var d=0,i=c.length;i>d;d++)eve.off(c[d],b);else{c=o(a)?a:n(a).split(f);var k,l,m,d,i,p,q,r=[j],s=[];for(d=0,i=c.length;i>d;d++)for(p=0;pd;d++)for(k=r[d];k.n;){if(b){if(k.f){for(p=0,q=k.f.length;q>p;p++)if(k.f[p]==b){k.f.splice(p,1);break}!k.f.length&&delete k.f}for(l in k.n)if(k.n[e](l)&&k.n[l].f){var t=k.n[l].f;for(p=0,q=t.length;q>p;p++)if(t[p]==b){t.splice(p,1);break}!t.length&&delete k.n[l].f}}else{delete k.f;for(l in k.n)k.n[e](l)&&k.n[l].f&&delete k.n[l].f}k=k.n}a:for(d=0,i=s.length;i>d;d++){k=s[d];for(l in k.n[k.name].f)continue a;for(l in k.n[k.name].n)continue a;delete k.n[k.name]}}},eve.once=function(a,b){var c=function(){return eve.off(a,c),b.apply(this,arguments)};return eve.on(a,c)},eve.version=d,eve.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=eve:"function"==typeof define&&define.amd?define("eve",[],function(){return eve}):a.eve=eve}(this),function(a,b){if("function"==typeof define&&define.amd)define(["eve"],function(c){return b(a,c)});else if("undefined"!=typeof exports){var c=require("eve");module.exports=b(a,c)}else b(a,a.eve)}(window||this,function(a,b){var c=function(b){var c,d={},e=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){return setTimeout(a,16,(new Date).getTime()),!0},f=Array.isArray||function(a){return a instanceof Array||"[object Array]"==Object.prototype.toString.call(a)},g=0,h="M"+(+new Date).toString(36),i=function(){return h+(g++).toString(36)},j=Date.now||function(){return+new Date},k=function(a){var b=this;if(null==a)return b.s;var c=b.s-a;b.b+=b.dur*c,b.B+=b.dur*c,b.s=a},l=function(a){var b=this;return null==a?b.spd:void(b.spd=a)},m=function(a){var b=this;return null==a?b.dur:(b.s=b.s*a/b.dur,void(b.dur=a))},n=function(){var a=this;delete d[a.id],a.update(),b("mina.stop."+a.id,a)},o=function(){var a=this;a.pdif||(delete d[a.id],a.update(),a.pdif=a.get()-a.b)},p=function(){var a=this;a.pdif&&(a.b=a.get()-a.pdif,delete a.pdif,d[a.id]=a,r())},q=function(){var a,b=this;if(f(b.start)){a=[];for(var c=0,d=b.start.length;d>c;c++)a[c]=+b.start[c]+(b.end[c]-b.start[c])*b.easing(b.s)}else a=+b.start+(b.end-b.start)*b.easing(b.s);b.set(a)},r=function(a){if(!a)return void(c||(c=e(r)));var f=0;for(var g in d)if(d.hasOwnProperty(g)){var h=d[g],i=h.get();f++,h.s=(i-h.b)/(h.dur/h.spd),h.s>=1&&(delete d[g],h.s=1,f--,function(a){setTimeout(function(){b("mina.finish."+a.id,a)})}(h)),h.update()}c=f?e(r):!1},s=function(a,b,c,e,f,g,h){var j={id:i(),start:a,end:b,b:c,s:0,dur:e-c,spd:1,get:f,set:g,easing:h||s.linear,status:k,speed:l,duration:m,stop:n,pause:o,resume:p,update:q};d[j.id]=j;var t,u=0;for(t in d)if(d.hasOwnProperty(t)&&(u++,2==u))break;return 1==u&&r(),j};return s.time=j,s.getById=function(a){return d[a]||null},s.linear=function(a){return a},s.easeout=function(a){return Math.pow(a,1.7)},s.easein=function(a){return Math.pow(a,.48)},s.easeinout=function(a){if(1==a)return 1;if(0==a)return 0;var b=.48-a/1.04,c=Math.sqrt(.1734+b*b),d=c-b,e=Math.pow(Math.abs(d),1/3)*(0>d?-1:1),f=-c-b,g=Math.pow(Math.abs(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},s.backin=function(a){if(1==a)return 1;var b=1.70158;return a*a*((b+1)*a-b)},s.backout=function(a){if(0==a)return 0;a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},s.elastic=function(a){return a==!!a?a:Math.pow(2,-10*a)*Math.sin((a-.075)*(2*Math.PI)/.3)+1},s.bounce=function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b},a.mina=s,s}("undefined"==typeof b?function(){}:b),d=function(a){function c(a,b){if(a){if(a.nodeType)return w(a);if(e(a,"array")&&c.set)return c.set.apply(c,a);if(a instanceof s)return a;if(null==b)return a=y.doc.querySelector(String(a)),w(a)}return a=null==a?"100%":a,b=null==b?"100%":b,new v(a,b)}function d(a,b){if(b){if("#text"==a&&(a=y.doc.createTextNode(b.text||b["#text"]||"")),"#comment"==a&&(a=y.doc.createComment(b.text||b["#text"]||"")),"string"==typeof a&&(a=d(a)),"string"==typeof b)return 1==a.nodeType?"xlink:"==b.substring(0,6)?a.getAttributeNS(T,b.substring(6)):"xml:"==b.substring(0,4)?a.getAttributeNS(U,b.substring(4)):a.getAttribute(b):"text"==b?a.nodeValue:null;if(1==a.nodeType){for(var c in b)if(b[z](c)){var e=A(b[c]);e?"xlink:"==c.substring(0,6)?a.setAttributeNS(T,c.substring(6),e):"xml:"==c.substring(0,4)?a.setAttributeNS(U,c.substring(4),e):a.setAttribute(c,e):a.removeAttribute(c)}}else"text"in b&&(a.nodeValue=b.text)}else a=y.doc.createElementNS(U,a);return a}function e(a,b){return b=A.prototype.toLowerCase.call(b),"finite"==b?isFinite(a):"array"==b&&(a instanceof Array||Array.isArray&&Array.isArray(a))?!0:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||J.call(a).slice(8,-1).toLowerCase()==b}function f(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=f(a[c]));return b}function h(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function i(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),g=d.cache=d.cache||{},i=d.count=d.count||[];return g[z](f)?(h(i,f),c?c(g[f]):g[f]):(i.length>=1e3&&delete g[i.shift()],i.push(f),g[f]=a.apply(b,e),c?c(g[f]):g[f])}return d}function j(a,b,c,d,e,f){if(null==e){var g=a-c,h=b-d;return g||h?(180+180*D.atan2(-h,-g)/H+360)%360:0}return j(a,b,e,f)-j(c,d,e,f)}function k(a){return a%360*H/180}function l(a){return 180*a/H%360}function m(a){var b=[];return a=a.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(a,c,d){return d=d.split(/\s*,\s*|\s+/),"rotate"==c&&1==d.length&&d.push(0,0),"scale"==c&&(d.length>2?d=d.slice(0,2):2==d.length&&d.push(0,0),1==d.length&&d.push(d[0],0,0)),"skewX"==c?b.push(["m",1,0,D.tan(k(d[0])),1,0,0]):"skewY"==c?b.push(["m",1,D.tan(k(d[0])),0,1,0,0]):b.push([c.charAt(0)].concat(d)),a}),b}function n(a,b){var d=aa(a),e=new c.Matrix;if(d)for(var f=0,g=d.length;g>f;f++){var h,i,j,k,l,m=d[f],n=m.length,o=A(m[0]).toLowerCase(),p=m[0]!=o,q=p?e.invert():0;"t"==o&&2==n?e.translate(m[1],0):"t"==o&&3==n?p?(h=q.x(0,0),i=q.y(0,0),j=q.x(m[1],m[2]),k=q.y(m[1],m[2]),e.translate(j-h,k-i)):e.translate(m[1],m[2]):"r"==o?2==n?(l=l||b,e.rotate(m[1],l.x+l.width/2,l.y+l.height/2)):4==n&&(p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.rotate(m[1],j,k)):e.rotate(m[1],m[2],m[3])):"s"==o?2==n||3==n?(l=l||b,e.scale(m[1],m[n-1],l.x+l.width/2,l.y+l.height/2)):4==n?p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.scale(m[1],m[1],j,k)):e.scale(m[1],m[1],m[2],m[3]):5==n&&(p?(j=q.x(m[3],m[4]),k=q.y(m[3],m[4]),e.scale(m[1],m[2],j,k)):e.scale(m[1],m[2],m[3],m[4])):"m"==o&&7==n&&e.add(m[1],m[2],m[3],m[4],m[5],m[6])}return e}function o(a){var b=a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||a.node.parentNode&&w(a.node.parentNode)||c.select("svg")||c(0,0),d=b.select("defs"),e=null==d?!1:d.node;return e||(e=u("defs",b.node).node),e}function p(a){return a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||c.select("svg")}function q(a,b,c){function e(a){if(null==a)return I;if(a==+a)return a;d(j,{width:a});try{return j.getBBox().width}catch(b){return 0}}function f(a){if(null==a)return I;if(a==+a)return a;d(j,{height:a});try{return j.getBBox().height}catch(b){return 0}}function g(d,e){null==b?i[d]=e(a.attr(d)||0):d==b&&(i=e(null==c?a.attr(d)||0:c))}var h=p(a).node,i={},j=h.querySelector(".svg---mgr");switch(j||(j=d("rect"),d(j,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),h.appendChild(j)),a.type){case"rect":g("rx",e),g("ry",f);case"image":g("width",e),g("height",f);case"text":g("x",e),g("y",f);break;case"circle":g("cx",e),g("cy",f),g("r",e);break;case"ellipse":g("cx",e),g("cy",f),g("rx",e),g("ry",f);break;case"line":g("x1",e),g("x2",e),g("y1",f),g("y2",f);break;case"marker":g("refX",e),g("markerWidth",e),g("refY",f),g("markerHeight",f);break;case"radialGradient":g("fx",e),g("fy",f);break;case"tspan":g("dx",e),g("dy",f);break;default:g(b,e)}return h.removeChild(j),i}function r(a){e(a,"array")||(a=Array.prototype.slice.call(arguments,0));for(var b=0,c=0,d=this.node;this[b];)delete this[b++];for(b=0;bc;c++){var e={type:a[c].type,attr:a[c].attr()},f=a[c].children();b.push(e),f.length&&x(f,e.childNodes=[])}}c.version="0.5.0",c.toString=function(){return"Snap v"+this.version},c._={};var y={win:a.window,doc:a.window.document};c._.glob=y;var z="hasOwnProperty",A=String,B=parseFloat,C=parseInt,D=Math,E=D.max,F=D.min,G=D.abs,H=(D.pow,D.PI),I=(D.round,""),J=Object.prototype.toString,K=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,L=(c._.separator=/[,\s]+/,/[\s]*,[\s]*/),M={hs:1,rg:1},N=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,O=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,P=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\s]*,?[\s]*/gi,Q=0,R="S"+(+new Date).toString(36),S=function(a){return(a&&a.type?a.type:I)+R+(Q++).toString(36)},T="http://www.w3.org/1999/xlink",U="http://www.w3.org/2000/svg",V={};c.url=function(a){return"url('#"+a+"')"};c._.$=d,c._.id=S,c.format=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return A(b).replace(a,function(a,b){return c(a,b,d)})}}(),c._.clone=f,c._.cacher=i,c.rad=k,c.deg=l,c.sin=function(a){return D.sin(c.rad(a))},c.tan=function(a){return D.tan(c.rad(a))},c.cos=function(a){return D.cos(c.rad(a))},c.asin=function(a){return c.deg(D.asin(a))},c.acos=function(a){return c.deg(D.acos(a))},c.atan=function(a){return c.deg(D.atan(a))},c.atan2=function(a){return c.deg(D.atan2(a))},c.angle=j,c.len=function(a,b,d,e){return Math.sqrt(c.len2(a,b,d,e))},c.len2=function(a,b,c,d){return(a-c)*(a-c)+(b-d)*(b-d)},c.closestPoint=function(a,b,c){function d(a){var d=a.x-b,e=a.y-c;return d*d+e*e}for(var e,f,g,h,i=a.node,j=i.getTotalLength(),k=j/i.pathSegList.numberOfItems*.125,l=1/0,m=0;j>=m;m+=k)(h=d(g=i.getPointAtLength(m))).5;){var n,o,p,q,r,s;(p=f-k)>=0&&(r=d(n=i.getPointAtLength(p)))f)return b-f;if(f>a-c)return b-f+a}return b},c.getRGB=i(function(a){if(!a||(a=A(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};if("none"==a)return{r:-1,g:-1,b:-1,hex:"none",toString:Z};if(!(M[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=W(a)),!a)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};var b,d,f,g,h,i,j=a.match(K);return j?(j[2]&&(f=C(j[2].substring(5),16),d=C(j[2].substring(3,5),16),b=C(j[2].substring(1,3),16)),j[3]&&(f=C((h=j[3].charAt(3))+h,16),d=C((h=j[3].charAt(2))+h,16),b=C((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=B(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),f=B(i[2]),"%"==i[2].slice(-1)&&(f*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100)),j[5]?(i=j[5].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsb2rgb(b,d,f,g)):j[6]?(i=j[6].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsl2rgb(b,d,f,g)):(b=F(D.round(b),255),d=F(D.round(d),255),f=F(D.round(f),255),g=F(E(g,0),1),j={r:b,g:d,b:f,toString:Z},j.hex="#"+(16777216|f|d<<8|b<<16).toString(16).slice(1),j.opacity=e(g,"finite")?g:1,j)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z}},c),c.hsb=i(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=i(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=i(function(a,b,c,d){if(e(d,"finite")){var f=D.round;return"rgba("+[f(a),f(b),f(c),+d.toFixed(2)]+")"}return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)});var W=function(a){var b=y.doc.getElementsByTagName("head")[0]||y.doc.getElementsByTagName("svg")[0],c="rgb(255, 0, 0)";return(W=i(function(a){if("red"==a.toLowerCase())return c;b.style.color=c,b.style.color=a;var d=y.doc.defaultView.getComputedStyle(b,I).getPropertyValue("color");return d==c?null:d}))(a)},X=function(){return"hsb("+[this.h,this.s,this.b]+")"},Y=function(){return"hsl("+[this.h,this.s,this.l]+")"},Z=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},$=function(a,b,d){if(null==b&&e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&e(a,string)){var f=c.getRGB(a);a=f.r,b=f.g,d=f.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},_=function(a,b,d,f){a=D.round(255*a),b=D.round(255*b),d=D.round(255*d);var g={r:a,g:b,b:d,opacity:e(f,"finite")?f:1,hex:c.rgb(a,b,d),toString:Z};return e(f,"finite")&&(g.opacity=f),g};c.color=function(a){var b;return e(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):e(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):(e(a,"string")&&(a=c.getRGB(a)),e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&!("error"in a)?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1,a.error=1)),a.toString=Z,a},c.hsb2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var f,g,h,i,j;return a=a%360/60,j=c*b,i=j*(1-G(a%2-1)),f=g=h=c-j,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.hsl2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var f,g,h,i,j;return a=a%360/60,j=2*b*(.5>c?c:1-c),i=j*(1-G(a%2-1)),f=g=h=c-j/2,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.rgb2hsb=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=E(a,b,c),g=f-F(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:X}},c.rgb2hsl=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=E(a,b,c),h=F(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:Y}},c.parsePathString=function(a){if(!a)return null;var b=c.path(a);if(b.arr)return c.path.clone(b.arr);var d={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},f=[];return e(a,"array")&&e(a[0],"array")&&(f=c.path.clone(a)),f.length||A(a).replace(N,function(a,b,c){var e=[],g=b.toLowerCase();if(c.replace(P,function(a,b){b&&e.push(+b)}),"m"==g&&e.length>2&&(f.push([b].concat(e.splice(0,2))),g="l",b="m"==b?"l":"L"),"o"==g&&1==e.length&&f.push([b,e[0]]),"r"==g)f.push([b].concat(e));else for(;e.length>=d[g]&&(f.push([b].concat(e.splice(0,d[g]))),d[g]););}),f.toString=c.path.toString,b.arr=c.path.clone(f),f};var aa=c.parseTransformString=function(a){if(!a)return null;var b=[];return e(a,"array")&&e(a[0],"array")&&(b=c.path.clone(a)),b.length||A(a).replace(O,function(a,c,d){var e=[];c.toLowerCase();d.replace(P,function(a,b){b&&e.push(+b)}),b.push([c].concat(e))}),b.toString=c.path.toString,b};c._.svgTransform2string=m,c._.rgTransform=/^[a-z][\s]*-?\.?\d/i,c._.transform2matrix=n,c._unit2px=q;y.doc.contains||y.doc.compareDocumentPosition?function(a,b){var c=9==a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a==d||!(!d||1!=d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b;)if(b=b.parentNode,b==a)return!0;return!1};c._.getSomeDefs=o,c._.getSomeSVG=p,c.select=function(a){return a=A(a).replace(/([^\\]):/g,"$1\\:"),w(y.doc.querySelector(a))},c.selectAll=function(a){for(var b=y.doc.querySelectorAll(a),d=(c.set||Array)(),e=0;ei;i++)h[g[i].nodeName]=g[i].nodeValue;return h}if(e(a,"string")){if(!(arguments.length>1))return b("snap.util.getattr."+a,d).firstDefined();var k={};k[a]=c,a=k}for(var l in a)a[z](l)&&b("snap.util.attr."+l,d,a[l]);return d},c.parse=function(a){var b=y.doc.createDocumentFragment(),c=!0,d=y.doc.createElement("div");if(a=A(a),a.match(/^\s*<\s*svg(?:\s|>)/)||(a=""+a+"",c=!1),d.innerHTML=a,a=d.getElementsByTagName("svg")[0])if(c)b=a;else for(;a.firstChild;)b.appendChild(a.firstChild);return new t(b)},c.fragment=function(){for(var a=Array.prototype.slice.call(arguments,0),b=y.doc.createDocumentFragment(),d=0,e=a.length;e>d;d++){var f=a[d];f.node&&f.node.nodeType&&b.appendChild(f.node),f.nodeType&&b.appendChild(f),"string"==typeof f&&b.appendChild(c.parse(f).node)}return new t(b)},c._.make=u,c._.wrap=w,v.prototype.el=function(a,b){var c=u(a,this.node);return b&&c.attr(b),c},s.prototype.children=function(){for(var a=[],b=this.node.childNodes,d=0,e=b.length;e>d;d++)a[d]=c(b[d]);return a},s.prototype.toJSON=function(){var a=[];return x([this],a),a[0]},b.on("snap.util.getattr",function(){var a=b.nt();a=a.substring(a.lastIndexOf(".")+1);var c=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});return ba[z](c)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(c):d(this.node,a)});var ba={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};b.on("snap.util.attr",function(a){var c=b.nt(),e={};c=c.substring(c.lastIndexOf(".")+1),e[c]=a;var f=c.replace(/-(\w)/gi,function(a,b){return b.toUpperCase()}),g=c.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});ba[z](g)?this.node.style[f]=null==a?I:a:d(this.node,e)}),function(a){}(v.prototype),c.ajax=function(a,c,d,f){var g=new XMLHttpRequest,h=S();if(g){if(e(c,"function"))f=d,d=c,c=null;else if(e(c,"object")){var i=[];for(var j in c)c.hasOwnProperty(j)&&i.push(encodeURIComponent(j)+"="+encodeURIComponent(c[j]));c=i.join("&")}return g.open(c?"POST":"GET",a,!0),c&&(g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.setRequestHeader("Content-type","application/x-www-form-urlencoded")),d&&(b.once("snap.ajax."+h+".0",d),b.once("snap.ajax."+h+".200",d),b.once("snap.ajax."+h+".304",d)),g.onreadystatechange=function(){4==g.readyState&&b("snap.ajax."+h+"."+g.status,f,g)},4==g.readyState?g:(g.send(c),g)}},c.load=function(a,b,d){c.ajax(a,function(a){var e=c.parse(a.responseText);d?b.call(d,e):b(e)})};var ca=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,h=e.clientLeft||d.clientLeft||0,i=b.top+(g.win.pageYOffset||e.scrollTop||d.scrollTop)-f,j=b.left+(g.win.pageXOffset||e.scrollLeft||d.scrollLeft)-h;return{y:i,x:j}};return c.getElementByPoint=function(a,b){var c=this,d=(c.canvas,y.doc.elementFromPoint(a,b));if(y.win.opera&&"svg"==d.tagName){var e=ca(d),f=d.createSVGRect();f.x=a-e.x,f.y=b-e.y,f.width=f.height=1;var g=d.getIntersectionList(f,null);g.length&&(d=g[g.length-1])}return d?w(d):null},c.plugin=function(a){a(c,s,v,y,t)},y.win.Snap=c,c}(a||this);return d.plugin(function(c,d,e,f,g){function h(a,b){if(null==b){var d=!0;if(b="linearGradient"==a.type||"radialGradient"==a.type?a.node.getAttribute("gradientTransform"):"pattern"==a.type?a.node.getAttribute("patternTransform"):a.node.getAttribute("transform"),!b)return new c.Matrix;b=c._.svgTransform2string(b)}else b=c._.rgTransform.test(b)?m(b).replace(/\.{3}|\u2026/g,a._.transform||""):c._.svgTransform2string(b),l(b,"array")&&(b=c.path?c.path.toString.call(b):m(b)),a._.transform=b;var e=c._.transform2matrix(b,a.getBBox(1));return d?e:void(a.matrix=e)}function i(a){function b(a,b){var d=o(a.node,b);d=d&&d.match(g),d=d&&d[2],d&&"#"==d.charAt()&&(d=d.substring(1),d&&(i[d]=(i[d]||[]).concat(function(d){var e={};e[b]=c.url(d),o(a.node,e)})))}function d(a){var b=o(a.node,"xlink:href");b&&"#"==b.charAt()&&(b=b.substring(1),b&&(i[b]=(i[b]||[]).concat(function(b){a.attr("xlink:href","#"+b)})))}for(var e,f=a.selectAll("*"),g=/^\s*url\(("|'|)(.*)\1\)\s*$/,h=[],i={},j=0,k=f.length;k>j;j++){e=f[j],b(e,"fill"),b(e,"stroke"),b(e,"filter"),b(e,"mask"),b(e,"clip-path"),d(e);var l=o(e.node,"id");l&&(o(e.node,{id:e.id}),h.push({old:l,id:e.id}))}for(j=0,k=h.length;k>j;j++){var m=i[h[j].old];if(m)for(var n=0,p=m.length;p>n;n++)m[n](h[j].id)}}function j(a){return function(){var b=a?"<"+this.type:"",c=this.node.attributes,d=this.node.childNodes;if(a)for(var e=0,f=c.length;f>e;e++)b+=" "+c[e].name+'="'+c[e].value.replace(/"/g,'\\"')+'"';if(d.length){for(a&&(b+=">"),e=0,f=d.length;f>e;e++)3==d[e].nodeType?b+=d[e].nodeValue:1==d[e].nodeType&&(b+=s(d[e]).toString());a&&(b+="")}else a&&(b+="/>");return b}}var k=d.prototype,l=c.is,m=String,n=c._unit2px,o=c._.$,p=c._.make,q=c._.getSomeDefs,r="hasOwnProperty",s=c._.wrap;k.getBBox=function(a){if("tspan"==this.type)return c._.box(this.node.getClientRects().item(0));if(!c.Matrix||!c.path)return this.node.getBBox();var b=this,d=new c.Matrix;if(b.removed)return c._.box();for(;"use"==b.type;)if(a||(d=d.add(b.transform().localMatrix.translate(b.attr("x")||0,b.attr("y")||0))),b.original)b=b.original;else{var e=b.attr("xlink:href");b=b.original=b.node.ownerDocument.getElementById(e.substring(e.indexOf("#")+1))}var f=b._,g=c.path.get[b.type]||c.path.get.deflt;try{return a?(f.bboxwt=g?c.path.getBBox(b.realPath=g(b)):c._.box(b.node.getBBox()),c._.box(f.bboxwt)):(b.realPath=g(b),b.matrix=b.transform().localMatrix,f.bbox=c.path.getBBox(c.path.map(b.realPath,d.add(b.matrix))),c._.box(f.bbox))}catch(h){return c._.box()}};var t=function(){return this.string};k.transform=function(a){var b=this._;if(null==a){for(var d,e=this,f=new c.Matrix(this.node.getCTM()),g=h(this),i=[g],j=new c.Matrix,k=g.toTransformString(),l=m(g)==m(this.matrix)?m(b.transform):k;"svg"!=e.type&&(e=e.parent());)i.push(h(e));for(d=i.length;d--;)j.add(i[d]);return{string:l,globalMatrix:f,totalMatrix:j,localMatrix:g,diffMatrix:f.clone().add(g.invert()),global:f.toTransformString(),total:j.toTransformString(),local:k,toString:t}}return a instanceof c.Matrix?(this.matrix=a,this._.transform=a.toTransformString()):h(this,a),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?o(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?o(this.node,{patternTransform:this.matrix}):o(this.node,{transform:this.matrix})),this},k.parent=function(){return s(this.node.parentNode)},k.append=k.add=function(a){if(a){if("set"==a.type){var b=this;return a.forEach(function(a){b.add(a)}),this}a=s(a),this.node.appendChild(a.node),a.paper=this.paper}return this},k.appendTo=function(a){return a&&(a=s(a),a.append(this)),this},k.prepend=function(a){if(a){if("set"==a.type){var b,c=this;return a.forEach(function(a){b?b.after(a):c.prepend(a),b=a}),this}a=s(a);var d=a.parent();this.node.insertBefore(a.node,this.node.firstChild),this.add&&this.add(),a.paper=this.paper,this.parent()&&this.parent().add(),d&&d.add()}return this},k.prependTo=function(a){return a=s(a),a.prepend(this),this},k.before=function(a){if("set"==a.type){var b=this;return a.forEach(function(a){var c=a.parent();b.node.parentNode.insertBefore(a.node,b.node),c&&c.add()}),this.parent().add(),this}a=s(a);var c=a.parent();return this.node.parentNode.insertBefore(a.node,this.node),this.parent()&&this.parent().add(),c&&c.add(),a.paper=this.paper,this},k.after=function(a){a=s(a);var b=a.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(a.node,this.node.nextSibling):this.node.parentNode.appendChild(a.node),this.parent()&&this.parent().add(),b&&b.add(),a.paper=this.paper,this},k.insertBefore=function(a){a=s(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},k.insertAfter=function(a){a=s(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node.nextSibling),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},k.remove=function(){var a=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,a&&a.add(),this},k.select=function(a){return s(this.node.querySelector(a))},k.selectAll=function(a){for(var b=this.node.querySelectorAll(a),d=(c.set||Array)(),e=0;e{contents}',{x:+b.x.toFixed(3),y:+b.y.toFixed(3),width:+b.width.toFixed(3),height:+b.height.toFixed(3),contents:this.outerSVG()}); +return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))}},g.prototype.select=k.select,g.prototype.selectAll=k.selectAll}),d.plugin(function(a,d,e,f,g){function h(a,b,c){return function(d){var e=d.slice(a,b);return 1==e.length&&(e=e[0]),c?c(e):e}}var i=d.prototype,j=a.is,k=String,l="hasOwnProperty",m=function(a,b,d,e){"function"!=typeof d||d.length||(e=d,d=c.linear),this.attr=a,this.dur=b,d&&(this.easing=d),e&&(this.callback=e)};a._.Animation=m,a.animation=function(a,b,c,d){return new m(a,b,c,d)},i.inAnim=function(){var a=this,b=[];for(var c in a.anims)a.anims[l](c)&&!function(a){b.push({anim:new m(a._attrs,a.dur,a.easing,a._callback),mina:a,curStatus:a.status(),status:function(b){return a.status(b)},stop:function(){a.stop()}})}(a.anims[c]);return b},a.animate=function(a,d,e,f,g,h){"function"!=typeof g||g.length||(h=g,g=c.linear);var i=c.time(),j=c(a,d,i,i+f,c.time,e,g);return h&&b.once("mina.finish."+j.id,h),j},i.stop=function(){for(var a=this.inAnim(),b=0,c=a.length;c>b;b++)a[b].stop();return this},i.animate=function(a,d,e,f){"function"!=typeof e||e.length||(f=e,e=c.linear),a instanceof m&&(f=a.callback,e=a.easing,d=a.dur,a=a.attr);var g,i,n,o,p=[],q=[],r={},s=this;for(var t in a)if(a[l](t)){s.equal?(o=s.equal(t,k(a[t])),g=o.from,i=o.to,n=o.f):(g=+s.attr(t),i=+a[t]);var u=j(g,"array")?g.length:1;r[t]=h(p.length,p.length+u,n),p=p.concat(g),q=q.concat(i)}var v=c.time(),w=c(p,q,v,v+d,c.time,function(a){var b={};for(var c in r)r[l](c)&&(b[c]=r[c](a));s.attr(b)},e);return s.anims[w.id]=w,w._attrs=a,w._callback=f,b("snap.animcreated."+s.id,w),b.once("mina.finish."+w.id,function(){b.off("mina.*."+w.id),delete s.anims[w.id],f&&f.call(s)}),b.once("mina.stop."+w.id,function(){b.off("mina.*."+w.id),delete s.anims[w.id]}),s}}),d.plugin(function(a,b,c,d,e){function f(a,b,c,d,e,f){return null==b&&"[object SVGMatrix]"==g.call(a)?(this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.e=a.e,void(this.f=a.f)):void(null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var g=Object.prototype.toString,h=String,i=Math,j="";!function(b){function c(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var b=i.sqrt(c(a));a[0]&&(a[0]/=b),a[1]&&(a[1]/=b)}b.add=function(a,b,c,d,e,g){if(a&&a instanceof f)return this.add(a.a,a.b,a.c,a.d,a.e,a.f);var h=a*this.a+b*this.c,i=a*this.b+b*this.d;return this.e+=e*this.a+g*this.c,this.f+=e*this.b+g*this.d,this.c=c*this.a+d*this.c,this.d=c*this.b+d*this.d,this.a=h,this.b=i,this},f.prototype.multLeft=function(a,b,c,d,e,g){if(a&&a instanceof f)return this.multLeft(a.a,a.b,a.c,a.d,a.e,a.f);var h=a*this.a+c*this.b,i=a*this.c+c*this.d,j=a*this.e+c*this.f+e;return this.b=b*this.a+d*this.b,this.d=b*this.c+d*this.d,this.f=b*this.e+d*this.f+g,this.a=h,this.c=i,this.e=j,this},b.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new f(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},b.clone=function(){return new f(this.a,this.b,this.c,this.d,this.e,this.f)},b.translate=function(a,b){return this.e+=a*this.a+b*this.c,this.f+=a*this.b+b*this.d,this},b.scale=function(a,b,c,d){return null==b&&(b=a),(c||d)&&this.translate(c,d),this.a*=a,this.b*=a,this.c*=b,this.d*=b,(c||d)&&this.translate(-c,-d),this},b.rotate=function(b,c,d){b=a.rad(b),c=c||0,d=d||0;var e=+i.cos(b).toFixed(9),f=+i.sin(b).toFixed(9);return this.add(e,f,-f,e,c,d),this.add(1,0,0,1,-c,-d)},b.skewX=function(a){return this.skew(a,0)},b.skewY=function(a){return this.skew(0,a)},b.skew=function(b,c){b=b||0,c=c||0,b=a.rad(b),c=a.rad(c);var d=i.tan(b).toFixed(9),e=i.tan(c).toFixed(9);return this.add(1,e,d,1,0,0)},b.x=function(a,b){return a*this.a+b*this.c+this.e},b.y=function(a,b){return a*this.b+b*this.d+this.f},b.get=function(a){return+this[h.fromCharCode(97+a)].toFixed(4)},b.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},b.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},b.determinant=function(){return this.a*this.d-this.b*this.c},b.split=function(){var b={};b.dx=this.e,b.dy=this.f;var e=[[this.a,this.b],[this.c,this.d]];b.scalex=i.sqrt(c(e[0])),d(e[0]),b.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*b.shear,e[1][1]-e[0][1]*b.shear],b.scaley=i.sqrt(c(e[1])),d(e[1]),b.shear/=b.scaley,this.determinant()<0&&(b.scalex=-b.scalex);var f=e[0][1],g=e[1][1];return 0>g?(b.rotate=a.deg(i.acos(g)),0>f&&(b.rotate=360-b.rotate)):b.rotate=a.deg(i.asin(f)),b.isSimple=!(+b.shear.toFixed(9)||b.scalex.toFixed(9)!=b.scaley.toFixed(9)&&b.rotate),b.isSuperSimple=!+b.shear.toFixed(9)&&b.scalex.toFixed(9)==b.scaley.toFixed(9)&&!b.rotate,b.noRotation=!+b.shear.toFixed(9)&&!b.rotate,b},b.toTransformString=function(a){var b=a||this.split();return+b.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[+b.dx.toFixed(4),+b.dy.toFixed(4)]:j)+(b.rotate?"r"+[+b.rotate.toFixed(4),0,0]:j)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:j))}}(f.prototype),a.Matrix=f,a.matrix=function(a,b,c,d,e,g){return new f(a,b,c,d,e,g)}}),d.plugin(function(a,c,d,e,f){function g(d){return function(e){if(b.stop(),e instanceof f&&1==e.node.childNodes.length&&("radialGradient"==e.node.firstChild.tagName||"linearGradient"==e.node.firstChild.tagName||"pattern"==e.node.firstChild.tagName)&&(e=e.node.firstChild,n(this).appendChild(e),e=l(e)),e instanceof c)if("radialGradient"==e.type||"linearGradient"==e.type||"pattern"==e.type){e.node.id||p(e.node,{id:e.id});var g=q(e.node.id)}else g=e.attr(d);else if(g=a.color(e),g.error){var h=a(n(this).ownerSVGElement).gradient(e);h?(h.node.id||p(h.node,{id:h.id}),g=q(h.node.id)):g=e}else g=r(g);var i={};i[d]=g,p(this.node,i),this.node.style[d]=t}}function h(a){b.stop(),a==+a&&(a+="px"),this.node.style.fontSize=a}function i(a){for(var b=[],c=a.childNodes,d=0,e=c.length;e>d;d++){var f=c[d];3==f.nodeType&&b.push(f.nodeValue),"tspan"==f.tagName&&(1==f.childNodes.length&&3==f.firstChild.nodeType?b.push(f.firstChild.nodeValue):b.push(i(f)))}return b}function j(){return b.stop(),this.node.style.fontSize}var k=a._.make,l=a._.wrap,m=a.is,n=a._.getSomeDefs,o=/^url\(#?([^)]+)\)$/,p=a._.$,q=a.url,r=String,s=a._.separator,t="";a.deurl=function(a){return String(a).match(o)[1]},b.on("snap.util.attr.mask",function(a){if(a instanceof c||a instanceof f){if(b.stop(),a instanceof f&&1==a.node.childNodes.length&&(a=a.node.firstChild,n(this).appendChild(a),a=l(a)),"mask"==a.type)var d=a;else d=k("mask",n(this)),d.node.appendChild(a.node);!d.node.id&&p(d.node,{id:d.id}),p(this.node,{mask:q(d.id)})}}),function(a){b.on("snap.util.attr.clip",a),b.on("snap.util.attr.clip-path",a),b.on("snap.util.attr.clipPath",a)}(function(a){if(a instanceof c||a instanceof f){b.stop();for(var d,e=a.node;e;){if("clipPath"===e.nodeName){d=new c(e);break}if("svg"===e.nodeName){d=void 0;break}e=e.parentNode}d||(d=k("clipPath",n(this)),d.node.appendChild(a.node),!d.node.id&&p(d.node,{id:d.id})),p(this.node,{"clip-path":q(d.node.id||d.id)})}}),b.on("snap.util.attr.fill",g("fill")),b.on("snap.util.attr.stroke",g("stroke"));var u=/^([lr])(?:\(([^)]*)\))?(.*)$/i;b.on("snap.util.grad.parse",function(a){function b(a,b){for(var c=(b-h)/(a-i),d=i;a>d;d++)f[d].offset=+(+h+c*(d-i)).toFixed(2);i=a,h=b}a=r(a);var c=a.match(u);if(!c)return null;var d=c[1],e=c[2],f=c[3];e=e.split(/\s*,\s*/).map(function(a){return+a==a?+a:a}),1==e.length&&0==e[0]&&(e=[]),f=f.split("-"),f=f.map(function(a){a=a.split(":");var b={color:a[0]};return a[1]&&(b.offset=parseFloat(a[1])),b});var g=f.length,h=0,i=0;g--;for(var j=0;g>j;j++)"offset"in f[j]&&b(j,f[j].offset);return f[g].offset=f[g].offset||100,b(g,f[g].offset),{type:d,params:e,stops:f}}),b.on("snap.util.attr.d",function(c){b.stop(),m(c,"array")&&m(c[0],"array")&&(c=a.path.toString.call(c)),c=r(c),c.match(/[ruo]/i)&&(c=a.path.toAbsolute(c)),p(this.node,{d:c})})(-1),b.on("snap.util.attr.#text",function(a){b.stop(),a=r(a);for(var c=e.doc.createTextNode(a);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(c)})(-1),b.on("snap.util.attr.path",function(a){b.stop(),this.attr({d:a})})(-1),b.on("snap.util.attr.class",function(a){b.stop(),this.node.className.baseVal=a})(-1),b.on("snap.util.attr.viewBox",function(a){var c;c=m(a,"object")&&"x"in a?[a.x,a.y,a.width,a.height].join(" "):m(a,"array")?a.join(" "):a,p(this.node,{viewBox:c}),b.stop()})(-1),b.on("snap.util.attr.transform",function(a){this.transform(a),b.stop()})(-1),b.on("snap.util.attr.r",function(a){"rect"==this.type&&(b.stop(),p(this.node,{rx:a,ry:a}))})(-1),b.on("snap.util.attr.textpath",function(a){if(b.stop(),"text"==this.type){var d,e,f;if(!a&&this.textPath){for(e=this.textPath;e.node.firstChild;)this.node.appendChild(e.node.firstChild);return e.remove(),void delete this.textPath}if(m(a,"string")){var g=n(this),h=l(g.parentNode).path(a);g.appendChild(h.node),d=h.id,h.attr({id:d})}else a=l(a),a instanceof c&&(d=a.attr("id"),d||(d=a.id,a.attr({id:d})));if(d)if(e=this.textPath,f=this.node,e)e.attr({"xlink:href":"#"+d});else{for(e=p("textPath",{"xlink:href":"#"+d});f.firstChild;)e.appendChild(f.firstChild);f.appendChild(e),this.textPath=l(e)}}})(-1),b.on("snap.util.attr.text",function(a){if("text"==this.type){for(var c=this.node,d=function(a){var b=p("tspan");if(m(a,"array"))for(var c=0;c1&&(a=Array.prototype.slice.call(arguments,0));var b={};return i(a,"object")&&!i(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polyline",b)},h.polygon=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b={};return i(a,"object")&&!i(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polygon",b)},function(){function d(){return this.selectAll("stop")}function e(a,b){var d=l("stop"),e={offset:+b+"%"};a=c.color(a),e["stop-color"]=a.hex,a.opacity<1&&(e["stop-opacity"]=a.opacity),l(d,e);for(var f,g=this.stops(),h=0;hb){this.node.insertBefore(d,g[h].node),f=!0;break}}return f||this.node.appendChild(d),this}function f(){if("linearGradient"==this.type){var a=l(this.node,"x1")||0,b=l(this.node,"x2")||1,d=l(this.node,"y1")||0,e=l(this.node,"y2")||0;return c._.box(a,d,math.abs(b-a),math.abs(e-d))}var f=this.node.cx||.5,g=this.node.cy||.5,h=this.node.r||0;return c._.box(f-h,g-h,2*h,2*h)}function g(a){var d=a,e=this.stops();if("string"==typeof a&&(d=b("snap.util.grad.parse",null,"l(0,0,0,1)"+a).firstDefined().stops),c.is(d,"array")){for(var f=0;fh;h++){var i=f[h];d.addStop(i.color,i.offset)}return d}function j(a,b,h,i,j){var k=c._.make("linearGradient",a);return k.stops=d,k.addStop=e,k.getBBox=f,k.setStops=g,null!=b&&l(k.node,{x1:b,y1:h,x2:i,y2:j}),k}function k(a,b,g,h,i,j){var k=c._.make("radialGradient",a);return k.stops=d,k.addStop=e,k.getBBox=f,null!=b&&l(k.node,{cx:b,cy:g,r:h}),null!=i&&null!=j&&l(k.node,{fx:i,fy:j}),k}var l=c._.$;h.gradient=function(a){return i(this.defs,a)},h.gradientLinear=function(a,b,c,d){return j(this.defs,a,b,c,d)},h.gradientRadial=function(a,b,c,d,e){return k(this.defs,a,b,c,d,e)},h.toString=function(){var a,b=this.node.ownerDocument,d=b.createDocumentFragment(),e=b.createElement("div"),f=this.node.cloneNode(!0);return d.appendChild(e),e.appendChild(f),c._.$(f,{xmlns:"http://www.w3.org/2000/svg"}),a=e.innerHTML,d.removeChild(d.firstChild),a},h.toDataURL=function(){return a&&a.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},h.clear=function(){for(var a,b=this.node.firstChild;b;)a=b.nextSibling,"defs"!=b.tagName?b.parentNode.removeChild(b):h.clear.call({node:b}),b=a}}()}),d.plugin(function(a,b,c,d){function e(a){var b=e.ps=e.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[M](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]}function f(a,b,c,d){return null==a&&(a=b=c=d=0),null==b&&(b=a.y,c=a.width,d=a.height,a=a.x),{x:a,y:b,width:c,w:c,height:d,h:d,x2:a+c,y2:b+d,cx:a+c/2,cy:b+d/2,r1:P.min(c,d)/2,r2:P.max(c,d)/2,r0:P.sqrt(c*c+d*d)/2,path:y(a,b,c,d),vb:[a,b,c,d].join(" ")}}function g(){return this.join(",").replace(N,"$1")}function h(a){var b=L(a);return b.toString=g,b}function i(a,b,c,d,e,f,g,h,i){return null==i?p(a,b,c,d,e,f,g,h):k(a,b,c,d,e,f,g,h,q(a,b,c,d,e,f,g,h,i))}function j(c,d){function e(a){return+(+a).toFixed(3)}return a._.cacher(function(a,f,g){a instanceof b&&(a=a.attr("d")),a=G(a);for(var h,j,l,m,n,o="",p={},q=0,r=0,s=a.length;s>r;r++){if(l=a[r],"M"==l[0])h=+l[1],j=+l[2];else{if(m=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6]),q+m>f){if(d&&!p.start){if(n=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6],f-q),o+=["C"+e(n.start.x),e(n.start.y),e(n.m.x),e(n.m.y),e(n.x),e(n.y)],g)return o;p.start=o,o=["M"+e(n.x),e(n.y)+"C"+e(n.n.x),e(n.n.y),e(n.end.x),e(n.end.y),e(l[5]),e(l[6])].join(),q+=m,h=+l[5],j=+l[6];continue}if(!c&&!d)return n=i(h,j,l[1],l[2],l[3],l[4],l[5],l[6],f-q)}q+=m,h=+l[5],j=+l[6]}o+=l.shift()+l}return p.end=o,n=c?q:d?p:k(h,j,l[0],l[1],l[2],l[3],l[4],l[5],1)},null,a._.clone)}function k(a,b,c,d,e,f,g,h,i){var j=1-i,k=T(j,3),l=T(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*P.atan2(q-s,r-t)/Q;return{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}}function l(b,c,d,e,g,h,i,j){a.is(b,"array")||(b=[b,c,d,e,g,h,i,j]);var k=F.apply(null,b);return f(k.min.x,k.min.y,k.max.x-k.min.x,k.max.y-k.min.y)}function m(a,b,c){return b>=a.x&&b<=a.x+a.width&&c>=a.y&&c<=a.y+a.height}function n(a,b){return a=f(a),b=f(b),m(b,a.x,a.y)||m(b,a.x2,a.y)||m(b,a.x,a.y2)||m(b,a.x2,a.y2)||m(a,b.x,b.y)||m(a,b.x2,b.y)||m(a,b.x,b.y2)||m(a,b.x2,b.y2)||(a.xb.x||b.xa.x)&&(a.yb.y||b.ya.y)}function o(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function p(a,b,c,d,e,f,g,h,i){null==i&&(i=1),i=i>1?1:0>i?0:i;for(var j=i/2,k=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0,p=0;k>p;p++){var q=j*l[p]+j,r=o(q,a,c,e,g),s=o(q,b,d,f,h),t=r*r+s*s;n+=m[p]*P.sqrt(t)}return j*n}function q(a,b,c,d,e,f,g,h,i){if(!(0>i||p(a,b,c,d,e,f,g,h)n;)l/=2,m+=(i>j?1:-1)*l,j=p(a,b,c,d,e,f,g,h,m);return m}}function r(a,b,c,d,e,f,g,h){if(!(S(a,c)S(e,g)||S(b,d)S(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+R(a,c).toFixed(2)||n>+S(a,c).toFixed(2)||n<+R(e,g).toFixed(2)||n>+S(e,g).toFixed(2)||o<+R(b,d).toFixed(2)||o>+S(b,d).toFixed(2)||o<+R(f,h).toFixed(2)||o>+S(f,h).toFixed(2)))return{x:l,y:m}}}}function s(a,b,c){var d=l(a),e=l(b);if(!n(d,e))return c?0:[];for(var f=p.apply(0,a),g=p.apply(0,b),h=~~(f/8),i=~~(g/8),j=[],m=[],o={},q=c?0:[],s=0;h+1>s;s++){var t=k.apply(0,a.concat(s/h));j.push({x:t.x,y:t.y,t:s/h})}for(s=0;i+1>s;s++)t=k.apply(0,b.concat(s/i)),m.push({x:t.x,y:t.y,t:s/i});for(s=0;h>s;s++)for(var u=0;i>u;u++){var v=j[s],w=j[s+1],x=m[u],y=m[u+1],z=U(w.x-v.x)<.001?"y":"x",A=U(y.x-x.x)<.001?"y":"x",B=r(v.x,v.y,w.x,w.y,x.x,x.y,y.x,y.y);if(B){if(o[B.x.toFixed(4)]==B.y.toFixed(4))continue;o[B.x.toFixed(4)]=B.y.toFixed(4);var C=v.t+U((B[z]-v[z])/(w[z]-v[z]))*(w.t-v.t),D=x.t+U((B[A]-x[A])/(y[A]-x[A]))*(y.t-x.t);C>=0&&1>=C&&D>=0&&1>=D&&(c?q++:q.push({x:B.x,y:B.y,t1:C,t2:D}))}}return q}function t(a,b){return v(a,b)}function u(a,b){return v(a,b,1)}function v(a,b,c){a=G(a),b=G(b);for(var d,e,f,g,h,i,j,k,l,m,n=c?0:[],o=0,p=a.length;p>o;o++){var q=a[o];if("M"==q[0])d=h=q[1],e=i=q[2];else{"C"==q[0]?(l=[d,e].concat(q.slice(1)),d=l[6],e=l[7]):(l=[d,e,d,e,h,i,h,i],d=h,e=i);for(var r=0,t=b.length;t>r;r++){var u=b[r];if("M"==u[0])f=j=u[1],g=k=u[2];else{"C"==u[0]?(m=[f,g].concat(u.slice(1)),f=m[6],g=m[7]):(m=[f,g,f,g,j,k,j,k],f=j,g=k);var v=s(l,m,c);if(c)n+=v;else{for(var w=0,x=v.length;x>w;w++)v[w].segment1=o,v[w].segment2=r,v[w].bez1=l,v[w].bez2=m;n=n.concat(v)}}}}}return n}function w(a,b,c){var d=x(a);return m(d,b,c)&&v(a,[["M",b,c],["H",d.x2+10]],1)%2==1}function x(a){var b=e(a);if(b.bbox)return L(b.bbox);if(!a)return f();a=G(a);for(var c,d=0,g=0,h=[],i=[],j=0,k=a.length;k>j;j++)if(c=a[j],"M"==c[0])d=c[1],g=c[2],h.push(d),i.push(g);else{var l=F(d,g,c[1],c[2],c[3],c[4],c[5],c[6]);h=h.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),d=c[5],g=c[6]}var m=R.apply(0,h),n=R.apply(0,i),o=S.apply(0,h),p=S.apply(0,i),q=f(m,n,o-m,p-n);return b.bbox=L(q),q}function y(a,b,c,d,e){if(e)return[["M",+a+ +e,b],["l",c-2*e,0],["a",e,e,0,0,1,e,e],["l",0,d-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-c,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-d],["a",e,e,0,0,1,e,-e],["z"]];var f=[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]];return f.toString=g,f}function z(a,b,c,d,e){if(null==e&&null==d&&(d=c),a=+a,b=+b,c=+c,d=+d,null!=e)var f=Math.PI/180,h=a+c*Math.cos(-d*f),i=a+c*Math.cos(-e*f),j=b+c*Math.sin(-d*f),k=b+c*Math.sin(-e*f),l=[["M",h,j],["A",c,c,0,+(e-d>180),0,i,k]];else l=[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]];return l.toString=g,l}function A(b){var c=e(b),d=String.prototype.toLowerCase;if(c.rel)return h(c.rel);a.is(b,"array")&&a.is(b&&b[0],"array")||(b=a.parsePathString(b));var f=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=b[0][1],j=b[0][2],k=i,l=j,m++,f.push(["M",i,j]));for(var n=m,o=b.length;o>n;n++){var p=f[n]=[],q=b[n];if(q[0]!=d.call(q[0]))switch(p[0]=d.call(q[0]),p[0]){case"a":p[1]=q[1],p[2]=q[2],p[3]=q[3],p[4]=q[4],p[5]=q[5],p[6]=+(q[6]-i).toFixed(3),p[7]=+(q[7]-j).toFixed(3);break;case"v":p[1]=+(q[1]-j).toFixed(3);break;case"m":k=q[1],l=q[2];default:for(var r=1,s=q.length;s>r;r++)p[r]=+(q[r]-(r%2?i:j)).toFixed(3)}else{p=f[n]=[],"m"==q[0]&&(k=q[1]+i,l=q[2]+j);for(var t=0,u=q.length;u>t;t++)f[n][t]=q[t]}var v=f[n].length;switch(f[n][0]){case"z":i=k,j=l;break;case"h":i+=+f[n][v-1];break;case"v":j+=+f[n][v-1];break;default:i+=+f[n][v-2],j+=+f[n][v-1]}}return f.toString=g,c.rel=h(f),f}function B(b){var c=e(b);if(c.abs)return h(c.abs);if(K(b,"array")&&K(b&&b[0],"array")||(b=a.parsePathString(b)),!b||!b.length)return[["M",0,0]];var d,f=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=+b[0][1],j=+b[0][2],k=i,l=j,m++,f[0]=["M",i,j]);for(var n,o,p=3==b.length&&"M"==b[0][0]&&"R"==b[1][0].toUpperCase()&&"Z"==b[2][0].toUpperCase(),q=m,r=b.length;r>q;q++){if(f.push(n=[]),o=b[q],d=o[0],d!=d.toUpperCase())switch(n[0]=d.toUpperCase(),n[0]){case"A":n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=+o[6]+i,n[7]=+o[7]+j;break;case"V":n[1]=+o[1]+j;break;case"H":n[1]=+o[1]+i;break;case"R":for(var s=[i,j].concat(o.slice(1)),t=2,u=s.length;u>t;t++)s[t]=+s[t]+i,s[++t]=+s[t]+j;f.pop(),f=f.concat(I(s,p));break;case"O":f.pop(),s=z(i,j,o[1],o[2]),s.push(s[0]),f=f.concat(s);break;case"U":f.pop(),f=f.concat(z(i,j,o[1],o[2],o[3])),n=["U"].concat(f[f.length-1].slice(-2));break;case"M":k=+o[1]+i,l=+o[2]+j;default:for(t=1,u=o.length;u>t;t++)n[t]=+o[t]+(t%2?i:j)}else if("R"==d)s=[i,j].concat(o.slice(1)),f.pop(),f=f.concat(I(s,p)),n=["R"].concat(o.slice(-2));else if("O"==d)f.pop(),s=z(i,j,o[1],o[2]),s.push(s[0]),f=f.concat(s);else if("U"==d)f.pop(),f=f.concat(z(i,j,o[1],o[2],o[3])),n=["U"].concat(f[f.length-1].slice(-2));else for(var v=0,w=o.length;w>v;v++)n[v]=o[v];if(d=d.toUpperCase(),"O"!=d)switch(n[0]){case"Z":i=+k,j=+l;break;case"H":i=n[1];break;case"V":j=n[1];break;case"M":k=n[n.length-2],l=n[n.length-1];default:i=n[n.length-2],j=n[n.length-1]}}return f.toString=g,c.abs=h(f),f}function C(a,b,c,d){return[a,b,c,d,c,d]}function D(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function E(b,c,d,e,f,g,h,i,j,k){var l,m=120*Q/180,n=Q/180*(+f||0),o=[],p=a._.cacher(function(a,b,c){var d=a*P.cos(c)-b*P.sin(c),e=a*P.sin(c)+b*P.cos(c);return{x:d,y:e}});if(!d||!e)return[b,c,i,j,i,j];if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(b,c,-n),b=l.x,c=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(P.cos(Q/180*f),P.sin(Q/180*f),(b-i)/2),r=(c-j)/2,s=q*q/(d*d)+r*r/(e*e);s>1&&(s=P.sqrt(s),d=s*d,e=s*e);var t=d*d,u=e*e,v=(g==h?-1:1)*P.sqrt(U((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*d*r/e+(b+i)/2,x=v*-e*q/d+(c+j)/2,y=P.asin(((c-x)/e).toFixed(9)),z=P.asin(((j-x)/e).toFixed(9));y=w>b?Q-y:y,z=w>i?Q-z:z,0>y&&(y=2*Q+y),0>z&&(z=2*Q+z),h&&y>z&&(y-=2*Q),!h&&z>y&&(z-=2*Q)}var A=z-y;if(U(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+d*P.cos(z),j=x+e*P.sin(z),o=E(i,j,d,e,f,0,h,C,D,[z,B,w,x])}A=z-y;var F=P.cos(y),G=P.sin(y),H=P.cos(z),I=P.sin(z),J=P.tan(A/4),K=4/3*d*J,L=4/3*e*J,M=[b,c],N=[b+K*G,c-L*F],O=[i+K*I,j-L*H],R=[i,j];if(N[0]=2*M[0]-N[0],N[1]=2*M[1]-N[1],k)return[N,O,R].concat(o);o=[N,O,R].concat(o).join().split(",");for(var S=[],T=0,V=o.length;V>T;T++)S[T]=T%2?p(o[T-1],o[T],n).y:p(o[T],o[T+1],n).x;return S}function F(a,b,c,d,e,f,g,h){for(var i,j,k,l,m,n,o,p,q=[],r=[[],[]],s=0;2>s;++s)if(0==s?(j=6*a-12*c+6*e,i=-3*a+9*c-9*e+3*g,k=3*c-3*a):(j=6*b-12*d+6*f,i=-3*b+9*d-9*f+3*h,k=3*d-3*b),U(i)<1e-12){if(U(j)<1e-12)continue;l=-k/j,l>0&&1>l&&q.push(l)}else o=j*j-4*k*i,p=P.sqrt(o),0>o||(m=(-j+p)/(2*i),m>0&&1>m&&q.push(m),n=(-j-p)/(2*i),n>0&&1>n&&q.push(n));for(var t,u=q.length,v=u;u--;)l=q[u],t=1-l,r[0][u]=t*t*t*a+3*t*t*l*c+3*t*l*l*e+l*l*l*g,r[1][u]=t*t*t*b+3*t*t*l*d+3*t*l*l*f+l*l*l*h;return r[0][v]=a,r[1][v]=b,r[0][v+1]=g,r[1][v+1]=h,r[0].length=r[1].length=v+2,{min:{x:R.apply(0,r[0]),y:R.apply(0,r[1])},max:{x:S.apply(0,r[0]),y:S.apply(0,r[1])}}}function G(a,b){var c=!b&&e(a);if(!b&&c.curve)return h(c.curve);for(var d=B(a),f=b&&B(b),g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},j=(function(a,b,c){var d,e;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"].concat(E.apply(0,[b.x,b.y].concat(a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e].concat(a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"].concat(D(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"].concat(D(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"].concat(C(b.x,b.y,a[1],a[2]));break;case"H":a=["C"].concat(C(b.x,b.y,a[1],b.y));break;case"V":a=["C"].concat(C(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"].concat(C(b.x,b.y,b.X,b.Y))}return a}),k=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)m[b]="A",f&&(n[b]="A"),a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),r=S(d.length,f&&f.length||0)}},l=function(a,b,c,e,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",e.x,e.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],r=S(d.length,f&&f.length||0))},m=[],n=[],o="",p="",q=0,r=S(d.length,f&&f.length||0);r>q;q++){d[q]&&(o=d[q][0]),"C"!=o&&(m[q]=o,q&&(p=m[q-1])),d[q]=j(d[q],g,p),"A"!=m[q]&&"C"==o&&(m[q]="C"),k(d,q),f&&(f[q]&&(o=f[q][0]),"C"!=o&&(n[q]=o,q&&(p=n[q-1])),f[q]=j(f[q],i,p),"A"!=n[q]&&"C"==o&&(n[q]="C"),k(f,q)),l(d,f,g,i,q),l(f,d,i,g,q);var s=d[q],t=f&&f[q],u=s.length,v=f&&t.length;g.x=s[u-2],g.y=s[u-1],g.bx=O(s[u-4])||g.x,g.by=O(s[u-3])||g.y,i.bx=f&&(O(t[v-4])||i.x),i.by=f&&(O(t[v-3])||i.y),i.x=f&&t[v-2],i.y=f&&t[v-1]}return f||(c.curve=h(d)),f?[d,f]:d}function H(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=G(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a}function I(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}var J=b.prototype,K=a.is,L=a._.clone,M="hasOwnProperty",N=/,?([a-z]),?/gi,O=parseFloat,P=Math,Q=P.PI,R=P.min,S=P.max,T=P.pow,U=P.abs,V=j(1),W=j(),X=j(0,1),Y=a._unit2px,Z={path:function(a){return a.attr("path")},circle:function(a){var b=Y(a);return z(b.cx,b.cy,b.r)},ellipse:function(a){var b=Y(a);return z(b.cx||0,b.cy||0,b.rx,b.ry); +},rect:function(a){var b=Y(a);return y(b.x||0,b.y||0,b.width,b.height,b.rx,b.ry)},image:function(a){var b=Y(a);return y(b.x||0,b.y||0,b.width,b.height)},line:function(a){return"M"+[a.attr("x1")||0,a.attr("y1")||0,a.attr("x2"),a.attr("y2")]},polyline:function(a){return"M"+a.attr("points")},polygon:function(a){return"M"+a.attr("points")+"z"},deflt:function(a){var b=a.node.getBBox();return y(b.x,b.y,b.width,b.height)}};a.path=e,a.path.getTotalLength=V,a.path.getPointAtLength=W,a.path.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return X(a,b).end;var d=X(a,c,1);return b?X(d,b).end:d},J.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},J.getPointAtLength=function(a){return W(this.attr("d"),a)},J.getSubpath=function(b,c){return a.path.getSubpath(this.attr("d"),b,c)},a._.box=f,a.path.findDotsAtSegment=k,a.path.bezierBBox=l,a.path.isPointInsideBBox=m,a.closest=function(b,c,d,e){for(var g=100,h=f(b-g/2,c-g/2,g,g),i=[],j=d[0].hasOwnProperty("x")?function(a){return{x:d[a].x,y:d[a].y}}:function(a){return{x:d[a],y:e[a]}},k=0;1e6>=g&&!k;){for(var l=0,n=d.length;n>l;l++){var o=j(l);if(m(h,o.x,o.y)){k++,i.push(o);break}}k||(g*=2,h=f(b-g/2,c-g/2,g,g))}if(1e6!=g){var p,q=1/0;for(l=0,n=i.length;n>l;l++){var r=a.len(b,c,i[l].x,i[l].y);q>r&&(q=r,i[l].len=r,p=i[l])}return p}},a.path.isBBoxIntersect=n,a.path.intersection=t,a.path.intersectionNumber=u,a.path.isPointInside=w,a.path.getBBox=x,a.path.get=Z,a.path.toRelative=A,a.path.toAbsolute=B,a.path.toCubic=G,a.path.map=H,a.path.toString=g,a.path.clone=h}),d.plugin(function(a,d,e,f){var g=Math.max,h=Math.min,i=function(a){if(this.items=[],this.bindings={},this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)a[b]&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},j=i.prototype;j.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],a&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},j.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},j.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this},j.animate=function(d,e,f,g){"function"!=typeof f||f.length||(g=f,f=c.linear),d instanceof a._.Animation&&(g=d.callback,f=d.easing,e=f.dur,d=d.attr);var h=arguments;if(a.is(d,"array")&&a.is(h[h.length-1],"array"))var i=!0;var j,k=function(){j?this.b=j:j=this.b},l=0,m=this,n=g&&function(){++l==m.length&&g.call(this)};return this.forEach(function(a,c){b.once("snap.animcreated."+a.id,k),i?h[c]&&a.animate.apply(a,h[c]):a.animate(d,e,f,n)})},j.remove=function(){for(;this.length;)this.pop().remove();return this},j.bind=function(a,b,c){var d={};if("function"==typeof b)this.bindings[a]=b;else{var e=c||a;this.bindings[a]=function(a){d[e]=a,b.attr(d)}}return this},j.attr=function(a){var b={};for(var c in a)this.bindings[c]?this.bindings[c](a[c]):b[c]=a[c];for(var d=0,e=this.items.length;e>d;d++)this.items[d].attr(b);return this},j.clear=function(){for(;this.length;)this.pop()},j.splice=function(a,b,c){a=0>a?g(this.length+a,0):a,b=g(0,h(this.length-a,b));var d,e=[],f=[],j=[];for(d=2;dd;d++)f.push(this[a+d]);for(;dd?j[d]:e[d-k];for(d=this.items.length=this.length-=b-k;this[d];)delete this[d++];return new i(f)},j.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0;return!1},j.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},j.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=h.apply(0,a),b=h.apply(0,b),c=g.apply(0,c),d=g.apply(0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b,cx:a+(c-a)/2,cy:b+(d-b)/2}},j.clone=function(a){a=new i;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},j.toString=function(){return"Snap‘s set"},j.type="set",a.Set=i,a.set=function(){var a=new i;return arguments.length&&a.push.apply(a,Array.prototype.slice.call(arguments,0)),a}}),d.plugin(function(a,c,d,e){function f(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}}function g(b,c,d){b=b||new a.Matrix,c=c||new a.Matrix,b=a.parseTransformString(b.toTransformString())||[],c=a.parseTransformString(c.toTransformString())||[];for(var e,g,h,i,j=Math.max(b.length,c.length),k=[],n=[],o=0;j>o;o++){if(h=b[o]||f(c[o]),i=c[o]||f(h),h[0]!=i[0]||"r"==h[0].toLowerCase()&&(h[2]!=i[2]||h[3]!=i[3])||"s"==h[0].toLowerCase()&&(h[3]!=i[3]||h[4]!=i[4])){b=a._.transform2matrix(b,d()),c=a._.transform2matrix(c,d()),k=[["m",b.a,b.b,b.c,b.d,b.e,b.f]],n=[["m",c.a,c.b,c.c,c.d,c.e,c.f]];break}for(k[o]=[],n[o]=[],e=0,g=Math.max(h.length,i.length);g>e;e++)e in h&&(k[o][e]=h[e]),e in i&&(n[o][e]=i[e])}return{from:m(k),to:m(n),f:l(k)}}function h(a){return a}function i(a){return function(b){return+b.toFixed(3)+a}}function j(a){return a.join(" ")}function k(b){return a.rgb(b[0],b[1],b[2],b[3])}function l(a){var b,c,d,e,f,g,h=0,i=[];for(b=0,c=a.length;c>b;b++){for(f="[",g=['"'+a[b][0]+'"'],d=1,e=a[b].length;e>d;d++)g[d]="val["+h++ +"]";f+=g+"]",i[b]=f}return Function("val","return Snap.path.toString.call(["+i+"])")}function m(a){for(var b=[],c=0,d=a.length;d>c;c++)for(var e=1,f=a[c].length;f>e;e++)b.push(a[c][e]);return b}function n(a){return isFinite(a)}function o(b,c){return a.is(b,"array")&&a.is(c,"array")?b.toString()==c.toString():!1}var p={},q=/[%a-z]+$/i,r=String;p.stroke=p.fill="colour",c.prototype.equal=function(a,c){return b("snap.util.equal",this,a,c).firstDefined()},b.on("snap.util.equal",function(b,c){var d,e,f=r(this.attr(b)||""),s=this;if("colour"==p[b])return d=a.color(f),e=a.color(c),{from:[d.r,d.g,d.b,d.opacity],to:[e.r,e.g,e.b,e.opacity],f:k};if("viewBox"==b)return d=this.attr(b).vb.split(" ").map(Number),e=c.split(" ").map(Number),{from:d,to:e,f:j};if("transform"==b||"gradientTransform"==b||"patternTransform"==b)return"string"==typeof c&&(c=r(c).replace(/\.{3}|\u2026/g,f)),f=this.matrix,c=a._.rgTransform.test(c)?a._.transform2matrix(c,this.getBBox()):a._.transform2matrix(a._.svgTransform2string(c),this.getBBox()),g(f,c,function(){return s.getBBox(1)});if("d"==b||"path"==b)return d=a.path.toCubic(f,c),{from:m(d[0]),to:m(d[1]),f:l(d[0])};if("points"==b)return d=r(f).split(a._.separator),e=r(c).split(a._.separator),{from:d,to:e,f:function(a){return a}};if(n(f)&&n(c))return{from:parseFloat(f),to:parseFloat(c),f:h};var t=f.match(q),u=r(c).match(q);return t&&o(t,u)?{from:parseFloat(f),to:parseFloat(c),f:i(t)}:{from:this.asPX(b),to:this.asPX(b,c),f:h}})}),d.plugin(function(a,c,d,e){for(var f=c.prototype,g="hasOwnProperty",h=("createTouch"in e.doc),i=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],j={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},k=(function(a,b){var c="y"==a?"scrollTop":"scrollLeft",d=b&&b.node?b.node.ownerDocument:e.doc;return d[c in d.documentElement?"documentElement":"body"][c]}),l=function(){return this.originalEvent.preventDefault()},m=function(){return this.originalEvent.stopPropagation()},n=function(a,b,c,d){var e=h&&j[b]?j[b]:b,f=function(e){var f=k("y",d),i=k("x",d);if(h&&j[g](b))for(var n=0,o=e.targetTouches&&e.targetTouches.length;o>n;n++)if(e.targetTouches[n].target==a||a.contains(e.targetTouches[n].target)){var p=e;e=e.targetTouches[n],e.originalEvent=p,e.preventDefault=l,e.stopPropagation=m;break}var q=e.clientX+i,r=e.clientY+f;return c.call(d,e,q,r)};return b!==e&&a.addEventListener(b,f,!1),a.addEventListener(e,f,!1),function(){return b!==e&&a.removeEventListener(b,f,!1),a.removeEventListener(e,f,!1),!0}},o=[],p=function(a){for(var c,d=a.clientX,e=a.clientY,f=k("y"),g=k("x"),i=o.length;i--;){if(c=o[i],h){for(var j,l=a.touches&&a.touches.length;l--;)if(j=a.touches[l],j.identifier==c.el._drag.id||c.el.node.contains(j.target)){d=j.clientX,e=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var m=c.el.node;m.nextSibling,m.parentNode,m.style.display;d+=g,e+=f,b("snap.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},q=function(c){a.unmousemove(p).unmouseup(q);for(var d,e=o.length;e--;)d=o[e],d.el._drag={},b("snap.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,c),b.off("snap.drag.*."+d.el.id);o=[]},r=i.length;r--;)!function(b){a[b]=f[b]=function(c,d){if(a.is(c,"function"))this.events=this.events||[],this.events.push({name:b,f:c,unbind:n(this.node||document,b,c,d||this)});else for(var e=0,f=this.events.length;f>e;e++)if(this.events[e].name==b)try{this.events[e].f.call(this)}catch(g){}return this},a["un"+b]=f["un"+b]=function(a){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==b&&(c[d].f==a||!a))return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(i[r]);f.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},f.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var s=[];f.drag=function(c,d,e,f,g,h){function i(i,j,l){(i.originalEvent||i).preventDefault(),k._drag.x=j,k._drag.y=l,k._drag.id=i.identifier,!o.length&&a.mousemove(p).mouseup(q),o.push({el:k,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("snap.drag.start."+k.id,d),c&&b.on("snap.drag.move."+k.id,c),e&&b.on("snap.drag.end."+k.id,e),b("snap.drag.start."+k.id,g||f||k,j,l,i)}function j(a,c,d){b("snap.draginit."+k.id,k,a,c,d)}var k=this;if(!arguments.length){var l;return k.drag(function(a,b){this.attr({transform:l+(l?"T":"t")+[a,b]})},function(){l=this.transform().local})}return b.on("snap.draginit."+k.id,i),k._drag={},s.push({el:k,start:i,init:j}),k.mousedown(j),k},f.undrag=function(){for(var c=s.length;c--;)s[c].el==this&&(this.unmousedown(s[c].init),s.splice(c,1),b.unbind("snap.drag.*."+this.id),b.unbind("snap.draginit."+this.id));return!s.length&&a.unmousemove(p).unmouseup(q),this}}),d.plugin(function(a,c,d,e){var f=(c.prototype,d.prototype),g=/^\s*url\((.+)\)/,h=String,i=a._.$;a.filter={},f.filter=function(b){var d=this;"svg"!=d.type&&(d=d.paper);var e=a.parse(h(b)),f=a._.id(),g=(d.node.offsetWidth,d.node.offsetHeight,i("filter"));return i(g,{id:f,filterUnits:"userSpaceOnUse"}),g.appendChild(e.node),d.defs.appendChild(g),new c(g)},b.on("snap.util.getattr.filter",function(){b.stop();var c=i(this.node,"filter");if(c){var d=h(c).match(g);return d&&a.select(d[1])}}),b.on("snap.util.attr.filter",function(d){if(d instanceof c&&"filter"==d.type){b.stop();var e=d.node.id;e||(i(d.node,{id:d.id}),e=d.id),i(this.node,{filter:a.url(e)})}d&&"none"!=d||(b.stop(),this.node.removeAttribute("filter"))}),a.filter.blur=function(b,c){null==b&&(b=2);var d=null==c?b:[b,c];return a.format('',{def:d})},a.filter.blur.toString=function(){return this()},a.filter.shadow=function(b,c,d,e,f){return null==f&&(null==e?(f=d,d=4,e="#000"):(f=e,e=d,d=4)),null==d&&(d=4),null==f&&(f=1),null==b&&(b=0,c=2),null==c&&(c=b),e=a.color(e),a.format('',{color:e,dx:b,dy:c,blur:d,opacity:f})},a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(b){return null==b&&(b=1),a.format('',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(b){return null==b&&(b=1),a.format('',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(b){return null==b&&(b=1),a.format('',{amount:1-b})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(b){return b=b||0,a.format('',{angle:b})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(b){return null==b&&(b=1),a.format('',{amount:b,amount2:1-b})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(b){return null==b&&(b=1),a.format('',{amount:b})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(b){return null==b&&(b=1),a.format('',{amount:b,amount2:.5-b/2})},a.filter.contrast.toString=function(){return this()}}),d.plugin(function(a,b,c,d,e){var f=a._.box,g=a.is,h=/^[^a-z]*([tbmlrc])/i,i=function(){return"T"+this.dx+","+this.dy};b.prototype.getAlign=function(a,b){null==b&&g(a,"string")&&(b=a,a=null),a=a||this.paper;var c=a.getBBox?a.getBBox():f(a),d=this.getBBox(),e={};switch(b=b&&b.match(h),b=b?b[1].toLowerCase():"c"){case"t":e.dx=0,e.dy=c.y-d.y;break;case"b":e.dx=0,e.dy=c.y2-d.y2;break;case"m":e.dx=0,e.dy=c.cy-d.cy;break;case"l":e.dx=c.x-d.x,e.dy=0;break;case"r":e.dx=c.x2-d.x2,e.dy=0;break;default:e.dx=c.cx-d.cx,e.dy=0}return e.toString=i,e},b.prototype.align=function(a,b){return this.transform("..."+this.getAlign(a,b))}}),d.plugin(function(b,c,d,e){function f(a){a=a.split(/(?=#)/);var b=new String(a[5]);return b[50]=a[0],b[100]=a[1],b[200]=a[2],b[300]=a[3],b[400]=a[4],b[500]=a[5],b[600]=a[6],b[700]=a[7],b[800]=a[8],b[900]=a[9],a[10]&&(b.A100=a[10],b.A200=a[11],b.A400=a[12],b.A700=a[13]),b}var g="#ffebee#ffcdd2#ef9a9a#e57373#ef5350#f44336#e53935#d32f2f#c62828#b71c1c#ff8a80#ff5252#ff1744#d50000",h="#FCE4EC#F8BBD0#F48FB1#F06292#EC407A#E91E63#D81B60#C2185B#AD1457#880E4F#FF80AB#FF4081#F50057#C51162",i="#F3E5F5#E1BEE7#CE93D8#BA68C8#AB47BC#9C27B0#8E24AA#7B1FA2#6A1B9A#4A148C#EA80FC#E040FB#D500F9#AA00FF",j="#EDE7F6#D1C4E9#B39DDB#9575CD#7E57C2#673AB7#5E35B1#512DA8#4527A0#311B92#B388FF#7C4DFF#651FFF#6200EA",k="#E8EAF6#C5CAE9#9FA8DA#7986CB#5C6BC0#3F51B5#3949AB#303F9F#283593#1A237E#8C9EFF#536DFE#3D5AFE#304FFE",l="#E3F2FD#BBDEFB#90CAF9#64B5F6#64B5F6#2196F3#1E88E5#1976D2#1565C0#0D47A1#82B1FF#448AFF#2979FF#2962FF",m="#E1F5FE#B3E5FC#81D4FA#4FC3F7#29B6F6#03A9F4#039BE5#0288D1#0277BD#01579B#80D8FF#40C4FF#00B0FF#0091EA",n="#E0F7FA#B2EBF2#80DEEA#4DD0E1#26C6DA#00BCD4#00ACC1#0097A7#00838F#006064#84FFFF#18FFFF#00E5FF#00B8D4",o="#E0F2F1#B2DFDB#80CBC4#4DB6AC#26A69A#009688#00897B#00796B#00695C#004D40#A7FFEB#64FFDA#1DE9B6#00BFA5",p="#E8F5E9#C8E6C9#A5D6A7#81C784#66BB6A#4CAF50#43A047#388E3C#2E7D32#1B5E20#B9F6CA#69F0AE#00E676#00C853",q="#F1F8E9#DCEDC8#C5E1A5#AED581#9CCC65#8BC34A#7CB342#689F38#558B2F#33691E#CCFF90#B2FF59#76FF03#64DD17",r="#F9FBE7#F0F4C3#E6EE9C#DCE775#D4E157#CDDC39#C0CA33#AFB42B#9E9D24#827717#F4FF81#EEFF41#C6FF00#AEEA00",s="#FFFDE7#FFF9C4#FFF59D#FFF176#FFEE58#FFEB3B#FDD835#FBC02D#F9A825#F57F17#FFFF8D#FFFF00#FFEA00#FFD600",t="#FFF8E1#FFECB3#FFE082#FFD54F#FFCA28#FFC107#FFB300#FFA000#FF8F00#FF6F00#FFE57F#FFD740#FFC400#FFAB00",u="#FFF3E0#FFE0B2#FFCC80#FFB74D#FFA726#FF9800#FB8C00#F57C00#EF6C00#E65100#FFD180#FFAB40#FF9100#FF6D00",v="#FBE9E7#FFCCBC#FFAB91#FF8A65#FF7043#FF5722#F4511E#E64A19#D84315#BF360C#FF9E80#FF6E40#FF3D00#DD2C00",w="#EFEBE9#D7CCC8#BCAAA4#A1887F#8D6E63#795548#6D4C41#5D4037#4E342E#3E2723",x="#FAFAFA#F5F5F5#EEEEEE#E0E0E0#BDBDBD#9E9E9E#757575#616161#424242#212121",y="#ECEFF1#CFD8DC#B0BEC5#90A4AE#78909C#607D8B#546E7A#455A64#37474F#263238";b.mui={},b.flat={},b.mui.red=f(g),b.mui.pink=f(h),b.mui.purple=f(i),b.mui.deeppurple=f(j),b.mui.indigo=f(k),b.mui.blue=f(l),b.mui.lightblue=f(m),b.mui.cyan=f(n),b.mui.teal=f(o),b.mui.green=f(p),b.mui.lightgreen=f(q),b.mui.lime=f(r),b.mui.yellow=f(s),b.mui.amber=f(t),b.mui.orange=f(u),b.mui.deeporange=f(v),b.mui.brown=f(w),b.mui.grey=f(x),b.mui.bluegrey=f(y),b.flat.turquoise="#1abc9c",b.flat.greensea="#16a085",b.flat.sunflower="#f1c40f",b.flat.orange="#f39c12",b.flat.emerland="#2ecc71",b.flat.nephritis="#27ae60",b.flat.carrot="#e67e22",b.flat.pumpkin="#d35400",b.flat.peterriver="#3498db",b.flat.belizehole="#2980b9",b.flat.alizarin="#e74c3c",b.flat.pomegranate="#c0392b",b.flat.amethyst="#9b59b6",b.flat.wisteria="#8e44ad",b.flat.clouds="#ecf0f1",b.flat.silver="#bdc3c7",b.flat.wetasphalt="#34495e",b.flat.midnightblue="#2c3e50",b.flat.concrete="#95a5a6",b.flat.asbestos="#7f8c8d",b.importMUIColors=function(){for(var c in b.mui)b.mui.hasOwnProperty(c)&&(a[c]=b.mui[c])}}),d}); \ No newline at end of file diff --git a/dist/snap.svg.js b/dist/snap.svg.js index 3d872aa..bb33c94 100644 --- a/dist/snap.svg.js +++ b/dist/snap.svg.js @@ -1,4 +1,4 @@ -// Snap.svg 0.4.2dev +// Snap.svg 0.5.0 // // Copyright (c) 2013 – 2017 Adobe Systems Incorporated. All rights reserved. // @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// build: 2017-02-02 +// build: 2017-02-03 // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. // @@ -868,7 +868,7 @@ var mina = (function (eve) { // limitations under the License. var Snap = (function(root) { -Snap.version = "0.4.2dev"; +Snap.version = "0.5.0"; /*\ * Snap [ method ] @@ -4156,9 +4156,20 @@ Snap.plugin(function (Snap, Element, Paper, glob, Fragment) { }(function (value) { if (value instanceof Element || value instanceof Fragment) { eve.stop(); - if (value.type == "clipPath") { - var clip = value; - } else { + var clip, + node = value.node; + while (node) { + if (node.nodeName === "clipPath") { + clip = new Element(node); + break; + } + if (node.nodeName === "svg") { + clip = undefined; + break; + } + node = node.parentNode; + } + if (!clip) { clip = make("clipPath", getSomeDefs(this)); clip.node.appendChild(value.node); !clip.node.id && $(clip.node, { diff --git a/doc/reference.html b/doc/reference.html index fd3f0cf..883b293 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -17,18 +17,15 @@ var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-44948757-1']); _gaq.push(['_trackPageview']); - (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); - function trackOutboundLink(link, category, action) { try { _gaq.push(['_trackEvent', category , action]); } catch(err){} - setTimeout(function() { document.location.href = link.href; }, 100); @@ -36,11 +33,10 @@ - - - -
-
-
- -
- -
-
-
-
- -
-
-

Snap(…)

-
-
-
-
- - - - -

Creates a drawing surface or wraps existing SVG element. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. width - number string - width of surface
  2. -
  3. height - number string - height of surface
  4. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. DOM - SVGElement - element to be wrapped into Snap structure
  2. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. array - array - array of elements (will return set of elements)
  2. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. query - string - CSS query selector
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - Element -

- - - - -
-
-
- -
-
-

Snap.url()(value)

-
-
-
-
- - - - -

Wraps path into "url('<path>')". -

- - - - - - - - - - -
-

Parameters

-
    -
  1. value - string - path
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - string - - wrapped path -

- - - - -
-
-
- -
-
-

Snap.format(token, json)

-
-
-
-
- - - - -

Replaces construction of type {<name>} to the corresponding argument -

- - - - - - - - - - -
-

Parameters

-
    -
  1. token - string - string to format
  2. -
  3. json - object - object which properties are used as a replacement
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - string - - formatted string -

- - - - - - - - -

Usage

- - - - - - - - - - - -
// this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+                
+
+ +
+ +
+
+
+
+
+
+

Snap(…) + + +

+
+
+
+
+

Creates a drawing surface or wraps existing SVG element. +

+
+

Parameters

+
    +
  1. + width + + number + string + + width of surface +
  2. +
  3. + height + + number + string + + height of surface +
  4. +
+
+

or +

+
+

Parameters

+
    +
  1. + DOM + + SVGElement + + element to be wrapped into Snap structure +
  2. +
+
+

or +

+
+

Parameters

+
    +
  1. + array + + array + + array of elements (will return set of + elements) +
  2. +
+
+

or +

+
+

Parameters

+
    +
  1. + query + + string + + CSS query selector +
  2. +
+
+

+ Returns: + object + + Element + +

+
+
+
+
+
+

Snap.url()(value) + + +

+
+
+
+
+

Wraps path into "url('<path>')". +

+
+

Parameters

+
    +
  1. + value + + string + + path +
  2. +
+
+

+ Returns: + string + wrapped path +

+
+
+
+
+
+

Snap.format(token, json) + + +

+
+
+
+
+

Replaces construction of type {<name>} to the corresponding argument +

+
+

Parameters

+
    +
  1. + token + + string + + string to format +
  2. +
  3. + json + + object + + object which properties are used as a + replacement +
  4. +
+
+

+ Returns: + string + formatted string +

+

Usage

+
// this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
 paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
     x: 10,
     y: 20,
@@ -1177,2596 +1247,1571 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
         "negative width": -40
     }
 }));
- - - - - -
-
-
- -
-
-

Snap.rad(deg)

-
-
-
-
- - - - -

Transform angle to radians -

- - - - - - - - - - -
-

Parameters

-
    -
  1. deg - number - angle in degrees
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - angle in radians -

- - - - -
-
-
- -
-
-

Snap.deg(rad)

-
-
-
-
- - - - -

Transform angle to degrees -

- - - - - - - - - - -
-

Parameters

-
    -
  1. rad - number - angle in radians
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - angle in degrees -

- - - - -
-
-
- -
-
-

Snap.sin(angle)

-
-
-
-
- - - - -

Equivalent to Math.sin() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. angle - number - angle in degrees
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - sin -

- - - - -
-
-
- -
-
-

Snap.tan(angle)

-
-
-
-
- - - - -

Equivalent to Math.tan() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. angle - number - angle in degrees
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - tan -

- - - - -
-
-
- -
-
-

Snap.cos(angle)

-
-
-
-
- - - - -

Equivalent to Math.cos() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. angle - number - angle in degrees
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - cos -

- - - - -
-
-
- -
-
-

Snap.asin(num)

-
-
-
-
- - - - -

Equivalent to Math.asin() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. num - number - value
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - asin in degrees -

- - - - -
-
-
- -
-
-

Snap.acos(num)

-
-
-
-
- - - - -

Equivalent to Math.acos() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. num - number - value
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - acos in degrees -

- - - - -
-
-
- -
-
-

Snap.atan(num)

-
-
-
-
- - - - -

Equivalent to Math.atan() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. num - number - value
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - atan in degrees -

- - - - -
-
-
- -
-
-

Snap.atan2(num)

-
-
-
-
- - - - -

Equivalent to Math.atan2() only works with degrees, not radians. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. num - number - value
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - atan2 in degrees -

- - - - -
-
-
- -
-
-

Snap.angle(x1, y1, x2, y2, [x3], [y3])

-
-
-
-
- - - - -

Returns an angle between two or three points -

- - - - - - - - - - - - -

Parameters

- - - - - - - - -
-

Parameters

-
    -
  1. x1 - number - x coord of first point
  2. -
  3. y1 - number - y coord of first point
  4. -
  5. x2 - number - x coord of second point
  6. -
  7. y2 - number - y coord of second point
  8. -
  9. x3 - number - x coord of third point
  10. -
  11. y3 - number - y coord of third point
  12. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - angle in degrees -

- - - - -
-
-
- -
-
-

Snap.len(x1, y1, x2, y2)

-
-
-
-
- - - - -

Returns distance between two points -

- - - - - - - - - - - - -

Parameters

- - - - - - - - -
-

Parameters

-
    -
  1. x1 - number - x coord of first point
  2. -
  3. y1 - number - y coord of first point
  4. -
  5. x2 - number - x coord of second point
  6. -
  7. y2 - number - y coord of second point
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - distance -

- - - - -
-
-
- -
-
-

Snap.len2(x1, y1, x2, y2)

-
-
-
-
- - - - -

Returns squared distance between two points -

- - - - - - - - - - - - -

Parameters

- - - - - - - - -
-

Parameters

-
    -
  1. x1 - number - x coord of first point
  2. -
  3. y1 - number - y coord of first point
  4. -
  5. x2 - number - x coord of second point
  6. -
  7. y2 - number - y coord of second point
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - distance -

- - - - -
-
-
- -
-
-

Snap.closestPoint(path, x, y)

-
-
-
-
- - - - -

Returns closest point to a given one on a given path. -

- - - - - - - - - - - - -

Parameters

- - - - - - - - -
-

Parameters

-
    -
  1. path - Element - path element
  2. -
  3. x - number - x coord of a point
  4. -
  5. y - number - y coord of a point
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - in format -

- - - - -
-
-
- -
-
-

Snap.is(o, type)

-
-
-
-
- - - - -

Handy replacement for the typeof operator -

- - - - - - - - - - -
-

Parameters

-
    -
  1. o - - any object or primitive
  2. -
  3. type - string - name of the type, e.g., string, function, number, etc.
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - boolean - - true if given value is of given type -

- - - - -
-
-
- -
-
-

Snap.snapTo(values, value, [tolerance])

-
-
-
-
- - - - -

Snaps given value to given grid -

- - - - - - - - - - -
-

Parameters

-
    -
  1. values - array number - given array of values or step of the grid
  2. -
  3. value - number - value to adjust
  4. -
  5. tolerance - number - maximum distance to the target value that would trigger the snap. Default is 10.
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - adjusted value -

- - - - -
-
-
- -
-
-

Snap.getRGB(color)

-
-
-
-
- - - - -

Parses color string as RGB object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. color - string - color string in one of the following formats:
  2. - -
-
- - - - - - - - - - -
    - - - - - - - - - - - -
  • Color name (red, green, cornflowerblue, etc)
  • - - - - - - - - - - - -
  • #••• — shortened HTML color: (#000, #fc0, etc.)
  • - - - - - - - - - - - -
  • #•••••• — full length HTML color: (#000000, #bd2300)
  • - - - - - - - - - - - -
  • rgb(•••, •••, •••) — red, green and blue channels values: (rgb(200, 100, 0))
  • - - - - - - - - - - - -
  • rgba(•••, •••, •••, •••) — also with opacity
  • - - - - - - - - - - - -
  • rgb(•••%, •••%, •••%) — same as above, but in %: (rgb(100%, 175%, 0%))
  • - - - - - - - - - - - -
  • rgba(•••%, •••%, •••%, •••%) — also with opacity
  • - - - - - - - - - - - -
  • hsb(•••, •••, •••) — hue, saturation and brightness values: (hsb(0.5, 0.25, 1))
  • - - - - - - - - - - - -
  • hsba(•••, •••, •••, •••) — also with opacity
  • - - - - - - - - - - - -
  • hsb(•••%, •••%, •••%) — same as above, but in %
  • - - - - - - - - - - - -
  • hsba(•••%, •••%, •••%, •••%) — also with opacity
  • - - - - - - - - - - - -
  • hsl(•••, •••, •••) — hue, saturation and luminosity values: (hsb(0.5, 0.25, 0.5))
  • - - - - - - - - - - - -
  • hsla(•••, •••, •••, •••) — also with opacity
  • - - - - - - - - - - - -
  • hsl(•••%, •••%, •••%) — same as above, but in %
  • - - - - - - - - - - - -
  • hsla(•••%, •••%, •••%, •••%) — also with opacity
  • - - - - - - - - - - - -
- - - - - - - - - -

Note that % can be used any time: rgb(20%, 255, 50%). -

- - - - - - - - - - - - - - -

- Returns: - - object - - RGB object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - r - number - red, -
    2. - - - -
    3. - g - number - green, -
    4. - - - -
    5. - b - number - blue, -
    6. - - - -
    7. - hex - string - color in HTML/CSS format: #••••••, -
    8. - - - -
    9. - error - boolean - true if string can't be parsed -
    10. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.hsb(h, s, b)

-
-
-
-
- - - - -

Converts HSB values to a hex representation of the color -

- - - - - - - - - - -
-

Parameters

-
    -
  1. h - number - hue
  2. -
  3. s - number - saturation
  4. -
  5. b - number - value or brightness
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - string - - hex representation of the color -

- - - - -
-
-
- -
-
-

Snap.hsl(h, s, l)

-
-
-
-
- - - - -

Converts HSL values to a hex representation of the color -

- - - - - - - - - - -
-

Parameters

-
    -
  1. h - number - hue
  2. -
  3. s - number - saturation
  4. -
  5. l - number - luminosity
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - string - - hex representation of the color -

- - - - -
-
-
- -
-
-

Snap.rgb(r, g, b)

-
-
-
-
- - - - -

Converts RGB values to a hex representation of the color -

- - - - - - - - - - -
-

Parameters

-
    -
  1. r - number - red
  2. -
  3. g - number - green
  4. -
  5. b - number - blue
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - string - - hex representation of the color -

- - - - -
-
-
- -
-
-

Snap.color(clr)

-
-
-
-
- - - - -

Parses the color string and returns an object featuring the color's component values -

- - - - - - - - - - -
-

Parameters

-
    -
  1. clr - string - color string in one of the supported formats (see Snap.getRGB)
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - Combined RGB/HSB object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - r - number - red, -
    2. - - - -
    3. - g - number - green, -
    4. - - - -
    5. - b - number - blue, -
    6. - - - -
    7. - hex - string - color in HTML/CSS format: #••••••, -
    8. - - - -
    9. - error - boolean - true if string can't be parsed, -
    10. - - - -
    11. - h - number - hue, -
    12. - - - -
    13. - s - number - saturation, -
    14. - - - -
    15. - v - number - value (brightness), -
    16. - - - -
    17. - l - number - lightness -
    18. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.hsb2rgb(h, s, v)

-
-
-
-
- - - - -

Converts HSB values to an RGB object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. h - number - hue
  2. -
  3. s - number - saturation
  4. -
  5. v - number - value or brightness
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - RGB object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - r - number - red, -
    2. - - - -
    3. - g - number - green, -
    4. - - - -
    5. - b - number - blue, -
    6. - - - -
    7. - hex - string - color in HTML/CSS format: #•••••• -
    8. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.hsl2rgb(h, s, l)

-
-
-
-
- - - - -

Converts HSL values to an RGB object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. h - number - hue
  2. -
  3. s - number - saturation
  4. -
  5. l - number - luminosity
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - RGB object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - r - number - red, -
    2. - - - -
    3. - g - number - green, -
    4. - - - -
    5. - b - number - blue, -
    6. - - - -
    7. - hex - string - color in HTML/CSS format: #•••••• -
    8. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.rgb2hsb(r, g, b)

-
-
-
-
- - - - -

Converts RGB values to an HSB object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. r - number - red
  2. -
  3. g - number - green
  4. -
  5. b - number - blue
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - HSB object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - h - number - hue, -
    2. - - - -
    3. - s - number - saturation, -
    4. - - - -
    5. - b - number - brightness -
    6. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.rgb2hsl(r, g, b)

-
-
-
-
- - - - -

Converts RGB values to an HSL object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. r - number - red
  2. -
  3. g - number - green
  4. -
  5. b - number - blue
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - HSL object in the following format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - h - number - hue, -
    2. - - - -
    3. - s - number - saturation, -
    4. - - - -
    5. - l - number - luminosity -
    6. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.parsePathString(pathString)

-
-
-
-
- - - - -

Utility method -Parses given path string into an array of arrays of path segments -

- - - - - - - - - - -
-

Parameters

-
    -
  1. pathString - string array - path string or array of segments (in the last case it is returned straight away)
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - array - - array of segments -

- - - - -
-
-
- -
-
-

Snap.parseTransformString(TString)

-
-
-
-
- - - - -

Utility method -Parses given transform string into an array of transformations -

- - - - - - - - - - -
-

Parameters

-
    -
  1. TString - string array - transform string or array of transformations (in the last case it is returned straight away)
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - array - - array of transformations -

- - - - -
-
-
- -
-
-

Snap.select(query)

-
-
-
-
- - - - -

Wraps a DOM element specified by CSS selector as Element -

- - - - - - - - - - -
-

Parameters

-
    -
  1. query - string - CSS selector of the element
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - -
-
-
- -
-
-

Snap.selectAll(query)

-
-
-
-
- - - - -

Wraps DOM elements specified by CSS selector as set or array of Element -

- - - - - - - - - - -
-

Parameters

-
    -
  1. query - string - CSS selector of the element
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - -
-
-
- -
-
-

Element.node()

-
-
-
-
- - - - -

Gives you a reference to the DOM object, so you can assign event handlers or just mess around. -

- - - - - - - - - - - - -

Usage

- - - - - - - - - - - -
// draw a circle at coordinate 10,10 with radius of 10
+                            
+
+
+
+
+

Snap.rad(deg) + + +

+
+
+
+
+

Transform angle to radians +

+
+

Parameters

+
    +
  1. + deg + + number + + angle in degrees +
  2. +
+
+

+ Returns: + number + angle in radians +

+
+
+
+
+
+

Snap.deg(rad) + + +

+
+
+
+
+

Transform angle to degrees +

+
+

Parameters

+
    +
  1. + rad + + number + + angle in radians +
  2. +
+
+

+ Returns: + number + angle in degrees +

+
+
+
+
+
+

Snap.sin(angle) + + +

+
+
+
+
+

Equivalent to Math.sin() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + angle + + number + + angle in degrees +
  2. +
+
+

+ Returns: + number + sin +

+
+
+
+
+
+

Snap.tan(angle) + + +

+
+
+
+
+

Equivalent to Math.tan() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + angle + + number + + angle in degrees +
  2. +
+
+

+ Returns: + number + tan +

+
+
+
+
+
+

Snap.cos(angle) + + +

+
+
+
+
+

Equivalent to Math.cos() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + angle + + number + + angle in degrees +
  2. +
+
+

+ Returns: + number + cos +

+
+
+
+
+
+

Snap.asin(num) + + +

+
+
+
+
+

Equivalent to Math.asin() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + num + + number + + value +
  2. +
+
+

+ Returns: + number + asin in degrees +

+
+
+
+
+
+

Snap.acos(num) + + +

+
+
+
+
+

Equivalent to Math.acos() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + num + + number + + value +
  2. +
+
+

+ Returns: + number + acos in degrees +

+
+
+
+
+
+

Snap.atan(num) + + +

+
+
+
+
+

Equivalent to Math.atan() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + num + + number + + value +
  2. +
+
+

+ Returns: + number + atan in degrees +

+
+
+
+
+
+

Snap.atan2(num) + + +

+
+
+
+
+

Equivalent to Math.atan2() only works + with degrees, not radians. +

+
+

Parameters

+
    +
  1. + num + + number + + value +
  2. +
+
+

+ Returns: + number + atan2 in degrees +

+
+
+
+
+
+

Snap.angle(x1, y1, x2, y2, [x3], [y3]) + + +

+
+
+
+
+

Returns an angle between two or three points +

+

Parameters

+
+

Parameters

+
    +
  1. + x1 + + number + + x coord of first point +
  2. +
  3. + y1 + + number + + y coord of first point +
  4. +
  5. + x2 + + number + + x coord of second point +
  6. +
  7. + y2 + + number + + y coord of second point +
  8. +
  9. + x3 + + number + + x coord of third point +
  10. +
  11. + y3 + + number + + y coord of third point +
  12. +
+
+

+ Returns: + number + angle in degrees +

+
+
+
+
+
+

Snap.len(x1, y1, x2, y2) + + +

+
+
+
+
+

Returns distance between two points +

+

Parameters

+
+

Parameters

+
    +
  1. + x1 + + number + + x coord of first point +
  2. +
  3. + y1 + + number + + y coord of first point +
  4. +
  5. + x2 + + number + + x coord of second point +
  6. +
  7. + y2 + + number + + y coord of second point +
  8. +
+
+

+ Returns: + number + distance +

+
+
+
+
+
+

Snap.len2(x1, y1, x2, y2) + + +

+
+
+
+
+

Returns squared distance between two points +

+

Parameters

+
+

Parameters

+
    +
  1. + x1 + + number + + x coord of first point +
  2. +
  3. + y1 + + number + + y coord of first point +
  4. +
  5. + x2 + + number + + x coord of second point +
  6. +
  7. + y2 + + number + + y coord of second point +
  8. +
+
+

+ Returns: + number + distance +

+
+
+
+
+
+

Snap.closestPoint(path, x, y) + + +

+
+
+
+
+

Returns closest point to a given one on a given path. +

+

Parameters

+
+

Parameters

+
    +
  1. + path + + Element + + path element +
  2. +
  3. + x + + number + + x coord of a point +
  4. +
  5. + y + + number + + y coord of a point +
  6. +
+
+

+ Returns: + object + in format +

+
+
+
+
+
+

Snap.is(o, type) + + +

+
+
+
+
+

Handy replacement for the typeof operator +

+
+

Parameters

+
    +
  1. + o + + + + any object or primitive +
  2. +
  3. + type + + string + + name of the type, e.g., string, + function, number, + etc. +
  4. +
+
+

+ Returns: + boolean + true if given value is of given + type +

+
+
+
+
+
+

Snap.snapTo(values, value, [tolerance]) + + +

+
+
+
+
+

Snaps given value to given grid +

+
+

Parameters

+
    +
  1. + values + + array + number + + given array of values or step of the + grid +
  2. +
  3. + value + + number + + value to adjust +
  4. +
  5. + tolerance + + number + + maximum distance to the target value + that would trigger the snap. Default + is 10. +
  6. +
+
+

+ Returns: + number + adjusted value +

+
+
+
+
+
+

Snap.getRGB(color) + + +

+
+
+
+
+

Parses color string as RGB object +

+
+

Parameters

+
    +
  1. + color + + string + + color string in one of the following + formats: +
  2. +
+
+
    +
  • Color name (red, green, + cornflowerblue, etc)
  • +
  • #••• — shortened HTML color: (#000, + #fc0, etc.)
  • +
  • #•••••• — full length HTML color: (#000000, + #bd2300)
  • +
  • rgb(•••, •••, •••) — red, green and blue channels + values: (rgb(200, 100, 0))
  • +
  • rgba(•••, •••, •••, •••) — also with opacity
  • +
  • rgb(•••%, •••%, •••%) — same as above, but in + %: (rgb(100%, 175%, 0%))
  • +
  • rgba(•••%, •••%, •••%, •••%) — also with opacity
  • +
  • hsb(•••, •••, •••) — hue, saturation and brightness + values: (hsb(0.5, 0.25, 1))
  • +
  • hsba(•••, •••, •••, •••) — also with opacity
  • +
  • hsb(•••%, •••%, •••%) — same as above, but in + %
  • +
  • hsba(•••%, •••%, •••%, •••%) — also with opacity
  • +
  • hsl(•••, •••, •••) — hue, saturation and luminosity + values: (hsb(0.5, 0.25, 0.5))
  • +
  • hsla(•••, •••, •••, •••) — also with opacity
  • +
  • hsl(•••%, •••%, •••%) — same as above, but in + %
  • +
  • hsla(•••%, •••%, •••%, •••%) — also with opacity
  • +
+

Note that % can be used any time: rgb(20%, 255, 50%). +

+

+ Returns: + object + RGB object in the following format: +

+
    +
  1. { +
      +
    1. + r + + number + + red, +
    2. +
    3. + g + + number + + green, +
    4. +
    5. + b + + number + + blue, +
    6. +
    7. + hex + + string + + color in HTML/CSS format: #••••••, +
    8. +
    9. + error + + boolean + + true if string can't be parsed +
    10. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.hsb(h, s, b) + + +

+
+
+
+
+

Converts HSB values to a hex representation of the + color +

+
+

Parameters

+
    +
  1. + h + + number + + hue +
  2. +
  3. + s + + number + + saturation +
  4. +
  5. + b + + number + + value or brightness +
  6. +
+
+

+ Returns: + string + hex representation of the color +

+
+
+
+
+
+

Snap.hsl(h, s, l) + + +

+
+
+
+
+

Converts HSL values to a hex representation of the + color +

+
+

Parameters

+
    +
  1. + h + + number + + hue +
  2. +
  3. + s + + number + + saturation +
  4. +
  5. + l + + number + + luminosity +
  6. +
+
+

+ Returns: + string + hex representation of the color +

+
+
+
+
+
+

Snap.rgb(r, g, b) + + +

+
+
+
+
+

Converts RGB values to a hex representation of the + color +

+
+

Parameters

+
    +
  1. + r + + number + + red +
  2. +
  3. + g + + number + + green +
  4. +
  5. + b + + number + + blue +
  6. +
+
+

+ Returns: + string + hex representation of the color +

+
+
+
+
+
+

Snap.color(clr) + + +

+
+
+
+
+

Parses the color string and returns an object featuring + the color's component values +

+
+

Parameters

+
    +
  1. + clr + + string + + color string in one of the supported + formats (see + Snap.getRGB) +
  2. +
+
+

+ Returns: + object + Combined RGB/HSB object in the following format: +

+
    +
  1. { +
      +
    1. + r + + number + + red, +
    2. +
    3. + g + + number + + green, +
    4. +
    5. + b + + number + + blue, +
    6. +
    7. + hex + + string + + color in HTML/CSS format: #••••••, +
    8. +
    9. + error + + boolean + + true if string can't + be parsed, +
    10. +
    11. + h + + number + + hue, +
    12. +
    13. + s + + number + + saturation, +
    14. +
    15. + v + + number + + value (brightness), +
    16. +
    17. + l + + number + + lightness +
    18. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.hsb2rgb(h, s, v) + + +

+
+
+
+
+

Converts HSB values to an RGB object +

+
+

Parameters

+
    +
  1. + h + + number + + hue +
  2. +
  3. + s + + number + + saturation +
  4. +
  5. + v + + number + + value or brightness +
  6. +
+
+

+ Returns: + object + RGB object in the following format: +

+
    +
  1. { +
      +
    1. + r + + number + + red, +
    2. +
    3. + g + + number + + green, +
    4. +
    5. + b + + number + + blue, +
    6. +
    7. + hex + + string + + color in HTML/CSS format: #•••••• +
    8. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.hsl2rgb(h, s, l) + + +

+
+
+
+
+

Converts HSL values to an RGB object +

+
+

Parameters

+
    +
  1. + h + + number + + hue +
  2. +
  3. + s + + number + + saturation +
  4. +
  5. + l + + number + + luminosity +
  6. +
+
+

+ Returns: + object + RGB object in the following format: +

+
    +
  1. { +
      +
    1. + r + + number + + red, +
    2. +
    3. + g + + number + + green, +
    4. +
    5. + b + + number + + blue, +
    6. +
    7. + hex + + string + + color in HTML/CSS format: #•••••• +
    8. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.rgb2hsb(r, g, b) + + +

+
+
+
+
+

Converts RGB values to an HSB object +

+
+

Parameters

+
    +
  1. + r + + number + + red +
  2. +
  3. + g + + number + + green +
  4. +
  5. + b + + number + + blue +
  6. +
+
+

+ Returns: + object + HSB object in the following format: +

+
    +
  1. { +
      +
    1. + h + + number + + hue, +
    2. +
    3. + s + + number + + saturation, +
    4. +
    5. + b + + number + + brightness +
    6. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.rgb2hsl(r, g, b) + + +

+
+
+
+
+

Converts RGB values to an HSL object +

+
+

Parameters

+
    +
  1. + r + + number + + red +
  2. +
  3. + g + + number + + green +
  4. +
  5. + b + + number + + blue +
  6. +
+
+

+ Returns: + object + HSL object in the following format: +

+
    +
  1. { +
      +
    1. + h + + number + + hue, +
    2. +
    3. + s + + number + + saturation, +
    4. +
    5. + l + + number + + luminosity +
    6. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.parsePathString(pathString) + + +

+
+
+
+
+

Utility method Parses given path string into an array + of arrays of path segments +

+
+

Parameters

+
    +
  1. + pathString + + string + array + + path string or array of segments (in + the last case it is returned straight + away) +
  2. +
+
+

+ Returns: + array + array of segments +

+
+
+
+
+
+

Snap.parseTransformString(TString) + + +

+
+
+
+
+

Utility method Parses given transform string into + an array of transformations +

+
+

Parameters

+
    +
  1. + TString + + string + array + + transform string or array of transformations + (in the last case it is returned + straight away) +
  2. +
+
+

+ Returns: + array + array of transformations +

+
+
+
+
+
+

Snap.select(query) + + +

+
+
+
+
+

Wraps a DOM element specified by CSS selector as + Element +

+
+

Parameters

+
    +
  1. + query + + string + + CSS selector of the element +
  2. +
+
+

+ Returns: + Element + the current element +

+
+
+
+
+
+

Snap.selectAll(query) + + +

+
+
+
+
+

Wraps DOM elements specified by CSS selector as set + or array of + Element +

+
+

Parameters

+
    +
  1. + query + + string + + CSS selector of the element +
  2. +
+
+

+ Returns: + Element + the current element +

+
+
+
+
+
+

Element.node() + + +

+
+
+
+
+

Gives you a reference to the DOM object, so you can + assign event handlers or just mess around. +

+

Usage

+
// draw a circle at coordinate 10,10 with radius of 10
 var c = paper.circle(10, 10, 10);
 c.node.onclick = function () {
     c.attr("fill", "red");
 };
- - - - - -
-
-
- -
-
-

Element.type()

-
-
-
-
- - - - -

SVG tag name of the given element. -

- - - - - - - - -
-
-
- -
-
-

Element.attr(…)

-
-
-
-
- - - - -

Gets or sets given attributes of the element. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. params - object - contains key-value pairs of attributes you want to set
  2. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. param - string - name of the attribute
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - - -

or -

- - - - - - - - - - - - - - -

- Returns: - - string - - value of attribute -

- - - - - - - - -

Usage

- - - - - - - - - - - -
el.attr({
+                            
+
+
+
+
+

Element.type() + + +

+
+
+
+
+

SVG tag name of the given element. +

+
+
+
+
+
+

Element.attr(…) + + +

+
+
+
+
+

Gets or sets given attributes of the element. +

+
+

Parameters

+
    +
  1. + params + + object + + contains key-value pairs of attributes + you want to set +
  2. +
+
+

or +

+
+

Parameters

+
    +
  1. + param + + string + + name of the attribute +
  2. +
+
+

+ Returns: + Element + the current element +

+

or +

+

+ Returns: + string + value of attribute +

+

Usage

+
el.attr({
     fill: "#fc0",
     stroke: "#000",
     strokeWidth: 2, // CamelCase...
@@ -3774,224 +2819,130 @@ c.node.onclick = function () {
     width: "*=2" // prefixed values
 });
 console.log(el.attr("fill")); // #fc0
- - - - - - -

Prefixed values in format "+=10" supported. All four operations -(+, -, * and /) could be used. Optionally you can use units for + -and -: "+=2em". -

- - - - - - - - -
-
-
- -
-
-

Snap.parse(svg)

-
-
-
-
- - - - -

Parses SVG fragment and converts it into a Fragment -

- - - - - - - - - - -
-

Parameters

-
    -
  1. svg - string - SVG string
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Fragment - - the Fragment -

- - - - -
-
-
- -
-
-

Snap.fragment(varargs)

-
-
-
-
- - - - -

Creates a DOM fragment from a given list of elements or strings -

- - - - - - - - - - -
-

Parameters

-
    -
  1. varargs - - SVG string
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Fragment - - the Fragment -

- - - - -
-
-
- -
-
-

Paper.el(name, attr)

-
-
-
-
- - - - -

Creates an element on paper with a given name and no attributes -

- - - - - - - - - - -
-

Parameters

-
    -
  1. name - string - tag name
  2. -
  3. attr - object - attributes
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - - - - - -

Usage

- - - - - - - - - - - -
var c = paper.circle(10, 10, 10); // is the same as...
+                                

Prefixed values in format "+=10" supported. All four operations ( + +, -, * and /) could be used. Optionally + you can use units for + and -: + "+=2em". +

+
+
+
+
+
+

Snap.parse(svg) + + +

+
+
+
+
+

Parses SVG fragment and converts it into a + Fragment +

+
+

Parameters

+
    +
  1. + svg + + string + + SVG string +
  2. +
+
+

+ Returns: + Fragment + the + Fragment + +

+
+
+
+
+
+

Snap.fragment(varargs) + + +

+
+
+
+
+

Creates a DOM fragment from a given list of elements + or strings +

+
+

Parameters

+
    +
  1. + varargs + + + + SVG string +
  2. +
+
+

+ Returns: + Fragment + the + Fragment + +

+
+
+
+
+
+

Paper.el(name, attr) + + +

+
+
+
+
+

Creates an element on paper with a given name and + no attributes +

+
+

Parameters

+
    +
  1. + name + + string + + tag name +
  2. +
  3. + attr + + object + + attributes +
  4. +
+
+

+ Returns: + Element + the current element +

+

Usage

+
var c = paper.circle(10, 10, 10); // is the same as...
 var c = paper.el("circle").attr({
     cx: 10,
     cy: 10,
@@ -4003,1780 +2954,1112 @@ var c = paper.el("circle", {
     cy: 10,
     r: 10
 });
- - - - - -
-
-
- -
-
-

Element.children()

-
-
-
-
- - - - -

Returns array of all the children of the element. -

- - - - - - - - - - - - - - -

- Returns: - - array - - array of Elements -

- - - - -
-
-
- -
-
-

Element.toJSON()

-
-
-
-
- - - - -

Returns object representation of the given element and all its children. -

- - - - - - - - - - - - - - -

- Returns: - - object - - in format -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - type - string - this.type, -
    2. - - - -
    3. - attr - object - attributes map, -
    4. - - - -
    5. - childNodes - array - optional array of children in the same format -
    6. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.ajax(…)

-
-
-
-
- - - - -

Simple implementation of Ajax -

- - - - - - - - - - -
-

Parameters

-
    -
  1. url - string - URL
  2. -
  3. postData - object string - data for post request
  4. -
  5. callback - function - callback
  6. -
  7. scope - object - scope of callback
  8. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. url - string - URL
  2. -
  3. callback - function - callback
  4. -
  5. scope - object - scope of callback
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - XMLHttpRequest - - the XMLHttpRequest object, just in case -

- - - - -
-
-
- -
-
-

Snap.load(url, callback, [scope])

-
-
-
-
- - - - -

Loads external SVG file as a Fragment (see Snap.ajax for more advanced AJAX) -

- - - - - - - - - - -
-

Parameters

-
    -
  1. url - string - URL
  2. -
  3. callback - function - callback
  4. -
  5. scope - object - scope of callback
  6. - -
-
- - - - - - - -
-
-
- -
-
-

Snap.getElementByPoint(x, y)

-
-
-
-
- - - - -

Returns you topmost element under given point. -

- - - - - - - - - - - - - - -

- Returns: - - object - - Snap element object -

- - - - - - -
-

Parameters

-
    -
  1. x - number - x coordinate from the top left corner of the window
  2. -
  3. y - number - y coordinate from the top left corner of the window
  4. - -
-
- - - - - - - - - - - -

Usage

- - - - - - - - - - - -
Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
- - - - - -
-
-
- -
-
-

Snap.plugin(f)

-
-
-
-
- - - - -

Let you write plugins. You pass in a function with five arguments, like this: -

- - - - - - - - - - - - - -
Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+                            
+
+
+
+
+

Element.children() + + +

+
+
+
+
+

Returns array of all the children of the element. +

+

+ Returns: + array + array of Elements +

+
+
+
+
+
+

Element.toJSON() + + +

+
+
+
+
+

Returns object representation of the given element + and all its children. +

+

+ Returns: + object + in format +

+
    +
  1. { +
      +
    1. + type + + string + + this.type, +
    2. +
    3. + attr + + object + + attributes map, +
    4. +
    5. + childNodes + + array + + optional array of children in the + same format +
    6. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.ajax(…) + + +

+
+
+
+
+

Simple implementation of Ajax +

+
+

Parameters

+
    +
  1. + url + + string + + URL +
  2. +
  3. + postData + + object + string + + data for post request +
  4. +
  5. + callback + + function + + callback +
  6. +
  7. + scope + + object + + scope of callback +
  8. +
+
+

or +

+
+

Parameters

+
    +
  1. + url + + string + + URL +
  2. +
  3. + callback + + function + + callback +
  4. +
  5. + scope + + object + + scope of callback +
  6. +
+
+

+ Returns: + XMLHttpRequest + the XMLHttpRequest object, just in case +

+
+
+
+
+
+

Snap.load(url, callback, [scope]) + + +

+
+
+
+
+

Loads external SVG file as a + Fragment (see + Snap.ajax for more advanced AJAX) +

+
+

Parameters

+
    +
  1. + url + + string + + URL +
  2. +
  3. + callback + + function + + callback +
  4. +
  5. + scope + + object + + scope of callback +
  6. +
+
+
+
+
+
+
+

Snap.getElementByPoint(x, y) + + +

+
+
+
+
+

Returns you topmost element under given point. +

+

+ Returns: + object + Snap element object +

+
+

Parameters

+
    +
  1. + x + + number + + x coordinate from the top left corner + of the window +
  2. +
  3. + y + + number + + y coordinate from the top left corner + of the window +
  4. +
+
+

Usage

+
Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
+
+
+
+
+
+

Snap.plugin(f) + + +

+
+
+
+
+

Let you write plugins. You pass in a function with + five arguments, like this: +

+
Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
     Snap.newmethod = function () {};
     Element.prototype.newmethod = function () {};
     Paper.prototype.newmethod = function () {};
 });
- - - - - - -

Inside the function you have access to all main objects (and their -prototypes). This allow you to extend anything you want. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. f - function - your plugin body
  2. - -
-
- - - - - - - -
-
-
- -
-
-

Element.getBBox()

-
-
-
-
- - - - -

Returns the bounding box descriptor for the given element -

- - - - - - - - - - - - - - -

- Returns: - - object - - bounding box descriptor: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - cx: - number - x of the center, -
    2. - - - -
    3. - cy: - number - x of the center, -
    4. - - - -
    5. - h: - number - height, -
    6. - - - -
    7. - height: - number - height, -
    8. - - - -
    9. - path: - string - path command for the box, -
    10. - - - -
    11. - r0: - number - radius of a circle that fully encloses the box, -
    12. - - - -
    13. - r1: - number - radius of the smallest circle that can be enclosed, -
    14. - - - -
    15. - r2: - number - radius of the largest circle that can be enclosed, -
    16. - - - -
    17. - vb: - string - box as a viewbox command, -
    18. - - - -
    19. - w: - number - width, -
    20. - - - -
    21. - width: - number - width, -
    22. - - - -
    23. - x2: - number - x of the right side, -
    24. - - - -
    25. - x: - number - x of the left side, -
    26. - - - -
    27. - y2: - number - y of the bottom edge, -
    28. - - - -
    29. - y: - number - y of the top edge -
    30. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Element.transform(tstr)

-
-
-
-
- - - - -

Gets or sets transformation of the element -

- - - - - - - - - - -
-

Parameters

-
    -
  1. tstr - string - transform string in Snap or SVG format
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - - -

or -

- - - - - - - - - - - - - - -

- Returns: - - object - - transformation descriptor: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - string - string - transform string, -
    2. - - - -
    3. - globalMatrix - Matrix - matrix of all transformations applied to element or its parents, -
    4. - - - -
    5. - localMatrix - Matrix - matrix of transformations applied only to the element, -
    6. - - - -
    7. - diffMatrix - Matrix - matrix of difference between global and local transformations, -
    8. - - - -
    9. - global - string - global transformation as string, -
    10. - - - -
    11. - local - string - local transformation as string, -
    12. - - - -
    13. - toString - function - returns string property -
    14. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Element.parent()

-
-
-
-
- - - - -

Returns the element's parent -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.append(el)

-
-
-
-
- - - - -

Appends the given element to current one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element Set - element to append
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- - - -
-
-

Element.appendTo(el)

-
-
-
-
- - - - -

Appends the current element to the given one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - parent element to append to
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the child element -

- - - - -
-
-
- -
-
-

Element.prepend(el)

-
-
-
-
- - - - -

Prepends the given element to the current one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - element to prepend
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.prependTo(el)

-
-
-
-
- - - - -

Prepends the current element to the given one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - parent element to prepend to
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the child element -

- - - - -
-
-
- -
-
-

Element.before(el)

-
-
-
-
- - - - -

Inserts given element before the current one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - element to insert
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.after(el)

-
-
-
-
- - - - -

Inserts given element after the current one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - element to insert
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.insertBefore(el)

-
-
-
-
- - - - -

Inserts the element after the given one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - element next to whom insert to
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.insertAfter(el)

-
-
-
-
- - - - -

Inserts the element after the given one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. el - Element - element next to whom insert to
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the parent element -

- - - - -
-
-
- -
-
-

Element.remove()

-
-
-
-
- - - - -

Removes element from the DOM -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the detached element -

- - - - -
-
-
- -
-
-

Element.select(query)

-
-
-
-
- - - - -

Gathers the nested Element matching the given set of CSS selectors -

- - - - - - - - - - -
-

Parameters

-
    -
  1. query - string - CSS selector
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - result of query selection -

- - - - -
-
-
- -
-
-

Element.selectAll(query)

-
-
-
-
- - - - -

Gathers nested Element objects matching the given set of CSS selectors -

- - - - - - - - - - -
-

Parameters

-
    -
  1. query - string - CSS selector
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - Set - - array - - result of query selection -

- - - - -
-
-
- -
-
-

Element.asPX(attr, [value])

-
-
-
-
- - - - -

Returns given attribute of the element as a px value (not %, em, etc.) -

- - - - - - - - - - -
-

Parameters

-
    -
  1. attr - string - attribute name
  2. -
  3. value - string - attribute value
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - result of query selection -

- - - - -
-
-
- -
-
-

Element.use()

-
-
-
-
- - - - -

Creates a <use> element linked to the current element -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the <use> element -

- - - - -
-
-
- -
-
-

Element.clone()

-
-
-
-
- - - - -

Creates a clone of the element and inserts it after the element -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the clone -

- - - - -
-
-
- -
-
-

Element.toDefs()

-
-
-
-
- - - - -

Moves element to the shared <defs> area -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the element -

- - - - -
-
-
- -
-
-

Element.toPattern(x, y, width, height)

-
-
-
-
- - - - -

Creates a <pattern> element from the current element -To create a pattern you have to specify the pattern rect: -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - string number -
  2. -
  3. y - string number -
  4. -
  5. width - string number -
  6. -
  7. height - string number -
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the <pattern> element -

- - - - - -

You can use pattern later on as an argument for fill attribute: -

- - - - - - - - - - - - - -
var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+                                

Inside the function you have access to all main objects + (and their prototypes). This allow you to extend + anything you want. +

+
+

Parameters

+
    +
  1. + f + + function + + your plugin body +
  2. +
+
+
+
+
+
+
+

Element.getBBox() + + +

+
+
+
+
+

Returns the bounding box descriptor for the given + element +

+

+ Returns: + object + bounding box descriptor: +

+
    +
  1. { +
      +
    1. + cx: + + number + + x of the center, +
    2. +
    3. + cy: + + number + + x of the center, +
    4. +
    5. + h: + + number + + height, +
    6. +
    7. + height: + + number + + height, +
    8. +
    9. + path: + + string + + path command for the box, +
    10. +
    11. + r0: + + number + + radius of a circle that fully encloses + the box, +
    12. +
    13. + r1: + + number + + radius of the smallest circle that + can be enclosed, +
    14. +
    15. + r2: + + number + + radius of the largest circle that + can be enclosed, +
    16. +
    17. + vb: + + string + + box as a viewbox command, +
    18. +
    19. + w: + + number + + width, +
    20. +
    21. + width: + + number + + width, +
    22. +
    23. + x2: + + number + + x of the right side, +
    24. +
    25. + x: + + number + + x of the left side, +
    26. +
    27. + y2: + + number + + y of the bottom edge, +
    28. +
    29. + y: + + number + + y of the top edge +
    30. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Element.transform(tstr) + + +

+
+
+
+
+

Gets or sets transformation of the element +

+
+

Parameters

+
    +
  1. + tstr + + string + + transform string in Snap or SVG format +
  2. +
+
+

+ Returns: + Element + the current element +

+

or +

+

+ Returns: + object + transformation descriptor: +

+
    +
  1. { +
      +
    1. + string + + string + + transform string, +
    2. +
    3. + globalMatrix + + Matrix + + matrix of all transformations applied + to element or its parents, +
    4. +
    5. + localMatrix + + Matrix + + matrix of transformations applied + only to the element, +
    6. +
    7. + diffMatrix + + Matrix + + matrix of difference between global + and local transformations, +
    8. +
    9. + global + + string + + global transformation as string, +
    10. +
    11. + local + + string + + local transformation as string, +
    12. +
    13. + toString + + function + + returns string property +
    14. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Element.parent() + + +

+
+
+
+
+

Returns the element's parent +

+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.append(el) + + +

+
+
+
+
+

Appends the given element to current one +

+
+

Parameters

+
    +
  1. + el + + Element + Set + + element to append +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+ +
+
+

Element.appendTo(el) + + +

+
+
+
+
+

Appends the current element to the given one +

+
+

Parameters

+
    +
  1. + el + + Element + + parent element to append to +
  2. +
+
+

+ Returns: + Element + the child element +

+
+
+
+
+
+

Element.prepend(el) + + +

+
+
+
+
+

Prepends the given element to the current one +

+
+

Parameters

+
    +
  1. + el + + Element + + element to prepend +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.prependTo(el) + + +

+
+
+
+
+

Prepends the current element to the given one +

+
+

Parameters

+
    +
  1. + el + + Element + + parent element to prepend to +
  2. +
+
+

+ Returns: + Element + the child element +

+
+
+
+
+
+

Element.before(el) + + +

+
+
+
+
+

Inserts given element before the current one +

+
+

Parameters

+
    +
  1. + el + + Element + + element to insert +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.after(el) + + +

+
+
+
+
+

Inserts given element after the current one +

+
+

Parameters

+
    +
  1. + el + + Element + + element to insert +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.insertBefore(el) + + +

+
+
+
+
+

Inserts the element after the given one +

+
+

Parameters

+
    +
  1. + el + + Element + + element next to whom insert to +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.insertAfter(el) + + +

+
+
+
+
+

Inserts the element after the given one +

+
+

Parameters

+
    +
  1. + el + + Element + + element next to whom insert to +
  2. +
+
+

+ Returns: + Element + the parent element +

+
+
+
+
+
+

Element.remove() + + +

+
+
+
+
+

Removes element from the DOM +

+

+ Returns: + Element + the detached element +

+
+
+
+
+
+

Element.select(query) + + +

+
+
+
+
+

Gathers the nested + Element matching the given set of CSS selectors +

+
+

Parameters

+
    +
  1. + query + + string + + CSS selector +
  2. +
+
+

+ Returns: + Element + result of query selection +

+
+
+
+
+
+

Element.selectAll(query) + + +

+
+
+
+
+

Gathers nested + Element objects matching the given set of + CSS selectors +

+
+

Parameters

+
    +
  1. + query + + string + + CSS selector +
  2. +
+
+

+ Returns: + Set + array + result of query selection +

+
+
+
+
+
+

Element.asPX(attr, [value]) + + +

+
+
+
+
+

Returns given attribute of the element as a px value (not %, em, etc.) +

+
+

Parameters

+
    +
  1. + attr + + string + + attribute name +
  2. +
  3. + value + + string + + attribute value +
  4. +
+
+

+ Returns: + Element + result of query selection +

+
+
+
+
+
+

Element.use() + + +

+
+
+
+
+

Creates a <use> element linked + to the current element +

+

+ Returns: + Element + the <use> element +

+
+
+
+
+
+

Element.clone() + + +

+
+
+
+
+

Creates a clone of the element and inserts it after + the element +

+

+ Returns: + Element + the clone +

+
+
+
+
+
+

Element.toDefs() + + +

+
+
+
+
+

Moves element to the shared <defs> area +

+

+ Returns: + Element + the element +

+
+
+
+
+
+

Element.toPattern(x, y, width, height) + + +

+
+
+
+
+

Creates a <pattern> element from + the current element To create a pattern you have + to specify the pattern rect: +

+
+

Parameters

+
    +
  1. + x + + string + number + + +
  2. +
  3. + y + + string + number + + +
  4. +
  5. + width + + string + number + + +
  6. +
  7. + height + + string + number + + +
  8. +
+
+

+ Returns: + Element + the <pattern> element +

+

You can use pattern later on as an argument for fill attribute: +

+
var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
         fill: "none",
         stroke: "#bada55",
         strokeWidth: 5
@@ -5785,208 +4068,140 @@ To create a pattern you have to specify the pattern rect:
 c.attr({
     fill: p
 });
- - - - - -
-
-
- -
-
-

Element.marker(x, y, width, height, refX, refY)

-
-
-
-
- - - - -

Creates a <marker> element from the current element -To create a marker you have to specify the bounding rect and reference point: -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number -
  2. -
  3. y - number -
  4. -
  5. width - number -
  6. -
  7. height - number -
  8. -
  9. refX - number -
  10. -
  11. refY - number -
  12. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the <marker> element -

- - - - - -

You can specify the marker later as an argument for marker-start, marker-end, marker-mid, and marker attributes. The marker attribute places the marker at every point along the path, and marker-mid places them at every point except the start and end. -

- - - - - - - - -
-
-
- -
-
-

Element.data(key, [value])

-
-
-
-
- - - - -

Adds or retrieves given value associated with given key. (Don’t confuse -with data- attributes) -

See also Element.removeData -

- - - - - - - - - - -
-

Parameters

-
    -
  1. key - string - key to store data
  2. -
  3. value - any - value to store
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - Element -

- - - - - -

or, if value is not specified: -

- - - - - - - - - - - - - - -

- Returns: - - any - - value -

- - - - - - - - -

Usage

- - - - - - - - - - - -
for (var i = 0, i < 5, i++) {
+                            
+
+
+
+
+

Element.marker(x, y, width, height, refX, refY) + + +

+
+
+
+
+

Creates a <marker> element from + the current element To create a marker you have + to specify the bounding rect and reference point: +

+
+

Parameters

+
    +
  1. + x + + number + + +
  2. +
  3. + y + + number + + +
  4. +
  5. + width + + number + + +
  6. +
  7. + height + + number + + +
  8. +
  9. + refX + + number + + +
  10. +
  11. + refY + + number + + +
  12. +
+
+

+ Returns: + Element + the <marker> element +

+

You can specify the marker later as an argument for + marker-start, marker-end, + marker-mid, and marker attributes. The marker attribute + places the marker at every point along the path, + and marker-mid places them at every + point except the start and end. +

+
+
+
+
+
+

Element.data(key, [value]) + + +

+
+
+
+
+

Adds or retrieves given value associated with given + key. (Don’t confuse with data- attributes) +

+

See also + Element.removeData +

+
+

Parameters

+
    +
  1. + key + + string + + key to store data +
  2. +
  3. + value + + any + + value to store +
  4. +
+
+

+ Returns: + object + + Element + +

+

or, if value is not specified: +

+

+ Returns: + any + value +

+

Usage

+
for (var i = 0, i < 5, i++) {
     paper.circle(10 + 15 * i, 10, 10)
          .attr({fill: "#000"})
          .data("i", i)
@@ -5994,552 +4209,402 @@ with data- attributes)
             alert(this.data("i"));
          });
 }
- - - - - -
-
-
- -
-
-

Element.removeData([key])

-
-
-
-
- - - - -

Removes value associated with an element by given key. -If key is not provided, removes all the data of the element. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. key - string - key
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - Element -

- - - - -
-
-
- -
-
-

Element.outerSVG()

-
-
-
-
- - - - -

Returns SVG code for the element, equivalent to HTML's outerHTML. -

See also Element.innerSVG -

- - - - - - - - - - - - - - -

- Returns: - - string - - SVG code for the element -

- - - - -
-
-
- - - -
-
-

Element.innerSVG()

-
-
-
-
- - - - -

Returns SVG code for the element's contents, equivalent to HTML's innerHTML -

- - - - - - - - - - - - - - -

- Returns: - - string - - SVG code for the element -

- - - - -
-
-
- - - - - -
-
-

Snap.animation(attr, duration, [easing], [callback])

-
-
-
-
- - - - -

Creates an animation object -

- - - - - - - - - - -
-

Parameters

-
    -
  1. attr - object - attributes of final destination
  2. -
  3. duration - number - duration of the animation, in milliseconds
  4. -
  5. easing - function - one of easing functions of mina or custom one
  6. -
  7. callback - function - callback function that fires when animation ends
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - animation object -

- - - - -
-
-
- -
-
-

Element.inAnim()

-
-
-
-
- - - - -

Returns a set of animations that may be able to manipulate the current element -

- - - - - - - - - - - - - - -

- Returns: - - object - - in format: -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - anim - object - animation object, -
    2. - - - -
    3. - mina - object - mina object, -
    4. - - - -
    5. - curStatus - number - 0..1 — status of the animation: 0 — just started, 1 — just finished, -
    6. - - - -
    7. - status - function - gets or sets the status of the animation, -
    8. - - - -
    9. - stop - function - stops the animation -
    10. - - - -
  2. }
  3. - - -
- - -
-
-
- -
-
-

Snap.animate(from, to, setter, duration, [easing], [callback])

-
-
-
-
- - - - -

Runs generic animation of one number into another with a caring function -

- - - - - - - - - - -
-

Parameters

-
    -
  1. from - number array - number or array of numbers
  2. -
  3. to - number array - number or array of numbers
  4. -
  5. setter - function - caring function that accepts one number argument
  6. -
  7. duration - number - duration, in milliseconds
  8. -
  9. easing - function - easing function from mina or custom
  10. -
  11. callback - function - callback function to execute when animation ends
  12. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - animation object in mina format -

- - - - - - - - - - - -
    - - -
  1. {
      - - - -
    1. - id - string - animation id, consider it read-only, -
    2. - - - -
    3. - duration - function - gets or sets the duration of the animation, -
    4. - - - -
    5. - easing - function - easing, -
    6. - - - -
    7. - speed - function - gets or sets the speed of the animation, -
    8. - - - -
    9. - status - function - gets or sets the status of the animation, -
    10. - - - -
    11. - stop - function - stops the animation -
    12. - - - -
  2. }
  3. - - -
- - - - - - - -
var rect = Snap().rect(0, 0, 10, 10);
+                            
+
+
+
+
+

Element.removeData([key]) + + +

+
+
+
+
+

Removes value associated with an element by given + key. If key is not provided, removes all the + data of the element. +

+
+

Parameters

+
    +
  1. + key + + string + + key +
  2. +
+
+

+ Returns: + object + + Element + +

+
+
+
+
+
+

Element.outerSVG() + + +

+
+
+
+
+

Returns SVG code for the element, equivalent to HTML's + outerHTML. +

+

See also + Element.innerSVG +

+

+ Returns: + string + SVG code for the element +

+
+
+
+ +
+
+

Element.innerSVG() + + +

+
+
+
+
+

Returns SVG code for the element's contents, + equivalent to HTML's innerHTML +

+

+ Returns: + string + SVG code for the element +

+
+
+
+ + +
+
+

Snap.animation(attr, duration, [easing], [callback]) + + +

+
+
+
+
+

Creates an animation object +

+
+

Parameters

+
    +
  1. + attr + + object + + attributes of final destination +
  2. +
  3. + duration + + number + + duration of the animation, in milliseconds +
  4. +
  5. + easing + + function + + one of easing functions of + mina or custom one +
  6. +
  7. + callback + + function + + callback function that fires when animation + ends +
  8. +
+
+

+ Returns: + object + animation object +

+
+
+
+
+
+

Element.inAnim() + + +

+
+
+
+
+

Returns a set of animations that may be able to manipulate + the current element +

+

+ Returns: + object + in format: +

+
    +
  1. { +
      +
    1. + anim + + object + + animation object, +
    2. +
    3. + mina + + object + + + mina object, +
    4. +
    5. + curStatus + + number + + 0..1 — status of the animation: 0 + — just started, 1 — just finished, +
    6. +
    7. + status + + function + + gets or sets the status of the animation, +
    8. +
    9. + stop + + function + + stops the animation +
    10. +
    +
  2. +
  3. }
  4. +
+
+
+
+
+
+

Snap.animate(from, to, setter, duration, [easing], [callback]) + + +

+
+
+
+
+

Runs generic animation of one number into another + with a caring function +

+
+

Parameters

+
    +
  1. + from + + number + array + + number or array of numbers +
  2. +
  3. + to + + number + array + + number or array of numbers +
  4. +
  5. + setter + + function + + caring function that accepts one number + argument +
  6. +
  7. + duration + + number + + duration, in milliseconds +
  8. +
  9. + easing + + function + + easing function from + mina or custom +
  10. +
  11. + callback + + function + + callback function to execute when animation + ends +
  12. +
+
+

+ Returns: + object + animation object in + mina format +

+
    +
  1. { +
      +
    1. + id + + string + + animation id, consider it read-only, +
    2. +
    3. + duration + + function + + gets or sets the duration of the + animation, +
    4. +
    5. + easing + + function + + easing, +
    6. +
    7. + speed + + function + + gets or sets the speed of the animation, +
    8. +
    9. + status + + function + + gets or sets the status of the animation, +
    10. +
    11. + stop + + function + + stops the animation +
    12. +
    +
  2. +
  3. }
  4. +
+
var rect = Snap().rect(0, 0, 10, 10);
 Snap.animate(0, 10, function (val) {
     rect.attr({
         x: val
@@ -6547,8907 +4612,5819 @@ Snap.animate(0, 10, function (val) {
 }, 1000);
 // in given context is equivalent to
 rect.animate({x: 10}, 1000);
- - - - - -
-
-
- -
-
-

Element.stop()

-
-
-
-
- - - - -

Stops all the animations for the current element -

- - - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - -
-
-
- -
-
-

Element.animate(attrs, duration, [easing], [callback])

-
-
-
-
- - - - -

Animates the given attributes of the element -

- - - - - - - - - - -
-

Parameters

-
    -
  1. attrs - object - key-value pairs of destination attributes
  2. -
  3. duration - number - duration of the animation in milliseconds
  4. -
  5. easing - function - easing function from mina or custom
  6. -
  7. callback - function - callback function that executes when the animation ends
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - Element - - the current element -

- - - - -
-
-
- -
-
-

Matrix.add(…)

-
-
-
-
- - - - -

Adds the given matrix to existing one -

- - - - - - - - - - -
-

Parameters

-
    -
  1. a - number -
  2. -
  3. b - number -
  4. -
  5. c - number -
  6. -
  7. d - number -
  8. -
  9. e - number -
  10. -
  11. f - number -
  12. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. matrix - object - Matrix
  2. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.multLeft(…)

-
-
-
-
- - - - -

Multiplies a passed affine transform to the left: M * this. -

- - - - - - - - - - -
-

Parameters

-
    -
  1. a - number -
  2. -
  3. b - number -
  4. -
  5. c - number -
  6. -
  7. d - number -
  8. -
  9. e - number -
  10. -
  11. f - number -
  12. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. matrix - object - Matrix
  2. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.invert()

-
-
-
-
- - - - -

Returns an inverted version of the matrix -

- - - - - - - - - - - - - - -

- Returns: - - object - - Matrix -

- - - - -
-
-
- -
-
-

Matrix.clone()

-
-
-
-
- - - - -

Returns a copy of the matrix -

- - - - - - - - - - - - - - -

- Returns: - - object - - Matrix -

- - - - -
-
-
- -
-
-

Matrix.translate(x, y)

-
-
-
-
- - - - -

Translate the matrix -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - horizontal offset distance
  2. -
  3. y - number - vertical offset distance
  4. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.scale(x, [y], [cx], [cy])

-
-
-
-
- - - - -

Scales the matrix -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - amount to be scaled, with 1 resulting in no change
  2. -
  3. y - number - amount to scale along the vertical axis. (Otherwise x applies to both axes.)
  4. -
  5. cx - number - horizontal origin point from which to scale
  6. -
  7. cy - number - vertical origin point from which to scale
  8. - -
-
- - - - - - - - -

Default cx, cy is the middle point of the element. -

- - - - - - - - -
-
-
- -
-
-

Matrix.rotate(a, x, y)

-
-
-
-
- - - - -

Rotates the matrix -

- - - - - - - - - - -
-

Parameters

-
    -
  1. a - number - angle of rotation, in degrees
  2. -
  3. x - number - horizontal origin point from which to rotate
  4. -
  5. y - number - vertical origin point from which to rotate
  6. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.skewX(x)

-
-
-
-
- - - - -

Skews the matrix along the x-axis -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - Angle to skew along the x-axis (in degrees).
  2. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.skewY(y)

-
-
-
-
- - - - -

Skews the matrix along the y-axis -

- - - - - - - - - - -
-

Parameters

-
    -
  1. y - number - Angle to skew along the y-axis (in degrees).
  2. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.skew(y, x)

-
-
-
-
- - - - -

Skews the matrix -

- - - - - - - - - - -
-

Parameters

-
    -
  1. y - number - Angle to skew along the y-axis (in degrees).
  2. -
  3. x - number - Angle to skew along the x-axis (in degrees).
  4. - -
-
- - - - - - - -
-
-
- -
-
-

Matrix.x(x, y)

-
-
-
-
- - - - -

Returns x coordinate for given point after transformation described by the matrix. See also Matrix.y -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number -
  2. -
  3. y - number -
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - x -

- - - - -
-
-
- -
-
-

Matrix.y(x, y)

-
-
-
-
- - - - -

Returns y coordinate for given point after transformation described by the matrix. See also Matrix.x -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number -
  2. -
  3. y - number -
  4. - -
-
- - - - - - - - - - - - - -

- Returns: - - number - - y -

- - - - -
-
-
- -
-
-

Matrix.determinant()

-
-
-
-
- - - - -

Finds determinant of the given matrix. -

- - - - - - - - - - - - - - -

- Returns: - - number - - determinant -

- - - - -
-
-
- -
-
-

Matrix.split()

-
-
-
-
- - - - -

Splits matrix into primitive transformations -

- - - - - - - - - - - - - - -

- Returns: - - object - - in format: -

- - - - - - - - - - - -
    - - -
  1. - dx - number - translation by x -
  2. - - - -
  3. - dy - number - translation by y -
  4. - - - -
  5. - scalex - number - scale by x -
  6. - - - -
  7. - scaley - number - scale by y -
  8. - - - -
  9. - shear - number - shear -
  10. - - - -
  11. - rotate - number - rotation in deg -
  12. - - - -
  13. - isSimple - boolean - could it be represented via simple transformations -
  14. - - -
- - -
-
-
- -
-
-

Matrix.toTransformString()

-
-
-
-
- - - - -

Returns transform string that represents given matrix -

- - - - - - - - - - - - - - -

- Returns: - - string - - transform string -

- - - - -
-
-
- -
-
-

Snap.Matrix()

-
-
-
-
- - - - -

Matrix constructor, extend on your own risk. -To create matrices use Snap.matrix. -

- - - - - - - - -
-
-
- -
-
-

Snap.matrix(…)

-
-
-
-
- - - - -

Utility method -Returns a matrix based on the given parameters -

- - - - - - - - - - -
-

Parameters

-
    -
  1. a - number -
  2. -
  3. b - number -
  4. -
  5. c - number -
  6. -
  7. d - number -
  8. -
  9. e - number -
  10. -
  11. f - number -
  12. - -
-
- - - - - - - - -

or -

- - - - - - - - - - -
-

Parameters

-
    -
  1. svgMatrix - SVGMatrix -
  2. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - Matrix -

- - - - -
-
-
- -
-
-

Paper.rect(x, y, width, height, [rx], [ry])

-
-
-
-
- - - - -

Draws a rectangle -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - x coordinate of the top left corner
  2. -
  3. y - number - y coordinate of the top left corner
  4. -
  5. width - number - width
  6. -
  7. height - number - height
  8. -
  9. rx - number - horizontal radius for rounded corners, default is 0
  10. -
  11. ry - number - vertical radius for rounded corners, default is rx or 0
  12. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - the rect element -

- - - - - - - - -

Usage

- - - - - - - - - - - -
// regular rectangle
+                            
+
+
+
+
+

Element.stop() + + +

+
+
+
+
+

Stops all the animations for the current element +

+

+ Returns: + Element + the current element +

+
+
+
+
+
+

Element.animate(attrs, duration, [easing], [callback]) + + +

+
+
+
+
+

Animates the given attributes of the element +

+
+

Parameters

+
    +
  1. + attrs + + object + + key-value pairs of destination attributes +
  2. +
  3. + duration + + number + + duration of the animation in milliseconds +
  4. +
  5. + easing + + function + + easing function from + mina or custom +
  6. +
  7. + callback + + function + + callback function that executes when + the animation ends +
  8. +
+
+

+ Returns: + Element + the current element +

+
+
+
+
+
+

Matrix.add(…) + + +

+
+
+
+
+

Adds the given matrix to existing one +

+
+

Parameters

+
    +
  1. + a + + number + + +
  2. +
  3. + b + + number + + +
  4. +
  5. + c + + number + + +
  6. +
  7. + d + + number + + +
  8. +
  9. + e + + number + + +
  10. +
  11. + f + + number + + +
  12. +
+
+

or +

+
+

Parameters

+
    +
  1. + matrix + + object + + + Matrix + +
  2. +
+
+
+
+
+
+
+

Matrix.multLeft(…) + + +

+
+
+
+
+

Multiplies a passed affine transform to the left: + M * this. +

+
+

Parameters

+
    +
  1. + a + + number + + +
  2. +
  3. + b + + number + + +
  4. +
  5. + c + + number + + +
  6. +
  7. + d + + number + + +
  8. +
  9. + e + + number + + +
  10. +
  11. + f + + number + + +
  12. +
+
+

or +

+
+

Parameters

+
    +
  1. + matrix + + object + + + Matrix + +
  2. +
+
+
+
+
+
+
+

Matrix.invert() + + +

+
+
+
+
+

Returns an inverted version of the matrix +

+

+ Returns: + object + + Matrix + +

+
+
+
+
+
+

Matrix.clone() + + +

+
+
+
+
+

Returns a copy of the matrix +

+

+ Returns: + object + + Matrix + +

+
+
+
+
+
+

Matrix.translate(x, y) + + +

+
+
+
+
+

Translate the matrix +

+
+

Parameters

+
    +
  1. + x + + number + + horizontal offset distance +
  2. +
  3. + y + + number + + vertical offset distance +
  4. +
+
+
+
+
+
+
+

Matrix.scale(x, [y], [cx], [cy]) + + +

+
+
+
+
+

Scales the matrix +

+
+

Parameters

+
    +
  1. + x + + number + + amount to be scaled, with 1 resulting in no change +
  2. +
  3. + y + + number + + amount to scale along the vertical axis. + (Otherwise x applies + to both axes.) +
  4. +
  5. + cx + + number + + horizontal origin point from which to + scale +
  6. +
  7. + cy + + number + + vertical origin point from which to scale +
  8. +
+
+

Default cx, cy is the middle point of the element. +

+
+
+
+
+
+

Matrix.rotate(a, x, y) + + +

+
+
+
+
+

Rotates the matrix +

+
+

Parameters

+
    +
  1. + a + + number + + angle of rotation, in degrees +
  2. +
  3. + x + + number + + horizontal origin point from which to + rotate +
  4. +
  5. + y + + number + + vertical origin point from which to rotate +
  6. +
+
+
+
+
+
+
+

Matrix.skewX(x) + + +

+
+
+
+
+

Skews the matrix along the x-axis +

+
+

Parameters

+
    +
  1. + x + + number + + Angle to skew along the x-axis (in degrees). +
  2. +
+
+
+
+
+
+
+

Matrix.skewY(y) + + +

+
+
+
+
+

Skews the matrix along the y-axis +

+
+

Parameters

+
    +
  1. + y + + number + + Angle to skew along the y-axis (in degrees). +
  2. +
+
+
+
+
+
+
+

Matrix.skew(y, x) + + +

+
+
+
+
+

Skews the matrix +

+
+

Parameters

+
    +
  1. + y + + number + + Angle to skew along the y-axis (in degrees). +
  2. +
  3. + x + + number + + Angle to skew along the x-axis (in degrees). +
  4. +
+
+
+
+
+
+
+

Matrix.x(x, y) + + +

+
+
+
+
+

Returns x coordinate for given point after transformation + described by the matrix. See also + Matrix.y +

+
+

Parameters

+
    +
  1. + x + + number + + +
  2. +
  3. + y + + number + + +
  4. +
+
+

+ Returns: + number + x +

+
+
+
+
+
+

Matrix.y(x, y) + + +

+
+
+
+
+

Returns y coordinate for given point after transformation + described by the matrix. See also + Matrix.x +

+
+

Parameters

+
    +
  1. + x + + number + + +
  2. +
  3. + y + + number + + +
  4. +
+
+

+ Returns: + number + y +

+
+
+
+
+
+

Matrix.determinant() + + +

+
+
+
+
+

Finds determinant of the given matrix. +

+

+ Returns: + number + determinant +

+
+
+
+
+
+

Matrix.split() + + +

+
+
+
+
+

Splits matrix into primitive transformations +

+

+ Returns: + object + in format: +

+
    +
  1. + dx + + number + + translation by x +
  2. +
  3. + dy + + number + + translation by y +
  4. +
  5. + scalex + + number + + scale by x +
  6. +
  7. + scaley + + number + + scale by y +
  8. +
  9. + shear + + number + + shear +
  10. +
  11. + rotate + + number + + rotation in deg +
  12. +
  13. + isSimple + + boolean + + could it be represented via simple transformations +
  14. +
+
+
+
+
+
+

Matrix.toTransformString() + + +

+
+
+
+
+

Returns transform string that represents given matrix +

+

+ Returns: + string + transform string +

+
+
+
+
+
+

Snap.Matrix() + + +

+
+
+
+
+

Matrix constructor, extend on your own risk. To create + matrices use + Snap.matrix. +

+
+
+
+
+
+

Snap.matrix(…) + + +

+
+
+
+
+

Utility method Returns a matrix based on the given + parameters +

+
+

Parameters

+
    +
  1. + a + + number + + +
  2. +
  3. + b + + number + + +
  4. +
  5. + c + + number + + +
  6. +
  7. + d + + number + + +
  8. +
  9. + e + + number + + +
  10. +
  11. + f + + number + + +
  12. +
+
+

or +

+
+

Parameters

+
    +
  1. + svgMatrix + + SVGMatrix + + +
  2. +
+
+

+ Returns: + object + + Matrix + +

+
+
+
+
+
+

Paper.rect(x, y, width, height, [rx], [ry]) + + +

+
+
+
+
+

+

Draws a rectangle +

+
+

Parameters

+
    +
  1. + x + + number + + x coordinate of the top left corner +
  2. +
  3. + y + + number + + y coordinate of the top left corner +
  4. +
  5. + width + + number + + width +
  6. +
  7. + height + + number + + height +
  8. +
  9. + rx + + number + + horizontal radius for rounded corners, + default is 0 +
  10. +
  11. + ry + + number + + vertical radius for rounded corners, + default is rx or 0 +
  12. +
+
+

+ Returns: + object + the rect element +

+

Usage

+
// regular rectangle
 var c = paper.rect(10, 10, 50, 50);
 // rectangle with rounded corners
 var c = paper.rect(40, 40, 50, 50, 10);
- - - - - -
-
-
- -
-
-

Paper.circle(x, y, r)

-
-
-
-
- - - - -

Draws a circle -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - x coordinate of the centre
  2. -
  3. y - number - y coordinate of the centre
  4. -
  5. r - number - radius
  6. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - the circle element -

- - - - - - - - -

Usage

- - - - - - - - - - - -
var c = paper.circle(50, 50, 40);
- - - - - -
-
-
- -
-
-

Paper.image(src, x, y, width, height)

-
-
-
-
- - - - -

Places an image on the surface -

- - - - - - - - - - -
-

Parameters

-
    -
  1. src - string - URI of the source image
  2. -
  3. x - number - x offset position
  4. -
  5. y - number - y offset position
  6. -
  7. width - number - width of the image
  8. -
  9. height - number - height of the image
  10. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - the image element -

- - - - - -

or -

- - - - - - - - - - - - - - -

- Returns: - - object - - Snap element object with type image -

- - - - - - - - -

Usage

- - - - - - - - - - - -
var c = paper.image("apple.png", 10, 10, 80, 80);
- - - - - -
-
-
- -
-
-

Paper.ellipse(x, y, rx, ry)

-
-
-
-
- - - - -

Draws an ellipse -

- - - - - - - - - - -
-

Parameters

-
    -
  1. x - number - x coordinate of the centre
  2. -
  3. y - number - y coordinate of the centre
  4. -
  5. rx - number - horizontal radius
  6. -
  7. ry - number - vertical radius
  8. - -
-
- - - - - - - - - - - - - -

- Returns: - - object - - the ellipse element -

- - - - - - - - -

Usage

- - - - - - - - - - - -
var c = paper.ellipse(50, 50, 40, 20);
- - - - - -
-
-
- -
-
-

Paper.path([pathString])

-
-
-
-
- - - - -

Creates a <path> element using the given string as the path's definition -

- - - - - - - - - - -
-

Parameters

-
    -
  1. pathString - string - path string in SVG format
  2. - -
-
- - - - - - - - -

Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example: -

- - - - - - - - - - - - - -
"M10,20L30,40"
- - - - - - -

This example features two commands: M, with arguments (10, 20) and L with arguments (30, 40). Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates. -

- - - - - - - - - - - -

Here is short list of commands available, for more details see SVG path string format or article about path strings at MDN.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandNameParameters
Mmoveto(x y)+
Zclosepath(none)
Llineto(x y)+
Hhorizontal linetox+
Vvertical linetoy+
Ccurveto(x1 y1 x2 y2 x y)+
Ssmooth curveto(x2 y2 x y)+
Qquadratic Bézier curveto(x1 y1 x y)+
Tsmooth quadratic Bézier curveto(x y)+
Aelliptical arc(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
RCatmull-Rom curveto*x1 y1 (x y)+
- - - - - - - - - -

  • Catmull-Rom curveto is a not standard SVG command and added to make life easier.
  • -Note: there is a special case when a path consists of only three commands: M10,10R…z. In this case the path connects back to its starting point. -

    - - - - - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var c = paper.path("M10 10L90 90");
    +                            
    +
    +
    +
    +
    +

    Paper.circle(x, y, r) + + +

    +
    +
    +
    +
    +

    Draws a circle +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + x coordinate of the centre +
    2. +
    3. + y + + number + + y coordinate of the centre +
    4. +
    5. + r + + number + + radius +
    6. +
    +
    +

    + Returns: + object + the circle element +

    +

    Usage

    +
    var c = paper.circle(50, 50, 40);
    +
    +
    +
    +
    +
    +

    Paper.image(src, x, y, width, height) + + +

    +
    +
    +
    +
    +

    Places an image on the surface +

    +
    +

    Parameters

    +
      +
    1. + src + + string + + URI of the source image +
    2. +
    3. + x + + number + + x offset position +
    4. +
    5. + y + + number + + y offset position +
    6. +
    7. + width + + number + + width of the image +
    8. +
    9. + height + + number + + height of the image +
    10. +
    +
    +

    + Returns: + object + the image element +

    +

    or +

    +

    + Returns: + object + Snap element object with type image +

    +

    Usage

    +
    var c = paper.image("apple.png", 10, 10, 80, 80);
    +
    +
    +
    +
    +
    +

    Paper.ellipse(x, y, rx, ry) + + +

    +
    +
    +
    +
    +

    Draws an ellipse +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + x coordinate of the centre +
    2. +
    3. + y + + number + + y coordinate of the centre +
    4. +
    5. + rx + + number + + horizontal radius +
    6. +
    7. + ry + + number + + vertical radius +
    8. +
    +
    +

    + Returns: + object + the ellipse element +

    +

    Usage

    +
    var c = paper.ellipse(50, 50, 40, 20);
    +
    +
    +
    +
    +
    +

    Paper.path([pathString]) + + +

    +
    +
    +
    +
    +

    Creates a <path> element using + the given string as the path's definition +

    +
    +

    Parameters

    +
      +
    1. + pathString + + string + + path string in SVG format +
    2. +
    +
    +

    Path string consists of one-letter commands, followed + by comma seprarated arguments in numerical form. + Example: +

    +
    "M10,20L30,40"
    +

    This example features two commands: M, + with arguments (10, 20) and L with arguments (30, 40). Uppercase + letter commands express coordinates in absolute + terms, while lowercase commands express them + in relative terms from the most recently declared + coordinates. +

    +

    +

    Here is short list of commands available, for more + details see + SVG path string format or + article about path strings at MDN.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CommandNameParameters
    Mmoveto(x y)+
    Zclosepath(none)
    Llineto(x y)+
    Hhorizontal linetox+
    Vvertical linetoy+
    Ccurveto(x1 y1 x2 y2 x y)+
    Ssmooth curveto(x2 y2 x y)+
    Qquadratic Bézier curveto(x1 y1 x y)+
    Tsmooth quadratic Bézier curveto(x y)+
    Aelliptical arc(rx ry x-axis-rotation large-arc-flag + sweep-flag x y)+
    R + Catmull-Rom curveto*x1 y1 (x y)+
    +

    +

  • + Catmull-Rom curveto is a not standard + SVG command and added to make life easier.
  • + Note: there is a special case when a path consists of only three commands: M10,10R…z. + In this case the path connects back to its starting + point. +

    +

    Usage

    +
    var c = paper.path("M10 10L90 90");
     // draw a diagonal line:
     // move to 10,10, line to 90,90
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.g([varargs])

    -
    -
    -
    -
    - - - - -

    Creates a group element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. varargs - - elements to nest within the group
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the g element -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var c1 = paper.circle(),
    +                            
    +
    +
    +
    +
    +

    Paper.g([varargs]) + + +

    +
    +
    +
    +
    +

    Creates a group element +

    +
    +

    Parameters

    +
      +
    1. + varargs + + + + elements to nest within the group +
    2. +
    +
    +

    + Returns: + object + the g element +

    +

    Usage

    +
    var c1 = paper.circle(),
         c2 = paper.rect(),
         g = paper.g(c2, c1); // note that the order of elements is different
    - - - - - - -

    or -

    - - - - - - - - - - - - - -
    var c1 = paper.circle(),
    +                                

    or +

    +
    var c1 = paper.circle(),
         c2 = paper.rect(),
         g = paper.g();
     g.add(c2, c1);
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.group()

    -
    -
    -
    -
    - - - - -

    See Paper.g -

    - - - - - - - - -
    -
    -
    - -
    -
    -

    Paper.svg(x, y, width, height, vbx, vby, vbw, vbh)

    -
    -
    -
    -
    - - - - -

    Creates a nested SVG element. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. x - number - optional X of the element
    2. -
    3. y - number - optional Y of the element
    4. -
    5. width - number - optional width of the element
    6. -
    7. height - number - optional height of the element
    8. -
    9. vbx - number - optional viewbox X
    10. -
    11. vby - number - optional viewbox Y
    12. -
    13. vbw - number - optional viewbox width
    14. -
    15. vbh - number - optional viewbox height
    16. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the svg element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.mask()

    -
    -
    -
    -
    - - - - -

    Equivalent in behaviour to Paper.g, except it’s a mask. -

    - - - - - - - - - - - - - - -

    - Returns: - - object - - the mask element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.ptrn(x, y, width, height, vbx, vby, vbw, vbh)

    -
    -
    -
    -
    - - - - -

    Equivalent in behaviour to Paper.g, except it’s a pattern. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. x - number - optional X of the element
    2. -
    3. y - number - optional Y of the element
    4. -
    5. width - number - optional width of the element
    6. -
    7. height - number - optional height of the element
    8. -
    9. vbx - number - optional viewbox X
    10. -
    11. vby - number - optional viewbox Y
    12. -
    13. vbw - number - optional viewbox width
    14. -
    15. vbh - number - optional viewbox height
    16. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the pattern element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.use(…)

    -
    -
    -
    -
    - - - - -

    Creates a <use> element. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. id - string - optional id of element to link
    2. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. id - Element - optional element to link
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the use element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.symbol(vbx, vby, vbw, vbh)

    -
    -
    -
    -
    - - - - -

    Creates a <symbol> element. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. vbx - number - optional viewbox X
    2. -
    3. vby - number - optional viewbox Y
    4. -
    5. vbw - number - optional viewbox width
    6. -
    7. vbh - number - optional viewbox height
    8. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the symbol element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.text(x, y, text)

    -
    -
    -
    -
    - - - - -

    Draws a text string -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. x - number - x coordinate position
    2. -
    3. y - number - y coordinate position
    4. -
    5. text - string array - The text string to draw or array of strings to nest within separate <tspan> elements
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the text element -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var t1 = paper.text(50, 50, "Snap");
    +                            
    +
    +
    +
    +
    +

    Paper.group() + + +

    +
    +
    +
    +
    +

    See + Paper.g +

    +
    +
    +
    +
    +
    +

    Paper.svg(x, y, width, height, vbx, vby, vbw, vbh) + + +

    +
    +
    +
    +
    +

    Creates a nested SVG element. +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + + optional X of the element +
    2. +
    3. + y + + number + + + optional Y of the element +
    4. +
    5. + width + + number + + + optional width of the element +
    6. +
    7. + height + + number + + + optional height of the element +
    8. +
    9. + vbx + + number + + + optional viewbox X +
    10. +
    11. + vby + + number + + + optional viewbox Y +
    12. +
    13. + vbw + + number + + + optional viewbox width +
    14. +
    15. + vbh + + number + + + optional viewbox height +
    16. +
    +
    +

    + Returns: + object + the svg element +

    +
    +
    +
    +
    +
    +

    Paper.mask() + + +

    +
    +
    +
    +
    +

    Equivalent in behaviour to + Paper.g, except it’s a mask. +

    +

    + Returns: + object + the mask element +

    +
    +
    +
    +
    +
    +

    Paper.ptrn(x, y, width, height, vbx, vby, vbw, vbh) + + +

    +
    +
    +
    +
    +

    Equivalent in behaviour to + Paper.g, except it’s a pattern. +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + + optional X of the element +
    2. +
    3. + y + + number + + + optional Y of the element +
    4. +
    5. + width + + number + + + optional width of the element +
    6. +
    7. + height + + number + + + optional height of the element +
    8. +
    9. + vbx + + number + + + optional viewbox X +
    10. +
    11. + vby + + number + + + optional viewbox Y +
    12. +
    13. + vbw + + number + + + optional viewbox width +
    14. +
    15. + vbh + + number + + + optional viewbox height +
    16. +
    +
    +

    + Returns: + object + the pattern element +

    +
    +
    +
    +
    +
    +

    Paper.use(…) + + +

    +
    +
    +
    +
    +

    Creates a <use> element. +

    +
    +

    Parameters

    +
      +
    1. + id + + string + + + optional id of element to link +
    2. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + id + + Element + + + optional element to link +
    2. +
    +
    +

    + Returns: + object + the use element +

    +
    +
    +
    +
    +
    +

    Paper.symbol(vbx, vby, vbw, vbh) + + +

    +
    +
    +
    +
    +

    Creates a <symbol> element. +

    +
    +

    Parameters

    +
      +
    1. + vbx + + number + + + optional viewbox X +
    2. +
    3. + vby + + number + + + optional viewbox Y +
    4. +
    5. + vbw + + number + + + optional viewbox width +
    6. +
    7. + vbh + + number + + + optional viewbox height +
    8. +
    +
    +

    + Returns: + object + the symbol element +

    +
    +
    +
    +
    +
    +

    Paper.text(x, y, text) + + +

    +
    +
    +
    +
    +

    Draws a text string +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + x coordinate position +
    2. +
    3. + y + + number + + y coordinate position +
    4. +
    5. + text + + string + array + + The text string to draw or array of strings + to nest within separate <tspan> elements +
    6. +
    +
    +

    + Returns: + object + the text element +

    +

    Usage

    +
    var t1 = paper.text(50, 50, "Snap");
     var t2 = paper.text(50, 50, ["S","n","a","p"]);
     // Text path usage
     t1.attr({textpath: "M10,10L100,100"});
     // or
     var pth = paper.path("M10,10L100,100");
     t1.attr({textpath: pth});
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.line(x1, y1, x2, y2)

    -
    -
    -
    -
    - - - - -

    Draws a line -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. x1 - number - x coordinate position of the start
    2. -
    3. y1 - number - y coordinate position of the start
    4. -
    5. x2 - number - x coordinate position of the end
    6. -
    7. y2 - number - y coordinate position of the end
    8. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the line element -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var t1 = paper.line(50, 50, 100, 100);
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.polyline(…)

    -
    -
    -
    -
    - - - - -

    Draws a polyline -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. points - array - array of points
    2. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. varargs - - points
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - the polyline element -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var p1 = paper.polyline([10, 10, 100, 100]);
    +                            
    +
    +
    +
    +
    +

    Paper.line(x1, y1, x2, y2) + + +

    +
    +
    +
    +
    +

    Draws a line +

    +
    +

    Parameters

    +
      +
    1. + x1 + + number + + x coordinate position of the start +
    2. +
    3. + y1 + + number + + y coordinate position of the start +
    4. +
    5. + x2 + + number + + x coordinate position of the end +
    6. +
    7. + y2 + + number + + y coordinate position of the end +
    8. +
    +
    +

    + Returns: + object + the line element +

    +

    Usage

    +
    var t1 = paper.line(50, 50, 100, 100);
    +
    +
    +
    +
    +
    +

    Paper.polyline(…) + + +

    +
    +
    +
    +
    +

    Draws a polyline +

    +
    +

    Parameters

    +
      +
    1. + points + + array + + array of points +
    2. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + varargs + + + + points +
    2. +
    +
    +

    + Returns: + object + the polyline element +

    +

    Usage

    +
    var p1 = paper.polyline([10, 10, 100, 100]);
     var p2 = paper.polyline(10, 10, 100, 100);
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.polygon()

    -
    -
    -
    -
    - - - - -

    Draws a polygon. See Paper.polyline -

    - - - - - - - - -
    -
    -
    - -
    -
    -

    Element.stops()()

    -
    -
    -
    -
    - - - - -

    Only for gradients! -Returns array of gradient stops elements. -

    - - - - - - - - - - - - - - -

    - Returns: - - array - - the stops array. -

    - - - - -
    -
    -
    - -
    -
    -

    Element.addStop()(color, offset)

    -
    -
    -
    -
    - - - - -

    Only for gradients! -Adds another stop to the gradient. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. color - string - stops color
    2. -
    3. offset - number - stops offset 0..100
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - gradient element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.setStops()(str)

    -
    -
    -
    -
    - - - - -

    Only for gradients! -Updates stops of the gradient based on passed gradient descriptor. See Ppaer.gradient -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. str - string - gradient descriptor part after ().
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - gradient element -

    - - - - - - - - - -
    var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
    +                            
    +
    +
    + +
    +
    +

    Element.stops()() + + +

    +
    +
    +
    +
    +

    Only for gradients! Returns array of gradient stops + elements. +

    +

    + Returns: + array + the stops array. +

    +
    +
    +
    +
    +
    +

    Element.addStop()(color, offset) + + +

    +
    +
    +
    +
    +

    Only for gradients! Adds another stop to the gradient. +

    +
    +

    Parameters

    +
      +
    1. + color + + string + + stops color +
    2. +
    3. + offset + + number + + stops offset 0..100 +
    4. +
    +
    +

    + Returns: + object + gradient element +

    +
    +
    +
    +
    +
    +

    Element.setStops()(str) + + +

    +
    +
    +
    +
    +

    Only for gradients! Updates stops of the gradient + based on passed gradient descriptor. See + Ppaer.gradient +

    +
    +

    Parameters

    +
      +
    1. + str + + string + + gradient descriptor part after (). +
    2. +
    +
    +

    + Returns: + object + gradient element +

    +
    var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
     g.setStops("#fff-#000-#f00-#fc0");
    - - - - - -
    -
    -
    - -
    -
    -

    Paper.gradient(gradient)

    -
    -
    -
    -
    - - - - -

    Creates a gradient element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. gradient - string - gradient descriptor
    2. - -
    -
    - - - - - - - - - - - -

    Gradient Descriptor

    - - - - - - - -

    The gradient descriptor is an expression formatted as -follows: <type>(<coords>)<colors>. The <type> can be -either linear or radial. The uppercase L or R letters -indicate absolute coordinates offset from the SVG surface. -Lowercase l or r letters indicate coordinates -calculated relative to the element to which the gradient is -applied. Coordinates specify a linear gradient vector as -x1, y1, x2, y2, or a radial gradient as cx, cy, -r and optional fx, fy specifying a focal point away -from the center of the circle. Specify <colors> as a list -of dash-separated CSS color values. Each color may be -followed by a custom offset value, separated with a colon -character. -

    - - - - - - - - - - - - -

    Examples

    - - - - - - - -

    Linear gradient, relative from top-left corner to bottom-right -corner, from black through red to white: -

    - - - - - - - - - - - - - -
    var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
    - - - - - - -

    Linear gradient, absolute from (0, 0) to (100, 100), from black -through red at 25% to white: -

    - - - - - - - - - - - - - -
    var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
    - - - - - - -

    Radial gradient, relative from the center of the element with radius -half the width, from black to white: -

    - - - - - - - - - - - - - -
    var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
    - - - - - - -

    To apply the gradient: -

    - - - - - - - - - - - - - -
    paper.circle(50, 50, 40).attr({
    +                            
    +
    +
    +
    +
    +

    Paper.gradient(gradient) + + +

    +
    +
    +
    +
    +

    Creates a gradient element +

    +
    +

    Parameters

    +
      +
    1. + gradient + + string + + gradient descriptor +
    2. +
    +
    +

    Gradient Descriptor

    +

    The gradient descriptor is an expression formatted + as follows: <type>(<coords>)<colors>. + The <type> can be either linear + or radial. The uppercase L or R letters indicate absolute coordinates offset + from the SVG surface. Lowercase l or r letters indicate coordinates + calculated relative to the element to which the + gradient is applied. Coordinates specify a linear + gradient vector as + x1, y1, x2, + y2, or a radial gradient as cx, + cy, + r and optional fx, + fy specifying a focal point away + from the center of the circle. Specify <colors> as a list of dash-separated CSS color values. + Each color may be followed by a custom offset + value, separated with a colon character. +

    +

    Examples

    +

    Linear gradient, relative from top-left corner to + bottom-right corner, from black through red to + white: +

    +
    var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
    +

    Linear gradient, absolute from (0, 0) to (100, 100), + from black through red at 25% to white: +

    +
    var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
    +

    Radial gradient, relative from the center of the + element with radius half the width, from black + to white: +

    +
    var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
    +

    To apply the gradient: +

    +
    paper.circle(50, 50, 40).attr({
         fill: g
     });
    - - - - - - - - - - - -

    - Returns: - - object - - the gradient element -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.toString()

    -
    -
    -
    -
    - - - - -

    Returns SVG code for the Paper -

    - - - - - - - - - - - - - - -

    - Returns: - - string - - SVG code for the Paper -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.toDataURL()

    -
    -
    -
    -
    - - - - -

    Returns SVG code for the Paper as Data URI string. -

    - - - - - - - - - - - - - - -

    - Returns: - - string - - Data URI string -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.clear()

    -
    -
    -
    -
    - - - - -

    Removes all child nodes of the paper, except <defs>. -

    - - - - - - - - -
    -
    -
    - -
    -
    -

    Element.addClass(value)

    -
    -
    -
    -
    - - - - -

    Adds given class name or list of class names to the element. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. value - string - class name or space separated list of class names
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - Element - - original element. -

    - - - - -
    -
    -
    - -
    -
    -

    Element.removeClass(value)

    -
    -
    -
    -
    - - - - -

    Removes given class name or list of class names from the element. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. value - string - class name or space separated list of class names
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - Element - - original element. -

    - - - - -
    -
    -
    - -
    -
    -

    Element.hasClass(value)

    -
    -
    -
    -
    - - - - -

    Checks if the element has a given class name in the list of class names applied to it. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. value - string - class name
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - boolean - - true if the element has given class -

    - - - - -
    -
    -
    - -
    -
    -

    Element.toggleClass(value, flag)

    -
    -
    -
    -
    - - - - -

    Add or remove one or more classes from the element, depending on either -the class’s presence or the value of the flag argument. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. value - string - class name or space separated list of class names
    2. -
    3. flag - boolean - value to determine whether the class should be added or removed
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - Element - - original element. -

    - - - - -
    -
    -
    - -
    -
    -

    mina(a, A, b, B, get, set, [easing])

    -
    -
    -
    -
    - - - - -

    Generic animation of numbers -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. a - number - start slave number
    2. -
    3. A - number - end slave number
    4. -
    5. b - number - start master number (start time in general case)
    6. -
    7. B - number - end master number (end time in general case)
    8. -
    9. get - function - getter of master number (see mina.time)
    10. -
    11. set - function - setter of slave number
    12. -
    13. easing - function - easing function, default is mina.linear
    14. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - animation descriptor -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - id - string - animation id, -
      2. - - - -
      3. - start - number - start slave number, -
      4. - - - -
      5. - end - number - end slave number, -
      6. - - - -
      7. - b - number - start master number, -
      8. - - - -
      9. - s - number - animation status (0..1), -
      10. - - - -
      11. - dur - number - animation duration, -
      12. - - - -
      13. - spd - number - animation speed, -
      14. - - - -
      15. - get - function - getter of master number (see mina.time), -
      16. - - - -
      17. - set - function - setter of slave number, -
      18. - - - -
      19. - easing - function - easing function, default is mina.linear, -
      20. - - - -
      21. - status - function - status getter/setter, -
      22. - - - -
      23. - speed - function - speed getter/setter, -
      24. - - - -
      25. - duration - function - duration getter/setter, -
      26. - - - -
      27. - stop - function - animation stopper -
      28. - - - -
      29. - pause - function - pauses the animation -
      30. - - - -
      31. - resume - function - resumes the animation -
      32. - - - -
      33. - update - function - calles setter with the right value of the animation -
      34. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    mina.time()

    -
    -
    -
    -
    - - - - -

    Returns the current time. Equivalent to: -

    - - - - - - - - - - - - - -
    function () {
    +                                

    + Returns: + object + the gradient element +

    +
    +
    +
    +
    +
    +

    Paper.toString() + + +

    +
    +
    +
    +
    +

    Returns SVG code for the + Paper +

    +

    + Returns: + string + SVG code for the + Paper + +

    +
    +
    +
    +
    +
    +

    Paper.toDataURL() + + +

    +
    +
    +
    +
    +

    Returns SVG code for the + Paper as Data URI string. +

    +

    + Returns: + string + Data URI string +

    +
    +
    +
    +
    +
    +

    Paper.clear() + + +

    +
    +
    +
    +
    +

    Removes all child nodes of the paper, except <defs>. +

    +
    +
    +
    +
    +
    +

    Element.addClass(value) + + +

    +
    +
    +
    +
    +

    Adds given class name or list of class names to the + element. +

    +
    +

    Parameters

    +
      +
    1. + value + + string + + class name or space separated list of + class names +
    2. +
    +
    +

    + Returns: + Element + original element. +

    +
    +
    +
    +
    +
    +

    Element.removeClass(value) + + +

    +
    +
    +
    +
    +

    Removes given class name or list of class names from + the element. +

    +
    +

    Parameters

    +
      +
    1. + value + + string + + class name or space separated list of + class names +
    2. +
    +
    +

    + Returns: + Element + original element. +

    +
    +
    +
    +
    +
    +

    Element.hasClass(value) + + +

    +
    +
    +
    +
    +

    Checks if the element has a given class name in the + list of class names applied to it. +

    +
    +

    Parameters

    +
      +
    1. + value + + string + + class name +
    2. +
    +
    +

    + Returns: + boolean + true if the element has given class +

    +
    +
    +
    +
    +
    +

    Element.toggleClass(value, flag) + + +

    +
    +
    +
    +
    +

    Add or remove one or more classes from the element, + depending on either the class’s presence or the + value of the flag argument. +

    +
    +

    Parameters

    +
      +
    1. + value + + string + + class name or space separated list of + class names +
    2. +
    3. + flag + + boolean + + value to determine whether the class + should be added or removed +
    4. +
    +
    +

    + Returns: + Element + original element. +

    +
    +
    +
    +
    +
    +

    mina(a, A, b, B, get, set, [easing]) + + +

    +
    +
    +
    +
    +

    Generic animation of numbers +

    +
    +

    Parameters

    +
      +
    1. + a + + number + + start + slave number +
    2. +
    3. + A + + number + + end + slave number +
    4. +
    5. + b + + number + + start + master number (start time in + general case) +
    6. +
    7. + B + + number + + end + master number (end time in general + case) +
    8. +
    9. + get + + function + + getter of + master number (see + mina.time) +
    10. +
    11. + set + + function + + setter of + slave number +
    12. +
    13. + easing + + function + + easing function, default is + mina.linear + +
    14. +
    +
    +

    + Returns: + object + animation descriptor +

    +
      +
    1. { +
        +
      1. + id + + string + + animation id, +
      2. +
      3. + start + + number + + start + slave number, +
      4. +
      5. + end + + number + + end + slave number, +
      6. +
      7. + b + + number + + start + master number, +
      8. +
      9. + s + + number + + animation status (0..1), +
      10. +
      11. + dur + + number + + animation duration, +
      12. +
      13. + spd + + number + + animation speed, +
      14. +
      15. + get + + function + + getter of + master number (see + mina.time), +
      16. +
      17. + set + + function + + setter of + slave number, +
      18. +
      19. + easing + + function + + easing function, default is + mina.linear, +
      20. +
      21. + status + + function + + status getter/setter, +
      22. +
      23. + speed + + function + + speed getter/setter, +
      24. +
      25. + duration + + function + + duration getter/setter, +
      26. +
      27. + stop + + function + + animation stopper +
      28. +
      29. + pause + + function + + pauses the animation +
      30. +
      31. + resume + + function + + resumes the animation +
      32. +
      33. + update + + function + + calles setter with the right value + of the animation +
      34. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    mina.time() + + +

    +
    +
    +
    +
    +

    Returns the current time. Equivalent to: +

    +
    function () {
         return (new Date).getTime();
     }
    - - - - - -
    -
    -
    - -
    -
    -

    mina.getById(id)

    -
    -
    -
    -
    - - - - -

    Returns an animation by its id -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. id - string - animation's id
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - See mina -

    - - - - -
    -
    -
    - -
    -
    -

    mina.linear(n)

    -
    -
    -
    -
    - - - - -

    Default linear easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.easeout(n)

    -
    -
    -
    -
    - - - - -

    Easeout easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.easein(n)

    -
    -
    -
    -
    - - - - -

    Easein easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.easeinout(n)

    -
    -
    -
    -
    - - - - -

    Easeinout easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.backin(n)

    -
    -
    -
    -
    - - - - -

    Backin easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.backout(n)

    -
    -
    -
    -
    - - - - -

    Backout easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.elastic(n)

    -
    -
    -
    -
    - - - - -

    Elastic easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    mina.bounce(n)

    -
    -
    -
    -
    - - - - -

    Bounce easing -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. n - number - input 0..1
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - output 0..1 -

    - - - - -
    -
    -
    - -
    -
    -

    Paper.filter(filstr)

    -
    -
    -
    -
    - - - - -

    Creates a <filter> element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. filstr - string - SVG fragment of filter provided as a string
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - - -

    Note: It is recommended to use filters embedded into the page inside an empty SVG element. -

    - - - - - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var f = paper.filter(''),
    +                            
    +
    +
    +
    +
    +

    mina.getById(id) + + +

    +
    +
    +
    +
    +

    Returns an animation by its id +

    +
    +

    Parameters

    +
      +
    1. + id + + string + + animation's id +
    2. +
    +
    +

    + Returns: + object + See + mina + +

    +
    +
    +
    +
    +
    +

    mina.linear(n) + + +

    +
    +
    +
    +
    +

    Default linear easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.easeout(n) + + +

    +
    +
    +
    +
    +

    Easeout easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.easein(n) + + +

    +
    +
    +
    +
    +

    Easein easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.easeinout(n) + + +

    +
    +
    +
    +
    +

    Easeinout easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.backin(n) + + +

    +
    +
    +
    +
    +

    Backin easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.backout(n) + + +

    +
    +
    +
    +
    +

    Backout easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.elastic(n) + + +

    +
    +
    +
    +
    +

    Elastic easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    mina.bounce(n) + + +

    +
    +
    +
    +
    +

    Bounce easing +

    +
    +

    Parameters

    +
      +
    1. + n + + number + + input 0..1 +
    2. +
    +
    +

    + Returns: + number + output 0..1 +

    +
    +
    +
    +
    +
    +

    Paper.filter(filstr) + + +

    +
    +
    +
    +
    +

    Creates a <filter> element +

    +
    +

    Parameters

    +
      +
    1. + filstr + + string + + SVG fragment of filter provided as a + string +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +

    Note: It is recommended to use filters embedded into + the page inside an empty SVG element. +

    +

    Usage

    +
    var f = paper.filter(''),
         c = paper.circle(10, 10, 10).attr({
             filter: f
         });
    - - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.blur(x, [y])

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the blur filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. x - number - amount of horizontal blur, in pixels
    2. -
    3. y - number - amount of vertical blur, in pixels
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var f = paper.filter(Snap.filter.blur(5, 10)),
    +                            
    +
    +
    +
    +
    +

    Snap.filter.blur(x, [y]) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the blur filter +

    +
    +

    Parameters

    +
      +
    1. + x + + number + + amount of horizontal blur, in pixels +
    2. +
    3. + y + + number + + amount of vertical blur, in pixels +
    4. +
    +
    +

    + Returns: + string + filter representation +

    +

    Usage

    +
    var f = paper.filter(Snap.filter.blur(5, 10)),
         c = paper.circle(10, 10, 10).attr({
             filter: f
         });
    - - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.shadow(…)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the shadow filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. dx - number - horizontal shift of the shadow, in pixels
    2. -
    3. dy - number - vertical shift of the shadow, in pixels
    4. -
    5. blur - number - amount of blur
    6. -
    7. color - string - color of the shadow
    8. -
    9. opacity - number - 0..1 opacity of the shadow
    10. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. dx - number - horizontal shift of the shadow, in pixels
    2. -
    3. dy - number - vertical shift of the shadow, in pixels
    4. -
    5. color - string - color of the shadow
    6. -
    7. opacity - number - 0..1 opacity of the shadow
    8. - -
    -
    - - - - - - - - -

    which makes blur default to 4. Or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. dx - number - horizontal shift of the shadow, in pixels
    2. -
    3. dy - number - vertical shift of the shadow, in pixels
    4. -
    5. opacity - number - 0..1 opacity of the shadow
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
    +                            
    +
    +
    +
    +
    +

    Snap.filter.shadow(…) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the shadow filter +

    +
    +

    Parameters

    +
      +
    1. + dx + + number + + horizontal shift of the shadow, in pixels +
    2. +
    3. + dy + + number + + vertical shift of the shadow, in pixels +
    4. +
    5. + blur + + number + + amount of blur +
    6. +
    7. + color + + string + + color of the shadow +
    8. +
    9. + opacity + + number + + 0..1 opacity of the shadow +
    10. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + dx + + number + + horizontal shift of the shadow, in pixels +
    2. +
    3. + dy + + number + + vertical shift of the shadow, in pixels +
    4. +
    5. + color + + string + + color of the shadow +
    6. +
    7. + opacity + + number + + 0..1 opacity of the shadow +
    8. +
    +
    +

    which makes blur default to 4. Or +

    +
    +

    Parameters

    +
      +
    1. + dx + + number + + horizontal shift of the shadow, in pixels +
    2. +
    3. + dy + + number + + vertical shift of the shadow, in pixels +
    4. +
    5. + opacity + + number + + 0..1 opacity of the shadow +
    6. +
    +
    +

    + Returns: + string + filter representation +

    +

    Usage

    +
    var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
         c = paper.circle(10, 10, 10).attr({
             filter: f
         });
    - - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.grayscale(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the grayscale filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.sepia(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the sepia filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.saturate(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the saturate filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.hueRotate(angle)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the hue-rotate filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. angle - number - angle of rotation
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.invert(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the invert filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.brightness(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the brightness filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.filter.contrast(amount)

    -
    -
    -
    -
    - - - - -

    Returns an SVG markup string for the contrast filter -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. amount - number - amount of filter (0..1)
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - filter representation -

    - - - - -
    -
    -
    - -
    -
    -

    Element.click(handler)

    -
    -
    -
    -
    - - - - -

    Adds a click event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unclick(handler)

    -
    -
    -
    -
    - - - - -

    Removes a click event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.dblclick(handler)

    -
    -
    -
    -
    - - - - -

    Adds a double click event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.undblclick(handler)

    -
    -
    -
    -
    - - - - -

    Removes a double click event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.mousedown(handler)

    -
    -
    -
    -
    - - - - -

    Adds a mousedown event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unmousedown(handler)

    -
    -
    -
    -
    - - - - -

    Removes a mousedown event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.mousemove(handler)

    -
    -
    -
    -
    - - - - -

    Adds a mousemove event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unmousemove(handler)

    -
    -
    -
    -
    - - - - -

    Removes a mousemove event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.mouseout(handler)

    -
    -
    -
    -
    - - - - -

    Adds a mouseout event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unmouseout(handler)

    -
    -
    -
    -
    - - - - -

    Removes a mouseout event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.mouseover(handler)

    -
    -
    -
    -
    - - - - -

    Adds a mouseover event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unmouseover(handler)

    -
    -
    -
    -
    - - - - -

    Removes a mouseover event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.mouseup(handler)

    -
    -
    -
    -
    - - - - -

    Adds a mouseup event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unmouseup(handler)

    -
    -
    -
    -
    - - - - -

    Removes a mouseup event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.touchstart(handler)

    -
    -
    -
    -
    - - - - -

    Adds a touchstart event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.untouchstart(handler)

    -
    -
    -
    -
    - - - - -

    Removes a touchstart event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.touchmove(handler)

    -
    -
    -
    -
    - - - - -

    Adds a touchmove event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.untouchmove(handler)

    -
    -
    -
    -
    - - - - -

    Removes a touchmove event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.touchend(handler)

    -
    -
    -
    -
    - - - - -

    Adds a touchend event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.untouchend(handler)

    -
    -
    -
    -
    - - - - -

    Removes a touchend event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.touchcancel(handler)

    -
    -
    -
    -
    - - - - -

    Adds a touchcancel event handler to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.untouchcancel(handler)

    -
    -
    -
    -
    - - - - -

    Removes a touchcancel event handler from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. handler - function - handler for the event
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.hover(f_in, f_out, [icontext], [ocontext])

    -
    -
    -
    -
    - - - - -

    Adds hover event handlers to the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. f_in - function - handler for hover in
    2. -
    3. f_out - function - handler for hover out
    4. -
    5. icontext - object - context for hover in handler
    6. -
    7. ocontext - object - context for hover out handler
    8. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.unhover(f_in, f_out)

    -
    -
    -
    -
    - - - - -

    Removes hover event handlers from the element -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. f_in - function - handler for hover in
    2. -
    3. f_out - function - handler for hover out
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])

    -
    -
    -
    -
    - - - - -

    Adds event handlers for an element's drag gesture -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. onmove - function - handler for moving
    2. -
    3. onstart - function - handler for drag start
    4. -
    5. onend - function - handler for drag end
    6. -
    7. mcontext - object - context for moving handler
    8. -
    9. scontext - object - context for drag start handler
    10. -
    11. econtext - object - context for drag end handler
    12. - -
    -
    - - - - - - - - -

    Additionaly following drag events are triggered: drag.start.<id> on start, -drag.end.<id> on end and drag.move.<id> on every move. When element is dragged over another element -drag.over.<id> fires as well. -

    Start event and start handler are called in specified context or in context of the element with following parameters: -

    - - - - - - - - - - - - - - - -
      - - -
    1. - x - number - x position of the mouse -
    2. - - - -
    3. - y - number - y position of the mouse -
    4. - - - -
    5. - event - object - DOM event object -
    6. - - -
    - - - -

    Move event and move handler are called in specified context or in context of the element with following parameters: -

    - - - - - - - - - - - - - - - -
      - - -
    1. - dx - number - shift by x from the start point -
    2. - - - -
    3. - dy - number - shift by y from the start point -
    4. - - - -
    5. - x - number - x position of the mouse -
    6. - - - -
    7. - y - number - y position of the mouse -
    8. - - - -
    9. - event - object - DOM event object -
    10. - - -
    - - - -

    End event and end handler are called in specified context or in context of the element with following parameters: -

    - - - - - - - - - - - - - - - -
      - - -
    1. - event - object - DOM event object -
    2. - - -
    - - - - - - - - -

    - Returns: - - object - - Element -

    - - - - -
    -
    -
    - -
    -
    -

    Element.undrag()

    -
    -
    -
    -
    - - - - -

    Removes all drag event handlers from the given element -

    - - - - - - - - -
    -
    -
    - -
    -
    -

    Snap.path.getTotalLength(path)

    -
    -
    -
    -
    - - - - -

    Returns the length of the given path in pixels -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - SVG path string
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - number - - length -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.getPointAtLength(path, length)

    -
    -
    -
    -
    - - - - -

    Returns the coordinates of the point located at the given length along the given path -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - SVG path string
    2. -
    3. length - number - length, in pixels, from the start of the path, excluding non-rendering jumps
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - representation of the point: -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - x: - number - x coordinate, -
      2. - - - -
      3. - y: - number - y coordinate, -
      4. - - - -
      5. - alpha: - number - angle of derivative -
      6. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    Snap.path.getSubpath(path, from, to)

    -
    -
    -
    -
    - - - - -

    Returns the subpath of a given path between given start and end lengths -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - SVG path string
    2. -
    3. from - number - length, in pixels, from the start of the path to the start of the segment
    4. -
    5. to - number - length, in pixels, from the start of the path to the end of the segment
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - path string definition for the segment -

    - - - - -
    -
    -
    - -
    -
    -

    Element.getTotalLength()

    -
    -
    -
    -
    - - - - -

    Returns the length of the path in pixels (only works for path elements) -

    - - - - - - - - - - - - - - -

    - Returns: - - number - - length -

    - - - - -
    -
    -
    - -
    -
    -

    Element.getPointAtLength(length)

    -
    -
    -
    -
    - - - - -

    Returns coordinates of the point located at the given length on the given path (only works for path elements) -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. length - number - length, in pixels, from the start of the path, excluding non-rendering jumps
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - representation of the point: -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - x: - number - x coordinate, -
      2. - - - -
      3. - y: - number - y coordinate, -
      4. - - - -
      5. - alpha: - number - angle of derivative -
      6. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    Element.getSubpath(from, to)

    -
    -
    -
    -
    - - - - -

    Returns subpath of a given element from given start and end lengths (only works for path elements) -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. from - number - length, in pixels, from the start of the path to the start of the segment
    2. -
    3. to - number - length, in pixels, from the start of the path to the end of the segment
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - path string definition for the segment -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)

    -
    -
    -
    -
    - - - - -

    Utility method -Finds dot coordinates on the given cubic beziér curve at the given t -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. p1x - number - x of the first point of the curve
    2. -
    3. p1y - number - y of the first point of the curve
    4. -
    5. c1x - number - x of the first anchor of the curve
    6. -
    7. c1y - number - y of the first anchor of the curve
    8. -
    9. c2x - number - x of the second anchor of the curve
    10. -
    11. c2y - number - y of the second anchor of the curve
    12. -
    13. p2x - number - x of the second point of the curve
    14. -
    15. p2y - number - y of the second point of the curve
    16. -
    17. t - number - position on the curve (0..1)
    18. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - point information in format: -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - x: - number - x coordinate of the point, -
      2. - - - -
      3. - y: - number - y coordinate of the point, -
      4. - - - -
      5. m: {
          - - - -
        1. - x: - number - x coordinate of the left anchor, -
        2. - - - -
        3. - y: - number - y coordinate of the left anchor -
        4. - - - -
      6. },
      7. - - - -
      8. n: {
          - - - -
        1. - x: - number - x coordinate of the right anchor, -
        2. - - - -
        3. - y: - number - y coordinate of the right anchor -
        4. - - - -
      9. },
      10. - - - -
      11. start: {
          - - - -
        1. - x: - number - x coordinate of the start of the curve, -
        2. - - - -
        3. - y: - number - y coordinate of the start of the curve -
        4. - - - -
      12. },
      13. - - - -
      14. end: {
          - - - -
        1. - x: - number - x coordinate of the end of the curve, -
        2. - - - -
        3. - y: - number - y coordinate of the end of the curve -
        4. - - - -
      15. },
      16. - - - -
      17. - alpha: - number - angle of the curve derivative at the point -
      18. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    Snap.path.bezierBBox(…)

    -
    -
    -
    -
    - - - - -

    Utility method -Returns the bounding box of a given cubic beziér curve -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. p1x - number - x of the first point of the curve
    2. -
    3. p1y - number - y of the first point of the curve
    4. -
    5. c1x - number - x of the first anchor of the curve
    6. -
    7. c1y - number - y of the first anchor of the curve
    8. -
    9. c2x - number - x of the second anchor of the curve
    10. -
    11. c2y - number - y of the second anchor of the curve
    12. -
    13. p2x - number - x of the second point of the curve
    14. -
    15. p2y - number - y of the second point of the curve
    16. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. bez - array - array of six points for beziér curve
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - bounding box -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - x: - number - x coordinate of the left top point of the box, -
      2. - - - -
      3. - y: - number - y coordinate of the left top point of the box, -
      4. - - - -
      5. - x2: - number - x coordinate of the right bottom point of the box, -
      6. - - - -
      7. - y2: - number - y coordinate of the right bottom point of the box, -
      8. - - - -
      9. - width: - number - width of the box, -
      10. - - - -
      11. - height: - number - height of the box -
      12. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    Snap.path.isPointInsideBBox(bbox, x, y)

    -
    -
    -
    -
    - - - - -

    Utility method -Returns true if given point is inside bounding box -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. bbox - string - bounding box
    2. -
    3. x - string - x coordinate of the point
    4. -
    5. y - string - y coordinate of the point
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - boolean - - true if point is inside -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.isBBoxIntersect(bbox1, bbox2)

    -
    -
    -
    -
    - - - - -

    Utility method -Returns true if two bounding boxes intersect -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. bbox1 - string - first bounding box
    2. -
    3. bbox2 - string - second bounding box
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - boolean - - true if bounding boxes intersect -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.intersection(path1, path2)

    -
    -
    -
    -
    - - - - -

    Utility method -Finds intersections of two paths -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path1 - string - path string
    2. -
    3. path2 - string - path string
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - array - - dots of intersection -

    - - - - - - - - - - - -
      - - -
    1. [
    2. - - - -
    3. {
        - - - -
      1. - x: - number - x coordinate of the point, -
      2. - - - -
      3. - y: - number - y coordinate of the point, -
      4. - - - -
      5. - t1: - number - t value for segment of path1, -
      6. - - - -
      7. - t2: - number - t value for segment of path2, -
      8. - - - -
      9. - segment1: - number - order number for segment of path1, -
      10. - - - -
      11. - segment2: - number - order number for segment of path2, -
      12. - - - -
      13. - bez1: - array - eight coordinates representing beziér curve for the segment of path1, -
      14. - - - -
      15. - bez2: - array - eight coordinates representing beziér curve for the segment of path2 -
      16. - - - -
    4. }
    5. - - - -
    6. ]
    7. - - -
    - - -
    -
    -
    - -
    -
    -

    Snap.path.isPointInside(path, x, y)

    -
    -
    -
    -
    - - - - -

    Utility method -Returns true if given point is inside a given closed path. -

    Note: fill mode doesn’t affect the result of this method. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - path string
    2. -
    3. x - number - x of the point
    4. -
    5. y - number - y of the point
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - boolean - - true if point is inside the path -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.getBBox(path)

    -
    -
    -
    -
    - - - - -

    Utility method -Returns the bounding box of a given path -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - path string
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - bounding box -

    - - - - - - - - - - - -
      - - -
    1. {
        - - - -
      1. - x: - number - x coordinate of the left top point of the box, -
      2. - - - -
      3. - y: - number - y coordinate of the left top point of the box, -
      4. - - - -
      5. - x2: - number - x coordinate of the right bottom point of the box, -
      6. - - - -
      7. - y2: - number - y coordinate of the right bottom point of the box, -
      8. - - - -
      9. - width: - number - width of the box, -
      10. - - - -
      11. - height: - number - height of the box -
      12. - - - -
    2. }
    3. - - -
    - - -
    -
    -
    - -
    -
    -

    Snap.path.toRelative(path)

    -
    -
    -
    -
    - - - - -

    Utility method -Converts path coordinates into relative values -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - path string
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - array - - path string -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.toAbsolute(path)

    -
    -
    -
    -
    - - - - -

    Utility method -Converts path coordinates into absolute values -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - path string
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - array - - path string -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.toCubic(pathString)

    -
    -
    -
    -
    - - - - -

    Utility method -Converts path to a new path where all segments are cubic beziér curves -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. pathString - string array - path string or array of segments
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - array - - array of segments -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.path.map(path, matrix)

    -
    -
    -
    -
    - - - - -

    Transform the path string with the given matrix -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. path - string - path string
    2. -
    3. matrix - object - see Matrix
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - string - - transformed path string -

    - - - - -
    -
    -
    - -
    -
    -

    Set.push()

    -
    -
    -
    -
    - - - - -

    Adds each argument to the current set -

    - - - - - - - - - - - - - - -

    - Returns: - - object - - original element -

    - - - - -
    -
    -
    - -
    -
    -

    Set.pop()

    -
    -
    -
    -
    - - - - -

    Removes last element and returns it -

    - - - - - - - - - - - - - - -

    - Returns: - - object - - element -

    - - - - -
    -
    -
    - -
    -
    -

    Set.forEach(callback, thisArg)

    -
    -
    -
    -
    - - - - -

    Executes given function for each element in the set -

    If the function returns false, the loop stops running. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. callback - function - function to run
    2. -
    3. thisArg - object - context object for the callback
    4. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Set object -

    - - - - -
    -
    -
    - -
    -
    -

    Set.animate(…)

    -
    -
    -
    -
    - - - - -

    Animates each element in set in sync. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. attrs - object - key-value pairs of destination attributes
    2. -
    3. duration - number - duration of the animation in milliseconds
    4. -
    5. easing - function - easing function from mina or custom
    6. -
    7. callback - function - callback function that executes when the animation ends
    8. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. animation - array - array of animation parameter for each element in set in format [attrs, duration, easing, callback]
    2. - -
    -
    - - - - - - - - - - - -

    Usage

    - - - - - - - - - - - -
    // animate all elements in set to radius 10
    +                            
    +
    +
    +
    +
    +

    Snap.filter.grayscale(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the grayscale filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.sepia(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the sepia filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.saturate(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the saturate filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.hueRotate(angle) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the hue-rotate filter +

    +
    +

    Parameters

    +
      +
    1. + angle + + number + + angle of rotation +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.invert(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the invert filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.brightness(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the brightness filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Snap.filter.contrast(amount) + + +

    +
    +
    +
    +
    +

    Returns an SVG markup string for the contrast filter +

    +
    +

    Parameters

    +
      +
    1. + amount + + number + + amount of filter (0..1) +
    2. +
    +
    +

    + Returns: + string + filter representation +

    +
    +
    +
    +
    +
    +

    Element.click(handler) + + +

    +
    +
    +
    +
    +

    Adds a click event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unclick(handler) + + +

    +
    +
    +
    +
    +

    Removes a click event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.dblclick(handler) + + +

    +
    +
    +
    +
    +

    Adds a double click event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.undblclick(handler) + + +

    +
    +
    +
    +
    +

    Removes a double click event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.mousedown(handler) + + +

    +
    +
    +
    +
    +

    Adds a mousedown event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unmousedown(handler) + + +

    +
    +
    +
    +
    +

    Removes a mousedown event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.mousemove(handler) + + +

    +
    +
    +
    +
    +

    Adds a mousemove event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unmousemove(handler) + + +

    +
    +
    +
    +
    +

    Removes a mousemove event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.mouseout(handler) + + +

    +
    +
    +
    +
    +

    Adds a mouseout event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unmouseout(handler) + + +

    +
    +
    +
    +
    +

    Removes a mouseout event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.mouseover(handler) + + +

    +
    +
    +
    +
    +

    Adds a mouseover event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unmouseover(handler) + + +

    +
    +
    +
    +
    +

    Removes a mouseover event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.mouseup(handler) + + +

    +
    +
    +
    +
    +

    Adds a mouseup event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unmouseup(handler) + + +

    +
    +
    +
    +
    +

    Removes a mouseup event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.touchstart(handler) + + +

    +
    +
    +
    +
    +

    Adds a touchstart event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.untouchstart(handler) + + +

    +
    +
    +
    +
    +

    Removes a touchstart event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.touchmove(handler) + + +

    +
    +
    +
    +
    +

    Adds a touchmove event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.untouchmove(handler) + + +

    +
    +
    +
    +
    +

    Removes a touchmove event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.touchend(handler) + + +

    +
    +
    +
    +
    +

    Adds a touchend event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.untouchend(handler) + + +

    +
    +
    +
    +
    +

    Removes a touchend event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.touchcancel(handler) + + +

    +
    +
    +
    +
    +

    Adds a touchcancel event handler to the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.untouchcancel(handler) + + +

    +
    +
    +
    +
    +

    Removes a touchcancel event handler from the element +

    +
    +

    Parameters

    +
      +
    1. + handler + + function + + handler for the event +
    2. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.hover(f_in, f_out, [icontext], [ocontext]) + + +

    +
    +
    +
    +
    +

    Adds hover event handlers to the element +

    +
    +

    Parameters

    +
      +
    1. + f_in + + function + + handler for hover in +
    2. +
    3. + f_out + + function + + handler for hover out +
    4. +
    5. + icontext + + object + + context for hover in handler +
    6. +
    7. + ocontext + + object + + context for hover out handler +
    8. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.unhover(f_in, f_out) + + +

    +
    +
    +
    +
    +

    Removes hover event handlers from the element +

    +
    +

    Parameters

    +
      +
    1. + f_in + + function + + handler for hover in +
    2. +
    3. + f_out + + function + + handler for hover out +
    4. +
    +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.drag(onmove, onstart, onend, [mcontext], [scontext], + [econtext]) + + +

    +
    +
    +
    +
    +

    Adds event handlers for an element's drag gesture +

    +
    +

    Parameters

    +
      +
    1. + onmove + + function + + handler for moving +
    2. +
    3. + onstart + + function + + handler for drag start +
    4. +
    5. + onend + + function + + handler for drag end +
    6. +
    7. + mcontext + + object + + context for moving handler +
    8. +
    9. + scontext + + object + + context for drag start handler +
    10. +
    11. + econtext + + object + + context for drag end handler +
    12. +
    +
    +

    Additionaly following drag events are + triggered: drag.start.<id> on start, + drag.end.<id> on end and drag.move.<id> on every move. When element is dragged over another + element + drag.over.<id> fires as well. +

    +

    Start event and start handler are called in specified + context or in context of the element with following + parameters: +

    +
      +
    1. + x + + number + + x position of the mouse +
    2. +
    3. + y + + number + + y position of the mouse +
    4. +
    5. + event + + object + + DOM event object +
    6. +
    +

    Move event and move handler are called in specified + context or in context of the element with following + parameters: +

    +
      +
    1. + dx + + number + + shift by x from the start point +
    2. +
    3. + dy + + number + + shift by y from the start point +
    4. +
    5. + x + + number + + x position of the mouse +
    6. +
    7. + y + + number + + y position of the mouse +
    8. +
    9. + event + + object + + DOM event object +
    10. +
    +

    End event and end handler are called in specified + context or in context of the element with following + parameters: +

    +
      +
    1. + event + + object + + DOM event object +
    2. +
    +

    + Returns: + object + + Element + +

    +
    +
    +
    +
    +
    +

    Element.undrag() + + +

    +
    +
    +
    +
    +

    Removes all drag event handlers from the given element +

    +
    +
    +
    +
    +
    +

    Snap.path.getTotalLength(path) + + +

    +
    +
    +
    +
    +

    Returns the length of the given path in pixels +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + SVG path string +
    2. +
    +
    +

    + Returns: + number + length +

    +
    +
    +
    +
    +
    +

    Snap.path.getPointAtLength(path, length) + + +

    +
    +
    +
    +
    +

    Returns the coordinates of the point located at the + given length along the given path +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + SVG path string +
    2. +
    3. + length + + number + + length, in pixels, from the start of + the path, excluding non-rendering + jumps +
    4. +
    +
    +

    + Returns: + object + representation of the point: +

    +
      +
    1. { +
        +
      1. + x: + + number + + x coordinate, +
      2. +
      3. + y: + + number + + y coordinate, +
      4. +
      5. + alpha: + + number + + angle of derivative +
      6. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    Snap.path.getSubpath(path, from, to) + + +

    +
    +
    +
    +
    +

    Returns the subpath of a given path between given + start and end lengths +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + SVG path string +
    2. +
    3. + from + + number + + length, in pixels, from the start of + the path to the start of the segment +
    4. +
    5. + to + + number + + length, in pixels, from the start of + the path to the end of the segment +
    6. +
    +
    +

    + Returns: + string + path string definition for the segment +

    +
    +
    +
    +
    +
    +

    Element.getTotalLength() + + +

    +
    +
    +
    +
    +

    Returns the length of the path in pixels (only works + for path elements) +

    +

    + Returns: + number + length +

    +
    +
    +
    +
    +
    +

    Element.getPointAtLength(length) + + +

    +
    +
    +
    +
    +

    Returns coordinates of the point located at the given + length on the given path (only works for path elements) +

    +
    +

    Parameters

    +
      +
    1. + length + + number + + length, in pixels, from the start of + the path, excluding non-rendering + jumps +
    2. +
    +
    +

    + Returns: + object + representation of the point: +

    +
      +
    1. { +
        +
      1. + x: + + number + + x coordinate, +
      2. +
      3. + y: + + number + + y coordinate, +
      4. +
      5. + alpha: + + number + + angle of derivative +
      6. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    Element.getSubpath(from, to) + + +

    +
    +
    +
    +
    +

    Returns subpath of a given element from given start + and end lengths (only works for path elements) +

    +
    +

    Parameters

    +
      +
    1. + from + + number + + length, in pixels, from the start of + the path to the start of the segment +
    2. +
    3. + to + + number + + length, in pixels, from the start of + the path to the end of the segment +
    4. +
    +
    +

    + Returns: + string + path string definition for the segment +

    +
    +
    +
    +
    +
    +

    Snap.path.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, + c2y, p2x, p2y, t) + + +

    +
    +
    +
    +
    +

    Utility method Finds dot coordinates on the given + cubic beziér curve at the given t +

    +
    +

    Parameters

    +
      +
    1. + p1x + + number + + x of the first point of the curve +
    2. +
    3. + p1y + + number + + y of the first point of the curve +
    4. +
    5. + c1x + + number + + x of the first anchor of the curve +
    6. +
    7. + c1y + + number + + y of the first anchor of the curve +
    8. +
    9. + c2x + + number + + x of the second anchor of the curve +
    10. +
    11. + c2y + + number + + y of the second anchor of the curve +
    12. +
    13. + p2x + + number + + x of the second point of the curve +
    14. +
    15. + p2y + + number + + y of the second point of the curve +
    16. +
    17. + t + + number + + position on the curve (0..1) +
    18. +
    +
    +

    + Returns: + object + point information in format: +

    +
      +
    1. { +
        +
      1. + x: + + number + + x coordinate of the point, +
      2. +
      3. + y: + + number + + y coordinate of the point, +
      4. +
      5. m: { +
          +
        1. + x: + + number + + x coordinate of the left + anchor, +
        2. +
        3. + y: + + number + + y coordinate of the left + anchor +
        4. +
        +
      6. +
      7. },
      8. +
      9. n: { +
          +
        1. + x: + + number + + x coordinate of the right + anchor, +
        2. +
        3. + y: + + number + + y coordinate of the right + anchor +
        4. +
        +
      10. +
      11. },
      12. +
      13. start: { +
          +
        1. + x: + + number + + x coordinate of the start + of the curve, +
        2. +
        3. + y: + + number + + y coordinate of the start + of the curve +
        4. +
        +
      14. +
      15. },
      16. +
      17. end: { +
          +
        1. + x: + + number + + x coordinate of the end of + the curve, +
        2. +
        3. + y: + + number + + y coordinate of the end of + the curve +
        4. +
        +
      18. +
      19. },
      20. +
      21. + alpha: + + number + + angle of the curve derivative at + the point +
      22. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    Snap.path.bezierBBox(…) + + +

    +
    +
    +
    +
    +

    Utility method Returns the bounding box of a given + cubic beziér curve +

    +
    +

    Parameters

    +
      +
    1. + p1x + + number + + x of the first point of the curve +
    2. +
    3. + p1y + + number + + y of the first point of the curve +
    4. +
    5. + c1x + + number + + x of the first anchor of the curve +
    6. +
    7. + c1y + + number + + y of the first anchor of the curve +
    8. +
    9. + c2x + + number + + x of the second anchor of the curve +
    10. +
    11. + c2y + + number + + y of the second anchor of the curve +
    12. +
    13. + p2x + + number + + x of the second point of the curve +
    14. +
    15. + p2y + + number + + y of the second point of the curve +
    16. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + bez + + array + + array of six points for beziér curve +
    2. +
    +
    +

    + Returns: + object + bounding box +

    +
      +
    1. { +
        +
      1. + x: + + number + + x coordinate of the left top point + of the box, +
      2. +
      3. + y: + + number + + y coordinate of the left top point + of the box, +
      4. +
      5. + x2: + + number + + x coordinate of the right bottom + point of the box, +
      6. +
      7. + y2: + + number + + y coordinate of the right bottom + point of the box, +
      8. +
      9. + width: + + number + + width of the box, +
      10. +
      11. + height: + + number + + height of the box +
      12. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    Snap.path.isPointInsideBBox(bbox, x, y) + + +

    +
    +
    +
    +
    +

    Utility method Returns true if given + point is inside bounding box +

    +
    +

    Parameters

    +
      +
    1. + bbox + + string + + bounding box +
    2. +
    3. + x + + string + + x coordinate of the point +
    4. +
    5. + y + + string + + y coordinate of the point +
    6. +
    +
    +

    + Returns: + boolean + true if point is inside +

    +
    +
    +
    +
    +
    +

    Snap.path.isBBoxIntersect(bbox1, bbox2) + + +

    +
    +
    +
    +
    +

    Utility method Returns true if two bounding + boxes intersect +

    +
    +

    Parameters

    +
      +
    1. + bbox1 + + string + + first bounding box +
    2. +
    3. + bbox2 + + string + + second bounding box +
    4. +
    +
    +

    + Returns: + boolean + true if bounding boxes intersect +

    +
    +
    +
    +
    +
    +

    Snap.path.intersection(path1, path2) + + +

    +
    +
    +
    +
    +

    Utility method Finds intersections of two paths +

    +
    +

    Parameters

    +
      +
    1. + path1 + + string + + path string +
    2. +
    3. + path2 + + string + + path string +
    4. +
    +
    +

    + Returns: + array + dots of intersection +

    +
      +
    1. [
    2. +
    3. { +
        +
      1. + x: + + number + + x coordinate of the point, +
      2. +
      3. + y: + + number + + y coordinate of the point, +
      4. +
      5. + t1: + + number + + t value for segment of path1, +
      6. +
      7. + t2: + + number + + t value for segment of path2, +
      8. +
      9. + segment1: + + number + + order number for segment of path1, +
      10. +
      11. + segment2: + + number + + order number for segment of path2, +
      12. +
      13. + bez1: + + array + + eight coordinates representing beziér + curve for the segment of path1, +
      14. +
      15. + bez2: + + array + + eight coordinates representing beziér + curve for the segment of path2 +
      16. +
      +
    4. +
    5. }
    6. +
    7. ]
    8. +
    +
    +
    +
    +
    +
    +

    Snap.path.isPointInside(path, x, y) + + +

    +
    +
    +
    +
    +

    Utility method Returns true if given + point is inside a given closed path. +

    +

    Note: fill mode doesn’t affect the result of this + method. +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + path string +
    2. +
    3. + x + + number + + x of the point +
    4. +
    5. + y + + number + + y of the point +
    6. +
    +
    +

    + Returns: + boolean + true if point is inside the path +

    +
    +
    +
    +
    +
    +

    Snap.path.getBBox(path) + + +

    +
    +
    +
    +
    +

    Utility method Returns the bounding box of a given + path +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + path string +
    2. +
    +
    +

    + Returns: + object + bounding box +

    +
      +
    1. { +
        +
      1. + x: + + number + + x coordinate of the left top point + of the box, +
      2. +
      3. + y: + + number + + y coordinate of the left top point + of the box, +
      4. +
      5. + x2: + + number + + x coordinate of the right bottom + point of the box, +
      6. +
      7. + y2: + + number + + y coordinate of the right bottom + point of the box, +
      8. +
      9. + width: + + number + + width of the box, +
      10. +
      11. + height: + + number + + height of the box +
      12. +
      +
    2. +
    3. }
    4. +
    +
    +
    +
    +
    +
    +

    Snap.path.toRelative(path) + + +

    +
    +
    +
    +
    +

    Utility method Converts path coordinates into relative + values +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + path string +
    2. +
    +
    +

    + Returns: + array + path string +

    +
    +
    +
    +
    +
    +

    Snap.path.toAbsolute(path) + + +

    +
    +
    +
    +
    +

    Utility method Converts path coordinates into absolute + values +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + path string +
    2. +
    +
    +

    + Returns: + array + path string +

    +
    +
    +
    +
    +
    +

    Snap.path.toCubic(pathString) + + +

    +
    +
    +
    +
    +

    Utility method Converts path to a new path where + all segments are cubic beziér curves +

    +
    +

    Parameters

    +
      +
    1. + pathString + + string + array + + path string or array of segments +
    2. +
    +
    +

    + Returns: + array + array of segments +

    +
    +
    +
    +
    +
    +

    Snap.path.map(path, matrix) + + +

    +
    +
    +
    +
    +

    Transform the path string with the given matrix +

    +
    +

    Parameters

    +
      +
    1. + path + + string + + path string +
    2. +
    3. + matrix + + object + + see + Matrix + +
    4. +
    +
    +

    + Returns: + string + transformed path string +

    +
    +
    +
    +
    +
    +

    Set.push() + + +

    +
    +
    +
    +
    +

    Adds each argument to the current set +

    +

    + Returns: + object + original element +

    +
    +
    +
    +
    +
    +

    Set.pop() + + +

    +
    +
    +
    +
    +

    Removes last element and returns it +

    +

    + Returns: + object + element +

    +
    +
    +
    +
    +
    +

    Set.forEach(callback, thisArg) + + +

    +
    +
    +
    +
    +

    Executes given function for each element in the set +

    +

    If the function returns false, the loop + stops running. +

    +
    +

    Parameters

    +
      +
    1. + callback + + function + + function to run +
    2. +
    3. + thisArg + + object + + context object for the callback +
    4. +
    +
    +

    + Returns: + object + Set object +

    +
    +
    +
    +
    +
    +

    Set.animate(…) + + +

    +
    +
    +
    +
    +

    Animates each element in set in sync. +

    +

    +
    +

    Parameters

    +
      +
    1. + attrs + + object + + key-value pairs of destination attributes +
    2. +
    3. + duration + + number + + duration of the animation in milliseconds +
    4. +
    5. + easing + + function + + easing function from + mina or custom +
    6. +
    7. + callback + + function + + callback function that executes when + the animation ends +
    8. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + animation + + array + + array of animation parameter for each + element in set in format [attrs, duration, easing, callback] +
    2. +
    +
    +

    Usage

    +
    // animate all elements in set to radius 10
     set.animate({r: 10}, 500, mina.easein);
     // or
     // animate first element to radius 10, but second to radius 20 and in different time
     set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);
    - - - - - - - - - - - -

    - Returns: - - Element - - the current element -

    - - - - -
    -
    -
    - -
    -
    -

    Set.bind(…)

    -
    -
    -
    -
    - - - - -

    Specifies how to handle a specific attribute when applied -to a set. -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. attr - string - attribute name
    2. -
    3. callback - function - function to run
    4. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. attr - string - attribute name
    2. -
    3. element - Element - specific element in the set to apply the attribute to
    4. - -
    -
    - - - - - - - - -

    or -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. attr - string - attribute name
    2. -
    3. element - Element - specific element in the set to apply the attribute to
    4. -
    5. eattr - string - attribute on the element to bind the attribute to
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - Set object -

    - - - - -
    -
    -
    - -
    -
    -

    Set.clear()

    -
    -
    -
    -
    - - - - -

    Removes all elements from the set -

    - - - - - - - - -
    -
    -
    - -
    -
    -

    Set.splice(index, count, [insertion…])

    -
    -
    -
    -
    - - - - -

    Removes range of elements from the set -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. index - number - position of the deletion
    2. -
    3. count - number - number of element to remove
    4. -
    5. insertion… - object - elements to insert
    6. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - object - - set elements that were deleted -

    - - - - -
    -
    -
    - -
    -
    -

    Set.exclude(element)

    -
    -
    -
    -
    - - - - -

    Removes given element from the set -

    - - - - - - - - - - -
    -

    Parameters

    -
      -
    1. element - object - element to remove
    2. - -
    -
    - - - - - - - - - - - - - -

    - Returns: - - boolean - - true if object was found and removed from the set -

    - - - - -
    -
    -
    - -
    -
    -

    Snap.mui()

    -
    -
    -
    -
    - - - - -

    Contain Material UI colours. -

    - - - - - - - - - - - - - -
    Snap().rect(0, 0, 10, 10).attr({fill: Snap.mui.deeppurple, stroke: Snap.mui.amber[600]});
    - - - - - - - - - For colour reference: https://www.materialui.co. - - - - - - - - -
    -
    -
    - -
    -
    -

    Snap.flat

    -
    -
    -
    -
    - - - - -

    Contain Flat UI colours. -

    - - - - - - - - - - - - - -
    Snap().rect(0, 0, 10, 10).attr({fill: Snap.flat.carrot, stroke: Snap.flat.wetasphalt});
    - - - - - - - - - For colour reference: https://www.materialui.co. - - - - - - - - -
    -
    -
    - -
    -
    -

    Snap.importMUIColors()

    -
    -
    -
    -
    - - - - -

    Imports Material UI colours into global object. -

    - - - - - - - - - - - - - -
    Snap.importMUIColors();
    +                                

    + Returns: + Element + the current element +

    +
    +
    +
    +
    +
    +

    Set.bind(…) + + +

    +
    +
    +
    +
    +

    Specifies how to handle a specific attribute when + applied to a set. +

    +

    +
    +

    Parameters

    +
      +
    1. + attr + + string + + attribute name +
    2. +
    3. + callback + + function + + function to run +
    4. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + attr + + string + + attribute name +
    2. +
    3. + element + + Element + + specific element in the set to apply + the attribute to +
    4. +
    +
    +

    or +

    +
    +

    Parameters

    +
      +
    1. + attr + + string + + attribute name +
    2. +
    3. + element + + Element + + specific element in the set to apply + the attribute to +
    4. +
    5. + eattr + + string + + attribute on the element to bind the + attribute to +
    6. +
    +
    +

    + Returns: + object + Set object +

    +
    +
    +
    +
    +
    +

    Set.clear() + + +

    +
    +
    +
    +
    +

    Removes all elements from the set +

    +
    +
    +
    +
    +
    +

    Set.splice(index, count, [insertion…]) + + +

    +
    +
    +
    +
    +

    Removes range of elements from the set +

    +
    +

    Parameters

    +
      +
    1. + index + + number + + position of the deletion +
    2. +
    3. + count + + number + + number of element to remove +
    4. +
    5. + insertion… + + object + + elements to insert +
    6. +
    +
    +

    + Returns: + object + set elements that were deleted +

    +
    +
    +
    +
    +
    +

    Set.exclude(element) + + +

    +
    +
    +
    +
    +

    Removes given element from the set +

    +
    +

    Parameters

    +
      +
    1. + element + + object + + element to remove +
    2. +
    +
    +

    + Returns: + boolean + true if object was found and removed + from the set +

    +
    +
    +
    +
    +
    +

    Snap.mui() + + +

    +
    +
    +
    +
    +

    Contain Material UI colours. +

    +
    Snap().rect(0, 0, 10, 10).attr({fill: Snap.mui.deeppurple, stroke: Snap.mui.amber[600]});
    + For colour reference: + https://www.materialui.co. +
    +
    +
    +
    +
    +

    Snap.flat + + +

    +
    +
    +
    +
    +

    Contain Flat UI colours. +

    +
    Snap().rect(0, 0, 10, 10).attr({fill: Snap.flat.carrot, stroke: Snap.flat.wetasphalt});
    + For colour reference: + https://www.materialui.co. +
    +
    +
    +
    +
    +

    Snap.importMUIColors() + + +

    +
    +
    +
    +
    +

    Imports Material UI colours into global object. +

    +
    Snap.importMUIColors();
     Snap().rect(0, 0, 10, 10).attr({fill: deeppurple, stroke: amber[600]});
    - - - - - - - - - For colour reference: https://www.materialui.co. - - - - - - - - -
    -
    -
    - -
    -
    -
    -
    - - - + - + + \ No newline at end of file diff --git a/package.json b/package.json index 380f799..2adc3c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snapsvg", - "version": "0.5.0dev", + "version": "0.5.0", "description": "JavaScript Vector Library", "main": "./dist/snap.svg.js", "repository": { @@ -17,6 +17,7 @@ "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-concat": "~0.3.0", "grunt-exec": "~0.4.2", + "grunt-prettify": "0.4.0", "mocha": "*", "expect.js": "*", "eslint": "*", diff --git a/src/svg.js b/src/svg.js index 5d03fb9..c2336ac 100644 --- a/src/svg.js +++ b/src/svg.js @@ -13,7 +13,7 @@ // limitations under the License. var Snap = (function(root) { -Snap.version = "0.5.0dev"; +Snap.version = "0.5.0"; /*\ * Snap [ method ] diff --git a/test.html b/test.html deleted file mode 100644 index a7a5f21..0000000 --- a/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Test - - - - - - -