From: Dmitry Baranovskiy Date: Mon, 25 Jul 2011 23:17:57 +0000 (+1000) Subject: Splitting fixes X-Git-Tag: v2.0.0~21 X-Git-Url: http://git.roojs.org/?p=raphael;a=commitdiff_plain;h=59524ab7e4213341319b2064bb67d7acb143d068 Splitting fixes --- diff --git a/raphael-min.js b/raphael-min.js index df70352..855d6f5 100644 --- a/raphael-min.js +++ b/raphael-min.js @@ -1 +1 @@ -(function(){function cq(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],n,o,p,q=b.ms,s={},t={},u={};if(f)for(w=0,x=ck.length;wf*b.top){e=b.percents[w],o=b.percents[w-1]||0,q=q/b.top*(e-o),n=b.percents[w+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[w]])}if(!!j){if(!k){for(attr in j)if(j[g](attr))if(V[g](attr)||d.paper.customAttributes[g](attr)){s[attr]=d.attr(attr),s[attr]==null&&(s[attr]=U[attr]),t[attr]=j[attr];switch(V[attr]){case C:u[attr]=(t[attr]-s[attr])/q;break;case"colour":s[attr]=a.getRGB(s[attr]);var y=a.getRGB(t[attr]);u[attr]={r:(y.r-s[attr].r)/q,g:(y.g-s[attr].g)/q,b:(y.b-s[attr].b)/q};break;case"path":var z=bF(s[attr],t[attr]),A=z[1];s[attr]=z[0],u[attr]=[];for(w=0,x=s[attr].length;wd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cc(){return this.x+q+this.y+q+this.width+" × "+this.height}function cb(){return this.x+q+this.y}function bQ(a,b,c,d,e,f){a!=null?(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)}function bv(){return this.hex}function bt(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bs(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bs(a,b){for(var c=0,d=a.length;c',bk=bj.firstChild,bk.style.behavior="url(#default#VML)";if(!bk||typeof bk.adj!="object")return a.type=p;bj=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,k.customAttributes={},a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bl=a._createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){cu("setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,initWin&&initWin(h.win)};var bm=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bm=bt(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bm=bt(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bm(b)},bn=function(){return"hsb("+[this.h,this.s,this.b]+")"},bo=function(){return"hsl("+[this.h,this.s,this.l]+")"},bp=function(){return this.hex},bq=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},br=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:bp};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},crl.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=bp;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bn}},a.rgb2hsl=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?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=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bo}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bu=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bt(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bv};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bm(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bv},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv}},a),a.hsb=bt(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bt(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bt(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bt(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bx(b)),d.length||r(b).replace(Z,function(a,b,e){var f=[],g=v.call(b);e.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(d.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");while(f.length>=c[g]){d.push([b][n](f.splice(0,c[g])));if(!c[g])break}}),d.toString=a._path2string;return d}),a.parseTransformString=bt(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bx(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([f][n](e))}),d.toString=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,l=A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-w.atan2(m-o,n-p)*180/B;(m>o||n1&&(u=w.sqrt(u),c=u*c,d=u*d);var v=c*c,x=d*d,y=(f==g?-1:1)*w.sqrt(z((v*x-v*t*t-x*s*s)/(v*t*t+x*s*s))),A=y*c*t/d+(a+h)/2,C=y*-d*s/c+(b+i)/2,D=w.asin(((b-C)/d).toFixed(9)),E=w.asin(((i-C)/d).toFixed(9));D=aE&&(D=D-B*2),!g&&E>D&&(E=E-B*2)}else D=j[0],E=j[1],A=j[2],C=j[3];var F=E-D;if(z(F)>k){var G=E,H=h,I=i;E=D+k*(g&&E>D?1:-1),h=A+c*w.cos(E),i=C+d*w.sin(E),m=bC(h,i,c,d,e,0,g,H,I,[E,G,A,C])}F=E-D;var J=w.cos(D),K=w.sin(D),L=w.cos(E),M=w.sin(E),N=w.tan(F/4),O=4/3*c*N,P=4/3*d*N,Q=[a,b],R=[a+O*K,b-P*J],S=[h+O*M,i-P*L],T=[h,i];R[0]=2*Q[0]-R[0],R[1]=2*Q[1]-R[1];if(j)return[R,S,T][n](m);m=[R,S,T][n](m).join().split(",");var U=[];for(var V=0,W=m.length;V"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bD(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bD(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bD(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bD(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bF=bt(function(a,b){var c=bz(a),d=b&&bz(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bC[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bB(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"][n](bB(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bA(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bA(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bA(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bA(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b].length>7){a[b].shift();var e=a[b];while(e.length)a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=x(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=x(c.length,d&&d.length||0))};for(var j=0,k=x(c.length,d&&d.length||0);j=j)return p;o=p}if(j==null)return k},cf=function(b,c){return function(d,e,f){d=bF(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=ce(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=ce(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cg=cf(1),ch=cf(),ci=cf(0,1);a.getTotalLength=cg,a.getPointAtLength=ch,a.getSubpath=function(a,b,c){if(z(this.getTotalLength(a)-c)<1e-6)return ci(a,b).end;var d=ci(a,c,1);return b?ci(d,b).end:d},b$.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cg(this.attrs.path)}},b$.getPointAtLength=function(a){if(this.type=="path")return ch(this.attrs.path,a)},b$.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cj=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cj.easeIn=cj["ease-in"]=cj["<"],cj.easeOut=cj["ease-out"]=cj[">"],cj.easeInOut=cj["ease-in-out"]=cj["<>"],cj["back-in"]=cj.backIn,cj["back-out"]=cj.backOut;var ck=[],cl=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cm=function(){var b=+(new Date),c=0;for(;c1&&!d.next&&cq(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1),d.next&&!d.stop&&cq(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}a.svg&&m&&m.paper&&m.paper.safari(),ck.length&&cl(cm)},cn=function(a){return a>255?255:a<0?0:a};b$.animateWith=function(a,b,c,d,e){this.animate(b,c,d,e);var f,g;for(var h=0,i=ck.length;h.5)*2-1;pow(l-.5,2)+pow(m-.5,2)>.25&&(m=f.sqrt(.25-pow(l-.5,2))*e+.5)&&m!=.5&&(m=m.toFixed(5)-1e-5*e)}return k}),e=e.split(/\s*\-\s*/);if(g=="linear"){var s=e.shift();s=-d(s);if(isNaN(s))return null;var t=[0,0,f.cos(a.rad(s)),f.sin(a.rad(s))],u=1/(h(i(t[2]),i(t[3]))||1);t[2]*=u,t[3]*=u,t[2]<0&&(t[0]=-t[2],t[2]=0),t[3]<0&&(t[1]=-t[3],t[3]=0)}var v=a._parseDots(e);if(!v)return null;b.gradient&&(p.defs.removeChild(b.gradient),delete b.gradient),j=j.replace(/[\(\)\s,\xb0#]/g,"-"),r=o(g+"Gradient",{id:j}),b.gradient=r,o(r,g=="radial"?{fx:l,fy:m}:{x1:t[0],y1:t[1],x2:t[2],y2:t[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(r);for(var w=0,x=v.length;w1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(v),n.setAttribute(r,G.hex),r=="stroke"&&G[b]("opacity")&&o(n,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),r=="stroke"&&d._.arrows&&("startString"in d._.arrows&&u(d,d._.arrows.startString),"endString"in d._.arrows&&u(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(v).charAt()!="r")&&s(d,v);break;case"opacity":p.gradient&&!p[b]("stroke-opacity")&&o(n,{"stroke-opacity":v>1?v/100:v});case"fill-opacity":if(p.gradient){H=g.doc.getElementById(n.getAttribute("fill").replace(/^url\(#|\)$/g,k)),H&&(I=H.getElementsByTagName("stop"),o(I[I.length-1],{"stop-opacity":v}));break};default:r=="font-size"&&(v=e(v,10)+"px");var J=r.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});n.style[J]=v,d._.dirty=1,n.setAttribute(r,v)}}x(d,f)},w=1.2,x=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,k).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),l=[],m;for(var n=0,p=j.length;n"));var $=X.getBoundingClientRect();y.W=p.w=($.right-$.left)/Y,y.H=p.h=($.bottom-$.top)/Y,y.paper.canvas.style.display="none",y.X=p.x,y.Y=p.y+y.H/2,("x"in j||"y"in j)&&(y.path.v=a.format("m{0},{1}l{2},{1}",f(p.x*t),f(p.y*t),f(p.x*t)+1));var _=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ba=0,bb=_.length;ba.25&&(c=e.sqrt(.25-pow(b-.5,2))*((c>.5)*2-1)+.5),l=b+m+c);return n}),f=f.split(/\s*\-\s*/);if(k=="linear"){var o=f.shift();o=-d(o);if(isNaN(o))return null}var p=a._parseDots(f);if(!p)return null;b=b.shape||b.node;if(p.length){b.removeChild(g),g.on=!0,g.method="none",g.color=p[0].color,g.color2=p[p.length-1].color;var q=[];for(var r=0,s=p.length;r')}}catch(c){A=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};B(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=t*1e3+m+t*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("clear",this),this.canvas.innerHTML=n,this.span=g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=removed(b);return!0}}(window.Raphael) \ No newline at end of file +(function(){function cq(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],n,o,p,q=b.ms,s={},t={},u={};if(f)for(w=0,x=ck.length;wf*b.top){e=b.percents[w],o=b.percents[w-1]||0,q=q/b.top*(e-o),n=b.percents[w+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[w]])}if(!!j){if(!k){for(attr in j)if(j[g](attr))if(V[g](attr)||d.paper.customAttributes[g](attr)){s[attr]=d.attr(attr),s[attr]==null&&(s[attr]=U[attr]),t[attr]=j[attr];switch(V[attr]){case C:u[attr]=(t[attr]-s[attr])/q;break;case"colour":s[attr]=a.getRGB(s[attr]);var y=a.getRGB(t[attr]);u[attr]={r:(y.r-s[attr].r)/q,g:(y.g-s[attr].g)/q,b:(y.b-s[attr].b)/q};break;case"path":var z=bF(s[attr],t[attr]),A=z[1];s[attr]=z[0],u[attr]=[];for(w=0,x=s[attr].length;wd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cc(){return this.x+q+this.y+q+this.width+" × "+this.height}function cb(){return this.x+q+this.y}function bQ(a,b,c,d,e,f){a!=null?(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)}function bv(){return this.hex}function bt(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bs(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bs(a,b){for(var c=0,d=a.length;c',bk=bj.firstChild,bk.style.behavior="url(#default#VML)";if(!bk||typeof bk.adj!="object")return a.type=p;bj=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,k.customAttributes={},a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bl=a._createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){cu("setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,initWin&&initWin(h.win)};var bm=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bm=bt(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bm=bt(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bm(b)},bn=function(){return"hsb("+[this.h,this.s,this.b]+")"},bo=function(){return"hsl("+[this.h,this.s,this.l]+")"},bp=function(){return this.hex},bq=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},br=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:bp};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},crl.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=bp;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bn}},a.rgb2hsl=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?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=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bo}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bu=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bt(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bv};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bm(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6].split(W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bv},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv}},a),a.hsb=bt(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bt(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bt(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bt(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bx(b)),d.length||r(b).replace(Z,function(a,b,e){var f=[],g=v.call(b);e.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(d.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");while(f.length>=c[g]){d.push([b][n](f.splice(0,c[g])));if(!c[g])break}}),d.toString=a._path2string;return d}),a.parseTransformString=bt(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bx(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([f][n](e))}),d.toString=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,l=A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-w.atan2(m-o,n-p)*180/B;(m>o||n1&&(u=w.sqrt(u),c=u*c,d=u*d);var v=c*c,x=d*d,y=(f==g?-1:1)*w.sqrt(z((v*x-v*t*t-x*s*s)/(v*t*t+x*s*s))),A=y*c*t/d+(a+h)/2,C=y*-d*s/c+(b+i)/2,D=w.asin(((b-C)/d).toFixed(9)),E=w.asin(((i-C)/d).toFixed(9));D=aE&&(D=D-B*2),!g&&E>D&&(E=E-B*2)}else D=j[0],E=j[1],A=j[2],C=j[3];var F=E-D;if(z(F)>k){var G=E,H=h,I=i;E=D+k*(g&&E>D?1:-1),h=A+c*w.cos(E),i=C+d*w.sin(E),m=bC(h,i,c,d,e,0,g,H,I,[E,G,A,C])}F=E-D;var J=w.cos(D),K=w.sin(D),L=w.cos(E),M=w.sin(E),N=w.tan(F/4),O=4/3*c*N,P=4/3*d*N,Q=[a,b],R=[a+O*K,b-P*J],S=[h+O*M,i-P*L],T=[h,i];R[0]=2*Q[0]-R[0],R[1]=2*Q[1]-R[1];if(j)return[R,S,T][n](m);m=[R,S,T][n](m).join().split(",");var U=[];for(var V=0,W=m.length;V"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bD(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bD(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bD(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bD(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bF=bt(function(a,b){var c=bz(a),d=b&&bz(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bC[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bB(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"][n](bB(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bA(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bA(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bA(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bA(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b].length>7){a[b].shift();var e=a[b];while(e.length)a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=x(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=x(c.length,d&&d.length||0))};for(var j=0,k=x(c.length,d&&d.length||0);j=j)return p;o=p}if(j==null)return k},cf=function(b,c){return function(d,e,f){d=bF(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=ce(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=ce(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cg=cf(1),ch=cf(),ci=cf(0,1);a.getTotalLength=cg,a.getPointAtLength=ch,a.getSubpath=function(a,b,c){if(z(this.getTotalLength(a)-c)<1e-6)return ci(a,b).end;var d=ci(a,c,1);return b?ci(d,b).end:d},b$.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cg(this.attrs.path)}},b$.getPointAtLength=function(a){if(this.type=="path")return ch(this.attrs.path,a)},b$.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cj=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cj.easeIn=cj["ease-in"]=cj["<"],cj.easeOut=cj["ease-out"]=cj[">"],cj.easeInOut=cj["ease-in-out"]=cj["<>"],cj["back-in"]=cj.backIn,cj["back-out"]=cj.backOut;var ck=[],cl=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cm=function(){var b=+(new Date),c=0;for(;c1&&!d.next&&cq(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1),d.next&&!d.stop&&cq(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}a.svg&&m&&m.paper&&m.paper.safari(),ck.length&&cl(cm)},cn=function(a){return a>255?255:a<0?0:a};b$.animateWith=function(a,b,c,d,e){this.animate(b,c,d,e);var f,g;for(var h=0,i=ck.length;h.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;b.gradient&&(q.defs.removeChild(b.gradient),delete b.gradient),k=k.replace(/[\(\)\s,\xb0#]/g,"-"),s=p(j+"Gradient",{id:k}),b.gradient=s,p(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),q.defs.appendChild(s);for(var x=0,y=w.length;x1?F.opacity/100:F.opacity});case"stroke":F=a.getRGB(r),k.setAttribute(q,F.hex),q=="stroke"&&F[b]("opacity")&&p(k,{"stroke-opacity":F.opacity>1?F.opacity/100:F.opacity}),q=="stroke"&&d._.arrows&&("startString"in d._.arrows&&v(d,d._.arrows.startString),"endString"in d._.arrows&&v(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(r).charAt()!="r")&&t(d,r);break;case"opacity":n.gradient&&!n[b]("stroke-opacity")&&p(k,{"stroke-opacity":r>1?r/100:r});case"fill-opacity":if(n.gradient){G=a._g.doc.getElementById(k.getAttribute("fill").replace(/^url\(#|\)$/g,l)),G&&(H=G.getElementsByTagName("stop"),p(H[H.length-1],{"stop-opacity":r}));break};default:q=="font-size"&&(r=e(r,10)+"px");var I=q.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});k.style[I]=r,d._.dirty=1,k.setAttribute(q,r)}}y(d,f)},x=1.2,y=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n"));var Z=W.getBoundingClientRect();x.W=o.w=(Z.right-Z.left)/X,x.H=o.h=(Z.bottom-Z.top)/X,x.paper.canvas.style.display="none",x.X=o.x,x.Y=o.y+x.H/2,("x"in i||"y"in i)&&(x.path.v=a.format("m{0},{1}l{2},{1}",f(o.x*t),f(o.y*t),f(o.x*t)+1));var $=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var _=0,ba=$.length;_.25&&(c=e.sqrt(.25-pow(b-.5,2))*((c>.5)*2-1)+.5),l=b+m+c);return n}),f=f.split(/\s*\-\s*/);if(k=="linear"){var o=f.shift();o=-d(o);if(isNaN(o))return null}var p=a._parseDots(f);if(!p)return null;b=b.shape||b.node;if(p.length){b.removeChild(g),g.on=!0,g.method="none",g.color=p[0].color,g.color2=p[p.length-1].color;var q=[];for(var r=0,s=p.length;r')}}catch(c){A=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};B(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=t*1e3+m+t*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("clear",this),this.canvas.innerHTML=n,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=removed(b);return!0}}(window.Raphael) \ No newline at end of file diff --git a/raphael.core.js b/raphael.core.js index e7b9803..ce38d5b 100644 --- a/raphael.core.js +++ b/raphael.core.js @@ -3895,9 +3895,14 @@ var prev = i && font.glyphs[letters[i - 1]] || {}, curr = font.glyphs[letters[i]]; shift += i ? (prev.w || font.w) + (prev.k && prev.k[letters[i]] || 0) + (font.w * letter_spacing) : 0; - curr && curr.d && out.push(this.path(curr.d).attr({fill: "#000", stroke: "none", transform: [["t", shift, 0]]})); + curr && curr.d && out.push(this.path(curr.d).attr({ + fill: "#000", + stroke: "none", + transform: [["t", shift * scale, 0]] + })); } - out.scale(scale, scale, top, height).translate(x - top, y - height); + out.transform(["...s", scale, scale, top, height, "t", (x - top) / scale, (y - height) / scale]); + // out.scale(scale, scale, top, height).translate(x - top, y - height); } return out; }; diff --git a/raphael.js b/raphael.js index 91e8ee6..ec1ba24 100644 --- a/raphael.js +++ b/raphael.js @@ -4236,7 +4236,9 @@ window.Raphael.svg && function (R) { math = Math, mmax = math.max, abs = math.abs, + pow = math.pow, separator = /[, ]+/, + eve = R.eve, E = ""; // SVG var xlink = "http://www.w3.org/1999/xlink", @@ -4276,7 +4278,7 @@ window.Raphael.svg && function (R) { oid = oid && oid.match(rgGrad); if (oid && !--gradients[oid[1]]) { delete gradients[oid[1]]; - paper.defs.removeChild(g.doc.getElementById(oid[1])); + paper.defs.removeChild(R._g.doc.getElementById(oid[1])); } }, addGradientFill = function (element, gradient) { @@ -4430,7 +4432,7 @@ window.Raphael.svg && function (R) { if (type != "none") { var pathId = "raphael-marker-" + type, markerId = "raphael-marker-" + se + type + w + h; - if (!g.doc.getElementById(pathId)) { + if (!R._g.doc.getElementById(pathId)) { p.defs.appendChild($($("path"), { "stroke-linecap": "round", d: markers[type], @@ -4440,7 +4442,7 @@ window.Raphael.svg && function (R) { } else { markerCounter[pathId]++; } - var marker = g.doc.getElementById(markerId), + var marker = R._g.doc.getElementById(markerId), use; if (!marker) { marker = $($("marker"), { @@ -4499,7 +4501,7 @@ window.Raphael.svg && function (R) { delete o._.arrows[se + "String"]; } for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) { - var item = g.doc.getElementById(attr); + var item = R._g.doc.getElementById(attr); item && item.parentNode.removeChild(item); } } @@ -4522,7 +4524,7 @@ window.Raphael.svg && function (R) { node = o.node, attrs = o.attrs, addDashes = function (o, value) { - value = dasharray[lowerCase.call(value)]; + value = dasharray[Str(value).toLowerCase()]; if (value) { var width = o.attrs["stroke-width"] || "1", butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0, @@ -4549,7 +4551,7 @@ window.Raphael.svg && function (R) { case "title": case "target": var pn = node.parentNode; - if (lowerCase.call(pn.tagName) != "a") { + if (pn.tagName.toLowerCase() != "a") { var hl = $("a"); pn.insertBefore(hl, node); hl.appendChild(node); @@ -4592,7 +4594,7 @@ window.Raphael.svg && function (R) { o.clip = rc; } if (!value) { - var clip = g.doc.getElementById(node.getAttribute("clip-path").replace(/(^url\(#|\)$)/g, E)); + var clip = R._g.doc.getElementById(node.getAttribute("clip-path").replace(/(^url\(#|\)$)/g, E)); clip && clip.parentNode.removeChild(clip); $(node, {"clip-path": E}); delete o.clip; @@ -4722,7 +4724,7 @@ window.Raphael.svg && function (R) { $(node, {"fill-opacity": attrs["fill-opacity"]}); } else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) { if ("opacity" in attrs || "fill-opacity" in attrs) { - var gradient = g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); + var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { var stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1)}); @@ -4752,7 +4754,7 @@ window.Raphael.svg && function (R) { // fall case "fill-opacity": if (attrs.gradient) { - gradient = g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); + gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": value}); @@ -5567,6 +5569,7 @@ window.Raphael.vml && function (R) { abs = math.abs, fillString = "fill", separator = /[, ]+/, + eve = R.eve, S = " ", E = ""; // VML @@ -5586,7 +5589,7 @@ window.Raphael.vml && function (R) { if (command == R._pathToAbsolute && !Str(path).match(total)) { var res = Str(path).replace(bites, function (all, command, args) { var vals = [], - isMove = lowerCase.call(command) == "m", + isMove = command.toLowerCase() == "m", res = map[command]; args.replace(val, function (value) { if (isMove && vals.length == 2) { @@ -5732,7 +5735,7 @@ window.Raphael.vml && function (R) { if (rect.length == 4) { rect[2] = +rect[2] + (+rect[0]); rect[3] = +rect[3] + (+rect[1]); - var div = node.clipRect || g.doc.createElement("div"), + var div = node.clipRect || R._g.doc.createElement("div"), dstyle = div.style, group = node.parentNode; dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect); @@ -6484,7 +6487,7 @@ window.Raphael.vml && function (R) { R.prototype.clear = function () { R.eve("clear", this); this.canvas.innerHTML = E; - this.span = g.doc.createElement("span"); + this.span = R._g.doc.createElement("span"); this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"; this.canvas.appendChild(this.span); this.bottom = this.top = null; diff --git a/raphael.svg.js b/raphael.svg.js index 61cc78b..4fb1a62 100644 --- a/raphael.svg.js +++ b/raphael.svg.js @@ -15,7 +15,9 @@ window.Raphael.svg && function (R) { math = Math, mmax = math.max, abs = math.abs, + pow = math.pow, separator = /[, ]+/, + eve = R.eve, E = ""; // SVG var xlink = "http://www.w3.org/1999/xlink", @@ -55,7 +57,7 @@ window.Raphael.svg && function (R) { oid = oid && oid.match(rgGrad); if (oid && !--gradients[oid[1]]) { delete gradients[oid[1]]; - paper.defs.removeChild(g.doc.getElementById(oid[1])); + paper.defs.removeChild(R._g.doc.getElementById(oid[1])); } }, addGradientFill = function (element, gradient) { @@ -209,7 +211,7 @@ window.Raphael.svg && function (R) { if (type != "none") { var pathId = "raphael-marker-" + type, markerId = "raphael-marker-" + se + type + w + h; - if (!g.doc.getElementById(pathId)) { + if (!R._g.doc.getElementById(pathId)) { p.defs.appendChild($($("path"), { "stroke-linecap": "round", d: markers[type], @@ -219,7 +221,7 @@ window.Raphael.svg && function (R) { } else { markerCounter[pathId]++; } - var marker = g.doc.getElementById(markerId), + var marker = R._g.doc.getElementById(markerId), use; if (!marker) { marker = $($("marker"), { @@ -278,7 +280,7 @@ window.Raphael.svg && function (R) { delete o._.arrows[se + "String"]; } for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) { - var item = g.doc.getElementById(attr); + var item = R._g.doc.getElementById(attr); item && item.parentNode.removeChild(item); } } @@ -301,7 +303,7 @@ window.Raphael.svg && function (R) { node = o.node, attrs = o.attrs, addDashes = function (o, value) { - value = dasharray[lowerCase.call(value)]; + value = dasharray[Str(value).toLowerCase()]; if (value) { var width = o.attrs["stroke-width"] || "1", butt = {round: width, square: width, butt: 0}[o.attrs["stroke-linecap"] || params["stroke-linecap"]] || 0, @@ -328,7 +330,7 @@ window.Raphael.svg && function (R) { case "title": case "target": var pn = node.parentNode; - if (lowerCase.call(pn.tagName) != "a") { + if (pn.tagName.toLowerCase() != "a") { var hl = $("a"); pn.insertBefore(hl, node); hl.appendChild(node); @@ -371,7 +373,7 @@ window.Raphael.svg && function (R) { o.clip = rc; } if (!value) { - var clip = g.doc.getElementById(node.getAttribute("clip-path").replace(/(^url\(#|\)$)/g, E)); + var clip = R._g.doc.getElementById(node.getAttribute("clip-path").replace(/(^url\(#|\)$)/g, E)); clip && clip.parentNode.removeChild(clip); $(node, {"clip-path": E}); delete o.clip; @@ -501,7 +503,7 @@ window.Raphael.svg && function (R) { $(node, {"fill-opacity": attrs["fill-opacity"]}); } else if ((o.type == "circle" || o.type == "ellipse" || Str(value).charAt() != "r") && addGradientFill(o, value)) { if ("opacity" in attrs || "fill-opacity" in attrs) { - var gradient = g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); + var gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { var stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": ("opacity" in attrs ? attrs.opacity : 1) * ("fill-opacity" in attrs ? attrs["fill-opacity"] : 1)}); @@ -531,7 +533,7 @@ window.Raphael.svg && function (R) { // fall case "fill-opacity": if (attrs.gradient) { - gradient = g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); + gradient = R._g.doc.getElementById(node.getAttribute("fill").replace(/^url\(#|\)$/g, E)); if (gradient) { stops = gradient.getElementsByTagName("stop"); $(stops[stops.length - 1], {"stop-opacity": value}); diff --git a/raphael.vml.js b/raphael.vml.js index b551dcb..d8f4498 100644 --- a/raphael.vml.js +++ b/raphael.vml.js @@ -18,6 +18,7 @@ window.Raphael.vml && function (R) { abs = math.abs, fillString = "fill", separator = /[, ]+/, + eve = R.eve, S = " ", E = ""; // VML @@ -37,7 +38,7 @@ window.Raphael.vml && function (R) { if (command == R._pathToAbsolute && !Str(path).match(total)) { var res = Str(path).replace(bites, function (all, command, args) { var vals = [], - isMove = lowerCase.call(command) == "m", + isMove = command.toLowerCase() == "m", res = map[command]; args.replace(val, function (value) { if (isMove && vals.length == 2) { @@ -183,7 +184,7 @@ window.Raphael.vml && function (R) { if (rect.length == 4) { rect[2] = +rect[2] + (+rect[0]); rect[3] = +rect[3] + (+rect[1]); - var div = node.clipRect || g.doc.createElement("div"), + var div = node.clipRect || R._g.doc.createElement("div"), dstyle = div.style, group = node.parentNode; dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect); @@ -935,7 +936,7 @@ window.Raphael.vml && function (R) { R.prototype.clear = function () { R.eve("clear", this); this.canvas.innerHTML = E; - this.span = g.doc.createElement("span"); + this.span = R._g.doc.createElement("span"); this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"; this.canvas.appendChild(this.span); this.bottom = this.top = null;