//>>built define("dojox/gfx/svg",["dojo/_base/lang","dojo/_base/sniff","dojo/_base/window","dojo/dom","dojo/_base/declare","dojo/_base/array","dojo/dom-geometry","dojo/dom-attr","dojo/_base/Color","./_base","./shape","./path"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,g,gs,_a){ var _b=g.svg={}; _b.useSvgWeb=(typeof window.svgweb!="undefined"); var _c=navigator.userAgent,_d=_2("ios"),_e=_2("android"),_f=_2("chrome")||(_e&&_e>=4)?"auto":"optimizeLegibility"; function _10(ns,_11){ if(_3.doc.createElementNS){ return _3.doc.createElementNS(ns,_11); }else{ return _3.doc.createElement(_11); } }; function _12(_13,ns,_14,_15){ if(_13.setAttributeNS){ return _13.setAttributeNS(ns,_14,_15); }else{ return _13.setAttribute(_14,_15); } }; function _16(_17){ if(_b.useSvgWeb){ return _3.doc.createTextNode(_17,true); }else{ return _3.doc.createTextNode(_17); } }; function _18(){ if(_b.useSvgWeb){ return _3.doc.createDocumentFragment(true); }else{ return _3.doc.createDocumentFragment(); } }; _b.xmlns={xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg"}; _b.getRef=function(_19){ if(!_19||_19=="none"){ return null; } if(_19.match(/^url\(#.+\)$/)){ return _4.byId(_19.slice(5,-1)); } if(_19.match(/^#dojoUnique\d+$/)){ return _4.byId(_19.slice(1)); } return null; }; _b.dasharray={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]}; var _1a=0; _b.Shape=_5("dojox.gfx.svg.Shape",gs.Shape,{destroy:function(){ if(this.fillStyle&&"type" in this.fillStyle){ var _1b=this.rawNode.getAttribute("fill"),ref=_b.getRef(_1b); if(ref){ ref.parentNode.removeChild(ref); } } if(this.clip){ var _1c=this.rawNode.getAttribute("clip-path"); if(_1c){ var _1d=_4.byId(_1c.match(/gfx_clip[\d]+/)[0]); _1d&&_1d.parentNode.removeChild(_1d); } } this.rawNode=null; gs.Shape.prototype.destroy.apply(this,arguments); },setFill:function(_1e){ if(!_1e){ this.fillStyle=null; this.rawNode.setAttribute("fill","none"); this.rawNode.setAttribute("fill-opacity",0); return this; } var f; var _1f=function(x){ this.setAttribute(x,f[x].toFixed(8)); }; if(typeof (_1e)=="object"&&"type" in _1e){ switch(_1e.type){ case "linear": f=g.makeParameters(g.defaultLinearGradient,_1e); var _20=this._setFillObject(f,"linearGradient"); _6.forEach(["x1","y1","x2","y2"],_1f,_20); break; case "radial": f=g.makeParameters(g.defaultRadialGradient,_1e); var _21=this._setFillObject(f,"radialGradient"); _6.forEach(["cx","cy","r"],_1f,_21); break; case "pattern": f=g.makeParameters(g.defaultPattern,_1e); var _22=this._setFillObject(f,"pattern"); _6.forEach(["x","y","width","height"],_1f,_22); break; } this.fillStyle=f; return this; } f=g.normalizeColor(_1e); this.fillStyle=f; this.rawNode.setAttribute("fill",f.toCss()); this.rawNode.setAttribute("fill-opacity",f.a); this.rawNode.setAttribute("fill-rule","evenodd"); return this; },setStroke:function(_23){ var rn=this.rawNode; if(!_23){ this.strokeStyle=null; rn.setAttribute("stroke","none"); rn.setAttribute("stroke-opacity",0); return this; } if(typeof _23=="string"||_1.isArray(_23)||_23 instanceof _9){ _23={color:_23}; } var s=this.strokeStyle=g.makeParameters(g.defaultStroke,_23); s.color=g.normalizeColor(s.color); if(s){ rn.setAttribute("stroke",s.color.toCss()); rn.setAttribute("stroke-opacity",s.color.a); rn.setAttribute("stroke-width",s.width); rn.setAttribute("stroke-linecap",s.cap); if(typeof s.join=="number"){ rn.setAttribute("stroke-linejoin","miter"); rn.setAttribute("stroke-miterlimit",s.join); }else{ rn.setAttribute("stroke-linejoin",s.join); } var da=s.style.toLowerCase(); if(da in _b.dasharray){ da=_b.dasharray[da]; } if(da instanceof Array){ da=_1._toArray(da); for(var i=0;i534; _b.Surface=_5("dojox.gfx.svg.Surface",gs.Surface,{constructor:function(){ gs.Container._init.call(this); },destroy:function(){ gs.Container.clear.call(this,true); this.defNode=null; this.inherited(arguments); },setDimensions:function(_4d,_4e){ if(!this.rawNode){ return this; } this.rawNode.setAttribute("width",_4d); this.rawNode.setAttribute("height",_4e); if(_4b){ this.rawNode.style.width=_4d; this.rawNode.style.height=_4e; } return this; },getDimensions:function(){ var t=this.rawNode?{width:g.normalizedLength(this.rawNode.getAttribute("width")),height:g.normalizedLength(this.rawNode.getAttribute("height"))}:null; return t; }}); _b.createSurface=function(_4f,_50,_51){ var s=new _b.Surface(); s.rawNode=_10(_b.xmlns.svg,"svg"); s.rawNode.setAttribute("overflow","hidden"); if(_50){ s.rawNode.setAttribute("width",_50); } if(_51){ s.rawNode.setAttribute("height",_51); } var _52=_10(_b.xmlns.svg,"defs"); s.rawNode.appendChild(_52); s.defNode=_52; s._parent=_4.byId(_4f); s._parent.appendChild(s.rawNode); return s; }; var _53={_setFont:function(){ var f=this.fontStyle; this.rawNode.setAttribute("font-style",f.style); this.rawNode.setAttribute("font-variant",f.variant); this.rawNode.setAttribute("font-weight",f.weight); this.rawNode.setAttribute("font-size",f.size); this.rawNode.setAttribute("font-family",f.family); }}; var C=gs.Container,_54={openBatch:function(){ this.fragment=_18(); },closeBatch:function(){ if(this.fragment){ this.rawNode.appendChild(this.fragment); delete this.fragment; } },add:function(_55){ if(this!=_55.getParent()){ if(this.fragment){ this.fragment.appendChild(_55.rawNode); }else{ this.rawNode.appendChild(_55.rawNode); } C.add.apply(this,arguments); _55.setClip(_55.clip); } return this; },remove:function(_56,_57){ if(this==_56.getParent()){ if(this.rawNode==_56.rawNode.parentNode){ this.rawNode.removeChild(_56.rawNode); } if(this.fragment&&this.fragment==_56.rawNode.parentNode){ this.fragment.removeChild(_56.rawNode); } _56._removeClipNode(); C.remove.apply(this,arguments); } return this; },clear:function(){ var r=this.rawNode; while(r.lastChild){ r.removeChild(r.lastChild); } var _58=this.defNode; if(_58){ while(_58.lastChild){ _58.removeChild(_58.lastChild); } r.appendChild(_58); } return C.clear.apply(this,arguments); },getBoundingBox:C.getBoundingBox,_moveChildToFront:C._moveChildToFront,_moveChildToBack:C._moveChildToBack}; var _59={createObject:function(_5a,_5b){ if(!this.rawNode){ return null; } var _5c=new _5a(),_5d=_10(_b.xmlns.svg,_5a.nodeType); _5c.setRawNode(_5d); _5c.setShape(_5b); this.add(_5c); return _5c; }}; _1.extend(_b.Text,_53); _1.extend(_b.TextPath,_53); _1.extend(_b.Group,_54); _1.extend(_b.Group,gs.Creator); _1.extend(_b.Group,_59); _1.extend(_b.Surface,_54); _1.extend(_b.Surface,gs.Creator); _1.extend(_b.Surface,_59); _b.fixTarget=function(_5e,_5f){ if(!_5e.gfxTarget){ if(_d&&_5e.target.wholeText){ _5e.gfxTarget=gs.byId(_5e.target.parentElement.__gfxObject__); }else{ _5e.gfxTarget=gs.byId(_5e.target.__gfxObject__); } } return true; }; if(_b.useSvgWeb){ _b.createSurface=function(_60,_61,_62){ var s=new _b.Surface(); if(!_61||!_62){ var pos=_7.position(_60); _61=_61||pos.w; _62=_62||pos.h; } _60=_4.byId(_60); var id=_60.id?_60.id+"_svgweb":g._base._getUniqueId(); var _63=_10(_b.xmlns.svg,"svg"); _63.id=id; _63.setAttribute("width",_61); _63.setAttribute("height",_62); svgweb.appendChild(_63,_60); _63.addEventListener("SVGLoad",function(){ s.rawNode=this; s.isLoaded=true; var _64=_10(_b.xmlns.svg,"defs"); s.rawNode.appendChild(_64); s.defNode=_64; if(s.onLoad){ s.onLoad(s); } },false); s.isLoaded=false; return s; }; _b.Surface.extend({destroy:function(){ var _65=this.rawNode; svgweb.removeChild(_65,_65.parentNode); }}); var _66={connect:function(_67,_68,_69){ if(_67.substring(0,2)==="on"){ _67=_67.substring(2); } if(arguments.length==2){ _69=_68; }else{ _69=_1.hitch(_68,_69); } this.getEventSource().addEventListener(_67,_69,false); return [this,_67,_69]; },disconnect:function(_6a){ this.getEventSource().removeEventListener(_6a[1],_6a[2],false); delete _6a[0]; }}; _1.extend(_b.Shape,_66); _1.extend(_b.Surface,_66); } return _b; });