graphics-svg-min.js revision 4228ce333e19cf320ab65129c52b05ded2c1cc2e
YUI.add("graphics-svg",function(b){var i="svgShape",c=b.Lang,g=b.AttributeLite,d,k,f,h,j,e,l=b.config.doc;function a(){}a.prototype={curveTo:function(r,p,w,v,u,t){var n,s,q,m,o,z;if(this._pathType!=="C"){this._pathType="C";s=["C"];this._pathArray.push(s);}else{s=this._pathArray[Math.max(0,this._pathArray.length-1)];if(!s){s=[];this._pathArray.push(s);}}n=this._pathArray.length-1;this._pathArray[n]=this._pathArray[n].concat([Math.round(r),Math.round(p),Math.round(w),Math.round(v),u,t]);q=Math.max(u,Math.max(r,w));o=Math.max(t,Math.max(p,v));m=Math.min(u,Math.min(r,w));z=Math.min(t,Math.min(p,v));this._trackSize(q,o);this._trackSize(m,z);},quadraticCurveTo:function(r,q,u,t){var n,s,p,m,o,v;if(this._pathType!=="Q"){this._pathType="Q";s=["Q"];this._pathArray.push(s);}else{s=this._pathArray[Math.max(0,this._pathArray.length-1)];if(!s){s=[];this._pathArray.push(s);}}n=this._pathArray.length-1;this._pathArray[n]=this._pathArray[n].concat([Math.round(r),Math.round(q),Math.round(u),Math.round(t)]);p=Math.max(u,r);o=Math.max(t,q);m=Math.min(u,r);v=Math.min(t,q);this._trackSize(p,o);this._trackSize(m,v);},drawRect:function(m,p,n,o){this.moveTo(m,p);this.lineTo(m+n,p);this.lineTo(m+n,p+o);this.lineTo(m,p+o);this.lineTo(m,p);},drawRoundRect:function(m,r,n,p,o,q){this.moveTo(m,r+q);this.lineTo(m,r+p-q);this.quadraticCurveTo(m,r+p,m+o,r+p);this.lineTo(m+n-o,r+p);this.quadraticCurveTo(m+n,r+p,m+n,r+p-q);this.lineTo(m+n,r+q);this.quadraticCurveTo(m+n,r,m+n-o,r);this.lineTo(m+o,r);this.quadraticCurveTo(m,r,m,r+q);},drawWedge:function(w,t,C,s,o,p){var B,A,r,G,q,z,v,F,E,n,m,D=0,u=o*2;p=p||o;if(this._pathType!="M"){this._pathType="M";currentArray=["M"];this._pathArray.push(currentArray);}else{currentArray=this._getCurrentArray();}pathArrayLen=this._pathArray.length-1;this._pathArray[pathArrayLen].push(w);this._pathArray[pathArrayLen].push(w);if(Math.abs(s)>360){s=360;}B=Math.ceil(Math.abs(s)/45);A=s/B;r=-(A/180)*Math.PI;G=(C/180)*Math.PI;if(B>0){z=w+Math.cos(C/180*Math.PI)*o;v=t+Math.sin(C/180*Math.PI)*p;this._pathType="L";pathArrayLen++;this._pathArray[pathArrayLen]=["L"];this._pathArray[pathArrayLen].push(Math.round(z));this._pathArray[pathArrayLen].push(Math.round(v));pathArrayLen++;this._pathType="Q";this._pathArray[pathArrayLen]=["Q"];for(;D<B;++D){G+=r;q=G-(r/2);F=w+Math.cos(G)*o;E=t+Math.sin(G)*p;n=w+Math.cos(q)*(o/Math.cos(r/2));m=t+Math.sin(q)*(p/Math.cos(r/2));this._pathArray[pathArrayLen].push(Math.round(n));this._pathArray[pathArrayLen].push(Math.round(m));this._pathArray[pathArrayLen].push(Math.round(F));this._pathArray[pathArrayLen].push(Math.round(E));}}this._trackSize(u,u);return this;},lineTo:function(r,q,o){var n=arguments,p,m,t,s;this._pathArray=this._pathArray||[];if(typeof r==="string"||typeof r==="number"){n=[[r,q]];}m=n.length;this._shapeType="path";if(this._pathType!=="L"){this._pathType="L";s=["L"];this._pathArray.push(s);}else{s=this._getCurrentArray();}t=this._pathArray.length-1;for(p=0;p<m;++p){this._pathArray[t].push(n[p][0]);this._pathArray[t].push(n[p][1]);this._trackSize.apply(this,n[p]);}},_getCurrentArray:function(){var m=this._pathArray[Math.max(0,this._pathArray.length-1)];if(!m){m=[];this._pathArray.push(m);}return m;},moveTo:function(m,p){var o,n;this._pathArray=this._pathArray||[];if(this._pathType!="M"){this._pathType="M";n=["M"];this._pathArray.push(n);}else{n=this._getCurrentArray();}o=this._pathArray.length-1;this._pathArray[o]=this._pathArray[o].concat([m,p]);this._trackSize(m,p);},end:function(){this._draw();},_trackSize:function(m,n){if(m>this._right){this._right=m;}if(m<this._left){this._left=m;}if(n<this._top){this._top=n;}if(n>this._bottom){this._bottom=n;}this._width=this._right-this._left;this._height=this._bottom-this._top;}};b.SVGDrawing=a;k=function(m){k.superclass.constructor.apply(this,arguments);};k.NAME="svgShape";b.extend(k,b.BaseGraphic,{init:function(){this.initializer.apply(this,arguments);},initializer:function(m){var n=this;n.createNode();n._graphic=m.graphic;n._updateHandler();},addClass:function(m){var n=this.node;n.className.baseVal=c.trim([n.className.baseVal,m].join(" "));},removeClass:function(m){var n=this.node,o=n.className.baseVal;o=o.replace(new RegExp(m+" "),m).replace(new RegExp(m),"");n.className.baseVal=o;},getXY:function(){var p=this._graphic,n=p.getXY(),m=this.get("x"),o=this.get("y");return[n[0]+m,n[1]+o];},setXY:function(n){var o=this._graphic,m=o.getXY();this.set("x",n[0]-m[0]);this.set("y",n[1]-m[1]);},contains:function(m){return m===b.one(this.node);},compareTo:function(m){var n=this.node;return n===m;},test:function(m){return b.Selector.test(this.node,m);},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:0.5,cy:0.5,fx:0.5,fy:0.5,r:0.5};},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1};},createNode:function(){var m=document.createElementNS("http://www.w3.org/2000/svg","svg:"+this._type),o=this.get("id"),n=this.get("pointerEvents");this.node=m;this.addClass("yui3-"+i+" yui3-"+this.name);if(o){m.setAttribute("id",o);}if(n){m.setAttribute("pointer-events",n);}},isMouseEvent:function(m){if(m.indexOf("mouse")>-1||m.indexOf("click")>-1){return true;}return false;},before:function(n,m){if(this.isMouseEvent(n)){return b.before(n,m,"#"+this.get("id"));}return b.on.apply(this,arguments);},on:function(n,m){if(this.isMouseEvent(n)){return b.on(n,m,"#"+this.get("id"));}return b.on.apply(this,arguments);},after:function(n,m){if(this.isMouseEvent(n)){return b.after(n,m,"#"+this.get("id"));}return b.on.apply(this,arguments);},_strokeChangeHandler:function(r){var p=this.node,q=this.get("stroke"),o,m,s,n;if(q&&q.weight&&q.weight>0){n=q.linejoin||"round";o=parseFloat(q.opacity);m=q.dashstyle||"none";s=c.isArray(m)?m.toString():m;q.color=q.color||"#000000";q.weight=q.weight||1;q.opacity=c.isNumber(o)?o:1;q.linecap=q.linecap||"butt";p.setAttribute("stroke-dasharray",s);p.setAttribute("stroke",q.color);p.setAttribute("stroke-linecap",q.linecap);p.setAttribute("stroke-width",q.weight);p.setAttribute("stroke-opacity",q.opacity);
if(n=="round"||n=="bevel"){p.setAttribute("stroke-linejoin",n);}else{n=parseInt(n,10);if(c.isNumber(n)){p.setAttribute("stroke-miterlimit",Math.max(n,1));p.setAttribute("stroke-linejoin","miter");}}}else{p.setAttribute("stroke","none");}},_fillChangeHandler:function(q){var o=this.node,p=this.get("fill"),m,n;if(p){n=p.type;if(n=="linear"||n=="radial"){this._setGradientFill(p);o.setAttribute("fill","url(#grad"+this.get("id")+")");}else{if(!p.color){o.setAttribute("fill","none");}else{m=parseFloat(p.opacity);m=c.isNumber(m)?m:1;o.setAttribute("fill",p.color);o.setAttribute("fill-opacity",m);}}}else{o.setAttribute("fill","none");}},_setGradientFill:function(I){var v,t,H,D,B=c.isNumber,A=this._graphic,u=I.type,F=A.getGradientNode("grad"+this.get("id"),u),x=I.stops,y=this.get("width"),M=this.get("height"),E=I.rotation,J,L,z,G,N="0%",K="100%",q="50%",n="50%",p=I.cx,m=I.cy,s=I.fx,o=I.fy,C=I.r;if(u=="linear"){F.setAttribute("gradientTransform","rotate("+E+","+(y/2)+", "+(M/2)+")");F.setAttribute("width",y);F.setAttribute("height",M);F.setAttribute("x1",N);F.setAttribute("y1",q);F.setAttribute("x2",K);F.setAttribute("y2",n);F.setAttribute("gradientUnits","userSpaceOnUse");}else{F.setAttribute("cx",(p*100)+"%");F.setAttribute("cy",(m*100)+"%");F.setAttribute("fx",(s*100)+"%");F.setAttribute("fy",(o*100)+"%");F.setAttribute("r",(C*100)+"%");}L=x.length;z=0;for(J=0;J<L;++J){G=x[J];t=G.opacity;H=G.color;v=G.offset||J/(L-1);v=Math.round(v*100)+"%";t=B(t)?t:1;t=Math.max(0,Math.min(1,t));z=(J+1)/L;D=A._createGraphicNode("stop");D.setAttribute("offset",v);D.setAttribute("stop-color",H);D.setAttribute("stop-opacity",t);F.appendChild(D);}},set:function(){var m=this;g.prototype.set.apply(m,arguments);if(m.initialized){m._updateHandler();}},translate:function(m,n){this._translateX=m;this._translateY=n;this._translate.apply(this,arguments);},_translate:function(m,n){this._addTransform("translate",arguments);},skewX:function(m){this._addTransform("skewX",arguments);},skewY:function(m){this._addTransform("skewY",arguments);},_rotation:0,rotate:function(m){this._rotation=m;this._addTransform("rotate",arguments);},scale:function(m){this._addTransform("scale",arguments);},matrix:function(n,m,r,q,p,o){this._addTransform("matrix",arguments);},_addTransform:function(n,m){if(!this._transformArgs){this._transformArgs={};}this._transformArgs[n]=Array.prototype.slice.call(m,0);this._updateTransform();},_updateTransform:function(){var q=this.node,p,o,r,n=q.getAttribute("transform"),s,m;if(this._transformArgs){if(this._transformArgs.hasOwnProperty("rotate")){m=this.get("transformOrigin");o=this._transformArgs.rotate;o[1]=this.get("x")+(this.get("width")*m[0]);o[2]=this.get("y")+(this.get("height")*m[1]);}}for(p in this._transformArgs){if(p&&this._transformArgs.hasOwnProperty(p)){r=p+"("+this._transformArgs[p].toString()+")";if(n&&n.length>0){s=new RegExp(p+"(.*)");if(n.indexOf(p)>-1){n=n.replace(s,r);}else{n+=" "+r;}}else{n=r;}}}this._graphic.addToRedrawQueue(this);if(n){q.setAttribute("transform",n);}},_draw:function(){var m=this.node;m.setAttribute("width",this.get("width"));m.setAttribute("height",this.get("height"));m.setAttribute("x",this.get("x"));m.setAttribute("y",this.get("y"));m.style.left=this.get("x")+"px";m.style.top=this.get("y")+"px";this._fillChangeHandler();this._strokeChangeHandler();this._updateTransform();},_updateHandler:function(m){this._draw();},_translateX:0,_translateY:0,getBounds:function(){var K=this.get("rotation"),o=Math.PI/180,J=parseFloat(parseFloat(Math.sin(K*o)).toFixed(8)),q=parseFloat(parseFloat(Math.cos(K*o)).toFixed(8)),G=this.get("width"),L=this.get("height"),r=this.get("stroke"),E=this.get("x"),C=this.get("y"),M=E+G,t=C+L,v,s,D,A,H,F,B,n,m=0,O=this.get("translateX"),N=this.get("translateY"),p={},I=this.get("transformOrigin"),z=I[0],u=I[1];if(r&&r.weight){m=r.weight;}if(K!==0){z=E+(z*G);u=C+(u*L);v=this._getRotatedCornerX(E,C,z,u,q,J);s=this._getRotatedCornerY(E,C,z,u,q,J);D=this._getRotatedCornerX(E,t,z,u,q,J);A=this._getRotatedCornerY(E,t,z,u,q,J);H=this._getRotatedCornerX(M,t,z,u,q,J);F=this._getRotatedCornerY(M,t,z,u,q,J);B=this._getRotatedCornerX(M,C,z,u,q,J);n=this._getRotatedCornerY(M,C,z,u,q,J);p.left=Math.min(v,Math.min(D,Math.min(H,B)));p.right=Math.max(v,Math.max(D,Math.max(H,B)));p.top=Math.min(s,Math.min(A,Math.min(F,n)));p.bottom=Math.max(s,Math.max(A,Math.max(F,n)));}else{p.left=E-m+O;p.top=C-m+N;p.right=E+G+m+O;p.bottom=C+L+m+N;}return p;},_getRotatedCornerX:function(n,r,m,q,o,p){return(m+(n-m)*o+(r-q)*p);},_getRotatedCornerY:function(n,r,m,q,o,p){return(q-(n-m)*p+(r-q)*o);},destroy:function(){if(this._graphic&&this._graphic._contentNode){this._graphic._contentNode.removeChild(this.node);}}});k.ATTRS={transformOrigin:{valueFn:function(){return[0.5,0.5];}},rotation:{setter:function(m){this.rotate(m);},getter:function(){return this._rotation;}},id:{valueFn:function(){return b.guid();},setter:function(n){var m=this.node;if(m){m.setAttribute("id",n);}return n;}},x:{value:0},y:{value:0},width:{value:0},height:{value:0},visible:{value:true,setter:function(n){var m=n?"visible":"hidden";this.node.style.visibility=m;return n;}},fill:{valueFn:"_getDefaultFill",setter:function(o){var n,m=this.get("fill")||this._getDefaultFill();n=(o)?b.merge(m,o):null;if(n&&n.color){if(n.color===undefined||n.color=="none"){n.color=null;}}return n;}},stroke:{valueFn:"_getDefaultStroke",setter:function(n){var m=this.get("stroke")||this._getDefaultStroke();return(n)?b.merge(m,n):null;}},autoSize:{value:false},pointerEvents:{valueFn:function(){var n="visiblePainted",m=this.node;if(m){m.setAttribute("pointer-events",n);}return n;},setter:function(n){var m=this.node;if(m){m.setAttribute("pointer-events",n);}return n;}},translateX:{getter:function(){return this._translateX;},setter:function(m){this._translateX=m;this._translate(m,this._translateY);return m;}},translateY:{getter:function(){return this._translateY;},setter:function(m){this._translateY=m;this._translate(this._translateX,m);return m;}},gradientNode:{setter:function(m){if(c.isString(m)){m=this._graphic.getGradientNode("linear",m);
}return m;}},autoDraw:{getter:function(){return this._graphic.autoDraw;}},node:{readOnly:true,getter:function(){return this.node;}},graphic:{readOnly:true,getter:function(){return this._graphic;}}};b.SVGShape=k;j=function(m){j.superclass.constructor.apply(this,arguments);};j.NAME="svgPath";b.extend(j,b.SVGShape,b.merge(b.SVGDrawing.prototype,{_left:0,_right:0,_top:0,_bottom:0,_type:"path",_draw:function(){var n,t,m,w,o,v,u,z="",q=this.node,s=this.get("translateX"),r=this.get("translateY"),p=this._left,x=this._top,y=this.get("fill");if(this._pathArray){n=this._pathArray.concat();while(n&&n.length>0){t=n.shift();w=t.length;m=t[0];z+=" "+m+(t[1]-p);switch(m){case"L":case"M":case"Q":for(u=2;u<w;++u){o=(u%2===0)?x:p;o=t[u]-o;z+=", "+o;}break;case"C":for(u=2;u<w;++u){o=(u%2===0)?x:p;v=t[u];v-=o;z+=" "+v;}break;}}if(y&&y.color){z+="z";}if(z){q.setAttribute("d",z);}this._transformArgs=this._transformArgs||{};this._transformArgs.translate=[p+s,x+r];this._path=z;this._fillChangeHandler();this._strokeChangeHandler();this._updateTransform();}},translate:function(m,n){m=parseInt(m,10);n=parseInt(n,10);this._translateX=m;this._translateY=n;this._translate(this._left+m,this._top+n);},_updateHandler:function(){},end:function(){this._draw();this._graphic.addToRedrawQueue(this);},clear:function(){this._left=0;this._right=0;this._top=0;this._bottom=0;this._pathArray=[];this._path="";},getBounds:function(){var n=0,p={},q=this.get("stroke"),o=this.get("translateX"),m=this.get("translateY");if(q&&q.weight){n=q.weight;}p.left=this._left-n+o;p.top=this._top-n+m;p.right=(this._right-this._left)+n+o;p.bottom=(this._bottom-this._top)+n+m;return p;},_path:""}));j.ATTRS=b.merge(b.SVGShape.ATTRS,{path:{readOnly:true,getter:function(){return this._path;}},width:{getter:function(){var m=Math.max(this._right-this._left,0);return m;}},height:{getter:function(){return Math.max(this._bottom-this._top,0);}}});b.SVGPath=j;h=function(){h.superclass.constructor.apply(this,arguments);};h.NAME="svgRect";b.extend(h,b.SVGShape,{_type:"rect"});h.ATTRS=b.SVGShape.ATTRS;b.SVGRect=h;e=function(m){e.superclass.constructor.apply(this,arguments);};e.NAME="svgEllipse";b.extend(e,k,{_type:"ellipse",_draw:function(){var m=this.node,u=this.get("width"),p=this.get("height"),t=this.get("x"),r=this.get("y"),s=u*0.5,q=p*0.5,o=t+s,n=r+q;m.setAttribute("rx",s);m.setAttribute("ry",q);m.setAttribute("cx",o);m.setAttribute("cy",n);this._fillChangeHandler();this._strokeChangeHandler();this._updateTransform();}});e.ATTRS=b.merge(k.ATTRS,{xRadius:{setter:function(m){this.set("width",m/2);},getter:function(){var m=this.get("width");if(m){m*=0.5;}return m;}},yRadius:{setter:function(m){this.set("height",m/2);},getter:function(){var m=this.get("height");if(m){m*=0.5;}return m;}}});b.SVGEllipse=e;f=function(m){f.superclass.constructor.apply(this,arguments);};f.NAME="svgCircle";b.extend(f,b.SVGShape,{_type:"circle",_draw:function(){var p=this.node,o=this.get("x"),r=this.get("y"),n=this.get("radius"),m=o+n,q=r+n;p.setAttribute("r",n);p.setAttribute("cx",m);p.setAttribute("cy",q);this._fillChangeHandler();this._strokeChangeHandler();this._updateTransform();}});f.ATTRS=b.merge(b.SVGShape.ATTRS,{width:{setter:function(m){this.set("radius",m/2);return m;},getter:function(){return this.get("radius")*2;}},height:{setter:function(m){this.set("radius",m/2);return m;},getter:function(){return this.get("radius")*2;}},radius:{value:0}});b.SVGCircle=f;SVGPieSlice=function(){SVGPieSlice.superclass.constructor.apply(this,arguments);};SVGPieSlice.NAME="svgPieSlice";b.extend(SVGPieSlice,b.SVGPath,{_type:"path",_updateHandler:function(q){var n=this.get("cx"),r=this.get("cy"),p=this.get("startAngle"),o=this.get("arc"),m=this.get("radius");this.clear();this.drawWedge(n,r,p,o,m);this._draw();}});SVGPieSlice.ATTRS=b.mix(b.SVGPath.ATTRS,{cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}});b.SVGPieSlice=SVGPieSlice;d=function(m){d.superclass.constructor.apply(this,arguments);};d.NAME="svgGraphic";d.ATTRS={render:{},id:{valueFn:function(){return b.guid();},setter:function(n){var m=this._node;if(m){m.setAttribute("id",n);}return n;}},shapes:{readOnly:true,getter:function(){return this._shapes;}},contentBounds:{readOnly:true,getter:function(){return this._contentBounds;}},node:{readOnly:true,getter:function(){return this._node;}},width:{setter:function(m){this._node.style.width=m+"px";return m;}},height:{setter:function(m){this._node.style.height=m+"px";return m;}},autoSize:{value:false},resizeDown:{getter:function(){return this._resizeDown;},setter:function(m){this._resizeDown=m;this._redraw();return m;}},x:{getter:function(){return this._x;},setter:function(m){this._x=m;if(this._node){this._node.style.left=m+"px";}return m;}},y:{getter:function(){return this._y;},setter:function(m){this._y=m;if(this._node){this._node.style.top=m+"px";}return m;}},autoDraw:{value:true},visible:{value:true,setter:function(m){this._toggleVisible(m);return m;}},pointerEvents:{value:"none"}};b.extend(d,b.BaseGraphic,{_x:0,_y:0,getXY:function(){var m=b.one(this._node),n;if(m){n=m.getXY();}return n;},_resizeDown:false,initializer:function(){var m=this.get("render");this._shapes={};this._contentBounds={left:0,top:0,right:0,bottom:0};this._gradients={};this._node=l.createElement("div");this._node.style.position="absolute";this._node.style.left=this.get("x")+"px";this._node.style.top=this.get("y")+"px";this._contentNode=this._createGraphics();this._contentNode.setAttribute("id",this.get("id"));this._node.appendChild(this._contentNode);if(m){this.render(m);}},render:function(p){var m=b.one(p),n=this.get("width")||parseInt(m.getComputedStyle("width"),10),o=this.get("height")||parseInt(m.getComputedStyle("height"),10);m=m||l.body;m.appendChild(this._node);this.parentNode=m;this.set("width",n);this.set("height",o);this.parentNode=m;return this;},destroy:function(){this.removeAllShapes();this._removeChildren(this._node);if(this._node&&this._node.parentNode){this._node.parentNode.removeChild(this._node);
}},getShape:function(m){m.graphic=this;var n=new this._shapeClass[m.type](m);this.addShape(n);return n;},addShape:function(n){var o=n.node,m=this._frag||this._contentNode;if(this.get("autoDraw")){m.appendChild(o);}else{this._getDocFrag().appendChild(o);}},removeShape:function(m){if(!(m instanceof k)){if(c.isString(m)){m=this._shapes[m];}}if(m&&m instanceof k){m.destroy();delete this._shapes[m.get("id")];}if(this.get("autoDraw")){this._redraw();}return m;},removeAllShapes:function(){var m=this._shapes,n;for(n in m){if(m.hasOwnProperty(n)){m[n].destroy();}}this._shapes={};},_removeChildren:function(m){if(m.hasChildNodes()){var n;while(m.firstChild){n=m.firstChild;this._removeChildren(n);m.removeChild(n);}}},clear:function(){this.removeAllShapes();},_toggleVisible:function(p){var o,n=this._shapes,m=p?"visible":"hidden";if(n){for(o in n){if(n.hasOwnProperty(o)){n[o].set("visible",p);}}}this._contentNode.style.visibility=m;this._node.style.visibility=m;},_shapeClass:{circle:b.SVGCircle,rect:b.SVGRect,path:b.SVGPath,ellipse:b.SVGEllipse,pieslice:b.SVGPieSlice},getShapeById:function(n){var m=this._shapes[n];return m;},batch:function(n){var m=this.get("autoDraw");this.set("autoDraw",false);n();this._redraw();this.set("autoDraw",m);},_getDocFrag:function(){if(!this._frag){this._frag=document.createDocumentFragment();}return this._frag;},_redraw:function(){var m=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds;this._contentNode.style.left=m.left+"px";this._contentNode.style.top=m.top+"px";this._contentNode.setAttribute("width",m.width);this._contentNode.setAttribute("height",m.height);this._contentNode.style.width=m.width+"px";this._contentNode.style.height=m.height+"px";this._contentNode.setAttribute("viewBox",""+m.left+" "+m.top+" "+m.width+" "+m.height+"");if(this.get("autoSize")){this.set("width",m.right);this.set("height",m.bottom);}if(this._frag){this._contentNode.appendChild(this._frag);this._frag=null;}},addToRedrawQueue:function(m){var o,n;this._shapes[m.get("id")]=m;if(!this.get("resizeDown")){o=m.getBounds();n=this._contentBounds;n.left=n.left<o.left?n.left:o.left;n.top=n.top<o.top?n.top:o.top;n.right=n.right>o.right?n.right:o.right;n.bottom=n.bottom>o.bottom?n.bottom:o.bottom;n.width=n.right-n.left;n.height=n.bottom-n.top;this._contentBounds=n;}if(this.get("autoDraw")){this._redraw();}},_getUpdatedContentBounds:function(){var q,o,n,m=this._shapes,p={left:0,top:0,right:0,bottom:0};for(o in m){if(m.hasOwnProperty(o)){n=m[o];q=n.getBounds();p.left=Math.min(p.left,q.left);p.top=Math.min(p.top,q.top);p.right=Math.max(p.right,q.right);p.bottom=Math.max(p.bottom,q.bottom);}}p.width=p.right-p.left;p.height=p.bottom-p.top;this._contentBounds=p;return p;},_createGraphics:function(){var m=this._createGraphicNode("svg"),n=this.get("pointerEvents");m.style.position="absolute";m.style.top="px";m.style.left="0px";m.style.overflow="auto";m.setAttribute("overflow","auto");m.setAttribute("pointer-events",n);return m;},_createGraphicNode:function(o,m){var p=document.createElementNS("http://www.w3.org/2000/svg","svg:"+o),n=m||"none";if(o!=="defs"&&o!=="stop"&&o!=="linearGradient"&&o!="radialGradient"){p.setAttribute("pointer-events",n);}return p;},getGradientNode:function(o,p){var m=this._gradients,q,n=p+"Gradient";if(m.hasOwnProperty(o)&&m[o].tagName.indexOf(p)>-1){q=this._gradients[o];}else{q=this._createGraphicNode(n);if(!this._defs){this._defs=this._createGraphicNode("defs");this._contentNode.appendChild(this._defs);}this._defs.appendChild(q);o=o||"gradient"+Math.round(100000*Math.random());q.setAttribute("id",o);if(m.hasOwnProperty(o)){this._defs.removeChild(m[o]);}m[o]=q;}return q;}});b.SVGGraphic=d;},"@VERSION@",{requires:["graphics"],skinnable:false});