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