summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js14
-rw-r--r--js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js.uncompressed.js19150
2 files changed, 19164 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js b/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js
new file mode 100644
index 0000000..7f4eaa4
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+dojo._xdResourceLoaded(function(_1,_2,_3){_1.loadInit(function(){var _4=_1.getObject("dojox.gfx",true),sl,_5,_6;while(!_4.renderer){if(_1.config.forceGfxRenderer){_3.gfx.renderer=_1.config.forceGfxRenderer;break;}var _7=(typeof _1.config.gfxRenderer=="string"?_1.config.gfxRenderer:"svg,vml,canvas,silverlight").split(",");for(var i=0;i<_7.length;++i){switch(_7[i]){case "svg":if("SVGAngle" in _1.global){_3.gfx.renderer="svg";}break;case "vml":if(_1.isIE){_3.gfx.renderer="vml";}break;case "silverlight":try{if(_1.isIE){sl=new ActiveXObject("AgControl.AgControl");if(sl&&sl.IsVersionSupported("1.0")){_5=true;}}else{if(navigator.plugins["Silverlight Plug-In"]){_5=true;}}}catch(e){_5=false;}finally{sl=null;}if(_5){_3.gfx.renderer="silverlight";}break;case "canvas":if(_1.global.CanvasRenderingContext2D){_3.gfx.renderer="canvas";}break;}if(_4.renderer){break;}}break;}if(_1.config.isDebug){}if(_4[_4.renderer]){_4.switchTo(_4.renderer);}else{_4.loadAndSwitch=_4.renderer;_1["require"]("dojox.gfx."+_4.renderer);}});return {depends:[["provide","dijit._base.manager"],["provide","dojo.Stateful"],["provide","dijit._WidgetBase"],["provide","dojo.window"],["provide","dijit._base.focus"],["provide","dojo.AdapterRegistry"],["provide","dijit._base.place"],["provide","dijit._base.window"],["provide","dijit._base.popup"],["provide","dijit._base.scroll"],["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dijit._base.typematic"],["provide","dijit._base.wai"],["provide","dijit._base"],["provide","dijit._Widget"],["provide","dojox.gfx.matrix"],["provide","dojox.gfx._base"],["provide","dojox.gfx"],["provide","dojox.lang.functional.lambda"],["provide","dojox.lang.functional.array"],["provide","dojox.lang.functional.object"],["provide","dojox.lang.functional"],["provide","dojox.lang.functional.fold"],["provide","dojox.lang.functional.reversed"],["provide","dojox.charting.Element"],["provide","dojo.colors"],["provide","dojox.color._base"],["provide","dojox.color"],["provide","dojox.color.Palette"],["provide","dojox.lang.utils"],["provide","dojox.gfx.gradutils"],["provide","dojox.charting.Theme"],["provide","dojox.charting.Series"],["provide","dojox.charting.axis2d.common"],["provide","dojox.charting.Chart"],["provide","dojox.charting.widget.Chart"],["provide","dojo.fx.easing"],["provide","dojox.gfx.fx"],["provide","dojox.charting.action2d.Base"],["provide","dojox.charting.action2d.Highlight"],["provide","dojo.fx.Toggler"],["provide","dojo.fx"],["provide","dojox.charting.action2d.Magnify"],["provide","dojox.lang.functional.scan"],["provide","dojox.charting.action2d.MoveSlice"],["provide","dojox.charting.action2d.Shake"],["provide","dojo.string"],["provide","dojo.date.stamp"],["provide","dojo.parser"],["provide","dojo.cache"],["provide","dijit._Templated"],["provide","dijit.Tooltip"],["provide","dojox.charting.action2d.Tooltip"],["provide","dojox.charting.scaler.common"],["provide","dojox.charting.scaler.linear"],["provide","dojox.charting.axis2d.Base"],["provide","dojox.charting.axis2d.Invisible"],["provide","dojox.charting.axis2d.Default"],["provide","dojox.charting.plot2d.common"],["provide","dojox.charting.scaler.primitive"],["provide","dojox.charting.plot2d._PlotEvents"],["provide","dojox.charting.plot2d.Base"],["provide","dojox.charting.plot2d.Default"],["provide","dojox.charting.plot2d.Lines"],["provide","dojox.charting.plot2d.Areas"],["provide","dojox.charting.plot2d.Markers"],["provide","dojox.charting.plot2d.MarkersOnly"],["provide","dojox.charting.plot2d.Scatter"],["provide","dojox.lang.functional.sequence"],["provide","dojox.charting.plot2d.Stacked"],["provide","dojox.charting.plot2d.StackedLines"],["provide","dojox.charting.plot2d.StackedAreas"],["provide","dojox.charting.plot2d.Columns"],["provide","dojox.charting.plot2d.StackedColumns"],["provide","dojox.charting.plot2d.ClusteredColumns"],["provide","dojox.charting.plot2d.Bars"],["provide","dojox.charting.plot2d.StackedBars"],["provide","dojox.charting.plot2d.ClusteredBars"],["provide","dojox.charting.plot2d.Grid"],["provide","dojox.charting.plot2d.Pie"],["provide","dojox.charting.plot2d.Bubble"],["provide","dojox.charting.plot2d.Candlesticks"],["provide","dojox.charting.plot2d.OHLC"],["provide","dojox.charting.plot2d.Spider"],["provide","dojox.charting.Chart2D"],["provide","dojox.charting.widget.Chart2D"],["provide","dojox.charting.themes.GreySkies"],["provide","dojox.charting.widget.Sparkline"],["provide","dojox.charting.widget.Legend"]],defineResource:function(_8,_9,_a){if(!_8._hasResource["dijit._base.manager"]){_8._hasResource["dijit._base.manager"]=true;_8.provide("dijit._base.manager");_8.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0;},add:function(_b){if(this._hash[_b.id]){throw new Error("Tried to register widget with id=="+_b.id+" but that id is already registered");}this._hash[_b.id]=_b;this.length++;},remove:function(id){if(this._hash[id]){delete this._hash[id];this.length--;}},forEach:function(_c,_d){_d=_d||_8.global;var i=0,id;for(id in this._hash){_c.call(_d,this._hash[id],i++,this._hash);}return this;},filter:function(_e,_f){_f=_f||_8.global;var res=new _9.WidgetSet(),i=0,id;for(id in this._hash){var w=this._hash[id];if(_e.call(_f,w,i++,this._hash)){res.add(w);}}return res;},byId:function(id){return this._hash[id];},byClass:function(cls){var res=new _9.WidgetSet(),id,_10;for(id in this._hash){_10=this._hash[id];if(_10.declaredClass==cls){res.add(_10);}}return res;},toArray:function(){var ar=[];for(var id in this._hash){ar.push(this._hash[id]);}return ar;},map:function(_11,_12){return _8.map(this.toArray(),_11,_12);},every:function(_13,_14){_14=_14||_8.global;var x=0,i;for(i in this._hash){if(!_13.call(_14,this._hash[i],x++,this._hash)){return false;}}return true;},some:function(_15,_16){_16=_16||_8.global;var x=0,i;for(i in this._hash){if(_15.call(_16,this._hash[i],x++,this._hash)){return true;}}return false;}});(function(){_9.registry=new _9.WidgetSet();var _17=_9.registry._hash,_18=_8.attr,_19=_8.hasAttr,_1a=_8.style;_9.byId=function(id){return typeof id=="string"?_17[id]:id;};var _1b={};_9.getUniqueId=function(_1c){var id;do{id=_1c+"_"+(_1c in _1b?++_1b[_1c]:_1b[_1c]=0);}while(_17[id]);return _9._scopeName=="dijit"?id:_9._scopeName+"_"+id;};_9.findWidgets=function(_1d){var _1e=[];function _1f(_20){for(var _21=_20.firstChild;_21;_21=_21.nextSibling){if(_21.nodeType==1){var _22=_21.getAttribute("widgetId");if(_22){var _23=_17[_22];if(_23){_1e.push(_23);}}else{_1f(_21);}}}};_1f(_1d);return _1e;};_9._destroyAll=function(){_9._curFocus=null;_9._prevFocus=null;_9._activeStack=[];_8.forEach(_9.findWidgets(_8.body()),function(_24){if(!_24._destroyed){if(_24.destroyRecursive){_24.destroyRecursive();}else{if(_24.destroy){_24.destroy();}}}});};if(_8.isIE){_8.addOnWindowUnload(function(){_9._destroyAll();});}_9.byNode=function(_25){return _17[_25.getAttribute("widgetId")];};_9.getEnclosingWidget=function(_26){while(_26){var id=_26.getAttribute&&_26.getAttribute("widgetId");if(id){return _17[id];}_26=_26.parentNode;}return null;};var _27=(_9._isElementShown=function(_28){var s=_1a(_28);return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_18(_28,"type")!="hidden");});_9.hasDefaultTabStop=function(_29){switch(_29.nodeName.toLowerCase()){case "a":return _19(_29,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var _2a;try{var _2b=_29.contentDocument;if("designMode" in _2b&&_2b.designMode=="on"){return true;}_2a=_2b.body;}catch(e1){try{_2a=_29.contentWindow.document.body;}catch(e2){return false;}}return _2a.contentEditable=="true"||(_2a.firstChild&&_2a.firstChild.contentEditable=="true");default:return _29.contentEditable=="true";}};var _2c=(_9.isTabNavigable=function(_2d){if(_18(_2d,"disabled")){return false;}else{if(_19(_2d,"tabIndex")){return _18(_2d,"tabIndex")>=0;}else{return _9.hasDefaultTabStop(_2d);}}});_9._getTabNavigable=function(_2e){var _2f,_30,_31,_32,_33,_34,_35={};function _36(_37){return _37&&_37.tagName.toLowerCase()=="input"&&_37.type&&_37.type.toLowerCase()=="radio"&&_37.name&&_37.name.toLowerCase();};var _38=function(_39){_8.query("> *",_39).forEach(function(_3a){if((_8.isIE&&_3a.scopeName!=="HTML")||!_27(_3a)){return;}if(_2c(_3a)){var _3b=_18(_3a,"tabIndex");if(!_19(_3a,"tabIndex")||_3b==0){if(!_2f){_2f=_3a;}_30=_3a;}else{if(_3b>0){if(!_31||_3b<_32){_32=_3b;_31=_3a;}if(!_33||_3b>=_34){_34=_3b;_33=_3a;}}}var rn=_36(_3a);if(_8.attr(_3a,"checked")&&rn){_35[rn]=_3a;}}if(_3a.nodeName.toUpperCase()!="SELECT"){_38(_3a);}});};if(_27(_2e)){_38(_2e);}function rs(_3c){return _35[_36(_3c)]||_3c;};return {first:rs(_2f),last:rs(_30),lowest:rs(_31),highest:rs(_33)};};_9.getFirstInTabbingOrder=function(_3d){var _3e=_9._getTabNavigable(_8.byId(_3d));return _3e.lowest?_3e.lowest:_3e.first;};_9.getLastInTabbingOrder=function(_3f){var _40=_9._getTabNavigable(_8.byId(_3f));return _40.last?_40.last:_40.highest;};_9.defaultDuration=_8.config["defaultDuration"]||200;})();}if(!_8._hasResource["dojo.Stateful"]){_8._hasResource["dojo.Stateful"]=true;_8.provide("dojo.Stateful");_8.declare("dojo.Stateful",null,{postscript:function(_41){if(_41){_8.mixin(this,_41);}},get:function(_42){return this[_42];},set:function(_43,_44){if(typeof _43==="object"){for(var x in _43){this.set(x,_43[x]);}return this;}var _45=this[_43];this[_43]=_44;if(this._watchCallbacks){this._watchCallbacks(_43,_45,_44);}return this;},watch:function(_46,_47){var _48=this._watchCallbacks;if(!_48){var _49=this;_48=this._watchCallbacks=function(_4a,_4b,_4c,_4d){var _4e=function(_4f){if(_4f){_4f=_4f.slice();for(var i=0,l=_4f.length;i<l;i++){try{_4f[i].call(_49,_4a,_4b,_4c);}catch(e){console.error(e);}}}};_4e(_48["_"+_4a]);if(!_4d){_4e(_48["*"]);}};}if(!_47&&typeof _46==="function"){_47=_46;_46="*";}else{_46="_"+_46;}var _50=_48[_46];if(typeof _50!=="object"){_50=_48[_46]=[];}_50.push(_47);return {unwatch:function(){_50.splice(_8.indexOf(_50,_47),1);}};}});}if(!_8._hasResource["dijit._WidgetBase"]){_8._hasResource["dijit._WidgetBase"]=true;_8.provide("dijit._WidgetBase");(function(){_8.declare("dijit._WidgetBase",_8.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(_8.config.blankGif||_8.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_51,_52){this.create(_51,_52);},create:function(_53,_54){this.srcNodeRef=_8.byId(_54);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_53){this.params=_53;_8._mixin(this,_53);}this.postMixInProperties();if(!this.id){this.id=_9.getUniqueId(this.declaredClass.replace(/\./g,"_"));}_9.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _55=this.srcNodeRef;if(_55&&_55.parentNode&&this.domNode!==_55){_55.parentNode.replaceChild(this.domNode,_55);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _56=function(_57,_58){if((_58.params&&_57 in _58.params)||_58[_57]){_58.set(_57,_58[_57]);}};for(var _59 in this.attributeMap){_56(_59,this);}_8.forEach(this._getSetterAttributes(),function(a){if(!(a in this.attributeMap)){_56(a,this);}},this);},_getSetterAttributes:function(){var _5a=this.constructor;if(!_5a._setterAttrs){var r=(_5a._setterAttrs=[]),_5b,_5c=_5a.prototype;for(var _5d in _5c){if(_8.isFunction(_5c[_5d])&&(_5b=_5d.match(/^_set([a-zA-Z]*)Attr$/))&&_5b[1]){r.push(_5b[1].charAt(0).toLowerCase()+_5b[1].substr(1));}}}return _5a._setterAttrs;},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||_8.create("div");}if(this.baseClass){var _5e=this.baseClass.split(" ");if(!this.isLeftToRight()){_5e=_5e.concat(_8.map(_5e,function(_5f){return _5f+"Rtl";}));}_8.addClass(this.domNode,_5e);}},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_60){this._beingDestroyed=true;this.destroyDescendants(_60);this.destroy(_60);},destroy:function(_61){this._beingDestroyed=true;this.uninitialize();var d=_8,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_62){dfe(_62,d.disconnect);});dfe(this._subscribes,function(_63){dun(_63);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_61);_9.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_64){if(this.bgIframe){this.bgIframe.destroy(_64);delete this.bgIframe;}if(this.domNode){if(_64){_8.removeAttr(this.domNode,"widgetId");}else{_8.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_64){_8.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_65){_8.forEach(this.getChildren(),function(_66){if(_66.destroyRecursive){_66.destroyRecursive(_65);}});},uninitialize:function(){return false;},_setClassAttr:function(_67){var _68=this[this.attributeMap["class"]||"domNode"];_8.replaceClass(_68,_67,this["class"]);this._set("class",_67);},_setStyleAttr:function(_69){var _6a=this[this.attributeMap.style||"domNode"];if(_8.isObject(_69)){_8.style(_6a,_69);}else{if(_6a.style.cssText){_6a.style.cssText+="; "+_69;}else{_6a.style.cssText=_69;}}this._set("style",_69);},_attrToDom:function(_6b,_6c){var _6d=this.attributeMap[_6b];_8.forEach(_8.isArray(_6d)?_6d:[_6d],function(_6e){var _6f=this[_6e.node||_6e||"domNode"];var _70=_6e.type||"attribute";switch(_70){case "attribute":if(_8.isFunction(_6c)){_6c=_8.hitch(this,_6c);}var _71=_6e.attribute?_6e.attribute:(/^on[A-Z][a-zA-Z]*$/.test(_6b)?_6b.toLowerCase():_6b);_8.attr(_6f,_71,_6c);break;case "innerText":_6f.innerHTML="";_6f.appendChild(_8.doc.createTextNode(_6c));break;case "innerHTML":_6f.innerHTML=_6c;break;case "class":_8.replaceClass(_6f,_6c,this[_6b]);break;}},this);},get:function(_72){var _73=this._getAttrNames(_72);return this[_73.g]?this[_73.g]():this[_72];},set:function(_74,_75){if(typeof _74==="object"){for(var x in _74){this.set(x,_74[x]);}return this;}var _76=this._getAttrNames(_74);if(this[_76.s]){var _77=this[_76.s].apply(this,Array.prototype.slice.call(arguments,1));}else{if(_74 in this.attributeMap){this._attrToDom(_74,_75);}this._set(_74,_75);}return _77||this;},_attrPairNames:{},_getAttrNames:function(_78){var apn=this._attrPairNames;if(apn[_78]){return apn[_78];}var uc=_78.charAt(0).toUpperCase()+_78.substr(1);return (apn[_78]={n:_78+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(_79,_7a){var _7b=this[_79];this[_79]=_7a;if(this._watchCallbacks&&this._created&&_7a!==_7b){this._watchCallbacks(_79,_7b,_7a);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?_8.query("[widgetId]",this.containerNode).map(_9.byNode):[];},getChildren:function(){return this.containerNode?_9.findWidgets(this.containerNode):[];},connect:function(obj,_7c,_7d){var _7e=[_8._connect(obj,_7c,this,_7d)];this._connects.push(_7e);return _7e;},disconnect:function(_7f){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_7f){_8.forEach(_7f,_8.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_80,_81){var _82=_8.subscribe(_80,this,_81);this._subscribes.push(_82);return _82;},unsubscribe:function(_83){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_83){_8.unsubscribe(_83);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):_8._isBodyLtr();},placeAt:function(_84,_85){if(_84.declaredClass&&_84.addChild){_84.addChild(this,_85);}else{_8.place(this.domNode,_84,_85);}return this;}});})();}if(!_8._hasResource["dojo.window"]){_8._hasResource["dojo.window"]=true;_8.provide("dojo.window");_8.getObject("window",true,_8);_8.window.getBox=function(){var _86=(_8.doc.compatMode=="BackCompat")?_8.body():_8.doc.documentElement;var _87=_8._docScroll();return {w:_86.clientWidth,h:_86.clientHeight,l:_87.x,t:_87.y};};_8.window.get=function(doc){if(_8.isIE&&window!==document.parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}return doc.parentWindow||doc.defaultView;};_8.window.scrollIntoView=function(_88,pos){try{_88=_8.byId(_88);var doc=_88.ownerDocument||_8.doc,_89=doc.body||_8.body(),_8a=doc.documentElement||_89.parentNode,_8b=_8.isIE,_8c=_8.isWebKit;if((!(_8.isMoz||_8b||_8c||_8.isOpera)||_88==_89||_88==_8a)&&(typeof _88.scrollIntoView!="undefined")){_88.scrollIntoView(false);return;}var _8d=doc.compatMode=="BackCompat",_8e=_8d?_89:_8a,_8f=_8c?_89:_8e,_90=_8e.clientWidth,_91=_8e.clientHeight,rtl=!_8._isBodyLtr(),_92=pos||_8.position(_88),el=_88.parentNode,_93=function(el){return ((_8b<=6||(_8b&&_8d))?false:(_8.style(el,"position").toLowerCase()=="fixed"));};if(_93(_88)){return;}while(el){if(el==_89){el=_8f;}var _94=_8.position(el),_95=_93(el);if(el==_8f){_94.w=_90;_94.h=_91;if(_8f==_8a&&_8b&&rtl){_94.x+=_8f.offsetWidth-_94.w;}if(_94.x<0||!_8b){_94.x=0;}if(_94.y<0||!_8b){_94.y=0;}}else{var pb=_8._getPadBorderExtents(el);_94.w-=pb.w;_94.h-=pb.h;_94.x+=pb.l;_94.y+=pb.t;}if(el!=_8f){var _96=el.clientWidth,_97=_94.w-_96;if(_96>0&&_97>0){_94.w=_96;if(_8b&&rtl){_94.x+=_97;}}_96=el.clientHeight;_97=_94.h-_96;if(_96>0&&_97>0){_94.h=_96;}}if(_95){if(_94.y<0){_94.h+=_94.y;_94.y=0;}if(_94.x<0){_94.w+=_94.x;_94.x=0;}if(_94.y+_94.h>_91){_94.h=_91-_94.y;}if(_94.x+_94.w>_90){_94.w=_90-_94.x;}}var l=_92.x-_94.x,t=_92.y-Math.max(_94.y,0),r=l+_92.w-_94.w,bot=t+_92.h-_94.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_92.x+=el.scrollLeft;el.scrollLeft+=(_8b>=8&&!_8d&&rtl)?-s:s;_92.x-=el.scrollLeft;}if(bot*t>0){_92.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_92.y-=el.scrollTop;}el=(el!=_8f)&&!_95&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_88.scrollIntoView(false);}};}if(!_8._hasResource["dijit._base.focus"]){_8._hasResource["dijit._base.focus"]=true;_8.provide("dijit._base.focus");_8.mixin(_9,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return _9.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=_8.doc.selection,cf=_9._curFocus;if(_8.global.getSelection){sel=_8.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_98){var _99=_8.doc,_9a=_98.mark;if(_9a){if(_8.global.getSelection){var sel=_8.global.getSelection();if(sel&&sel.removeAllRanges){if(_9a.pRange){var r=_9a;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(_9a);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_99.selection&&_9a){var rg;if(_9a.pRange){rg=_9a.range;}else{if(_8.isArray(_9a)){rg=_99.body.createControlRange();_8.forEach(_9a,function(n){rg.addElement(n);});}else{rg=_99.body.createTextRange();rg.moveToBookmark(_9a);}}rg.select();}}}},getFocus:function(_9b,_9c){var _9d=!_9._curFocus||(_9b&&_8.isDescendant(_9._curFocus,_9b.domNode))?_9._prevFocus:_9._curFocus;return {node:_9d,bookmark:(_9d==_9._curFocus)&&_8.withGlobal(_9c||_8.global,_9.getBookmark),openedForWindow:_9c};},focus:function(_9e){if(!_9e){return;}var _9f="node" in _9e?_9e.node:_9e,_a0=_9e.bookmark,_a1=_9e.openedForWindow,_a2=_a0?_a0.isCollapsed:false;if(_9f){var _a3=(_9f.tagName.toLowerCase()=="iframe")?_9f.contentWindow:_9f;if(_a3&&_a3.focus){try{_a3.focus();}catch(e){}}_9._onFocusNode(_9f);}if(_a0&&_8.withGlobal(_a1||_8.global,_9.isCollapsed)&&!_a2){if(_a1){_a1.focus();}try{_8.withGlobal(_a1||_8.global,_9.moveToBookmark,null,[_a0]);}catch(e2){}}},_activeStack:[],registerIframe:function(_a4){return _9.registerWin(_a4.contentWindow,_a4);},unregisterIframe:function(_a5){_9.unregisterWin(_a5);},registerWin:function(_a6,_a7){var _a8=function(evt){_9._justMouseDowned=true;setTimeout(function(){_9._justMouseDowned=false;},0);if(_8.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}_9._onTouchNode(_a7||evt.target||evt.srcElement,"mouse");};var doc=_8.isIE?_a6.document.documentElement:_a6.document;if(doc){if(_8.isIE){_a6.document.body.attachEvent("onmousedown",_a8);var _a9=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&_9.isTabNavigable(evt.srcElement)){_9._onFocusNode(_a7||evt.srcElement);}else{_9._onTouchNode(_a7||evt.srcElement);}};doc.attachEvent("onactivate",_a9);var _aa=function(evt){_9._onBlurNode(_a7||evt.srcElement);};doc.attachEvent("ondeactivate",_aa);return function(){_a6.document.detachEvent("onmousedown",_a8);doc.detachEvent("onactivate",_a9);doc.detachEvent("ondeactivate",_aa);doc=null;};}else{doc.body.addEventListener("mousedown",_a8,true);var _ab=function(evt){_9._onFocusNode(_a7||evt.target);};doc.addEventListener("focus",_ab,true);var _ac=function(evt){_9._onBlurNode(_a7||evt.target);};doc.addEventListener("blur",_ac,true);return function(){doc.body.removeEventListener("mousedown",_a8,true);doc.removeEventListener("focus",_ab,true);doc.removeEventListener("blur",_ac,true);doc=null;};}}},unregisterWin:function(_ad){_ad&&_ad();},_onBlurNode:function(_ae){_9._prevFocus=_9._curFocus;_9._curFocus=null;if(_9._justMouseDowned){return;}if(_9._clearActiveWidgetsTimer){clearTimeout(_9._clearActiveWidgetsTimer);}_9._clearActiveWidgetsTimer=setTimeout(function(){delete _9._clearActiveWidgetsTimer;_9._setStack([]);_9._prevFocus=null;},100);},_onTouchNode:function(_af,by){if(_9._clearActiveWidgetsTimer){clearTimeout(_9._clearActiveWidgetsTimer);delete _9._clearActiveWidgetsTimer;}var _b0=[];try{while(_af){var _b1=_8.attr(_af,"dijitPopupParent");if(_b1){_af=_9.byId(_b1).domNode;}else{if(_af.tagName&&_af.tagName.toLowerCase()=="body"){if(_af===_8.body()){break;}_af=_8.window.get(_af.ownerDocument).frameElement;}else{var id=_af.getAttribute&&_af.getAttribute("widgetId"),_b2=id&&_9.byId(id);if(_b2&&!(by=="mouse"&&_b2.get("disabled"))){_b0.unshift(id);}_af=_af.parentNode;}}}}catch(e){}_9._setStack(_b0,by);},_onFocusNode:function(_b3){if(!_b3){return;}if(_b3.nodeType==9){return;}_9._onTouchNode(_b3);if(_b3==_9._curFocus){return;}if(_9._curFocus){_9._prevFocus=_9._curFocus;}_9._curFocus=_b3;_8.publish("focusNode",[_b3]);},_setStack:function(_b4,by){var _b5=_9._activeStack;_9._activeStack=_b4;for(var _b6=0;_b6<Math.min(_b5.length,_b4.length);_b6++){if(_b5[_b6]!=_b4[_b6]){break;}}var _b7;for(var i=_b5.length-1;i>=_b6;i--){_b7=_9.byId(_b5[i]);if(_b7){_b7._focused=false;_b7.set("focused",false);_b7._hasBeenBlurred=true;if(_b7._onBlur){_b7._onBlur(by);}_8.publish("widgetBlur",[_b7,by]);}}for(i=_b6;i<_b4.length;i++){_b7=_9.byId(_b4[i]);if(_b7){_b7._focused=true;_b7.set("focused",true);if(_b7._onFocus){_b7._onFocus(by);}_8.publish("widgetFocus",[_b7,by]);}}}});_8.addOnLoad(function(){var _b8=_9.registerWin(window);if(_8.isIE){_8.addOnWindowUnload(function(){_9.unregisterWin(_b8);_b8=null;});}});}if(!_8._hasResource["dojo.AdapterRegistry"]){_8._hasResource["dojo.AdapterRegistry"]=true;_8.provide("dojo.AdapterRegistry");_8.AdapterRegistry=function(_b9){this.pairs=[];this.returnWrappers=_b9||false;};_8.extend(_8.AdapterRegistry,{register:function(_ba,_bb,_bc,_bd,_be){this.pairs[((_be)?"unshift":"push")]([_ba,_bb,_bc,_bd]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _bf=this.pairs[i];if(_bf[1].apply(this,arguments)){if((_bf[3])||(this.returnWrappers)){return _bf[2];}else{return _bf[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_c0){for(var i=0;i<this.pairs.length;i++){var _c1=this.pairs[i];if(_c1[0]==_c0){this.pairs.splice(i,1);return true;}}return false;}});}if(!_8._hasResource["dijit._base.place"]){_8._hasResource["dijit._base.place"]=true;_8.provide("dijit._base.place");_9.getViewport=function(){return _8.window.getBox();};_9.placeOnScreen=function(_c2,pos,_c3,_c4){var _c5=_8.map(_c3,function(_c6){var c={corner:_c6,pos:{x:pos.x,y:pos.y}};if(_c4){c.pos.x+=_c6.charAt(1)=="L"?_c4.x:-_c4.x;c.pos.y+=_c6.charAt(0)=="T"?_c4.y:-_c4.y;}return c;});return _9._place(_c2,_c5);};_9._place=function(_c7,_c8,_c9,_ca){var _cb=_8.window.getBox();if(!_c7.parentNode||String(_c7.parentNode.tagName).toLowerCase()!="body"){_8.body().appendChild(_c7);}var _cc=null;_8.some(_c8,function(_cd){var _ce=_cd.corner;var pos=_cd.pos;var _cf=0;var _d0={w:_ce.charAt(1)=="L"?(_cb.l+_cb.w)-pos.x:pos.x-_cb.l,h:_ce.charAt(1)=="T"?(_cb.t+_cb.h)-pos.y:pos.y-_cb.t};if(_c9){var res=_c9(_c7,_cd.aroundCorner,_ce,_d0,_ca);_cf=typeof res=="undefined"?0:res;}var _d1=_c7.style;var _d2=_d1.display;var _d3=_d1.visibility;_d1.visibility="hidden";_d1.display="";var mb=_8.marginBox(_c7);_d1.display=_d2;_d1.visibility=_d3;var _d4=Math.max(_cb.l,_ce.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_d5=Math.max(_cb.t,_ce.charAt(0)=="T"?pos.y:(pos.y-mb.h)),_d6=Math.min(_cb.l+_cb.w,_ce.charAt(1)=="L"?(_d4+mb.w):pos.x),_d7=Math.min(_cb.t+_cb.h,_ce.charAt(0)=="T"?(_d5+mb.h):pos.y),_d8=_d6-_d4,_d9=_d7-_d5;_cf+=(mb.w-_d8)+(mb.h-_d9);if(_cc==null||_cf<_cc.overflow){_cc={corner:_ce,aroundCorner:_cd.aroundCorner,x:_d4,y:_d5,w:_d8,h:_d9,overflow:_cf,spaceAvailable:_d0};}return !_cf;});if(_cc.overflow&&_c9){_c9(_c7,_cc.aroundCorner,_cc.corner,_cc.spaceAvailable,_ca);}var l=_8._isBodyLtr(),s=_c7.style;s.top=_cc.y+"px";s[l?"left":"right"]=(l?_cc.x:_cb.w-_cc.x-_cc.w)+"px";return _cc;};_9.placeOnScreenAroundNode=function(_da,_db,_dc,_dd){_db=_8.byId(_db);var _de=_8.position(_db,true);return _9._placeOnScreenAroundRect(_da,_de.x,_de.y,_de.w,_de.h,_dc,_dd);};_9.placeOnScreenAroundRectangle=function(_df,_e0,_e1,_e2){return _9._placeOnScreenAroundRect(_df,_e0.x,_e0.y,_e0.width,_e0.height,_e1,_e2);};_9._placeOnScreenAroundRect=function(_e3,x,y,_e4,_e5,_e6,_e7){var _e8=[];for(var _e9 in _e6){_e8.push({aroundCorner:_e9,corner:_e6[_e9],pos:{x:x+(_e9.charAt(1)=="L"?0:_e4),y:y+(_e9.charAt(0)=="T"?0:_e5)}});}return _9._place(_e3,_e8,_e7,{w:_e4,h:_e5});};_9.placementRegistry=new _8.AdapterRegistry();_9.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},_9.placeOnScreenAroundNode);_9.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},_9.placeOnScreenAroundRectangle);_9.placeOnScreenAroundElement=function(_ea,_eb,_ec,_ed){return _9.placementRegistry.match.apply(_9.placementRegistry,arguments);};_9.getPopupAroundAlignment=function(_ee,_ef){var _f0={};_8.forEach(_ee,function(pos){switch(pos){case "after":_f0[_ef?"BR":"BL"]=_ef?"BL":"BR";break;case "before":_f0[_ef?"BL":"BR"]=_ef?"BR":"BL";break;case "below-alt":_ef=!_ef;case "below":_f0[_ef?"BL":"BR"]=_ef?"TL":"TR";_f0[_ef?"BR":"BL"]=_ef?"TR":"TL";break;case "above-alt":_ef=!_ef;case "above":default:_f0[_ef?"TL":"TR"]=_ef?"BL":"BR";_f0[_ef?"TR":"TL"]=_ef?"BR":"BL";break;}});return _f0;};}if(!_8._hasResource["dijit._base.window"]){_8._hasResource["dijit._base.window"]=true;_8.provide("dijit._base.window");_9.getDocumentWindow=function(doc){return _8.window.get(doc);};}if(!_8._hasResource["dijit._base.popup"]){_8._hasResource["dijit._base.popup"]=true;_8.provide("dijit._base.popup");_9.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_f1){var _f2=_f1.declaredClass?_f1._popupWrapper:(_8.hasClass(_f1.parentNode,"dijitPopup")&&_f1.parentNode),_f3=_f1.domNode||_f1;if(!_f2){_f2=_8.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},_8.body());_f2.appendChild(_f3);var s=_f3.style;s.display="";s.visibility="";s.position="";s.top="0px";if(_f1.declaredClass){_f1._popupWrapper=_f2;_8.connect(_f1,"destroy",function(){_8.destroy(_f2);delete _f1._popupWrapper;});}}return _f2;},moveOffScreen:function(_f4){var _f5=this._createWrapper(_f4);_8.style(_f5,{visibility:"hidden",top:"-9999px",display:""});},hide:function(_f6){var _f7=this._createWrapper(_f6);_8.style(_f7,"display","none");},getTopPopup:function(){var _f8=this._stack;for(var pi=_f8.length-1;pi>0&&_f8[pi].parent===_f8[pi-1].widget;pi--){}return _f8[pi];},open:function(_f9){var _fa=this._stack,_fb=_f9.popup,_fc=_f9.orient||((_f9.parent?_f9.parent.isLeftToRight():_8._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_fd=_f9.around,id=(_f9.around&&_f9.around.id)?(_f9.around.id+"_dropdown"):("popup_"+this._idGen++);while(_fa.length&&(!_f9.parent||!_8.isDescendant(_f9.parent.domNode,_fa[_fa.length-1].widget.domNode))){_9.popup.close(_fa[_fa.length-1].widget);}var _fe=this._createWrapper(_fb);_8.attr(_fe,{id:id,style:{zIndex:this._beginZIndex+_fa.length},"class":"dijitPopup "+(_fb.baseClass||_fb["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_f9.parent?_f9.parent.id:""});if(_8.isIE||_8.isMoz){if(!_fb.bgIframe){_fb.bgIframe=new _9.BackgroundIframe(_fe);}}var _ff=_fd?_9.placeOnScreenAroundElement(_fe,_fd,_fc,_fb.orient?_8.hitch(_fb,"orient"):null):_9.placeOnScreen(_fe,_f9,_fc=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_f9.padding);_fe.style.display="";_fe.style.visibility="visible";_fb.domNode.style.visibility="visible";var _100=[];_100.push(_8.connect(_fe,"onkeypress",this,function(evt){if(evt.charOrCode==_8.keys.ESCAPE&&_f9.onCancel){_8.stopEvent(evt);_f9.onCancel();}else{if(evt.charOrCode===_8.keys.TAB){_8.stopEvent(evt);var _101=this.getTopPopup();if(_101&&_101.onCancel){_101.onCancel();}}}}));if(_fb.onCancel){_100.push(_8.connect(_fb,"onCancel",_f9.onCancel));}_100.push(_8.connect(_fb,_fb.onExecute?"onExecute":"onChange",this,function(){var _102=this.getTopPopup();if(_102&&_102.onExecute){_102.onExecute();}}));_fa.push({widget:_fb,parent:_f9.parent,onExecute:_f9.onExecute,onCancel:_f9.onCancel,onClose:_f9.onClose,handlers:_100});if(_fb.onOpen){_fb.onOpen(_ff);}return _ff;},close:function(_103){var _104=this._stack;while((_103&&_8.some(_104,function(elem){return elem.widget==_103;}))||(!_103&&_104.length)){var top=_104.pop(),_105=top.widget,_106=top.onClose;if(_105.onClose){_105.onClose();}_8.forEach(top.handlers,_8.disconnect);if(_105&&_105.domNode){this.hide(_105);}if(_106){_106();}}}};_9._frames=new function(){var _107=[];this.pop=function(){var _108;if(_107.length){_108=_107.pop();_108.style.display="";}else{if(_8.isIE<9){var burl=_8.config["dojoBlankHtmlUrl"]||(_8.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var html="<iframe src='"+burl+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_108=_8.doc.createElement(html);}else{_108=_8.create("iframe");_108.src="javascript:\"\"";_108.className="dijitBackgroundIframe";_8.style(_108,"opacity",0.1);}_108.tabIndex=-1;_9.setWaiRole(_108,"presentation");}return _108;};this.push=function(_109){_109.style.display="none";_107.push(_109);};}();_9.BackgroundIframe=function(node){if(!node.id){throw new Error("no id");}if(_8.isIE||_8.isMoz){var _10a=(this.iframe=_9._frames.pop());node.appendChild(_10a);if(_8.isIE<7||_8.isQuirks){this.resize(node);this._conn=_8.connect(node,"onresize",this,function(){this.resize(node);});}else{_8.style(_10a,{width:"100%",height:"100%"});}}};_8.extend(_9.BackgroundIframe,{resize:function(node){if(this.iframe){_8.style(this.iframe,{width:node.offsetWidth+"px",height:node.offsetHeight+"px"});}},destroy:function(){if(this._conn){_8.disconnect(this._conn);this._conn=null;}if(this.iframe){_9._frames.push(this.iframe);delete this.iframe;}}});}if(!_8._hasResource["dijit._base.scroll"]){_8._hasResource["dijit._base.scroll"]=true;_8.provide("dijit._base.scroll");_9.scrollIntoView=function(node,pos){_8.window.scrollIntoView(node,pos);};}if(!_8._hasResource["dojo.uacss"]){_8._hasResource["dojo.uacss"]=true;_8.provide("dojo.uacss");(function(){var d=_8,html=d.doc.documentElement,ie=d.isIE,_10b=d.isOpera,maj=Math.floor,ff=d.isFF,_10c=d.boxModel.replace(/-/,""),_10d={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_ie9:maj(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_10b,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_10d["dj_"+_10c]=true;var _10e="";for(var clz in _10d){if(_10d[clz]){_10e+=clz+" ";}}html.className=d.trim(html.className+" "+_10e);_8._loaders.unshift(function(){if(!_8._isBodyLtr()){var _10f="dj_rtl dijitRtl "+_10e.replace(/ /g,"-rtl ");html.className=d.trim(html.className+" "+_10f);}});})();}if(!_8._hasResource["dijit._base.sniff"]){_8._hasResource["dijit._base.sniff"]=true;_8.provide("dijit._base.sniff");}if(!_8._hasResource["dijit._base.typematic"]){_8._hasResource["dijit._base.typematic"]=true;_8.provide("dijit._base.typematic");_9.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);this._timer=setTimeout(_8.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_110,node,_111,obj,_112,_113,_114){if(obj!=this._obj){this.stop();this._initialDelay=_113||500;this._subsequentDelay=_112||0.9;this._minDelay=_114||10;this._obj=obj;this._evt=evt;this._node=node;this._currentTimeout=-1;this._count=-1;this._callback=_8.hitch(_110,_111);this._fireEventAndReload();this._evt=_8.mixin({faux:true},evt);}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(node,_115,_116,_117,_118,_119,_11a){if(_115.keyCode){_115.charOrCode=_115.keyCode;_8.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_115.charCode){_115.charOrCode=String.fromCharCode(_115.charCode);_8.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [_8.connect(node,"onkeypress",this,function(evt){if(evt.charOrCode==_115.charOrCode&&(_115.ctrlKey===undefined||_115.ctrlKey==evt.ctrlKey)&&(_115.altKey===undefined||_115.altKey==evt.altKey)&&(_115.metaKey===undefined||_115.metaKey==(evt.metaKey||false))&&(_115.shiftKey===undefined||_115.shiftKey==evt.shiftKey)){_8.stopEvent(evt);_9.typematic.trigger(evt,_116,node,_117,_115,_118,_119,_11a);}else{if(_9.typematic._obj==_115){_9.typematic.stop();}}}),_8.connect(node,"onkeyup",this,function(evt){if(_9.typematic._obj==_115){_9.typematic.stop();}})];},addMouseListener:function(node,_11b,_11c,_11d,_11e,_11f){var dc=_8.connect;return [dc(node,"mousedown",this,function(evt){_8.stopEvent(evt);_9.typematic.trigger(evt,_11b,node,_11c,node,_11d,_11e,_11f);}),dc(node,"mouseup",this,function(evt){_8.stopEvent(evt);_9.typematic.stop();}),dc(node,"mouseout",this,function(evt){_8.stopEvent(evt);_9.typematic.stop();}),dc(node,"mousemove",this,function(evt){evt.preventDefault();}),dc(node,"dblclick",this,function(evt){_8.stopEvent(evt);if(_8.isIE){_9.typematic.trigger(evt,_11b,node,_11c,node,_11d,_11e,_11f);setTimeout(_8.hitch(this,_9.typematic.stop),50);}})];},addListener:function(_120,_121,_122,_123,_124,_125,_126,_127){return this.addKeyListener(_121,_122,_123,_124,_125,_126,_127).concat(this.addMouseListener(_120,_123,_124,_125,_126,_127));}};}if(!_8._hasResource["dijit._base.wai"]){_8._hasResource["dijit._base.wai"]=true;_8.provide("dijit._base.wai");_9.wai={onload:function(){var div=_8.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(_8.config.blankGif||_8.moduleUrl("dojo","resources/blank.gif"))+"\");"}},_8.body());var cs=_8.getComputedStyle(div);if(cs){var _128=cs.backgroundImage;var _129=(cs.borderTopColor==cs.borderRightColor)||(_128!=null&&(_128=="none"||_128=="url(invalid-url:)"));_8[_129?"addClass":"removeClass"](_8.body(),"dijit_a11y");if(_8.isIE){div.outerHTML="";}else{_8.body().removeChild(div);}}}};if(_8.isIE||_8.isMoz){_8._loaders.unshift(_9.wai.onload);}_8.mixin(_9,{hasWaiRole:function(elem,role){var _12a=this.getWaiRole(elem);return role?(_12a.indexOf(role)>-1):(_12a.length>0);},getWaiRole:function(elem){return _8.trim((_8.attr(elem,"role")||"").replace("wairole:",""));},setWaiRole:function(elem,role){_8.attr(elem,"role",role);},removeWaiRole:function(elem,role){var _12b=_8.attr(elem,"role");if(!_12b){return;}if(role){var t=_8.trim((" "+_12b+" ").replace(" "+role+" "," "));_8.attr(elem,"role",t);}else{elem.removeAttribute("role");}},hasWaiState:function(elem,_12c){return elem.hasAttribute?elem.hasAttribute("aria-"+_12c):!!elem.getAttribute("aria-"+_12c);},getWaiState:function(elem,_12d){return elem.getAttribute("aria-"+_12d)||"";},setWaiState:function(elem,_12e,_12f){elem.setAttribute("aria-"+_12e,_12f);},removeWaiState:function(elem,_130){elem.removeAttribute("aria-"+_130);}});}if(!_8._hasResource["dijit._base"]){_8._hasResource["dijit._base"]=true;_8.provide("dijit._base");}if(!_8._hasResource["dijit._Widget"]){_8._hasResource["dijit._Widget"]=true;_8.provide("dijit._Widget");_8.connect(_8,"_connect",function(_131,_132){if(_131&&_8.isFunction(_131._onConnect)){_131._onConnect(_132);}});_9._connectOnUseEventHandler=function(_133){};_9._lastKeyDownNode=null;if(_8.isIE){(function(){var _134=function(evt){_9._lastKeyDownNode=evt.srcElement;};_8.doc.attachEvent("onkeydown",_134);_8.addOnWindowUnload(function(){_8.doc.detachEvent("onkeydown",_134);});})();}else{_8.doc.addEventListener("keydown",function(evt){_9._lastKeyDownNode=evt.target;},true);}(function(){_8.declare("dijit._Widget",_9._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:_9._connectOnUseEventHandler,onDblClick:_9._connectOnUseEventHandler,onKeyDown:_9._connectOnUseEventHandler,onKeyPress:_9._connectOnUseEventHandler,onKeyUp:_9._connectOnUseEventHandler,onMouseDown:_9._connectOnUseEventHandler,onMouseMove:_9._connectOnUseEventHandler,onMouseOut:_9._connectOnUseEventHandler,onMouseOver:_9._connectOnUseEventHandler,onMouseLeave:_9._connectOnUseEventHandler,onMouseEnter:_9._connectOnUseEventHandler,onMouseUp:_9._connectOnUseEventHandler,create:function(_135,_136){this._deferredConnects=_8.clone(this._deferredConnects);for(var attr in this.attributeMap){delete this._deferredConnects[attr];}for(attr in this._deferredConnects){if(this[attr]!==_9._connectOnUseEventHandler){delete this._deferredConnects[attr];}}this.inherited(arguments);if(this.domNode){for(attr in this.params){this._onConnect(attr);}}},_onConnect:function(_137){if(_137 in this._deferredConnects){var _138=this[this._deferredConnects[_137]||"domNode"];this.connect(_138,_137.toLowerCase(),_137);delete this._deferredConnects[_137];}},focused:false,isFocusable:function(){return this.focus&&(_8.style(this.domNode,"display")!="none");},onFocus:function(){},onBlur:function(){},_onFocus:function(e){this.onFocus();},_onBlur:function(){this.onBlur();},setAttribute:function(attr,_139){_8.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(attr,_139);},attr:function(name,_13a){if(_8.config.isDebug){var _13b=arguments.callee._ach||(arguments.callee._ach={}),_13c=(arguments.callee.caller||"unknown caller").toString();if(!_13b[_13c]){_8.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_13c,"","2.0");_13b[_13c]=true;}}var args=arguments.length;if(args>=2||typeof name==="object"){return this.set.apply(this,arguments);}else{return this.get(name);}},nodesWithKeyClick:["input","button"],connect:function(obj,_13d,_13e){var d=_8,dc=d._connect,_13f=this.inherited(arguments,[obj,_13d=="ondijitclick"?"onclick":_13d,_13e]);if(_13d=="ondijitclick"){if(d.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){var m=d.hitch(this,_13e);_13f.push(dc(obj,"onkeydown",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_9._lastKeyDownNode=e.target;if(!("openDropDown" in this&&obj==this._buttonNode)){e.preventDefault();}}}),dc(obj,"onkeyup",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target==_9._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_9._lastKeyDownNode=null;return m(e);}}));}}return _13f;},_onShow:function(){this.onShow();},onShow:function(){},onHide:function(){},onClose:function(){return true;}});})();}if(!_8._hasResource["dojox.gfx.matrix"]){_8._hasResource["dojox.gfx.matrix"]=true;_8.provide("dojox.gfx.matrix");(function(){var m=_a.gfx.matrix;var _140={};m._degToRad=function(_141){return _140[_141]||(_140[_141]=(Math.PI*_141/180));};m._radToDeg=function(_142){return _142/Math.PI*180;};m.Matrix2D=function(arg){if(arg){if(typeof arg=="number"){this.xx=this.yy=arg;}else{if(arg instanceof Array){if(arg.length>0){var _143=m.normalize(arg[0]);for(var i=1;i<arg.length;++i){var l=_143,r=_a.gfx.matrix.normalize(arg[i]);_143=new m.Matrix2D();_143.xx=l.xx*r.xx+l.xy*r.yx;_143.xy=l.xx*r.xy+l.xy*r.yy;_143.yx=l.yx*r.xx+l.yy*r.yx;_143.yy=l.yx*r.xy+l.yy*r.yy;_143.dx=l.xx*r.dx+l.xy*r.dy+l.dx;_143.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}_8.mixin(this,_143);}}else{_8.mixin(this,arg);}}}};_8.extend(m.Matrix2D,{xx:1,xy:0,yx:0,yy:1,dx:0,dy:0});_8.mixin(m,{identity:new m.Matrix2D(),flipX:new m.Matrix2D({xx:-1}),flipY:new m.Matrix2D({yy:-1}),flipXY:new m.Matrix2D({xx:-1,yy:-1}),translate:function(a,b){if(arguments.length>1){return new m.Matrix2D({dx:a,dy:b});}return new m.Matrix2D({dx:a.x,dy:a.y});},scale:function(a,b){if(arguments.length>1){return new m.Matrix2D({xx:a,yy:b});}if(typeof a=="number"){return new m.Matrix2D({xx:a,yy:a});}return new m.Matrix2D({xx:a.x,yy:a.y});},rotate:function(_144){var c=Math.cos(_144);var s=Math.sin(_144);return new m.Matrix2D({xx:c,xy:-s,yx:s,yy:c});},rotateg:function(_145){return m.rotate(m._degToRad(_145));},skewX:function(_146){return new m.Matrix2D({xy:Math.tan(_146)});},skewXg:function(_147){return m.skewX(m._degToRad(_147));},skewY:function(_148){return new m.Matrix2D({yx:Math.tan(_148)});},skewYg:function(_149){return m.skewY(m._degToRad(_149));},reflect:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=2*a*b/n2;return new m.Matrix2D({xx:2*a2/n2-1,xy:xy,yx:xy,yy:2*b2/n2-1});},project:function(a,b){if(arguments.length==1){b=a.y;a=a.x;}var a2=a*a,b2=b*b,n2=a2+b2,xy=a*b/n2;return new m.Matrix2D({xx:a2/n2,xy:xy,yx:xy,yy:b2/n2});},normalize:function(_14a){return (_14a instanceof m.Matrix2D)?_14a:new m.Matrix2D(_14a);},clone:function(_14b){var obj=new m.Matrix2D();for(var i in _14b){if(typeof (_14b[i])=="number"&&typeof (obj[i])=="number"&&obj[i]!=_14b[i]){obj[i]=_14b[i];}}return obj;},invert:function(_14c){var M=m.normalize(_14c),D=M.xx*M.yy-M.xy*M.yx,M=new m.Matrix2D({xx:M.yy/D,xy:-M.xy/D,yx:-M.yx/D,yy:M.xx/D,dx:(M.xy*M.dy-M.yy*M.dx)/D,dy:(M.yx*M.dx-M.xx*M.dy)/D});return M;},_multiplyPoint:function(_14d,x,y){return {x:_14d.xx*x+_14d.xy*y+_14d.dx,y:_14d.yx*x+_14d.yy*y+_14d.dy};},multiplyPoint:function(_14e,a,b){var M=m.normalize(_14e);if(typeof a=="number"&&typeof b=="number"){return m._multiplyPoint(M,a,b);}return m._multiplyPoint(M,a.x,a.y);},multiply:function(_14f){var M=m.normalize(_14f);for(var i=1;i<arguments.length;++i){var l=M,r=m.normalize(arguments[i]);M=new m.Matrix2D();M.xx=l.xx*r.xx+l.xy*r.yx;M.xy=l.xx*r.xy+l.xy*r.yy;M.yx=l.yx*r.xx+l.yy*r.yx;M.yy=l.yx*r.xy+l.yy*r.yy;M.dx=l.xx*r.dx+l.xy*r.dy+l.dx;M.dy=l.yx*r.dx+l.yy*r.dy+l.dy;}return M;},_sandwich:function(_150,x,y){return m.multiply(m.translate(x,y),_150,m.translate(-x,-y));},scaleAt:function(a,b,c,d){switch(arguments.length){case 4:return m._sandwich(m.scale(a,b),c,d);case 3:if(typeof c=="number"){return m._sandwich(m.scale(a),b,c);}return m._sandwich(m.scale(a,b),c.x,c.y);}return m._sandwich(m.scale(a),b.x,b.y);},rotateAt:function(_151,a,b){if(arguments.length>2){return m._sandwich(m.rotate(_151),a,b);}return m._sandwich(m.rotate(_151),a.x,a.y);},rotategAt:function(_152,a,b){if(arguments.length>2){return m._sandwich(m.rotateg(_152),a,b);}return m._sandwich(m.rotateg(_152),a.x,a.y);},skewXAt:function(_153,a,b){if(arguments.length>2){return m._sandwich(m.skewX(_153),a,b);}return m._sandwich(m.skewX(_153),a.x,a.y);},skewXgAt:function(_154,a,b){if(arguments.length>2){return m._sandwich(m.skewXg(_154),a,b);}return m._sandwich(m.skewXg(_154),a.x,a.y);},skewYAt:function(_155,a,b){if(arguments.length>2){return m._sandwich(m.skewY(_155),a,b);}return m._sandwich(m.skewY(_155),a.x,a.y);},skewYgAt:function(_156,a,b){if(arguments.length>2){return m._sandwich(m.skewYg(_156),a,b);}return m._sandwich(m.skewYg(_156),a.x,a.y);}});})();_a.gfx.Matrix2D=_a.gfx.matrix.Matrix2D;}if(!_8._hasResource["dojox.gfx._base"]){_8._hasResource["dojox.gfx._base"]=true;_8.provide("dojox.gfx._base");(function(){var g=_a.gfx,b=g._base;g._hasClass=function(node,_157){var cls=node.getAttribute("className");return cls&&(" "+cls+" ").indexOf(" "+_157+" ")>=0;};g._addClass=function(node,_158){var cls=node.getAttribute("className")||"";if(!cls||(" "+cls+" ").indexOf(" "+_158+" ")<0){node.setAttribute("className",cls+(cls?" ":"")+_158);}};g._removeClass=function(node,_159){var cls=node.getAttribute("className");if(cls){node.setAttribute("className",cls.replace(new RegExp("(^|\\s+)"+_159+"(\\s+|$)"),"$1$2"));}};b._getFontMeasurements=function(){var _15a={"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,"small":0,"medium":0,"large":0,"x-large":0,"xx-large":0};if(_8.isIE){_8.doc.documentElement.style.fontSize="100%";}var div=_8.create("div",{style:{position:"absolute",left:"0",top:"-100px",width:"30px",height:"1000em",borderWidth:"0",margin:"0",padding:"0",outline:"none",lineHeight:"1",overflow:"hidden"}},_8.body());for(var p in _15a){div.style.fontSize=p;_15a[p]=Math.round(div.offsetHeight*12/16)*16/12/1000;}_8.body().removeChild(div);return _15a;};var _15b=null;b._getCachedFontMeasurements=function(_15c){if(_15c||!_15b){_15b=b._getFontMeasurements();}return _15b;};var _15d=null,_15e={};b._getTextBox=function(text,_15f,_160){var m,s,al=arguments.length;if(!_15d){_15d=_8.create("div",{style:{position:"absolute",top:"-10000px",left:"0"}},_8.body());}m=_15d;m.className="";s=m.style;s.borderWidth="0";s.margin="0";s.padding="0";s.outline="0";if(al>1&&_15f){for(var i in _15f){if(i in _15e){continue;}s[i]=_15f[i];}}if(al>2&&_160){m.className=_160;}m.innerHTML=text;if(m["getBoundingClientRect"]){var bcr=m.getBoundingClientRect();return {l:bcr.left,t:bcr.top,w:bcr.width||(bcr.right-bcr.left),h:bcr.height||(bcr.bottom-bcr.top)};}else{return _8.marginBox(m);}};var _161=0;b._getUniqueId=function(){var id;do{id=_8._scopeName+"Unique"+(++_161);}while(_8.byId(id));return id;};})();_8.mixin(_a.gfx,{defaultPath:{type:"path",path:""},defaultPolyline:{type:"polyline",points:[]},defaultRect:{type:"rect",x:0,y:0,width:100,height:100,r:0},defaultEllipse:{type:"ellipse",cx:0,cy:0,rx:200,ry:100},defaultCircle:{type:"circle",cx:0,cy:0,r:100},defaultLine:{type:"line",x1:0,y1:0,x2:100,y2:100},defaultImage:{type:"image",x:0,y:0,width:0,height:0,src:""},defaultText:{type:"text",x:0,y:0,text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultTextPath:{type:"textpath",text:"",align:"start",decoration:"none",rotated:false,kerning:true},defaultStroke:{type:"stroke",color:"black",style:"solid",width:1,cap:"butt",join:4},defaultLinearGradient:{type:"linear",x1:0,y1:0,x2:100,y2:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultRadialGradient:{type:"radial",cx:0,cy:0,r:100,colors:[{offset:0,color:"black"},{offset:1,color:"white"}]},defaultPattern:{type:"pattern",x:0,y:0,width:0,height:0,src:""},defaultFont:{type:"font",style:"normal",variant:"normal",weight:"normal",size:"10pt",family:"serif"},getDefault:(function(){var _162={};return function(type){var t=_162[type];if(t){return new t();}t=_162[type]=new Function;t.prototype=_a.gfx["default"+type];return new t();};})(),normalizeColor:function(_163){return (_163 instanceof _8.Color)?_163:new _8.Color(_163);},normalizeParameters:function(_164,_165){if(_165){var _166={};for(var x in _164){if(x in _165&&!(x in _166)){_164[x]=_165[x];}}}return _164;},makeParameters:function(_167,_168){if(!_168){return _8.delegate(_167);}var _169={};for(var i in _167){if(!(i in _169)){_169[i]=_8.clone((i in _168)?_168[i]:_167[i]);}}return _169;},formatNumber:function(x,_16a){var val=x.toString();if(val.indexOf("e")>=0){val=x.toFixed(4);}else{var _16b=val.indexOf(".");if(_16b>=0&&val.length-_16b>5){val=x.toFixed(4);}}if(x<0){return val;}return _16a?" "+val:val;},makeFontString:function(font){return font.style+" "+font.variant+" "+font.weight+" "+font.size+" "+font.family;},splitFontString:function(str){var font=_a.gfx.getDefault("Font");var t=str.split(/\s+/);do{if(t.length<5){break;}font.style=t[0];font.variant=t[1];font.weight=t[2];var i=t[3].indexOf("/");font.size=i<0?t[3]:t[3].substring(0,i);var j=4;if(i<0){if(t[4]=="/"){j=6;}else{if(t[4].charAt(0)=="/"){j=5;}}}if(j<t.length){font.family=t.slice(j).join(" ");}}while(false);return font;},cm_in_pt:72/2.54,mm_in_pt:7.2/2.54,px_in_pt:function(){return _a.gfx._base._getCachedFontMeasurements()["12pt"]/12;},pt2px:function(len){return len*_a.gfx.px_in_pt();},px2pt:function(len){return len/_a.gfx.px_in_pt();},normalizedLength:function(len){if(len.length==0){return 0;}if(len.length>2){var _16c=_a.gfx.px_in_pt();var val=parseFloat(len);switch(len.slice(-2)){case "px":return val;case "pt":return val*_16c;case "in":return val*72*_16c;case "pc":return val*12*_16c;case "mm":return val*_a.gfx.mm_in_pt*_16c;case "cm":return val*_a.gfx.cm_in_pt*_16c;}}return parseFloat(len);},pathVmlRegExp:/([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,pathSvgRegExp:/([A-Za-z])|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,equalSources:function(a,b){return a&&b&&a==b;},switchTo:function(_16d){var ns=_a.gfx[_16d];if(ns){_8.forEach(["Group","Rect","Ellipse","Circle","Line","Polyline","Image","Text","Path","TextPath","Surface","createSurface"],function(name){_a.gfx[name]=ns[name];});}}});}if(!_8._hasResource["dojox.gfx"]){_8._hasResource["dojox.gfx"]=true;_8.provide("dojox.gfx");}if(!_8._hasResource["dojox.lang.functional.lambda"]){_8._hasResource["dojox.lang.functional.lambda"]=true;_8.provide("dojox.lang.functional.lambda");(function(){var df=_a.lang.functional,_16e={};var _16f="ab".split(/a*/).length>1?String.prototype.split:function(sep){var r=this.split.call(this,sep),m=sep.exec(this);if(m&&m.index==0){r.unshift("");}return r;};var _170=function(s){var args=[],_171=_16f.call(s,/\s*->\s*/m);if(_171.length>1){while(_171.length){s=_171.pop();args=_171.pop().split(/\s*,\s*|\s+/m);if(_171.length){_171.push("(function("+args+"){return ("+s+")})");}}}else{if(s.match(/\b_\b/)){args=["_"];}else{var l=s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/m),r=s.match(/[+\-*\/%&|\^\.=<>!]\s*$/m);if(l||r){if(l){args.push("$1");s="$1"+s;}if(r){args.push("$2");s=s+"$2";}}else{var vars=s.replace(/(?:\b[A-Z]|\.[a-zA-Z_$])[a-zA-Z_$\d]*|[a-zA-Z_$][a-zA-Z_$\d]*:|this|true|false|null|undefined|typeof|instanceof|in|delete|new|void|arguments|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|dojo|dijit|dojox|window|document|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,"").match(/([a-z_$][a-z_$\d]*)/gi)||[],t={};_8.forEach(vars,function(v){if(!(v in t)){args.push(v);t[v]=1;}});}}}return {args:args,body:s};};var _172=function(a){return a.length?function(){var i=a.length-1,x=df.lambda(a[i]).apply(this,arguments);for(--i;i>=0;--i){x=df.lambda(a[i]).call(this,x);}return x;}:function(x){return x;};};_8.mixin(df,{rawLambda:function(s){return _170(s);},buildLambda:function(s){s=_170(s);return "function("+s.args.join(",")+"){return ("+s.body+");}";},lambda:function(s){if(typeof s=="function"){return s;}if(s instanceof Array){return _172(s);}if(s in _16e){return _16e[s];}s=_170(s);return _16e[s]=new Function(s.args,"return ("+s.body+");");},clearLambdaCache:function(){_16e={};}});})();}if(!_8._hasResource["dojox.lang.functional.array"]){_8._hasResource["dojox.lang.functional.array"]=true;_8.provide("dojox.lang.functional.array");(function(){var d=_8,df=_a.lang.functional,_173={};d.mixin(df,{filter:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){v=a.next();if(f.call(o,v,i++,a)){t.push(v);}}}else{for(i in a){if(!(i in _173)){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}}}return t;},forEach:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();f.call(o,a.next(),i++,a)){}}else{for(i in a){if(!(i in _173)){f.call(o,a[i],i,a);}}}}return o;},map:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array(n=a.length);for(i=0;i<n;t[i]=f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[];for(i=0;a.hasNext();t.push(f.call(o,a.next(),i++,a))){}}else{t=[];for(i in a){if(!(i in _173)){t.push(f.call(o,a[i],i,a));}}}}return t;},every:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(!f.call(o,a[i],i,a)){return false;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(!f.call(o,a.next(),i++,a)){return false;}}}else{for(i in a){if(!(i in _173)){if(!f.call(o,a[i],i,a)){return false;}}}}}return true;},some:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(f.call(o,a[i],i,a)){return true;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(f.call(o,a.next(),i++,a)){return true;}}}else{for(i in a){if(!(i in _173)){if(f.call(o,a[i],i,a)){return true;}}}}}return false;}});})();}if(!_8._hasResource["dojox.lang.functional.object"]){_8._hasResource["dojox.lang.functional.object"]=true;_8.provide("dojox.lang.functional.object");(function(){var d=_8,df=_a.lang.functional,_174={};d.mixin(df,{keys:function(obj){var t=[];for(var i in obj){if(!(i in _174)){t.push(i);}}return t;},values:function(obj){var t=[];for(var i in obj){if(!(i in _174)){t.push(obj[i]);}}return t;},filterIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},v,i;for(i in obj){if(!(i in _174)){v=obj[i];if(f.call(o,v,i,obj)){t[i]=v;}}}return t;},forIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);for(var i in obj){if(!(i in _174)){f.call(o,obj[i],i,obj);}}return o;},mapIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},i;for(i in obj){if(!(i in _174)){t[i]=f.call(o,obj[i],i,obj);}}return t;}});})();}if(!_8._hasResource["dojox.lang.functional"]){_8._hasResource["dojox.lang.functional"]=true;_8.provide("dojox.lang.functional");}if(!_8._hasResource["dojox.lang.functional.fold"]){_8._hasResource["dojox.lang.functional.fold"]=true;_8.provide("dojox.lang.functional.fold");(function(){var d=_8,df=_a.lang.functional,_175={};d.mixin(df,{foldl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}else{for(i in a){if(!(i in _175)){z=f.call(o,z,a[i],i,a);}}}}return z;},foldl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var z,i,n;if(d.isArray(a)){z=a[0];for(i=1,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){z=a.next();for(i=1;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}}else{var _176=true;for(i in a){if(!(i in _175)){if(_176){z=a[i];_176=false;}else{z=f.call(o,z,a[i],i,a);}}}}}return z;},foldr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},foldr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,z=a[n-1],i=n-1;for(;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},reduce:function(a,f,z){return arguments.length<3?df.foldl1(a,f):df.foldl(a,f,z);},reduceRight:function(a,f,z){return arguments.length<3?df.foldr1(a,f):df.foldr(a,f,z);},unfold:function(pr,f,g,z,o){o=o||d.global;f=df.lambda(f);g=df.lambda(g);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(f.call(o,z)),z=g.call(o,z)){}return t;}});})();}if(!_8._hasResource["dojox.lang.functional.reversed"]){_8._hasResource["dojox.lang.functional.reversed"]=true;_8.provide("dojox.lang.functional.reversed");(function(){var d=_8,df=_a.lang.functional;d.mixin(df,{filterRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i=a.length-1;for(;i>=0;--i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}return t;},forEachRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;f.call(o,a[i],i,a),--i){}},mapRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),i=n-1,j=0;for(;i>=0;t[j++]=f.call(o,a[i],i,a),--i){}return t;},everyRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(!f.call(o,a[i],i,a)){return false;}}return true;},someRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(f.call(o,a[i],i,a)){return true;}}return false;}});})();}if(!_8._hasResource["dojox.charting.Element"]){_8._hasResource["dojox.charting.Element"]=true;_8.provide("dojox.charting.Element");_8.declare("dojox.charting.Element",null,{chart:null,group:null,htmlElements:null,dirty:true,constructor:function(_177){this.chart=_177;this.group=null;this.htmlElements=[];this.dirty=true;this.trailingSymbol="...";this._events=[];},createGroup:function(_178){if(!_178){_178=this.chart.surface;}if(!this.group){this.group=_178.createGroup();}return this;},purgeGroup:function(){this.destroyHtmlElements();if(this.group){this.group.clear();this.group.removeShape();this.group=null;}this.dirty=true;if(this._events.length){_8.forEach(this._events,function(item){item.shape.disconnect(item.handle);});this._events=[];}return this;},cleanGroup:function(_179){this.destroyHtmlElements();if(!_179){_179=this.chart.surface;}if(this.group){this.group.clear();}else{this.group=_179.createGroup();}this.dirty=true;return this;},destroyHtmlElements:function(){if(this.htmlElements.length){_8.forEach(this.htmlElements,_8.destroy);this.htmlElements=[];}},destroy:function(){this.purgeGroup();},getTextWidth:function(s,font){return _a.gfx._base._getTextBox(s,{font:font}).w||0;},getTextWithLimitLength:function(s,font,_17a,_17b){if(!s||s.length<=0){return {text:"",truncated:_17b||false};}if(!_17a||_17a<=0){return {text:s,truncated:_17b||false};}var _17c=2,_17d=0.618,_17e=s.substring(0,1)+this.trailingSymbol,_17f=this.getTextWidth(_17e,font);if(_17a<=_17f){return {text:_17e,truncated:true};}var _180=this.getTextWidth(s,font);if(_180<=_17a){return {text:s,truncated:_17b||false};}else{var _181=0,end=s.length;while(_181<end){if(end-_181<=_17c){while(this.getTextWidth(s.substring(0,_181)+this.trailingSymbol,font)>_17a){_181-=1;}return {text:(s.substring(0,_181)+this.trailingSymbol),truncated:true};}var _182=_181+Math.round((end-_181)*_17d),_183=this.getTextWidth(s.substring(0,_182),font);if(_183<_17a){_181=_182;end=end;}else{_181=_181;end=_182;}}}},getTextWithLimitCharCount:function(s,font,_184,_185){if(!s||s.length<=0){return {text:"",truncated:_185||false};}if(!_184||_184<=0||s.length<=_184){return {text:s,truncated:_185||false};}return {text:s.substring(0,_184)+this.trailingSymbol,truncated:true};},_plotFill:function(fill,dim,_186){if(!fill||!fill.type||!fill.space){return fill;}var _187=fill.space;switch(fill.type){case "linear":if(_187==="plot"||_187==="shapeX"||_187==="shapeY"){fill=_a.gfx.makeParameters(_a.gfx.defaultLinearGradient,fill);fill.space=_187;if(_187==="plot"||_187==="shapeX"){var span=dim.height-_186.t-_186.b;fill.y1=_186.t+span*fill.y1/100;fill.y2=_186.t+span*fill.y2/100;}if(_187==="plot"||_187==="shapeY"){var span=dim.width-_186.l-_186.r;fill.x1=_186.l+span*fill.x1/100;fill.x2=_186.l+span*fill.x2/100;}}break;case "radial":if(_187==="plot"){fill=_a.gfx.makeParameters(_a.gfx.defaultRadialGradient,fill);fill.space=_187;var _188=dim.width-_186.l-_186.r,_189=dim.height-_186.t-_186.b;fill.cx=_186.l+_188*fill.cx/100;fill.cy=_186.t+_189*fill.cy/100;fill.r=fill.r*Math.sqrt(_188*_188+_189*_189)/200;}break;case "pattern":if(_187==="plot"||_187==="shapeX"||_187==="shapeY"){fill=_a.gfx.makeParameters(_a.gfx.defaultPattern,fill);fill.space=_187;if(_187==="plot"||_187==="shapeX"){var span=dim.height-_186.t-_186.b;fill.y=_186.t+span*fill.y/100;fill.height=span*fill.height/100;}if(_187==="plot"||_187==="shapeY"){var span=dim.width-_186.l-_186.r;fill.x=_186.l+span*fill.x/100;fill.width=span*fill.width/100;}}break;}return fill;},_shapeFill:function(fill,bbox){if(!fill||!fill.space){return fill;}var _18a=fill.space;switch(fill.type){case "linear":if(_18a==="shape"||_18a==="shapeX"||_18a==="shapeY"){fill=_a.gfx.makeParameters(_a.gfx.defaultLinearGradient,fill);fill.space=_18a;if(_18a==="shape"||_18a==="shapeX"){var span=bbox.width;fill.x1=bbox.x+span*fill.x1/100;fill.x2=bbox.x+span*fill.x2/100;}if(_18a==="shape"||_18a==="shapeY"){var span=bbox.height;fill.y1=bbox.y+span*fill.y1/100;fill.y2=bbox.y+span*fill.y2/100;}}break;case "radial":if(_18a==="shape"){fill=_a.gfx.makeParameters(_a.gfx.defaultRadialGradient,fill);fill.space=_18a;fill.cx=bbox.x+bbox.width/2;fill.cy=bbox.y+bbox.height/2;fill.r=fill.r*bbox.width/200;}break;case "pattern":if(_18a==="shape"||_18a==="shapeX"||_18a==="shapeY"){fill=_a.gfx.makeParameters(_a.gfx.defaultPattern,fill);fill.space=_18a;if(_18a==="shape"||_18a==="shapeX"){var span=bbox.width;fill.x=bbox.x+span*fill.x/100;fill.width=span*fill.width/100;}if(_18a==="shape"||_18a==="shapeY"){var span=bbox.height;fill.y=bbox.y+span*fill.y/100;fill.height=span*fill.height/100;}}break;}return fill;},_pseudoRadialFill:function(fill,_18b,_18c,_18d,end){if(!fill||fill.type!=="radial"||fill.space!=="shape"){return fill;}var _18e=fill.space;fill=_a.gfx.makeParameters(_a.gfx.defaultRadialGradient,fill);fill.space=_18e;if(arguments.length<4){fill.cx=_18b.x;fill.cy=_18b.y;fill.r=fill.r*_18c/100;return fill;}var _18f=arguments.length<5?_18d:(end+_18d)/2;return {type:"linear",x1:_18b.x,y1:_18b.y,x2:_18b.x+fill.r*_18c*Math.cos(_18f)/100,y2:_18b.y+fill.r*_18c*Math.sin(_18f)/100,colors:fill.colors};return fill;}});}if(!_8._hasResource["dojo.colors"]){_8._hasResource["dojo.colors"]=true;_8.provide("dojo.colors");_8.getObject("colors",true,_8);(function(){var _190=function(m1,m2,h){if(h<0){++h;}if(h>1){--h;}var h6=6*h;if(h6<1){return m1+(m2-m1)*h6;}if(2*h<1){return m2;}if(3*h<2){return m1+(m2-m1)*(2/3-h)*6;}return m1;};_8.colorFromRgb=function(_191,obj){var m=_191.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(m){var c=m[2].split(/\s*,\s*/),l=c.length,t=m[1],a;if((t=="rgb"&&l==3)||(t=="rgba"&&l==4)){var r=c[0];if(r.charAt(r.length-1)=="%"){a=_8.map(c,function(x){return parseFloat(x)*2.56;});if(l==4){a[3]=c[3];}return _8.colorFromArray(a,obj);}return _8.colorFromArray(c,obj);}if((t=="hsl"&&l==3)||(t=="hsla"&&l==4)){var H=((parseFloat(c[0])%360)+360)%360/360,S=parseFloat(c[1])/100,L=parseFloat(c[2])/100,m2=L<=0.5?L*(S+1):L+S-L*S,m1=2*L-m2;a=[_190(m1,m2,H+1/3)*256,_190(m1,m2,H)*256,_190(m1,m2,H-1/3)*256,1];if(l==4){a[3]=c[3];}return _8.colorFromArray(a,obj);}}return null;};var _192=function(c,low,high){c=Number(c);return isNaN(c)?high:c<low?low:c>high?high:c;};_8.Color.prototype.sanitize=function(){var t=this;t.r=Math.round(_192(t.r,0,255));t.g=Math.round(_192(t.g,0,255));t.b=Math.round(_192(t.b,0,255));t.a=_192(t.a,0,1);return this;};})();_8.colors.makeGrey=function(g,a){return _8.colorFromArray([g,g,g,a]);};_8.mixin(_8.Color.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});}if(!_8._hasResource["dojox.color._base"]){_8._hasResource["dojox.color._base"]=true;_8.provide("dojox.color._base");_a.color.Color=_8.Color;_a.color.blend=_8.blendColors;_a.color.fromRgb=_8.colorFromRgb;_a.color.fromHex=_8.colorFromHex;_a.color.fromArray=_8.colorFromArray;_a.color.fromString=_8.colorFromString;_a.color.greyscale=_8.colors.makeGrey;_8.mixin(_a.color,{fromCmy:function(cyan,_193,_194){if(_8.isArray(cyan)){_193=cyan[1],_194=cyan[2],cyan=cyan[0];}else{if(_8.isObject(cyan)){_193=cyan.m,_194=cyan.y,cyan=cyan.c;}}cyan/=100,_193/=100,_194/=100;var r=1-cyan,g=1-_193,b=1-_194;return new _a.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromCmyk:function(cyan,_195,_196,_197){if(_8.isArray(cyan)){_195=cyan[1],_196=cyan[2],_197=cyan[3],cyan=cyan[0];}else{if(_8.isObject(cyan)){_195=cyan.m,_196=cyan.y,_197=cyan.b,cyan=cyan.c;}}cyan/=100,_195/=100,_196/=100,_197/=100;var r,g,b;r=1-Math.min(1,cyan*(1-_197)+_197);g=1-Math.min(1,_195*(1-_197)+_197);b=1-Math.min(1,_196*(1-_197)+_197);return new _a.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsl:function(hue,_198,_199){if(_8.isArray(hue)){_198=hue[1],_199=hue[2],hue=hue[0];}else{if(_8.isObject(hue)){_198=hue.s,_199=hue.l,hue=hue.h;}}_198/=100;_199/=100;while(hue<0){hue+=360;}while(hue>=360){hue-=360;}var r,g,b;if(hue<120){r=(120-hue)/60,g=hue/60,b=0;}else{if(hue<240){r=0,g=(240-hue)/60,b=(hue-120)/60;}else{r=(hue-240)/60,g=0,b=(360-hue)/60;}}r=2*_198*Math.min(r,1)+(1-_198);g=2*_198*Math.min(g,1)+(1-_198);b=2*_198*Math.min(b,1)+(1-_198);if(_199<0.5){r*=_199,g*=_199,b*=_199;}else{r=(1-_199)*r+2*_199-1;g=(1-_199)*g+2*_199-1;b=(1-_199)*b+2*_199-1;}return new _a.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsv:function(hue,_19a,_19b){if(_8.isArray(hue)){_19a=hue[1],_19b=hue[2],hue=hue[0];}else{if(_8.isObject(hue)){_19a=hue.s,_19b=hue.v,hue=hue.h;}}if(hue==360){hue=0;}_19a/=100;_19b/=100;var r,g,b;if(_19a==0){r=_19b,b=_19b,g=_19b;}else{var _19c=hue/60,i=Math.floor(_19c),f=_19c-i;var p=_19b*(1-_19a);var q=_19b*(1-(_19a*f));var t=_19b*(1-(_19a*(1-f)));switch(i){case 0:r=_19b,g=t,b=p;break;case 1:r=q,g=_19b,b=p;break;case 2:r=p,g=_19b,b=t;break;case 3:r=p,g=q,b=_19b;break;case 4:r=t,g=p,b=_19b;break;case 5:r=_19b,g=p,b=q;break;}}return new _a.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});}});_8.extend(_a.color.Color,{toCmy:function(){var cyan=1-(this.r/255),_19d=1-(this.g/255),_19e=1-(this.b/255);return {c:Math.round(cyan*100),m:Math.round(_19d*100),y:Math.round(_19e*100)};},toCmyk:function(){var cyan,_19f,_1a0,_1a1;var r=this.r/255,g=this.g/255,b=this.b/255;_1a1=Math.min(1-r,1-g,1-b);cyan=(1-r-_1a1)/(1-_1a1);_19f=(1-g-_1a1)/(1-_1a1);_1a0=(1-b-_1a1)/(1-_1a1);return {c:Math.round(cyan*100),m:Math.round(_19f*100),y:Math.round(_1a0*100),b:Math.round(_1a1*100)};},toHsl:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _1a2=max-min;var h=0,s=0,l=(min+max)/2;if(l>0&&l<1){s=_1a2/((l<0.5)?(2*l):(2-2*l));}if(_1a2>0){if(max==r&&max!=g){h+=(g-b)/_1a2;}if(max==g&&max!=b){h+=(2+(b-r)/_1a2);}if(max==b&&max!=r){h+=(4+(r-g)/_1a2);}h*=60;}return {h:h,s:Math.round(s*100),l:Math.round(l*100)};},toHsv:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _1a3=max-min;var h=null,s=(max==0)?0:(_1a3/max);if(s==0){h=0;}else{if(r==max){h=60*(g-b)/_1a3;}else{if(g==max){h=120+60*(b-r)/_1a3;}else{h=240+60*(r-g)/_1a3;}}if(h<0){h+=360;}}return {h:h,s:Math.round(s*100),v:Math.round(max*100)};}});}if(!_8._hasResource["dojox.color"]){_8._hasResource["dojox.color"]=true;_8.provide("dojox.color");}if(!_8._hasResource["dojox.color.Palette"]){_8._hasResource["dojox.color.Palette"]=true;_8.provide("dojox.color.Palette");(function(){var dxc=_a.color;dxc.Palette=function(base){this.colors=[];if(base instanceof _a.color.Palette){this.colors=base.colors.slice(0);}else{if(base instanceof _a.color.Color){this.colors=[null,null,base,null,null];}else{if(_8.isArray(base)){this.colors=_8.map(base.slice(0),function(item){if(_8.isString(item)){return new _a.color.Color(item);}return item;});}else{if(_8.isString(base)){this.colors=[null,null,new _a.color.Color(base),null,null];}}}}};function _1a4(p,_1a5,val){var ret=new _a.color.Palette();ret.colors=[];_8.forEach(p.colors,function(item){var r=(_1a5=="dr")?item.r+val:item.r,g=(_1a5=="dg")?item.g+val:item.g,b=(_1a5=="db")?item.b+val:item.b,a=(_1a5=="da")?item.a+val:item.a;ret.colors.push(new _a.color.Color({r:Math.min(255,Math.max(0,r)),g:Math.min(255,Math.max(0,g)),b:Math.min(255,Math.max(0,b)),a:Math.min(1,Math.max(0,a))}));});return ret;};function tCMY(p,_1a6,val){var ret=new _a.color.Palette();ret.colors=[];_8.forEach(p.colors,function(item){var o=item.toCmy(),c=(_1a6=="dc")?o.c+val:o.c,m=(_1a6=="dm")?o.m+val:o.m,y=(_1a6=="dy")?o.y+val:o.y;ret.colors.push(_a.color.fromCmy(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y))));});return ret;};function _1a7(p,_1a8,val){var ret=new _a.color.Palette();ret.colors=[];_8.forEach(p.colors,function(item){var o=item.toCmyk(),c=(_1a8=="dc")?o.c+val:o.c,m=(_1a8=="dm")?o.m+val:o.m,y=(_1a8=="dy")?o.y+val:o.y,k=(_1a8=="dk")?o.b+val:o.b;ret.colors.push(_a.color.fromCmyk(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y)),Math.min(100,Math.max(0,k))));});return ret;};function tHSL(p,_1a9,val){var ret=new _a.color.Palette();ret.colors=[];_8.forEach(p.colors,function(item){var o=item.toHsl(),h=(_1a9=="dh")?o.h+val:o.h,s=(_1a9=="ds")?o.s+val:o.s,l=(_1a9=="dl")?o.l+val:o.l;ret.colors.push(_a.color.fromHsl(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,l))));});return ret;};function tHSV(p,_1aa,val){var ret=new _a.color.Palette();ret.colors=[];_8.forEach(p.colors,function(item){var o=item.toHsv(),h=(_1aa=="dh")?o.h+val:o.h,s=(_1aa=="ds")?o.s+val:o.s,v=(_1aa=="dv")?o.v+val:o.v;ret.colors.push(_a.color.fromHsv(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,v))));});return ret;};function _1ab(val,low,high){return high-((high-val)*((high-low)/high));};_8.extend(dxc.Palette,{transform:function(_1ac){var fn=_1a4;if(_1ac.use){var use=_1ac.use.toLowerCase();if(use.indexOf("hs")==0){if(use.charAt(2)=="l"){fn=tHSL;}else{fn=tHSV;}}else{if(use.indexOf("cmy")==0){if(use.charAt(3)=="k"){fn=_1a7;}else{fn=tCMY;}}}}else{if("dc" in _1ac||"dm" in _1ac||"dy" in _1ac){if("dk" in _1ac){fn=_1a7;}else{fn=tCMY;}}else{if("dh" in _1ac||"ds" in _1ac){if("dv" in _1ac){fn=tHSV;}else{fn=tHSL;}}}}var _1ad=this;for(var p in _1ac){if(p=="use"){continue;}_1ad=fn(_1ad,p,_1ac[p]);}return _1ad;},clone:function(){return new dxc.Palette(this);}});_8.mixin(dxc.Palette,{generators:{analogous:function(args){var high=args.high||60,low=args.low||18,base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var h=[(hsv.h+low+360)%360,(hsv.h+Math.round(low/2)+360)%360,hsv.h,(hsv.h-Math.round(high/2)+360)%360,(hsv.h-high+360)%360];var s1=Math.max(10,(hsv.s<=95)?hsv.s+5:(100-(hsv.s-95))),s2=(hsv.s>1)?hsv.s-1:21-hsv.s,v1=(hsv.v>=92)?hsv.v-9:Math.max(hsv.v+9,20),v2=(hsv.v<=90)?Math.max(hsv.v+5,20):(95+Math.ceil((hsv.v-90)/2)),s=[s1,s2,hsv.s,s1,s1],v=[v1,v2,hsv.v,v1,v2];return new dxc.Palette(_8.map(h,function(hue,i){return _a.color.fromHsv(hue,s[i],v[i]);}));},monochromatic:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var s1=(hsv.s-30>9)?hsv.s-30:hsv.s+30,s2=hsv.s,v1=_1ab(hsv.v,20,100),v2=(hsv.v-20>20)?hsv.v-20:hsv.v+60,v3=(hsv.v-50>20)?hsv.v-50:hsv.v+30;return new dxc.Palette([_a.color.fromHsv(hsv.h,s1,v1),_a.color.fromHsv(hsv.h,s2,v3),base,_a.color.fromHsv(hsv.h,s1,v3),_a.color.fromHsv(hsv.h,s2,v2)]);},triadic:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var h1=(hsv.h+57+360)%360,h2=(hsv.h-157+360)%360,s1=(hsv.s>20)?hsv.s-10:hsv.s+10,s2=(hsv.s>90)?hsv.s-10:hsv.s+10,s3=(hsv.s>95)?hsv.s-5:hsv.s+5,v1=(hsv.v-20>20)?hsv.v-20:hsv.v+20,v2=(hsv.v-30>20)?hsv.v-30:hsv.v+30,v3=(hsv.v-30>70)?hsv.v-30:hsv.v+30;return new dxc.Palette([_a.color.fromHsv(h1,s1,hsv.v),_a.color.fromHsv(hsv.h,s2,v2),base,_a.color.fromHsv(h2,s2,v1),_a.color.fromHsv(h2,s3,v3)]);},complementary:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,s1=Math.max(hsv.s-10,0),s2=_1ab(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([_a.color.fromHsv(hsv.h,s1,v1),_a.color.fromHsv(hsv.h,s2,v2),base,_a.color.fromHsv(h1,s3,v2),_a.color.fromHsv(h1,hsv.s,hsv.v)]);},splitComplementary:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,_1ae=args.da||30,hsv=base.toHsv();var _1af=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,h1=(_1af-_1ae+360)%360,h2=(_1af+_1ae)%360,s1=Math.max(hsv.s-10,0),s2=_1ab(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([_a.color.fromHsv(h1,s1,v1),_a.color.fromHsv(h1,s2,v2),base,_a.color.fromHsv(h2,s3,v2),_a.color.fromHsv(h2,hsv.s,hsv.v)]);},compound:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+18<360)?(hsv.h*2)+18:Math.floor(hsv.h/2)-18,h2=((hsv.h*2)+120<360)?(hsv.h*2)+120:Math.floor(hsv.h/2)-120,h3=((hsv.h*2)+99<360)?(hsv.h*2)+99:Math.floor(hsv.h/2)-99,s1=(hsv.s-40>10)?hsv.s-40:hsv.s+40,s2=(hsv.s-10>80)?hsv.s-10:hsv.s+10,s3=(hsv.s-25>10)?hsv.s-25:hsv.s+25,v1=(hsv.v-40>10)?hsv.v-40:hsv.v+40,v2=(hsv.v-20>80)?hsv.v-20:hsv.v+20,v3=Math.max(hsv.v,20);return new dxc.Palette([_a.color.fromHsv(h1,s1,v1),_a.color.fromHsv(h1,s2,v2),base,_a.color.fromHsv(h2,s3,v3),_a.color.fromHsv(h3,s2,v2)]);},shades:function(args){var base=_8.isString(args.base)?new _a.color.Color(args.base):args.base,hsv=base.toHsv();var s=(hsv.s==100&&hsv.v==0)?0:hsv.s,v1=(hsv.v-50>20)?hsv.v-50:hsv.v+30,v2=(hsv.v-25>=20)?hsv.v-25:hsv.v+55,v3=(hsv.v-75>=20)?hsv.v-75:hsv.v+5,v4=Math.max(hsv.v-10,20);return new dxc.Palette([new _a.color.fromHsv(hsv.h,s,v1),new _a.color.fromHsv(hsv.h,s,v2),base,new _a.color.fromHsv(hsv.h,s,v3),new _a.color.fromHsv(hsv.h,s,v4)]);}},generate:function(base,type){if(_8.isFunction(type)){return type({base:base});}else{if(dxc.Palette.generators[type]){return dxc.Palette.generators[type]({base:base});}}throw new Error("dojox.color.Palette.generate: the specified generator ('"+type+"') does not exist.");}});})();}if(!_8._hasResource["dojox.lang.utils"]){_8._hasResource["dojox.lang.utils"]=true;_8.provide("dojox.lang.utils");(function(){var _1b0={},du=_a.lang.utils,opts=Object.prototype.toString;var _1b1=function(o){if(o){switch(opts.call(o)){case "[object Array]":return o.slice(0);case "[object Object]":return _8.delegate(o);}}return o;};_8.mixin(du,{coerceType:function(_1b2,_1b3){switch(typeof _1b2){case "number":return Number(eval("("+_1b3+")"));case "string":return String(_1b3);case "boolean":return Boolean(eval("("+_1b3+")"));}return eval("("+_1b3+")");},updateWithObject:function(_1b4,_1b5,conv){if(!_1b5){return _1b4;}for(var x in _1b4){if(x in _1b5&&!(x in _1b0)){var t=_1b4[x];if(t&&typeof t=="object"){du.updateWithObject(t,_1b5[x],conv);}else{_1b4[x]=conv?du.coerceType(t,_1b5[x]):_1b1(_1b5[x]);}}}return _1b4;},updateWithPattern:function(_1b6,_1b7,_1b8,conv){if(!_1b7||!_1b8){return _1b6;}for(var x in _1b8){if(x in _1b7&&!(x in _1b0)){_1b6[x]=conv?du.coerceType(_1b8[x],_1b7[x]):_1b1(_1b7[x]);}}return _1b6;},merge:function(_1b9,_1ba){if(_1ba){var _1bb=opts.call(_1b9),_1bc=opts.call(_1ba),t,i,l,m;switch(_1bc){case "[object Array]":if(_1bc==_1bb){t=new Array(Math.max(_1b9.length,_1ba.length));for(i=0,l=t.length;i<l;++i){t[i]=du.merge(_1b9[i],_1ba[i]);}return t;}return _1ba.slice(0);case "[object Object]":if(_1bc==_1bb&&_1b9){t=_8.delegate(_1b9);for(i in _1ba){if(i in _1b9){l=_1b9[i];m=_1ba[i];if(m!==l){t[i]=du.merge(l,m);}}else{t[i]=_8.clone(_1ba[i]);}}return t;}return _8.clone(_1ba);}}return _1ba;}});})();}if(!_8._hasResource["dojox.gfx.gradutils"]){_8._hasResource["dojox.gfx.gradutils"]=true;_8.provide("dojox.gfx.gradutils");(function(){var d=_8,m=_a.gfx.matrix,C=d.Color;function _1bd(o,c){if(o<=0){return c[0].color;}var len=c.length;if(o>=1){return c[len-1].color;}for(var i=0;i<len;++i){var stop=c[i];if(stop.offset>=o){if(i){var prev=c[i-1];return d.blendColors(new C(prev.color),new C(stop.color),(o-prev.offset)/(stop.offset-prev.offset));}return stop.color;}}return c[len-1].color;};_a.gfx.gradutils.getColor=function(fill,pt){var o;if(fill){switch(fill.type){case "linear":var _1be=Math.atan2(fill.y2-fill.y1,fill.x2-fill.x1),_1bf=m.rotate(-_1be),_1c0=m.project(fill.x2-fill.x1,fill.y2-fill.y1),p=m.multiplyPoint(_1c0,pt),pf1=m.multiplyPoint(_1c0,fill.x1,fill.y1),pf2=m.multiplyPoint(_1c0,fill.x2,fill.y2),_1c1=m.multiplyPoint(_1bf,pf2.x-pf1.x,pf2.y-pf1.y).x,o=m.multiplyPoint(_1bf,p.x-pf1.x,p.y-pf1.y).x/_1c1;break;case "radial":var dx=pt.x-fill.cx,dy=pt.y-fill.cy,o=Math.sqrt(dx*dx+dy*dy)/fill.r;break;}return _1bd(o,fill.colors);}return new C(fill||[0,0,0,0]);};_a.gfx.gradutils.reverse=function(fill){if(fill){switch(fill.type){case "linear":case "radial":fill=_8.delegate(fill);if(fill.colors){var c=fill.colors,l=c.length,i=0,stop,n=fill.colors=new Array(c.length);for(;i<l;++i){stop=c[i];n[i]={offset:1-stop.offset,color:stop.color};}n.sort(function(a,b){return a.offset-b.offset;});}break;}}return fill;};})();}if(!_8._hasResource["dojox.charting.Theme"]){_8._hasResource["dojox.charting.Theme"]=true;_8.provide("dojox.charting.Theme");_8.declare("dojox.charting.Theme",null,{shapeSpaces:{shape:1,shapeX:1,shapeY:1},constructor:function(_1c2){_1c2=_1c2||{};var def=_a.charting.Theme.defaultTheme;_8.forEach(["chart","plotarea","axis","series","marker"],function(name){this[name]=_8.delegate(def[name],_1c2[name]);},this);if(_1c2.seriesThemes&&_1c2.seriesThemes.length){this.colors=null;this.seriesThemes=_1c2.seriesThemes.slice(0);}else{this.seriesThemes=null;this.colors=(_1c2.colors||_a.charting.Theme.defaultColors).slice(0);}this.markerThemes=null;if(_1c2.markerThemes&&_1c2.markerThemes.length){this.markerThemes=_1c2.markerThemes.slice(0);}this.markers=_1c2.markers?_8.clone(_1c2.markers):_8.delegate(_a.charting.Theme.defaultMarkers);this.noGradConv=_1c2.noGradConv;this.noRadialConv=_1c2.noRadialConv;if(_1c2.reverseFills){this.reverseFills();}this._current=0;this._buildMarkerArray();},clone:function(){var _1c3=new _a.charting.Theme({chart:this.chart,plotarea:this.plotarea,axis:this.axis,series:this.series,marker:this.marker,colors:this.colors,markers:this.markers,seriesThemes:this.seriesThemes,markerThemes:this.markerThemes,noGradConv:this.noGradConv,noRadialConv:this.noRadialConv});_8.forEach(["clone","clear","next","skip","addMixin","post","getTick"],function(name){if(this.hasOwnProperty(name)){_1c3[name]=this[name];}},this);return _1c3;},clear:function(){this._current=0;},next:function(_1c4,_1c5,_1c6){var _1c7=_a.lang.utils.merge,_1c8,_1c9;if(this.colors){_1c8=_8.delegate(this.series);_1c9=_8.delegate(this.marker);var _1ca=new _8.Color(this.colors[this._current%this.colors.length]),old;if(_1c8.stroke&&_1c8.stroke.color){_1c8.stroke=_8.delegate(_1c8.stroke);old=new _8.Color(_1c8.stroke.color);_1c8.stroke.color=new _8.Color(_1ca);_1c8.stroke.color.a=old.a;}else{_1c8.stroke={color:_1ca};}if(_1c9.stroke&&_1c9.stroke.color){_1c9.stroke=_8.delegate(_1c9.stroke);old=new _8.Color(_1c9.stroke.color);_1c9.stroke.color=new _8.Color(_1ca);_1c9.stroke.color.a=old.a;}else{_1c9.stroke={color:_1ca};}if(!_1c8.fill||_1c8.fill.type){_1c8.fill=_1ca;}else{old=new _8.Color(_1c8.fill);_1c8.fill=new _8.Color(_1ca);_1c8.fill.a=old.a;}if(!_1c9.fill||_1c9.fill.type){_1c9.fill=_1ca;}else{old=new _8.Color(_1c9.fill);_1c9.fill=new _8.Color(_1ca);_1c9.fill.a=old.a;}}else{_1c8=this.seriesThemes?_1c7(this.series,this.seriesThemes[this._current%this.seriesThemes.length]):this.series;_1c9=this.markerThemes?_1c7(this.marker,this.markerThemes[this._current%this.markerThemes.length]):_1c8;}var _1cb=_1c9&&_1c9.symbol||this._markers[this._current%this._markers.length];var _1cc={series:_1c8,marker:_1c9,symbol:_1cb};++this._current;if(_1c5){_1cc=this.addMixin(_1cc,_1c4,_1c5);}if(_1c6){_1cc=this.post(_1cc,_1c4);}return _1cc;},skip:function(){++this._current;},addMixin:function(_1cd,_1ce,_1cf,_1d0){if(_8.isArray(_1cf)){_8.forEach(_1cf,function(m){_1cd=this.addMixin(_1cd,_1ce,m);},this);}else{var t={};if("color" in _1cf){if(_1ce=="line"||_1ce=="area"){_8.setObject("series.stroke.color",_1cf.color,t);_8.setObject("marker.stroke.color",_1cf.color,t);}else{_8.setObject("series.fill",_1cf.color,t);}}_8.forEach(["stroke","outline","shadow","fill","font","fontColor","labelWiring"],function(name){var _1d1="marker"+name.charAt(0).toUpperCase()+name.substr(1),b=_1d1 in _1cf;if(name in _1cf){_8.setObject("series."+name,_1cf[name],t);if(!b){_8.setObject("marker."+name,_1cf[name],t);}}if(b){_8.setObject("marker."+name,_1cf[_1d1],t);}});if("marker" in _1cf){t.symbol=_1cf.marker;}_1cd=_a.lang.utils.merge(_1cd,t);}if(_1d0){_1cd=this.post(_1cd,_1ce);}return _1cd;},post:function(_1d2,_1d3){var fill=_1d2.series.fill,t;if(!this.noGradConv&&this.shapeSpaces[fill.space]&&fill.type=="linear"){if(_1d3=="bar"){t={x1:fill.y1,y1:fill.x1,x2:fill.y2,y2:fill.x2};}else{if(!this.noRadialConv&&fill.space=="shape"&&(_1d3=="slice"||_1d3=="circle")){t={type:"radial",cx:0,cy:0,r:100};}}if(t){return _a.lang.utils.merge(_1d2,{series:{fill:t}});}}return _1d2;},getTick:function(name,_1d4){var tick=this.axis.tick,_1d5=name+"Tick";merge=_a.lang.utils.merge;if(tick){if(this.axis[_1d5]){tick=merge(tick,this.axis[_1d5]);}}else{tick=this.axis[_1d5];}if(_1d4){if(tick){if(_1d4[_1d5]){tick=merge(tick,_1d4[_1d5]);}}else{tick=_1d4[_1d5];}}return tick;},inspectObjects:function(f){_8.forEach(["chart","plotarea","axis","series","marker"],function(name){f(this[name]);},this);if(this.seriesThemes){_8.forEach(this.seriesThemes,f);}if(this.markerThemes){_8.forEach(this.markerThemes,f);}},reverseFills:function(){this.inspectObjects(function(o){if(o&&o.fill){o.fill=_a.gfx.gradutils.reverse(o.fill);}});},addMarker:function(name,_1d6){this.markers[name]=_1d6;this._buildMarkerArray();},setMarkers:function(obj){this.markers=obj;this._buildMarkerArray();},_buildMarkerArray:function(){this._markers=[];for(var p in this.markers){this._markers.push(this.markers[p]);}}});_8.mixin(_a.charting.Theme,{defaultMarkers:{CIRCLE:"m-3,0 c0,-4 6,-4 6,0 m-6,0 c0,4 6,4 6,0",SQUARE:"m-3,-3 l0,6 6,0 0,-6 z",DIAMOND:"m0,-3 l3,3 -3,3 -3,-3 z",CROSS:"m0,-3 l0,6 m-3,-3 l6,0",X:"m-3,-3 l6,6 m0,-6 l-6,6",TRIANGLE:"m-3,3 l3,-6 3,6 z",TRIANGLE_INVERTED:"m-3,-3 l3,6 3,-6 z"},defaultColors:["#54544c","#858e94","#6e767a","#948585","#474747"],defaultTheme:{chart:{stroke:null,fill:"white",pageStyle:null,titleGap:20,titlePos:"top",titleFont:"normal normal bold 14pt Tahoma",titleFontColor:"#333"},plotarea:{stroke:null,fill:"white"},axis:{stroke:{color:"#333",width:1},tick:{color:"#666",position:"center",font:"normal normal normal 7pt Tahoma",fontColor:"#333",titleGap:15,titleFont:"normal normal normal 11pt Tahoma",titleFontColor:"#333",titleOrientation:"axis"},majorTick:{width:1,length:6},minorTick:{width:0.8,length:3},microTick:{width:0.5,length:1}},series:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000",labelWiring:{width:1,color:"#ccc"}},marker:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000"}},defineColors:function(_1d7){_1d7=_1d7||{};var c=[],n=_1d7.num||5;if(_1d7.colors){var l=_1d7.colors.length;for(var i=0;i<n;i++){c.push(_1d7.colors[i%l]);}return c;}if(_1d7.hue){var s=_1d7.saturation||100;var st=_1d7.low||30;var end=_1d7.high||90;var l=(end+st)/2;return _a.color.Palette.generate(_a.color.fromHsv(_1d7.hue,s,l),"monochromatic").colors;}if(_1d7.generator){return _a.color.Palette.generate(_1d7.base,_1d7.generator).colors;}return c;},generateGradient:function(_1d8,_1d9,_1da){var fill=_8.delegate(_1d8);fill.colors=[{offset:0,color:_1d9},{offset:1,color:_1da}];return fill;},generateHslColor:function(_1db,_1dc){_1db=new _a.color.Color(_1db);var hsl=_1db.toHsl(),_1dd=_a.color.fromHsl(hsl.h,hsl.s,_1dc);_1dd.a=_1db.a;return _1dd;},generateHslGradient:function(_1de,_1df,_1e0,_1e1){_1de=new _a.color.Color(_1de);var hsl=_1de.toHsl(),_1e2=_a.color.fromHsl(hsl.h,hsl.s,_1e0),_1e3=_a.color.fromHsl(hsl.h,hsl.s,_1e1);_1e2.a=_1e3.a=_1de.a;return _a.charting.Theme.generateGradient(_1df,_1e2,_1e3);}});}if(!_8._hasResource["dojox.charting.Series"]){_8._hasResource["dojox.charting.Series"]=true;_8.provide("dojox.charting.Series");_8.declare("dojox.charting.Series",_a.charting.Element,{constructor:function(_1e4,data,_1e5){_8.mixin(this,_1e5);if(typeof this.plot!="string"){this.plot="default";}this.update(data);},clear:function(){this.dyn={};},update:function(data){if(_8.isArray(data)){this.data=data;}else{this.source=data;this.data=this.source.data;if(this.source.setSeriesObject){this.source.setSeriesObject(this);}}this.dirty=true;this.clear();}});}if(!_8._hasResource["dojox.charting.axis2d.common"]){_8._hasResource["dojox.charting.axis2d.common"]=true;_8.provide("dojox.charting.axis2d.common");(function(){var g=_a.gfx;var _1e6=function(s){s.marginLeft="0px";s.marginTop="0px";s.marginRight="0px";s.marginBottom="0px";s.paddingLeft="0px";s.paddingTop="0px";s.paddingRight="0px";s.paddingBottom="0px";s.borderLeftWidth="0px";s.borderTopWidth="0px";s.borderRightWidth="0px";s.borderBottomWidth="0px";};var _1e7=function(n){if(n["getBoundingClientRect"]){var bcr=n.getBoundingClientRect();return bcr.width||(bcr.right-bcr.left);}else{return _8.marginBox(n).w;}};_8.mixin(_a.charting.axis2d.common,{createText:{gfx:function(_1e8,_1e9,x,y,_1ea,text,font,_1eb){return _1e9.createText({x:x,y:y,text:text,align:_1ea}).setFont(font).setFill(_1eb);},html:function(_1ec,_1ed,x,y,_1ee,text,font,_1ef,_1f0){var p=_8.doc.createElement("div"),s=p.style,_1f1;_1e6(s);s.font=font;p.innerHTML=String(text).replace(/\s/g,"&nbsp;");s.color=_1ef;s.position="absolute";s.left="-10000px";_8.body().appendChild(p);var size=g.normalizedLength(g.splitFontString(font).size);if(!_1f0){_1f1=_1e7(p);}_8.body().removeChild(p);s.position="relative";if(_1f0){s.width=_1f0+"px";switch(_1ee){case "middle":s.textAlign="center";s.left=(x-_1f0/2)+"px";break;case "end":s.textAlign="right";s.left=(x-_1f0)+"px";break;default:s.left=x+"px";s.textAlign="left";break;}}else{switch(_1ee){case "middle":s.left=Math.floor(x-_1f1/2)+"px";break;case "end":s.left=Math.floor(x-_1f1)+"px";break;default:s.left=Math.floor(x)+"px";break;}}s.top=Math.floor(y-size)+"px";s.whiteSpace="nowrap";var wrap=_8.doc.createElement("div"),w=wrap.style;_1e6(w);w.width="0px";w.height="0px";wrap.appendChild(p);_1ec.node.insertBefore(wrap,_1ec.node.firstChild);return wrap;}}});})();}if(!_8._hasResource["dojox.charting.Chart"]){_8._hasResource["dojox.charting.Chart"]=true;_8.provide("dojox.charting.Chart");(function(){var df=_a.lang.functional,dc=_a.charting,g=_a.gfx,_1f2=df.lambda("item.clear()"),_1f3=df.lambda("item.purgeGroup()"),_1f4=df.lambda("item.destroy()"),_1f5=df.lambda("item.dirty = false"),_1f6=df.lambda("item.dirty = true"),_1f7=df.lambda("item.name");_8.declare("dojox.charting.Chart",null,{constructor:function(node,_1f8){if(!_1f8){_1f8={};}this.margins=_1f8.margins?_1f8.margins:{l:10,t:10,r:10,b:10};this.stroke=_1f8.stroke;this.fill=_1f8.fill;this.delayInMs=_1f8.delayInMs||200;this.title=_1f8.title;this.titleGap=_1f8.titleGap;this.titlePos=_1f8.titlePos;this.titleFont=_1f8.titleFont;this.titleFontColor=_1f8.titleFontColor;this.chartTitle=null;this.theme=null;this.axes={};this.stack=[];this.plots={};this.series=[];this.runs={};this.dirty=true;this.coords=null;this.node=_8.byId(node);var box=_8.marginBox(node);this.surface=g.createSurface(this.node,box.w||400,box.h||300);},destroy:function(){_8.forEach(this.series,_1f4);_8.forEach(this.stack,_1f4);df.forIn(this.axes,_1f4);if(this.chartTitle&&this.chartTitle.tagName){_8.destroy(this.chartTitle);}this.surface.destroy();},getCoords:function(){if(!this.coords){this.coords=_8.coords(this.node,true);}return this.coords;},setTheme:function(_1f9){this.theme=_1f9.clone();this.dirty=true;return this;},addAxis:function(name,_1fa){var axis,_1fb=_1fa&&_1fa.type||"Default";if(typeof _1fb=="string"){if(!dc.axis2d||!dc.axis2d[_1fb]){throw Error("Can't find axis: "+_1fb+" - didn't you forget to dojo"+".require() it?");}axis=new dc.axis2d[_1fb](this,_1fa);}else{axis=new _1fb(this,_1fa);}axis.name=name;axis.dirty=true;if(name in this.axes){this.axes[name].destroy();}this.axes[name]=axis;this.dirty=true;return this;},getAxis:function(name){return this.axes[name];},removeAxis:function(name){if(name in this.axes){this.axes[name].destroy();delete this.axes[name];this.dirty=true;}return this;},addPlot:function(name,_1fc){var plot,_1fd=_1fc&&_1fc.type||"Default";if(typeof _1fd=="string"){if(!dc.plot2d||!dc.plot2d[_1fd]){throw Error("Can't find plot: "+_1fd+" - didn't you forget to dojo"+".require() it?");}plot=new dc.plot2d[_1fd](this,_1fc);}else{plot=new _1fd(this,_1fc);}plot.name=name;plot.dirty=true;if(name in this.plots){this.stack[this.plots[name]].destroy();this.stack[this.plots[name]]=plot;}else{this.plots[name]=this.stack.length;this.stack.push(plot);}this.dirty=true;return this;},removePlot:function(name){if(name in this.plots){var _1fe=this.plots[name];delete this.plots[name];this.stack[_1fe].destroy();this.stack.splice(_1fe,1);df.forIn(this.plots,function(idx,name,_1ff){if(idx>_1fe){_1ff[name]=idx-1;}});var ns=_8.filter(this.series,function(run){return run.plot!=name;});if(ns.length<this.series.length){_8.forEach(this.series,function(run){if(run.plot==name){run.destroy();}});this.runs={};_8.forEach(ns,function(run,_200){this.runs[run.plot]=_200;},this);this.series=ns;}this.dirty=true;}return this;},getPlotOrder:function(){return df.map(this.stack,_1f7);},setPlotOrder:function(_201){var _202={},_203=df.filter(_201,function(name){if(!(name in this.plots)||(name in _202)){return false;}_202[name]=1;return true;},this);if(_203.length<this.stack.length){df.forEach(this.stack,function(plot){var name=plot.name;if(!(name in _202)){_203.push(name);}});}var _204=df.map(_203,function(name){return this.stack[this.plots[name]];},this);df.forEach(_204,function(plot,i){this.plots[plot.name]=i;},this);this.stack=_204;this.dirty=true;return this;},movePlotToFront:function(name){if(name in this.plots){var _205=this.plots[name];if(_205){var _206=this.getPlotOrder();_206.splice(_205,1);_206.unshift(name);return this.setPlotOrder(_206);}}return this;},movePlotToBack:function(name){if(name in this.plots){var _207=this.plots[name];if(_207<this.stack.length-1){var _208=this.getPlotOrder();_208.splice(_207,1);_208.push(name);return this.setPlotOrder(_208);}}return this;},addSeries:function(name,data,_209){var run=new dc.Series(this,data,_209);run.name=name;if(name in this.runs){this.series[this.runs[name]].destroy();this.series[this.runs[name]]=run;}else{this.runs[name]=this.series.length;this.series.push(run);}this.dirty=true;if(!("ymin" in run)&&"min" in run){run.ymin=run.min;}if(!("ymax" in run)&&"max" in run){run.ymax=run.max;}return this;},removeSeries:function(name){if(name in this.runs){var _20a=this.runs[name];delete this.runs[name];this.series[_20a].destroy();this.series.splice(_20a,1);df.forIn(this.runs,function(idx,name,runs){if(idx>_20a){runs[name]=idx-1;}});this.dirty=true;}return this;},updateSeries:function(name,data){if(name in this.runs){var run=this.series[this.runs[name]];run.update(data);this._invalidateDependentPlots(run.plot,false);this._invalidateDependentPlots(run.plot,true);}return this;},getSeriesOrder:function(_20b){return df.map(df.filter(this.series,function(run){return run.plot==_20b;}),_1f7);},setSeriesOrder:function(_20c){var _20d,_20e={},_20f=df.filter(_20c,function(name){if(!(name in this.runs)||(name in _20e)){return false;}var run=this.series[this.runs[name]];if(_20d){if(run.plot!=_20d){return false;}}else{_20d=run.plot;}_20e[name]=1;return true;},this);df.forEach(this.series,function(run){var name=run.name;if(!(name in _20e)&&run.plot==_20d){_20f.push(name);}});var _210=df.map(_20f,function(name){return this.series[this.runs[name]];},this);this.series=_210.concat(df.filter(this.series,function(run){return run.plot!=_20d;}));df.forEach(this.series,function(run,i){this.runs[run.name]=i;},this);this.dirty=true;return this;},moveSeriesToFront:function(name){if(name in this.runs){var _211=this.runs[name],_212=this.getSeriesOrder(this.series[_211].plot);if(name!=_212[0]){_212.splice(_211,1);_212.unshift(name);return this.setSeriesOrder(_212);}}return this;},moveSeriesToBack:function(name){if(name in this.runs){var _213=this.runs[name],_214=this.getSeriesOrder(this.series[_213].plot);if(name!=_214[_214.length-1]){_214.splice(_213,1);_214.push(name);return this.setSeriesOrder(_214);}}return this;},resize:function(_215,_216){var box;switch(arguments.length){case 1:box=_8.mixin({},_215);_8.marginBox(this.node,box);break;case 2:box={w:_215,h:_216};_8.marginBox(this.node,box);break;}box=_8.marginBox(this.node);this.surface.setDimensions(box.w,box.h);this.dirty=true;this.coords=null;return this.render();},getGeometry:function(){var ret={};df.forIn(this.axes,function(axis){if(axis.initialized()){ret[axis.name]={name:axis.name,vertical:axis.vertical,scaler:axis.scaler,ticks:axis.ticks};}});return ret;},setAxisWindow:function(name,_217,_218,zoom){var axis=this.axes[name];if(axis){axis.setWindow(_217,_218);_8.forEach(this.stack,function(plot){if(plot.hAxis==name||plot.vAxis==name){plot.zoom=zoom;}});}return this;},setWindow:function(sx,sy,dx,dy,zoom){if(!("plotArea" in this)){this.calculateGeometry();}df.forIn(this.axes,function(axis){var _219,_21a,_21b=axis.getScaler().bounds,s=_21b.span/(_21b.upper-_21b.lower);if(axis.vertical){_219=sy;_21a=dy/s/_219;}else{_219=sx;_21a=dx/s/_219;}axis.setWindow(_219,_21a);});_8.forEach(this.stack,function(plot){plot.zoom=zoom;});return this;},zoomIn:function(name,_21c){var axis=this.axes[name];if(axis){var _21d,_21e,_21f=axis.getScaler().bounds;var _220=Math.min(_21c[0],_21c[1]);var _221=Math.max(_21c[0],_21c[1]);_220=_21c[0]<_21f.lower?_21f.lower:_220;_221=_21c[1]>_21f.upper?_21f.upper:_221;_21d=(_21f.upper-_21f.lower)/(_221-_220);_21e=_220-_21f.lower;this.setAxisWindow(name,_21d,_21e);this.render();}},calculateGeometry:function(){if(this.dirty){return this.fullGeometry();}var _222=_8.filter(this.stack,function(plot){return plot.dirty||(plot.hAxis&&this.axes[plot.hAxis].dirty)||(plot.vAxis&&this.axes[plot.vAxis].dirty);},this);_223(_222,this.plotArea);return this;},fullGeometry:function(){this._makeDirty();_8.forEach(this.stack,_1f2);if(!this.theme){this.setTheme(new _a.charting.Theme(_a.charting._def));}_8.forEach(this.series,function(run){if(!(run.plot in this.plots)){if(!dc.plot2d||!dc.plot2d.Default){throw Error("Can't find plot: Default - didn't you forget to dojo"+".require() it?");}var plot=new dc.plot2d.Default(this,{});plot.name=run.plot;this.plots[run.plot]=this.stack.length;this.stack.push(plot);}this.stack[this.plots[run.plot]].addSeries(run);},this);_8.forEach(this.stack,function(plot){if(plot.hAxis){plot.setAxis(this.axes[plot.hAxis]);}if(plot.vAxis){plot.setAxis(this.axes[plot.vAxis]);}},this);var dim=this.dim=this.surface.getDimensions();dim.width=g.normalizedLength(dim.width);dim.height=g.normalizedLength(dim.height);df.forIn(this.axes,_1f2);_223(this.stack,dim);var _224=this.offsets={l:0,r:0,t:0,b:0};df.forIn(this.axes,function(axis){df.forIn(axis.getOffsets(),function(o,i){_224[i]+=o;});});if(this.title){this.titleGap=(this.titleGap==0)?0:this.titleGap||this.theme.chart.titleGap||20;this.titlePos=this.titlePos||this.theme.chart.titlePos||"top";this.titleFont=this.titleFont||this.theme.chart.titleFont;this.titleFontColor=this.titleFontColor||this.theme.chart.titleFontColor||"black";var _225=g.normalizedLength(g.splitFontString(this.titleFont).size);_224[this.titlePos=="top"?"t":"b"]+=(_225+this.titleGap);}df.forIn(this.margins,function(o,i){_224[i]+=o;});this.plotArea={width:dim.width-_224.l-_224.r,height:dim.height-_224.t-_224.b};df.forIn(this.axes,_1f2);_223(this.stack,this.plotArea);return this;},render:function(){if(this.theme){this.theme.clear();}if(this.dirty){return this.fullRender();}this.calculateGeometry();df.forEachRev(this.stack,function(plot){plot.render(this.dim,this.offsets);},this);df.forIn(this.axes,function(axis){axis.render(this.dim,this.offsets);},this);this._makeClean();if(this.surface.render){this.surface.render();}return this;},fullRender:function(){this.fullGeometry();var _226=this.offsets,dim=this.dim,rect;_8.forEach(this.series,_1f3);df.forIn(this.axes,_1f3);_8.forEach(this.stack,_1f3);if(this.chartTitle&&this.chartTitle.tagName){_8.destroy(this.chartTitle);}this.surface.clear();this.chartTitle=null;var t=this.theme,fill=t.plotarea&&t.plotarea.fill,_227=t.plotarea&&t.plotarea.stroke,rect={x:_226.l-1,y:_226.t-1,width:dim.width-_226.l-_226.r+2,height:dim.height-_226.t-_226.b+2};if(fill){fill=dc.Element.prototype._shapeFill(dc.Element.prototype._plotFill(fill,dim,_226),rect);this.surface.createRect(rect).setFill(fill);}if(_227){this.surface.createRect({x:_226.l,y:_226.t,width:dim.width-_226.l-_226.r+1,height:dim.height-_226.t-_226.b+1}).setStroke(_227);}df.foldr(this.stack,function(z,plot){return plot.render(dim,_226),0;},0);fill=this.fill!==undefined?this.fill:(t.chart&&t.chart.fill);_227=this.stroke!==undefined?this.stroke:(t.chart&&t.chart.stroke);if(fill=="inherit"){var node=this.node,fill=new _8.Color(_8.style(node,"backgroundColor"));while(fill.a==0&&node!=document.documentElement){fill=new _8.Color(_8.style(node,"backgroundColor"));node=node.parentNode;}}if(fill){fill=dc.Element.prototype._plotFill(fill,dim,_226);if(_226.l){rect={width:_226.l,height:dim.height+1};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_226.r){rect={x:dim.width-_226.r,width:_226.r+1,height:dim.height+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_226.t){rect={width:dim.width+1,height:_226.t};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_226.b){rect={y:dim.height-_226.b,width:dim.width+1,height:_226.b+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}}if(_227){this.surface.createRect({width:dim.width-1,height:dim.height-1}).setStroke(_227);}if(this.title){var _228=(g.renderer=="canvas"),_229=_228||!_8.isIE&&!_8.isOpera?"html":"gfx",_22a=g.normalizedLength(g.splitFontString(this.titleFont).size);this.chartTitle=dc.axis2d.common.createText[_229](this,this.surface,dim.width/2,this.titlePos=="top"?_22a+this.margins.t:dim.height-this.margins.b,"middle",this.title,this.titleFont,this.titleFontColor);}df.forIn(this.axes,function(axis){axis.render(dim,_226);});this._makeClean();if(this.surface.render){this.surface.render();}return this;},delayedRender:function(){if(!this._delayedRenderHandle){this._delayedRenderHandle=setTimeout(_8.hitch(this,function(){clearTimeout(this._delayedRenderHandle);this._delayedRenderHandle=null;this.render();}),this.delayInMs);}return this;},connectToPlot:function(name,_22b,_22c){return name in this.plots?this.stack[this.plots[name]].connect(_22b,_22c):null;},fireEvent:function(_22d,_22e,_22f){if(_22d in this.runs){var _230=this.series[this.runs[_22d]].plot;if(_230 in this.plots){var plot=this.stack[this.plots[_230]];if(plot){plot.fireEvent(_22d,_22e,_22f);}}}return this;},_makeClean:function(){_8.forEach(this.axes,_1f5);_8.forEach(this.stack,_1f5);_8.forEach(this.series,_1f5);this.dirty=false;},_makeDirty:function(){_8.forEach(this.axes,_1f6);_8.forEach(this.stack,_1f6);_8.forEach(this.series,_1f6);this.dirty=true;},_invalidateDependentPlots:function(_231,_232){if(_231 in this.plots){var plot=this.stack[this.plots[_231]],axis,_233=_232?"vAxis":"hAxis";if(plot[_233]){axis=this.axes[plot[_233]];if(axis&&axis.dependOnData()){axis.dirty=true;_8.forEach(this.stack,function(p){if(p[_233]&&p[_233]==plot[_233]){p.dirty=true;}});}}else{plot.dirty=true;}}}});function _234(_235){return {min:_235.hmin,max:_235.hmax};};function _236(_237){return {min:_237.vmin,max:_237.vmax};};function _238(_239,h){_239.hmin=h.min;_239.hmax=h.max;};function _23a(_23b,v){_23b.vmin=v.min;_23b.vmax=v.max;};function _23c(_23d,_23e){if(_23d&&_23e){_23d.min=Math.min(_23d.min,_23e.min);_23d.max=Math.max(_23d.max,_23e.max);}return _23d||_23e;};function _223(_23f,_240){var _241={},axes={};_8.forEach(_23f,function(plot){var _242=_241[plot.name]=plot.getSeriesStats();if(plot.hAxis){axes[plot.hAxis]=_23c(axes[plot.hAxis],_234(_242));}if(plot.vAxis){axes[plot.vAxis]=_23c(axes[plot.vAxis],_236(_242));}});_8.forEach(_23f,function(plot){var _243=_241[plot.name];if(plot.hAxis){_238(_243,axes[plot.hAxis]);}if(plot.vAxis){_23a(_243,axes[plot.vAxis]);}plot.initializeScalers(_240,_243);});};})();}if(!_8._hasResource["dojox.charting.widget.Chart"]){_8._hasResource["dojox.charting.widget.Chart"]=true;_8.provide("dojox.charting.widget.Chart");(function(){var _244,_245,_246,_247,_248,_249=function(o){return o;},df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting,d=_8;_8.declare("dojox.charting.widget.Chart",_9._Widget,{theme:null,margins:null,stroke:null,fill:null,buildRendering:function(){var n=this.domNode=this.srcNodeRef;var axes=d.query("> .axis",n).map(_245).filter(_249),_24a=d.query("> .plot",n).map(_246).filter(_249),_24b=d.query("> .action",n).map(_247).filter(_249),_24c=d.query("> .series",n).map(_248).filter(_249);n.innerHTML="";var c=this.chart=new dc.Chart(n,{margins:this.margins,stroke:this.stroke,fill:this.fill});if(this.theme){c.setTheme(this.theme);}axes.forEach(function(axis){c.addAxis(axis.name,axis.kwArgs);});_24a.forEach(function(plot){c.addPlot(plot.name,plot.kwArgs);});this.actions=_24b.map(function(_24d){return new _24d.action(c,_24d.plot,_24d.kwArgs);});var _24e=df.foldl(_24c,function(_24f,_250){if(_250.type=="data"){c.addSeries(_250.name,_250.data,_250.kwArgs);_24f=true;}else{c.addSeries(_250.name,[0],_250.kwArgs);var kw={};du.updateWithPattern(kw,_250.kwArgs,{"query":"","queryOptions":null,"start":0,"count":1},true);if(_250.kwArgs.sort){kw.sort=_8.clone(_250.kwArgs.sort);}d.mixin(kw,{onComplete:function(data){var _251;if("valueFn" in _250.kwArgs){var fn=_250.kwArgs.valueFn;_251=d.map(data,function(x){return fn(_250.data.getValue(x,_250.field,0));});}else{_251=d.map(data,function(x){return _250.data.getValue(x,_250.field,0);});}c.addSeries(_250.name,_251,_250.kwArgs).render();}});_250.data.fetch(kw);}return _24f;},false);if(_24e){c.render();}},destroy:function(){this.chart.destroy();this.inherited(arguments);},resize:function(box){this.chart.resize(box);}});_244=function(node,type,kw){var dp=eval("("+type+".prototype.defaultParams)");var x,attr;for(x in dp){if(x in kw){continue;}attr=node.getAttribute(x);kw[x]=du.coerceType(dp[x],attr==null||typeof attr=="undefined"?dp[x]:attr);}var op=eval("("+type+".prototype.optionalParams)");for(x in op){if(x in kw){continue;}attr=node.getAttribute(x);if(attr!=null){kw[x]=du.coerceType(op[x],attr);}}};_245=function(node){var name=node.getAttribute("name"),type=node.getAttribute("type");if(!name){return null;}var o={name:name,kwArgs:{}},kw=o.kwArgs;if(type){if(dc.axis2d[type]){type=_a._scopeName+".charting.axis2d."+type;}var axis=eval("("+type+")");if(axis){kw.type=axis;}}else{type=_a._scopeName+".charting.axis2d.Default";}_244(node,type,kw);if(kw.font||kw.fontColor){if(!kw.tick){kw.tick={};}if(kw.font){kw.tick.font=kw.font;}if(kw.fontColor){kw.tick.fontColor=kw.fontColor;}}return o;};_246=function(node){var name=node.getAttribute("name"),type=node.getAttribute("type");if(!name){return null;}var o={name:name,kwArgs:{}},kw=o.kwArgs;if(type){if(dc.plot2d&&dc.plot2d[type]){type=_a._scopeName+".charting.plot2d."+type;}var plot=eval("("+type+")");if(plot){kw.type=plot;}}else{type=_a._scopeName+".charting.plot2d.Default";}_244(node,type,kw);return o;};_247=function(node){var plot=node.getAttribute("plot"),type=node.getAttribute("type");if(!plot){plot="default";}var o={plot:plot,kwArgs:{}},kw=o.kwArgs;if(type){if(dc.action2d[type]){type=_a._scopeName+".charting.action2d."+type;}var _252=eval("("+type+")");if(!_252){return null;}o.action=_252;}else{return null;}_244(node,type,kw);return o;};_248=function(node){var ga=d.partial(d.attr,node);var name=ga("name");if(!name){return null;}var o={name:name,kwArgs:{}},kw=o.kwArgs,t;t=ga("plot");if(t!=null){kw.plot=t;}t=ga("marker");if(t!=null){kw.marker=t;}t=ga("stroke");if(t!=null){kw.stroke=eval("("+t+")");}t=ga("outline");if(t!=null){kw.outline=eval("("+t+")");}t=ga("shadow");if(t!=null){kw.shadow=eval("("+t+")");}t=ga("fill");if(t!=null){kw.fill=eval("("+t+")");}t=ga("font");if(t!=null){kw.font=t;}t=ga("fontColor");if(t!=null){kw.fontColor=eval("("+t+")");}t=ga("legend");if(t!=null){kw.legend=t;}t=ga("data");if(t!=null){o.type="data";o.data=t?_8.map(String(t).split(","),Number):[];return o;}t=ga("array");if(t!=null){o.type="data";o.data=eval("("+t+")");return o;}t=ga("store");if(t!=null){o.type="store";o.data=eval("("+t+")");t=ga("field");o.field=t!=null?t:"value";t=ga("query");if(!!t){kw.query=t;}t=ga("queryOptions");if(!!t){kw.queryOptions=eval("("+t+")");}t=ga("start");if(!!t){kw.start=Number(t);}t=ga("count");if(!!t){kw.count=Number(t);}t=ga("sort");if(!!t){kw.sort=eval("("+t+")");}t=ga("valueFn");if(!!t){kw.valueFn=df.lambda(t);}return o;}return null;};})();}if(!_8._hasResource["dojo.fx.easing"]){_8._hasResource["dojo.fx.easing"]=true;_8.provide("dojo.fx.easing");_8.getObject("fx.easing",true,_8);_8.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-_8.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return _8.fx.easing.bounceIn(n*2)/2;}return (_8.fx.easing.bounceOut(n*2-1)/2)+0.5;}};}if(!_8._hasResource["dojox.gfx.fx"]){_8._hasResource["dojox.gfx.fx"]=true;_8.provide("dojox.gfx.fx");(function(){var d=_8,g=_a.gfx,m=g.matrix;function _253(_254,end){this.start=_254,this.end=end;};_253.prototype.getValue=function(r){return (this.end-this.start)*r+this.start;};function _255(_256,end,_257){this.start=_256,this.end=end;this.units=_257;};_255.prototype.getValue=function(r){return (this.end-this.start)*r+this.start+this.units;};function _258(_259,end){this.start=_259,this.end=end;this.temp=new _8.Color();};_258.prototype.getValue=function(r){return d.blendColors(this.start,this.end,r,this.temp);};function _25a(_25b){this.values=_25b;this.length=_25b.length;};_25a.prototype.getValue=function(r){return this.values[Math.min(Math.floor(r*this.length),this.length-1)];};function _25c(_25d,def){this.values=_25d;this.def=def?def:{};};_25c.prototype.getValue=function(r){var ret=_8.clone(this.def);for(var i in this.values){ret[i]=this.values[i].getValue(r);}return ret;};function _25e(_25f,_260){this.stack=_25f;this.original=_260;};_25e.prototype.getValue=function(r){var ret=[];_8.forEach(this.stack,function(t){if(t instanceof m.Matrix2D){ret.push(t);return;}if(t.name=="original"&&this.original){ret.push(this.original);return;}if(!(t.name in m)){return;}var f=m[t.name];if(typeof f!="function"){ret.push(f);return;}var val=_8.map(t.start,function(v,i){return (t.end[i]-v)*r+v;}),_261=f.apply(m,val);if(_261 instanceof m.Matrix2D){ret.push(_261);}},this);return ret;};var _262=new d.Color(0,0,0,0);function _263(prop,obj,name,def){if(prop.values){return new _25a(prop.values);}var _264,_265,end;if(prop.start){_265=g.normalizeColor(prop.start);}else{_265=_264=obj?(name?obj[name]:obj):def;}if(prop.end){end=g.normalizeColor(prop.end);}else{if(!_264){_264=obj?(name?obj[name]:obj):def;}end=_264;}return new _258(_265,end);};function _266(prop,obj,name,def){if(prop.values){return new _25a(prop.values);}var _267,_268,end;if(prop.start){_268=prop.start;}else{_268=_267=obj?obj[name]:def;}if(prop.end){end=prop.end;}else{if(typeof _267!="number"){_267=obj?obj[name]:def;}end=_267;}return new _253(_268,end);};g.fx.animateStroke=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_269=args.shape,_26a;d.connect(anim,"beforeBegin",anim,function(){_26a=_269.getStroke();var prop=args.color,_26b={},_26c,_26d,end;if(prop){_26b.color=_263(prop,_26a,"color",_262);}prop=args.style;if(prop&&prop.values){_26b.style=new _25a(prop.values);}prop=args.width;if(prop){_26b.width=_266(prop,_26a,"width",1);}prop=args.cap;if(prop&&prop.values){_26b.cap=new _25a(prop.values);}prop=args.join;if(prop){if(prop.values){_26b.join=new _25a(prop.values);}else{_26d=prop.start?prop.start:(_26a&&_26a.join||0);end=prop.end?prop.end:(_26a&&_26a.join||0);if(typeof _26d=="number"&&typeof end=="number"){_26b.join=new _253(_26d,end);}}}this.curve=new _25c(_26b,_26a);});d.connect(anim,"onAnimate",_269,"setStroke");return anim;};g.fx.animateFill=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_26e=args.shape,fill;d.connect(anim,"beforeBegin",anim,function(){fill=_26e.getFill();var prop=args.color,_26f={};if(prop){this.curve=_263(prop,fill,"",_262);}});d.connect(anim,"onAnimate",_26e,"setFill");return anim;};g.fx.animateFont=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_270=args.shape,font;d.connect(anim,"beforeBegin",anim,function(){font=_270.getFont();var prop=args.style,_271={},_272,_273,end;if(prop&&prop.values){_271.style=new _25a(prop.values);}prop=args.variant;if(prop&&prop.values){_271.variant=new _25a(prop.values);}prop=args.weight;if(prop&&prop.values){_271.weight=new _25a(prop.values);}prop=args.family;if(prop&&prop.values){_271.family=new _25a(prop.values);}prop=args.size;if(prop&&prop.units){_273=parseFloat(prop.start?prop.start:(_270.font&&_270.font.size||"0"));end=parseFloat(prop.end?prop.end:(_270.font&&_270.font.size||"0"));_271.size=new _255(_273,end,prop.units);}this.curve=new _25c(_271,font);});d.connect(anim,"onAnimate",_270,"setFont");return anim;};g.fx.animateTransform=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_274=args.shape,_275;d.connect(anim,"beforeBegin",anim,function(){_275=_274.getTransform();this.curve=new _25e(args.transform,_275);});d.connect(anim,"onAnimate",_274,"setTransform");return anim;};})();}if(!_8._hasResource["dojox.charting.action2d.Base"]){_8._hasResource["dojox.charting.action2d.Base"]=true;_8.provide("dojox.charting.action2d.Base");(function(){var _276=400,_277=_8.fx.easing.backOut,df=_a.lang.functional;_8.declare("dojox.charting.action2d.Base",null,{overOutEvents:{onmouseover:1,onmouseout:1},constructor:function(_278,plot,_279){this.chart=_278;this.plot=plot||"default";this.anim={};if(!_279){_279={};}this.duration=_279.duration?_279.duration:_276;this.easing=_279.easing?_279.easing:_277;},connect:function(){this.handle=this.chart.connectToPlot(this.plot,this,"process");},disconnect:function(){if(this.handle){_8.disconnect(this.handle);this.handle=null;}},reset:function(){},destroy:function(){this.disconnect();df.forIn(this.anim,function(o){df.forIn(o,function(anim){anim.action.stop(true);});});this.anim={};}});})();}if(!_8._hasResource["dojox.charting.action2d.Highlight"]){_8._hasResource["dojox.charting.action2d.Highlight"]=true;_8.provide("dojox.charting.action2d.Highlight");(function(){var _27a=100,_27b=75,_27c=50,c=_a.color,cc=function(_27d){return function(){return _27d;};},hl=function(_27e){var a=new c.Color(_27e),x=a.toHsl();if(x.s==0){x.l=x.l<50?100:0;}else{x.s=_27a;if(x.l<_27c){x.l=_27b;}else{if(x.l>_27b){x.l=_27c;}else{x.l=x.l-_27c>_27b-x.l?_27c:_27b;}}}return c.fromHsl(x);};_8.declare("dojox.charting.action2d.Highlight",_a.charting.action2d.Base,{defaultParams:{duration:400,easing:_8.fx.easing.backOut},optionalParams:{highlight:"red"},constructor:function(_27f,plot,_280){var a=_280&&_280.highlight;this.colorFun=a?(_8.isFunction(a)?a:cc(a)):hl;this.connect();},process:function(o){if(!o.shape||!(o.type in this.overOutEvents)){return;}var _281=o.run.name,_282=o.index,anim,_283,_284;if(_281 in this.anim){anim=this.anim[_281][_282];}else{this.anim[_281]={};}if(anim){anim.action.stop(true);}else{var _285=o.shape.getFill();if(!_285||!(_285 instanceof _8.Color)){return;}this.anim[_281][_282]=anim={start:_285,end:this.colorFun(_285)};}var _286=anim.start,end=anim.end;if(o.type=="onmouseout"){var t=_286;_286=end;end=t;}anim.action=_a.gfx.fx.animateFill({shape:o.shape,duration:this.duration,easing:this.easing,color:{start:_286,end:end}});if(o.type=="onmouseout"){_8.connect(anim.action,"onEnd",this,function(){if(this.anim[_281]){delete this.anim[_281][_282];}});}anim.action.play();}});})();}if(!_8._hasResource["dojo.fx.Toggler"]){_8._hasResource["dojo.fx.Toggler"]=true;_8.provide("dojo.fx.Toggler");_8.declare("dojo.fx.Toggler",null,{node:null,showFunc:_8.fadeIn,hideFunc:_8.fadeOut,showDuration:200,hideDuration:200,constructor:function(args){var _287=this;_8.mixin(_287,args);_287.node=args.node;_287._showArgs=_8.mixin({},args);_287._showArgs.node=_287.node;_287._showArgs.duration=_287.showDuration;_287.showAnim=_287.showFunc(_287._showArgs);_287._hideArgs=_8.mixin({},args);_287._hideArgs.node=_287.node;_287._hideArgs.duration=_287.hideDuration;_287.hideAnim=_287.hideFunc(_287._hideArgs);_8.connect(_287.showAnim,"beforeBegin",_8.hitch(_287.hideAnim,"stop",true));_8.connect(_287.hideAnim,"beforeBegin",_8.hitch(_287.showAnim,"stop",true));},show:function(_288){return this.showAnim.play(_288||0);},hide:function(_289){return this.hideAnim.play(_289||0);}});}if(!_8._hasResource["dojo.fx"]){_8._hasResource["dojo.fx"]=true;_8.provide("dojo.fx");(function(){var d=_8,_28a={_fire:function(evt,args){if(this[evt]){this[evt].apply(this,args||[]);}return this;}};var _28b=function(_28c){this._index=-1;this._animations=_28c||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_28b,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_28d,_28e){if(!this._current){this._current=this._animations[this._index=0];}if(!_28e&&this._current.status()=="playing"){return this;}var _28f=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_290=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_291=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_28f);d.disconnect(_290);d.disconnect(_291);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_292,_293){this.pause();var _294=this.duration*_292;this._current=null;d.some(this._animations,function(a){if(a.duration<=_294){this._current=a;return true;}_294-=a.duration;return false;});if(this._current){this._current.gotoPercent(_294/this._current.duration,_293);}return this;},stop:function(_295){if(this._current){if(_295){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_28b,_28a);_8.fx.chain=function(_296){return new _28b(_296);};var _297=function(_298){this._animations=_298||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_298,function(a){var _299=a.duration;if(a.delay){_299+=a.delay;}if(this.duration<_299){this.duration=_299;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var self=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){self._connects.push(d.connect(self._pseudoAnimation,evt,function(){self._fire(evt,arguments);}));});};d.extend(_297,{_doAction:function(_29a,args){d.forEach(this._animations,function(a){a[_29a].apply(a,args);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_29b,args){var t=this._pseudoAnimation;t[_29b].apply(t,args);},play:function(_29c,_29d){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_29e,_29f){var ms=this.duration*_29e;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_29f);});this._call("gotoPercent",arguments);return this;},stop:function(_2a0){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,_8.disconnect);}});d.extend(_297,_28a);_8.fx.combine=function(_2a1){return new _297(_2a1);};_8.fx.wipeIn=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _2a2=d.style(node,"height");return Math.max(_2a2,1);}},end:function(){return node.scrollHeight;}}}},args));d.connect(anim,"onEnd",function(){s.height="auto";s.overflow=o;});return anim;};_8.fx.wipeOut=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{end:1}}},args));d.connect(anim,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(anim,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return anim;};_8.fx.slideTo=function(args){var node=args.node=d.byId(args.node),top=null,left=null;var init=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);left=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;left=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=left+"px";}};})(node);init();var anim=d.animateProperty(d.mixin({properties:{top:args.top||0,left:args.left||0}},args));d.connect(anim,"beforeBegin",anim,init);return anim;};})();}if(!_8._hasResource["dojox.charting.action2d.Magnify"]){_8._hasResource["dojox.charting.action2d.Magnify"]=true;_8.provide("dojox.charting.action2d.Magnify");(function(){var _2a3=2,m=_a.gfx.matrix,gf=_a.gfx.fx;_8.declare("dojox.charting.action2d.Magnify",_a.charting.action2d.Base,{defaultParams:{duration:400,easing:_8.fx.easing.backOut,scale:_2a3},optionalParams:{},constructor:function(_2a4,plot,_2a5){this.scale=_2a5&&typeof _2a5.scale=="number"?_2a5.scale:_2a3;this.connect();},process:function(o){if(!o.shape||!(o.type in this.overOutEvents)||!("cx" in o)||!("cy" in o)){return;}var _2a6=o.run.name,_2a7=o.index,_2a8=[],anim,init,_2a9;if(_2a6 in this.anim){anim=this.anim[_2a6][_2a7];}else{this.anim[_2a6]={};}if(anim){anim.action.stop(true);}else{this.anim[_2a6][_2a7]=anim={};}if(o.type=="onmouseover"){init=m.identity;_2a9=this.scale;}else{init=m.scaleAt(this.scale,o.cx,o.cy);_2a9=1/this.scale;}var _2aa={shape:o.shape,duration:this.duration,easing:this.easing,transform:[{name:"scaleAt",start:[1,o.cx,o.cy],end:[_2a9,o.cx,o.cy]},init]};if(o.shape){_2a8.push(gf.animateTransform(_2aa));}if(o.oultine){_2aa.shape=o.outline;_2a8.push(gf.animateTransform(_2aa));}if(o.shadow){_2aa.shape=o.shadow;_2a8.push(gf.animateTransform(_2aa));}if(!_2a8.length){delete this.anim[_2a6][_2a7];return;}anim.action=_8.fx.combine(_2a8);if(o.type=="onmouseout"){_8.connect(anim.action,"onEnd",this,function(){if(this.anim[_2a6]){delete this.anim[_2a6][_2a7];}});}anim.action.play();}});})();}if(!_8._hasResource["dojox.lang.functional.scan"]){_8._hasResource["dojox.lang.functional.scan"]=true;_8.provide("dojox.lang.functional.scan");(function(){var d=_8,df=_a.lang.functional,_2ab={};d.mixin(df,{scanl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array((n=a.length)+1);t[0]=z;for(i=0;i<n;z=f.call(o,z,a[i],i,a),t[++i]=z){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[z];for(i=0;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}else{t=[z];for(i in a){if(!(i in _2ab)){t.push(z=f.call(o,z,a[i],i,a));}}}}return t;},scanl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,z,_2ac=true;if(d.isArray(a)){t=new Array(n=a.length);t[0]=z=a[0];for(var i=1;i<n;t[i]=z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){t=[z=a.next()];for(var i=1;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}}else{for(var i in a){if(!(i in _2ab)){if(_2ac){t=[z=a[i]];_2ac=false;}else{t.push(z=f.call(o,z,a[i],i,a));}}}}}return t;},scanr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n+1),i=n;t[n]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;},scanr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),z=a[n-1],i=n-1;t[i]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;}});})();}if(!_8._hasResource["dojox.charting.action2d.MoveSlice"]){_8._hasResource["dojox.charting.action2d.MoveSlice"]=true;_8.provide("dojox.charting.action2d.MoveSlice");(function(){var _2ad=1.05,_2ae=7,m=_a.gfx.matrix,gf=_a.gfx.fx,df=_a.lang.functional;_8.declare("dojox.charting.action2d.MoveSlice",_a.charting.action2d.Base,{defaultParams:{duration:400,easing:_8.fx.easing.backOut,scale:_2ad,shift:_2ae},optionalParams:{},constructor:function(_2af,plot,_2b0){if(!_2b0){_2b0={};}this.scale=typeof _2b0.scale=="number"?_2b0.scale:_2ad;this.shift=typeof _2b0.shift=="number"?_2b0.shift:_2ae;this.connect();},process:function(o){if(!o.shape||o.element!="slice"||!(o.type in this.overOutEvents)){return;}if(!this.angles){var _2b1=m._degToRad(o.plot.opt.startAngle);if(typeof o.run.data[0]=="number"){this.angles=df.map(df.scanl(o.run.data,"+",_2b1),"* 2 * Math.PI / this",df.foldl(o.run.data,"+",0));}else{this.angles=df.map(df.scanl(o.run.data,"a + b.y",_2b1),"* 2 * Math.PI / this",df.foldl(o.run.data,"a + b.y",0));}}var _2b2=o.index,anim,_2b3,_2b4,_2b5,_2b6,_2b7=(this.angles[_2b2]+this.angles[_2b2+1])/2,_2b8=m.rotateAt(-_2b7,o.cx,o.cy),_2b9=m.rotateAt(_2b7,o.cx,o.cy);anim=this.anim[_2b2];if(anim){anim.action.stop(true);}else{this.anim[_2b2]=anim={};}if(o.type=="onmouseover"){_2b5=0;_2b6=this.shift;_2b3=1;_2b4=this.scale;}else{_2b5=this.shift;_2b6=0;_2b3=this.scale;_2b4=1;}anim.action=_a.gfx.fx.animateTransform({shape:o.shape,duration:this.duration,easing:this.easing,transform:[_2b9,{name:"translate",start:[_2b5,0],end:[_2b6,0]},{name:"scaleAt",start:[_2b3,o.cx,o.cy],end:[_2b4,o.cx,o.cy]},_2b8]});if(o.type=="onmouseout"){_8.connect(anim.action,"onEnd",this,function(){delete this.anim[_2b2];});}anim.action.play();},reset:function(){delete this.angles;}});})();}if(!_8._hasResource["dojox.charting.action2d.Shake"]){_8._hasResource["dojox.charting.action2d.Shake"]=true;_8.provide("dojox.charting.action2d.Shake");(function(){var _2ba=3,m=_a.gfx.matrix,gf=_a.gfx.fx;_8.declare("dojox.charting.action2d.Shake",_a.charting.action2d.Base,{defaultParams:{duration:400,easing:_8.fx.easing.backOut,shiftX:_2ba,shiftY:_2ba},optionalParams:{},constructor:function(_2bb,plot,_2bc){if(!_2bc){_2bc={};}this.shiftX=typeof _2bc.shiftX=="number"?_2bc.shiftX:_2ba;this.shiftY=typeof _2bc.shiftY=="number"?_2bc.shiftY:_2ba;this.connect();},process:function(o){if(!o.shape||!(o.type in this.overOutEvents)){return;}var _2bd=o.run.name,_2be=o.index,_2bf=[],anim,_2c0=o.type=="onmouseover"?this.shiftX:-this.shiftX,_2c1=o.type=="onmouseover"?this.shiftY:-this.shiftY;if(_2bd in this.anim){anim=this.anim[_2bd][_2be];}else{this.anim[_2bd]={};}if(anim){anim.action.stop(true);}else{this.anim[_2bd][_2be]=anim={};}var _2c2={shape:o.shape,duration:this.duration,easing:this.easing,transform:[{name:"translate",start:[this.shiftX,this.shiftY],end:[0,0]},m.identity]};if(o.shape){_2bf.push(gf.animateTransform(_2c2));}if(o.oultine){_2c2.shape=o.outline;_2bf.push(gf.animateTransform(_2c2));}if(o.shadow){_2c2.shape=o.shadow;_2bf.push(gf.animateTransform(_2c2));}if(!_2bf.length){delete this.anim[_2bd][_2be];return;}anim.action=_8.fx.combine(_2bf);if(o.type=="onmouseout"){_8.connect(anim.action,"onEnd",this,function(){if(this.anim[_2bd]){delete this.anim[_2bd][_2be];}});}anim.action.play();}});})();}if(!_8._hasResource["dojo.string"]){_8._hasResource["dojo.string"]=true;_8.provide("dojo.string");_8.getObject("string",true,_8);_8.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};_8.string.pad=function(text,size,ch,end){if(!ch){ch="0";}var out=String(text),pad=_8.string.rep(ch,Math.ceil((size-out.length)/ch.length));return end?out+pad:pad+out;};_8.string.substitute=function(_2c3,map,_2c4,_2c5){_2c5=_2c5||_8.global;_2c4=_2c4?_8.hitch(_2c5,_2c4):function(v){return v;};return _2c3.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_2c6,key,_2c7){var _2c8=_8.getObject(key,false,map);if(_2c7){_2c8=_8.getObject(_2c7,false,_2c5).call(_2c5,_2c8,key);}return _2c4(_2c8,key).toString();});};_8.string.trim=String.prototype.trim?_8.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!_8._hasResource["dojo.date.stamp"]){_8._hasResource["dojo.date.stamp"]=true;_8.provide("dojo.date.stamp");_8.getObject("date.stamp",true,_8);_8.date.stamp.fromISOString=function(_2c9,_2ca){if(!_8.date.stamp._isoRegExp){_8.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _2cb=_8.date.stamp._isoRegExp.exec(_2c9),_2cc=null;if(_2cb){_2cb.shift();if(_2cb[1]){_2cb[1]--;}if(_2cb[6]){_2cb[6]*=1000;}if(_2ca){_2ca=new Date(_2ca);_8.forEach(_8.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(prop){return _2ca["get"+prop]();}),function(_2cd,_2ce){_2cb[_2ce]=_2cb[_2ce]||_2cd;});}_2cc=new Date(_2cb[0]||1970,_2cb[1]||0,_2cb[2]||1,_2cb[3]||0,_2cb[4]||0,_2cb[5]||0,_2cb[6]||0);if(_2cb[0]<100){_2cc.setFullYear(_2cb[0]||1970);}var _2cf=0,_2d0=_2cb[7]&&_2cb[7].charAt(0);if(_2d0!="Z"){_2cf=((_2cb[8]||0)*60)+(Number(_2cb[9])||0);if(_2d0!="-"){_2cf*=-1;}}if(_2d0){_2cf-=_2cc.getTimezoneOffset();}if(_2cf){_2cc.setTime(_2cc.getTime()+_2cf*60000);}}return _2cc;};_8.date.stamp.toISOString=function(_2d1,_2d2){var _2d3=function(n){return (n<10)?"0"+n:n;};_2d2=_2d2||{};var _2d4=[],_2d5=_2d2.zulu?"getUTC":"get",date="";if(_2d2.selector!="time"){var year=_2d1[_2d5+"FullYear"]();date=["0000".substr((year+"").length)+year,_2d3(_2d1[_2d5+"Month"]()+1),_2d3(_2d1[_2d5+"Date"]())].join("-");}_2d4.push(date);if(_2d2.selector!="date"){var time=[_2d3(_2d1[_2d5+"Hours"]()),_2d3(_2d1[_2d5+"Minutes"]()),_2d3(_2d1[_2d5+"Seconds"]())].join(":");var _2d6=_2d1[_2d5+"Milliseconds"]();if(_2d2.milliseconds){time+="."+(_2d6<100?"0":"")+_2d3(_2d6);}if(_2d2.zulu){time+="Z";}else{if(_2d2.selector!="time"){var _2d7=_2d1.getTimezoneOffset();var _2d8=Math.abs(_2d7);time+=(_2d7>0?"-":"+")+_2d3(Math.floor(_2d8/60))+":"+_2d3(_2d8%60);}}_2d4.push(time);}return _2d4.join("T");};}if(!_8._hasResource["dojo.parser"]){_8._hasResource["dojo.parser"]=true;_8.provide("dojo.parser");new Date("X");_8.parser=new function(){var d=_8;function _2d9(_2da){if(d.isString(_2da)){return "string";}if(typeof _2da=="number"){return "number";}if(typeof _2da=="boolean"){return "boolean";}if(d.isFunction(_2da)){return "function";}if(d.isArray(_2da)){return "array";}if(_2da instanceof Date){return "date";}if(_2da instanceof d._Url){return "url";}return "object";};function _2db(_2dc,type){switch(type){case "string":return _2dc;case "number":return _2dc.length?Number(_2dc):NaN;case "boolean":return typeof _2dc=="boolean"?_2dc:!(_2dc.toLowerCase()=="false");case "function":if(d.isFunction(_2dc)){_2dc=_2dc.toString();_2dc=d.trim(_2dc.substring(_2dc.indexOf("{")+1,_2dc.length-1));}try{if(_2dc===""||_2dc.search(/[^\w\.]+/i)!=-1){return new Function(_2dc);}else{return d.getObject(_2dc,false)||new Function(_2dc);}}catch(e){return new Function();}case "array":return _2dc?_2dc.split(/\s*,\s*/):[];case "date":switch(_2dc){case "":return new Date("");case "now":return new Date();default:return d.date.stamp.fromISOString(_2dc);}case "url":return d.baseUrl+_2dc;default:return d.fromJson(_2dc);}};var _2dd={},_2de={};d.connect(d,"extend",function(){_2de={};});function _2df(cls,_2e0){for(var name in cls){if(name.charAt(0)=="_"){continue;}if(name in _2dd){continue;}_2e0[name]=_2d9(cls[name]);}return _2e0;};function _2e1(_2e2,_2e3){var c=_2de[_2e2];if(!c){var cls=d.getObject(_2e2),_2e4=null;if(!cls){return null;}if(!_2e3){_2e4=_2df(cls.prototype,{});}c={cls:cls,params:_2e4};}else{if(!_2e3&&!c.params){c.params=_2df(c.cls.prototype,{});}}return c;};this._functionFromScript=function(_2e5,_2e6){var _2e7="";var _2e8="";var _2e9=(_2e5.getAttribute(_2e6+"args")||_2e5.getAttribute("args"));if(_2e9){d.forEach(_2e9.split(/\s*,\s*/),function(part,idx){_2e7+="var "+part+" = arguments["+idx+"]; ";});}var _2ea=_2e5.getAttribute("with");if(_2ea&&_2ea.length){d.forEach(_2ea.split(/\s*,\s*/),function(part){_2e7+="with("+part+"){";_2e8+="}";});}return new Function(_2e7+_2e5.innerHTML+_2e8);};this.instantiate=function(_2eb,_2ec,args){var _2ed=[],_2ec=_2ec||{};args=args||{};var _2ee=(args.scope||d._scopeName)+"Type",_2ef="data-"+(args.scope||d._scopeName)+"-";d.forEach(_2eb,function(obj){if(!obj){return;}var node,type,_2f0,_2f1,_2f2,_2f3;if(obj.node){node=obj.node;type=obj.type;_2f3=obj.fastpath;_2f0=obj.clsInfo||(type&&_2e1(type,_2f3));_2f1=_2f0&&_2f0.cls;_2f2=obj.scripts;}else{node=obj;type=_2ee in _2ec?_2ec[_2ee]:node.getAttribute(_2ee);_2f0=type&&_2e1(type);_2f1=_2f0&&_2f0.cls;_2f2=(_2f1&&(_2f1._noScript||_2f1.prototype._noScript)?[]:d.query("> script[type^='dojo/']",node));}if(!_2f0){throw new Error("Could not load class '"+type);}var _2f4={};if(args.defaults){d._mixin(_2f4,args.defaults);}if(obj.inherited){d._mixin(_2f4,obj.inherited);}if(_2f3){var _2f5=node.getAttribute(_2ef+"props");if(_2f5&&_2f5.length){try{_2f5=d.fromJson.call(args.propsThis,"{"+_2f5+"}");d._mixin(_2f4,_2f5);}catch(e){throw new Error(e.toString()+" in data-dojo-props='"+_2f5+"'");}}var _2f6=node.getAttribute(_2ef+"attach-point");if(_2f6){_2f4.dojoAttachPoint=_2f6;}var _2f7=node.getAttribute(_2ef+"attach-event");if(_2f7){_2f4.dojoAttachEvent=_2f7;}_8.mixin(_2f4,_2ec);}else{var _2f8=node.attributes;for(var name in _2f0.params){var item=name in _2ec?{value:_2ec[name],specified:true}:_2f8.getNamedItem(name);if(!item||(!item.specified&&(!_8.isIE||name.toLowerCase()!="value"))){continue;}var _2f9=item.value;switch(name){case "class":_2f9="className" in _2ec?_2ec.className:node.className;break;case "style":_2f9="style" in _2ec?_2ec.style:(node.style&&node.style.cssText);}var _2fa=_2f0.params[name];if(typeof _2f9=="string"){_2f4[name]=_2db(_2f9,_2fa);}else{_2f4[name]=_2f9;}}}var _2fb=[],_2fc=[];d.forEach(_2f2,function(_2fd){node.removeChild(_2fd);var _2fe=(_2fd.getAttribute(_2ef+"event")||_2fd.getAttribute("event")),type=_2fd.getAttribute("type"),nf=d.parser._functionFromScript(_2fd,_2ef);if(_2fe){if(type=="dojo/connect"){_2fb.push({event:_2fe,func:nf});}else{_2f4[_2fe]=nf;}}else{_2fc.push(nf);}});var _2ff=_2f1.markupFactory||_2f1.prototype&&_2f1.prototype.markupFactory;var _300=_2ff?_2ff(_2f4,node,_2f1):new _2f1(_2f4,node);_2ed.push(_300);var _301=(node.getAttribute(_2ef+"id")||node.getAttribute("jsId"));if(_301){d.setObject(_301,_300);}d.forEach(_2fb,function(_302){d.connect(_300,_302.event,null,_302.func);});d.forEach(_2fc,function(func){func.call(_300);});});if(!_2ec._started){d.forEach(_2ed,function(_303){if(!args.noStart&&_303&&_8.isFunction(_303.startup)&&!_303._started&&(!_303.getParent||!_303.getParent())){_303.startup();}});}return _2ed;};this.parse=function(_304,args){var root;if(!args&&_304&&_304.rootNode){args=_304;root=args.rootNode;}else{root=_304;}args=args||{};var _305=(args.scope||d._scopeName)+"Type",_306="data-"+(args.scope||d._scopeName)+"-";function scan(_307,list){var _308=_8.clone(_307.inherited);_8.forEach(["dir","lang"],function(name){var val=_307.node.getAttribute(name);if(val){_308[name]=val;}});var _309=_307.clsInfo&&!_307.clsInfo.cls.prototype._noScript?_307.scripts:null;var _30a=(!_307.clsInfo||!_307.clsInfo.cls.prototype.stopParser)||(args&&args.template);for(var _30b=_307.node.firstChild;_30b;_30b=_30b.nextSibling){if(_30b.nodeType==1){var type,_30c=_30a&&_30b.getAttribute(_306+"type");if(_30c){type=_30c;}else{type=_30a&&_30b.getAttribute(_305);}var _30d=_30c==type;if(type){var _30e={"type":type,fastpath:_30d,clsInfo:_2e1(type,_30d),node:_30b,scripts:[],inherited:_308};list.push(_30e);scan(_30e,list);}else{if(_309&&_30b.nodeName.toLowerCase()=="script"){type=_30b.getAttribute("type");if(type&&/^dojo\/\w/i.test(type)){_309.push(_30b);}}else{if(_30a){scan({node:_30b,inherited:_308},list);}}}}}};var list=[];scan({node:root?_8.byId(root):_8.body(),inherited:(args&&args.inherited)||{dir:_8._isBodyLtr()?"ltr":"rtl"}},list);var _30f=args&&args.template?{template:true}:null;return this.instantiate(list,_30f,args);};}();(function(){var _310=function(){if(_8.config.parseOnLoad){_8.parser.parse();}};if(_8.getObject("dijit.wai.onload")===_8._loaders[0]){_8._loaders.splice(1,0,_310);}else{_8._loaders.unshift(_310);}})();}if(!_8._hasResource["dojo.cache"]){_8._hasResource["dojo.cache"]=true;_8.provide("dojo.cache");var _311={};_8.cache=function(_312,url,_313){if(typeof _312=="string"){var _314=_8.moduleUrl(_312,url);}else{_314=_312;_313=url;}var key=_314.toString();var val=_313;if(_313!=undefined&&!_8.isString(_313)){val=("value" in _313?_313.value:undefined);}var _315=_313&&_313.sanitize?true:false;if(typeof val=="string"){val=_311[key]=_315?_8.cache._sanitize(val):val;}else{if(val===null){delete _311[key];}else{if(!(key in _311)){val=_8._getText(key);_311[key]=_315?_8.cache._sanitize(val):val;}val=_311[key];}}return val;};_8.cache._sanitize=function(val){if(val){val=val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _316=val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_316){val=_316[1];}}else{val="";}return val;};}if(!_8._hasResource["dijit._Templated"]){_8._hasResource["dijit._Templated"]=true;_8.provide("dijit._Templated");_8.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[];},_stringRepl:function(tmpl){var _317=this.declaredClass,_318=this;return _8.string.substitute(tmpl,this,function(_319,key){if(key.charAt(0)=="!"){_319=_8.getObject(key.substr(1),false,_318);}if(typeof _319=="undefined"){throw new Error(_317+" template:"+key);}if(_319==null){return "";}return key.charAt(0)=="!"?_319:_319.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){var _31a=_9._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var node;if(_8.isString(_31a)){node=_8._toDom(this._stringRepl(_31a));if(node.nodeType!=1){throw new Error("Invalid template: "+_31a);}}else{node=_31a.cloneNode(true);}this.domNode=node;this.inherited(arguments);this._attachTemplateNodes(node);if(this.widgetsInTemplate){var cw=(this._startupWidgets=_8.parser.parse(node,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"}));this._supportingWidgets=_9.findWidgets(node);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(this.srcNodeRef);},_fillContent:function(_31b){var dest=this.containerNode;if(_31b&&dest){while(_31b.hasChildNodes()){dest.appendChild(_31b.firstChild);}}},_attachTemplateNodes:function(_31c,_31d){_31d=_31d||function(n,p){return n.getAttribute(p);};var _31e=_8.isArray(_31c)?_31c:(_31c.all||_31c.getElementsByTagName("*"));var x=_8.isArray(_31c)?0:-1;for(;x<_31e.length;x++){var _31f=(x==-1)?_31c:_31e[x];if(this.widgetsInTemplate&&(_31d(_31f,"dojoType")||_31d(_31f,"data-dojo-type"))){continue;}var _320=_31d(_31f,"dojoAttachPoint")||_31d(_31f,"data-dojo-attach-point");if(_320){var _321,_322=_320.split(/\s*,\s*/);while((_321=_322.shift())){if(_8.isArray(this[_321])){this[_321].push(_31f);}else{this[_321]=_31f;}this._attachPoints.push(_321);}}var _323=_31d(_31f,"dojoAttachEvent")||_31d(_31f,"data-dojo-attach-event");if(_323){var _324,_325=_323.split(/\s*,\s*/);var trim=_8.trim;while((_324=_325.shift())){if(_324){var _326=null;if(_324.indexOf(":")!=-1){var _327=_324.split(":");_324=trim(_327[0]);_326=trim(_327[1]);}else{_324=trim(_324);}if(!_326){_326=_324;}this._attachEvents.push(this.connect(_31f,_324,_326));}}}var role=_31d(_31f,"waiRole");if(role){_9.setWaiRole(_31f,role);}var _328=_31d(_31f,"waiState");if(_328){_8.forEach(_328.split(/\s*,\s*/),function(_329){if(_329.indexOf("-")!=-1){var pair=_329.split("-");_9.setWaiState(_31f,pair[0],pair[1]);}});}}},startup:function(){_8.forEach(this._startupWidgets,function(w){if(w&&!w._started&&w.startup){w.startup();}});this.inherited(arguments);},destroyRendering:function(){_8.forEach(this._attachPoints,function(_32a){delete this[_32a];},this);this._attachPoints=[];_8.forEach(this._attachEvents,this.disconnect,this);this._attachEvents=[];this.inherited(arguments);}});_9._Templated._templateCache={};_9._Templated.getCachedTemplate=function(_32b,_32c,_32d){var _32e=_9._Templated._templateCache;var key=_32c||_32b;var _32f=_32e[key];if(_32f){try{if(!_32f.ownerDocument||_32f.ownerDocument==_8.doc){return _32f;}}catch(e){}_8.destroy(_32f);}if(!_32c){_32c=_8.cache(_32b,{sanitize:true});}_32c=_8.string.trim(_32c);if(_32d||_32c.match(/\$\{([^\}]+)\}/g)){return (_32e[key]=_32c);}else{var node=_8._toDom(_32c);if(node.nodeType!=1){throw new Error("Invalid template: "+_32c);}return (_32e[key]=node);}};if(_8.isIE){_8.addOnWindowUnload(function(){var _330=_9._Templated._templateCache;for(var key in _330){var _331=_330[key];if(typeof _331=="object"){_8.destroy(_331);}delete _330[key];}});}_8.extend(_9._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}if(!_8._hasResource["dijit.Tooltip"]){_8._hasResource["dijit.Tooltip"]=true;_8.provide("dijit.Tooltip");_8.declare("dijit._MasterTooltip",[_9._Widget,_9._Templated],{duration:_9.defaultDuration,templateString:_8.cache("dijit","templates/Tooltip.html","<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\r\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\r\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\r\n></div>\r\n"),postCreate:function(){_8.body().appendChild(this.domNode);this.bgIframe=new _9.BackgroundIframe(this.domNode);this.fadeIn=_8.fadeIn({node:this.domNode,duration:this.duration,onEnd:_8.hitch(this,"_onShow")});this.fadeOut=_8.fadeOut({node:this.domNode,duration:this.duration,onEnd:_8.hitch(this,"_onHide")});},show:function(_332,_333,_334,rtl){if(this.aroundNode&&this.aroundNode===_333){return;}this.domNode.width="auto";if(this.fadeOut.status()=="playing"){this._onDeck=arguments;return;}this.containerNode.innerHTML=_332;var pos=_9.placeOnScreenAroundElement(this.domNode,_333,_9.getPopupAroundAlignment((_334&&_334.length)?_334:_9.Tooltip.defaultPosition,!rtl),_8.hitch(this,"orient"));_8.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=_333;},orient:function(node,_335,_336,_337,_338){this.connectorNode.style.top="";var _339=_337.w-this.connectorNode.offsetWidth;node.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_335+"-"+_336];this.domNode.style.width="auto";var size=_8.contentBox(this.domNode);var _33a=Math.min((Math.max(_339,1)),size.w);var _33b=_33a<size.w;this.domNode.style.width=_33a+"px";if(_33b){this.containerNode.style.overflow="auto";var _33c=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(_33c>_33a){_33c=_33c+_8.style(this.domNode,"paddingLeft")+_8.style(this.domNode,"paddingRight");this.domNode.style.width=_33c+"px";}}if(_336.charAt(0)=="B"&&_335.charAt(0)=="B"){var mb=_8.marginBox(node);var _33d=this.connectorNode.offsetHeight;if(mb.h>_337.h){var _33e=_337.h-(_338.h/2)-(_33d/2);this.connectorNode.style.top=_33e+"px";this.connectorNode.style.bottom="";}else{this.connectorNode.style.bottom=Math.min(Math.max(_338.h/2-_33d/2,0),mb.h-_33d)+"px";this.connectorNode.style.top="";}}else{this.connectorNode.style.top="";this.connectorNode.style.bottom="";}return Math.max(0,size.w-_339);},_onShow:function(){if(_8.isIE){this.domNode.style.filter="";}},hide:function(_33f){if(this._onDeck&&this._onDeck[1]==_33f){this._onDeck=null;}else{if(this.aroundNode===_33f){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play();}else{}}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null;}}});_9.showTooltip=function(_340,_341,_342,rtl){if(!_9._masterTT){_9._masterTT=new _9._MasterTooltip();}return _9._masterTT.show(_340,_341,_342,rtl);};_9.hideTooltip=function(_343){if(!_9._masterTT){_9._masterTT=new _9._MasterTooltip();}return _9._masterTT.hide(_343);};_8.declare("dijit.Tooltip",_9._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(_344){_8.forEach(this._connections||[],function(_345){_8.forEach(_345,_8.hitch(this,"disconnect"));},this);var ary=_8.isArrayLike(_344)?_344:(_344?[_344]:[]);this._connections=_8.map(ary,function(id){var node=_8.byId(id);return node?[this.connect(node,"onmouseenter","_onTargetMouseEnter"),this.connect(node,"onmouseleave","_onTargetMouseLeave"),this.connect(node,"onfocus","_onTargetFocus"),this.connect(node,"onblur","_onTargetBlur")]:[];},this);this._set("connectId",_344);this._connectIds=ary;},addTarget:function(node){var id=node.id||node;if(_8.indexOf(this._connectIds,id)==-1){this.set("connectId",this._connectIds.concat(id));}},removeTarget:function(node){var id=node.id||node,idx=_8.indexOf(this._connectIds,id);if(idx>=0){this._connectIds.splice(idx,1);this.set("connectId",this._connectIds);}},buildRendering:function(){this.inherited(arguments);_8.addClass(this.domNode,"dijitTooltipData");},startup:function(){this.inherited(arguments);var ids=this.connectId;_8.forEach(_8.isArrayLike(ids)?ids:[ids],this.addTarget,this);},_onTargetMouseEnter:function(e){this._onHover(e);},_onTargetMouseLeave:function(e){this._onUnHover(e);},_onTargetFocus:function(e){this._focus=true;this._onHover(e);},_onTargetBlur:function(e){this._focus=false;this._onUnHover(e);},_onHover:function(e){if(!this._showTimer){var _346=e.target;this._showTimer=setTimeout(_8.hitch(this,function(){this.open(_346);}),this.showDelay);}},_onUnHover:function(e){if(this._focus){return;}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}this.close();},open:function(_347){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}_9.showTooltip(this.label||this.domNode.innerHTML,_347,this.position,!this.isLeftToRight());this._connectNode=_347;this.onShow(_347,this.position);},close:function(){if(this._connectNode){_9.hideTooltip(this._connectNode);delete this._connectNode;this.onHide();}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}},onShow:function(_348,_349){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments);}});_9.Tooltip.defaultPosition=["after","before"];}if(!_8._hasResource["dojox.charting.action2d.Tooltip"]){_8._hasResource["dojox.charting.action2d.Tooltip"]=true;_8.provide("dojox.charting.action2d.Tooltip");(function(){var _34a=function(o){var t=o.run&&o.run.data&&o.run.data[o.index];if(t&&typeof t!="number"&&(t.tooltip||t.text)){return t.tooltip||t.text;}if(o.element=="candlestick"){return "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:0.9em;\">"+"<tr><td>Open:</td><td align=\"right\"><strong>"+o.data.open+"</strong></td></tr>"+"<tr><td>High:</td><td align=\"right\"><strong>"+o.data.high+"</strong></td></tr>"+"<tr><td>Low:</td><td align=\"right\"><strong>"+o.data.low+"</strong></td></tr>"+"<tr><td>Close:</td><td align=\"right\"><strong>"+o.data.close+"</strong></td></tr>"+(o.data.mid!==undefined?"<tr><td>Mid:</td><td align=\"right\"><strong>"+o.data.mid+"</strong></td></tr>":"")+"</table>";}return o.element=="bar"?o.x:o.y;};var df=_a.lang.functional,m=_a.gfx.matrix,pi4=Math.PI/4,pi2=Math.PI/2;_8.declare("dojox.charting.action2d.Tooltip",_a.charting.action2d.Base,{defaultParams:{text:_34a},optionalParams:{},constructor:function(_34b,plot,_34c){this.text=_34c&&_34c.text?_34c.text:_34a;this.connect();},process:function(o){if(o.type==="onplotreset"||o.type==="onmouseout"){_9.hideTooltip(this.aroundRect);this.aroundRect=null;if(o.type==="onplotreset"){delete this.angles;}return;}if(!o.shape||o.type!=="onmouseover"){return;}var _34d={type:"rect"},_34e=["after","before"];switch(o.element){case "marker":_34d.x=o.cx;_34d.y=o.cy;_34d.width=_34d.height=1;break;case "circle":_34d.x=o.cx-o.cr;_34d.y=o.cy-o.cr;_34d.width=_34d.height=2*o.cr;break;case "column":_34e=["above","below"];case "bar":_34d=_8.clone(o.shape.getShape());break;case "candlestick":_34d.x=o.x;_34d.y=o.y;_34d.width=o.width;_34d.height=o.height;break;default:if(!this.angles){if(typeof o.run.data[0]=="number"){this.angles=df.map(df.scanl(o.run.data,"+",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"+",0));}else{this.angles=df.map(df.scanl(o.run.data,"a + b.y",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"a + b.y",0));}}var _34f=m._degToRad(o.plot.opt.startAngle),_350=(this.angles[o.index]+this.angles[o.index+1])/2+_34f;_34d.x=o.cx+o.cr*Math.cos(_350);_34d.y=o.cy+o.cr*Math.sin(_350);_34d.width=_34d.height=1;if(_350<pi4){}else{if(_350<pi2+pi4){_34e=["below","above"];}else{if(_350<Math.PI+pi4){_34e=["before","after"];}else{if(_350<2*Math.PI-pi4){_34e=["above","below"];}}}}break;}var lt=_8.coords(this.chart.node,true);_34d.x+=lt.x;_34d.y+=lt.y;_34d.x=Math.round(_34d.x);_34d.y=Math.round(_34d.y);_34d.width=Math.ceil(_34d.width);_34d.height=Math.ceil(_34d.height);this.aroundRect=_34d;var _351=this.text(o);if(_351){_9.showTooltip(_351,this.aroundRect,_34e);}}});})();}if(!_8._hasResource["dojox.charting.scaler.common"]){_8._hasResource["dojox.charting.scaler.common"]=true;_8.provide("dojox.charting.scaler.common");(function(){var eq=function(a,b){return Math.abs(a-b)<=0.000001*(Math.abs(a)+Math.abs(b));};_8.mixin(_a.charting.scaler.common,{findString:function(val,text){val=val.toLowerCase();for(var i=0;i<text.length;++i){if(val==text[i]){return true;}}return false;},getNumericLabel:function(_352,_353,_354){var def="";if(_8.number){def=(_354.fixed?_8.number.format(_352,{places:_353<0?-_353:0}):_8.number.format(_352))||"";}else{def=_354.fixed?_352.toFixed(_353<0?-_353:0):_352.toString();}if(_354.labelFunc){var r=_354.labelFunc(def,_352,_353);if(r){return r;}}if(_354.labels){var l=_354.labels,lo=0,hi=l.length;while(lo<hi){var mid=Math.floor((lo+hi)/2),val=l[mid].value;if(val<_352){lo=mid+1;}else{hi=mid;}}if(lo<l.length&&eq(l[lo].value,_352)){return l[lo].text;}--lo;if(lo>=0&&lo<l.length&&eq(l[lo].value,_352)){return l[lo].text;}lo+=2;if(lo<l.length&&eq(l[lo].value,_352)){return l[lo].text;}}return def;}});})();}if(!_8._hasResource["dojox.charting.scaler.linear"]){_8._hasResource["dojox.charting.scaler.linear"]=true;_8.provide("dojox.charting.scaler.linear");(function(){var _355=3,dc=_a.charting,dcs=dc.scaler,dcsc=dcs.common,_356=dcsc.findString,_357=dcsc.getNumericLabel;var _358=function(min,max,_359,_35a,_35b,_35c,span){_359=_8.delegate(_359);if(!_35a){if(_359.fixUpper=="major"){_359.fixUpper="minor";}if(_359.fixLower=="major"){_359.fixLower="minor";}}if(!_35b){if(_359.fixUpper=="minor"){_359.fixUpper="micro";}if(_359.fixLower=="minor"){_359.fixLower="micro";}}if(!_35c){if(_359.fixUpper=="micro"){_359.fixUpper="none";}if(_359.fixLower=="micro"){_359.fixLower="none";}}var _35d=_356(_359.fixLower,["major"])?Math.floor(_359.min/_35a)*_35a:_356(_359.fixLower,["minor"])?Math.floor(_359.min/_35b)*_35b:_356(_359.fixLower,["micro"])?Math.floor(_359.min/_35c)*_35c:_359.min,_35e=_356(_359.fixUpper,["major"])?Math.ceil(_359.max/_35a)*_35a:_356(_359.fixUpper,["minor"])?Math.ceil(_359.max/_35b)*_35b:_356(_359.fixUpper,["micro"])?Math.ceil(_359.max/_35c)*_35c:_359.max;if(_359.useMin){min=_35d;}if(_359.useMax){max=_35e;}var _35f=(!_35a||_359.useMin&&_356(_359.fixLower,["major"]))?min:Math.ceil(min/_35a)*_35a,_360=(!_35b||_359.useMin&&_356(_359.fixLower,["major","minor"]))?min:Math.ceil(min/_35b)*_35b,_361=(!_35c||_359.useMin&&_356(_359.fixLower,["major","minor","micro"]))?min:Math.ceil(min/_35c)*_35c,_362=!_35a?0:(_359.useMax&&_356(_359.fixUpper,["major"])?Math.round((max-_35f)/_35a):Math.floor((max-_35f)/_35a))+1,_363=!_35b?0:(_359.useMax&&_356(_359.fixUpper,["major","minor"])?Math.round((max-_360)/_35b):Math.floor((max-_360)/_35b))+1,_364=!_35c?0:(_359.useMax&&_356(_359.fixUpper,["major","minor","micro"])?Math.round((max-_361)/_35c):Math.floor((max-_361)/_35c))+1,_365=_35b?Math.round(_35a/_35b):0,_366=_35c?Math.round(_35b/_35c):0,_367=_35a?Math.floor(Math.log(_35a)/Math.LN10):0,_368=_35b?Math.floor(Math.log(_35b)/Math.LN10):0,_369=span/(max-min);if(!isFinite(_369)){_369=1;}return {bounds:{lower:_35d,upper:_35e,from:min,to:max,scale:_369,span:span},major:{tick:_35a,start:_35f,count:_362,prec:_367},minor:{tick:_35b,start:_360,count:_363,prec:_368},micro:{tick:_35c,start:_361,count:_364,prec:0},minorPerMajor:_365,microPerMinor:_366,scaler:dcs.linear};};_8.mixin(_a.charting.scaler.linear,{buildScaler:function(min,max,span,_36a){var h={fixUpper:"none",fixLower:"none",natural:false};if(_36a){if("fixUpper" in _36a){h.fixUpper=String(_36a.fixUpper);}if("fixLower" in _36a){h.fixLower=String(_36a.fixLower);}if("natural" in _36a){h.natural=Boolean(_36a.natural);}}if("min" in _36a){min=_36a.min;}if("max" in _36a){max=_36a.max;}if(_36a.includeZero){if(min>0){min=0;}if(max<0){max=0;}}h.min=min;h.useMin=true;h.max=max;h.useMax=true;if("from" in _36a){min=_36a.from;h.useMin=false;}if("to" in _36a){max=_36a.to;h.useMax=false;}if(max<=min){return _358(min,max,h,0,0,0,span);}var mag=Math.floor(Math.log(max-min)/Math.LN10),_36b=_36a&&("majorTickStep" in _36a)?_36a.majorTickStep:Math.pow(10,mag),_36c=0,_36d=0,_36e;if(_36a&&("minorTickStep" in _36a)){_36c=_36a.minorTickStep;}else{do{_36c=_36b/10;if(!h.natural||_36c>0.9){_36e=_358(min,max,h,_36b,_36c,0,span);if(_36e.bounds.scale*_36e.minor.tick>_355){break;}}_36c=_36b/5;if(!h.natural||_36c>0.9){_36e=_358(min,max,h,_36b,_36c,0,span);if(_36e.bounds.scale*_36e.minor.tick>_355){break;}}_36c=_36b/2;if(!h.natural||_36c>0.9){_36e=_358(min,max,h,_36b,_36c,0,span);if(_36e.bounds.scale*_36e.minor.tick>_355){break;}}return _358(min,max,h,_36b,0,0,span);}while(false);}if(_36a&&("microTickStep" in _36a)){_36d=_36a.microTickStep;_36e=_358(min,max,h,_36b,_36c,_36d,span);}else{do{_36d=_36c/10;if(!h.natural||_36d>0.9){_36e=_358(min,max,h,_36b,_36c,_36d,span);if(_36e.bounds.scale*_36e.micro.tick>_355){break;}}_36d=_36c/5;if(!h.natural||_36d>0.9){_36e=_358(min,max,h,_36b,_36c,_36d,span);if(_36e.bounds.scale*_36e.micro.tick>_355){break;}}_36d=_36c/2;if(!h.natural||_36d>0.9){_36e=_358(min,max,h,_36b,_36c,_36d,span);if(_36e.bounds.scale*_36e.micro.tick>_355){break;}}_36d=0;}while(false);}return _36d?_36e:_358(min,max,h,_36b,_36c,0,span);},buildTicks:function(_36f,_370){var step,next,tick,_371=_36f.major.start,_372=_36f.minor.start,_373=_36f.micro.start;if(_370.microTicks&&_36f.micro.tick){step=_36f.micro.tick,next=_373;}else{if(_370.minorTicks&&_36f.minor.tick){step=_36f.minor.tick,next=_372;}else{if(_36f.major.tick){step=_36f.major.tick,next=_371;}else{return null;}}}var _374=1/_36f.bounds.scale;if(_36f.bounds.to<=_36f.bounds.from||isNaN(_374)||!isFinite(_374)||step<=0||isNaN(step)||!isFinite(step)){return null;}var _375=[],_376=[],_377=[];while(next<=_36f.bounds.to+_374){if(Math.abs(_371-next)<step/2){tick={value:_371};if(_370.majorLabels){tick.label=_357(_371,_36f.major.prec,_370);}_375.push(tick);_371+=_36f.major.tick;_372+=_36f.minor.tick;_373+=_36f.micro.tick;}else{if(Math.abs(_372-next)<step/2){if(_370.minorTicks){tick={value:_372};if(_370.minorLabels&&(_36f.minMinorStep<=_36f.minor.tick*_36f.bounds.scale)){tick.label=_357(_372,_36f.minor.prec,_370);}_376.push(tick);}_372+=_36f.minor.tick;_373+=_36f.micro.tick;}else{if(_370.microTicks){_377.push({value:_373});}_373+=_36f.micro.tick;}}next+=step;}return {major:_375,minor:_376,micro:_377};},getTransformerFromModel:function(_378){var _379=_378.bounds.from,_37a=_378.bounds.scale;return function(x){return (x-_379)*_37a;};},getTransformerFromPlot:function(_37b){var _37c=_37b.bounds.from,_37d=_37b.bounds.scale;return function(x){return x/_37d+_37c;};}});})();}if(!_8._hasResource["dojox.charting.axis2d.Base"]){_8._hasResource["dojox.charting.axis2d.Base"]=true;_8.provide("dojox.charting.axis2d.Base");_8.declare("dojox.charting.axis2d.Base",_a.charting.Element,{constructor:function(_37e,_37f){this.vertical=_37f&&_37f.vertical;},clear:function(){return this;},initialized:function(){return false;},calculate:function(min,max,span){return this;},getScaler:function(){return null;},getTicks:function(){return null;},getOffsets:function(){return {l:0,r:0,t:0,b:0};},render:function(dim,_380){this.dirty=false;return this;}});}if(!_8._hasResource["dojox.charting.axis2d.Invisible"]){_8._hasResource["dojox.charting.axis2d.Invisible"]=true;_8.provide("dojox.charting.axis2d.Invisible");(function(){var dc=_a.charting,df=_a.lang.functional,du=_a.lang.utils,g=_a.gfx,lin=dc.scaler.linear,_381=du.merge,_382=4,_383=45;_8.declare("dojox.charting.axis2d.Invisible",_a.charting.axis2d.Base,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null},constructor:function(_384,_385){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_385);du.updateWithPattern(this.opt,_385,this.optionalParams);},dependOnData:function(){return !("min" in this.opt)||!("max" in this.opt);},clear:function(){delete this.scaler;delete this.ticks;this.dirty=true;return this;},initialized:function(){return "scaler" in this&&!(this.dirty&&this.dependOnData());},setWindow:function(_386,_387){this.scale=_386;this.offset=_387;return this.clear();},getWindowScale:function(){return "scale" in this?this.scale:1;},getWindowOffset:function(){return "offset" in this?this.offset:0;},_groupLabelWidth:function(_388,font,_389){if(!_388.length){return 0;}if(_8.isObject(_388[0])){_388=df.map(_388,function(_38a){return _38a.text;});}if(_389){_388=df.map(_388,function(_38b){return _8.trim(_38b).length==0?"":_38b.substring(0,_389)+this.trailingSymbol;},this);}var s=_388.join("<br>");return _a.gfx._base._getTextBox(s,{font:font}).w||0;},calculate:function(min,max,span,_38c){if(this.initialized()){return this;}var o=this.opt;this.labels="labels" in o?o.labels:_38c;this.scaler=lin.buildScaler(min,max,span,o);var tsb=this.scaler.bounds;if("scale" in this){o.from=tsb.lower+this.offset;o.to=(tsb.upper-tsb.lower)/this.scale+o.from;if(!isFinite(o.from)||isNaN(o.from)||!isFinite(o.to)||isNaN(o.to)||o.to-o.from>=tsb.upper-tsb.lower){delete o.from;delete o.to;delete this.scale;delete this.offset;}else{if(o.from<tsb.lower){o.to+=tsb.lower-o.from;o.from=tsb.lower;}else{if(o.to>tsb.upper){o.from+=tsb.upper-o.to;o.to=tsb.upper;}}this.offset=o.from-tsb.lower;}this.scaler=lin.buildScaler(min,max,span,o);tsb=this.scaler.bounds;if(this.scale==1&&this.offset==0){delete this.scale;delete this.offset;}}var ta=this.chart.theme.axis,_38d=0,_38e=o.rotation%360,_38f=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),size=_38f?g.normalizedLength(g.splitFontString(_38f).size):0,cosr=Math.abs(Math.cos(_38e*Math.PI/180)),sinr=Math.abs(Math.sin(_38e*Math.PI/180));if(_38e<0){_38e+=360;}if(size){if(this.vertical?_38e!=0&&_38e!=180:_38e!=90&&_38e!=270){if(this.labels){_38d=this._groupLabelWidth(this.labels,_38f,o.maxLabelCharCount);}else{var _390=Math.ceil(Math.log(Math.max(Math.abs(tsb.from),Math.abs(tsb.to)))/Math.LN10),t=[];if(tsb.from<0||tsb.to<0){t.push("-");}t.push(_8.string.rep("9",_390));var _391=Math.floor(Math.log(tsb.to-tsb.from)/Math.LN10);if(_391>0){t.push(".");t.push(_8.string.rep("9",_391));}_38d=_a.gfx._base._getTextBox(t.join(""),{font:_38f}).w;}_38d=o.maxLabelSize?Math.min(o.maxLabelSize,_38d):_38d;}else{_38d=size;}switch(_38e){case 0:case 90:case 180:case 270:break;default:var gap1=Math.sqrt(_38d*_38d+size*size),gap2=this.vertical?size*cosr+_38d*sinr:_38d*cosr+size*sinr;_38d=Math.min(gap1,gap2);break;}}this.scaler.minMinorStep=_38d+_382;this.ticks=lin.buildTicks(this.scaler,o);return this;},getScaler:function(){return this.scaler;},getTicks:function(){return this.ticks;}});})();}if(!_8._hasResource["dojox.charting.axis2d.Default"]){_8._hasResource["dojox.charting.axis2d.Default"]=true;_8.provide("dojox.charting.axis2d.Default");(function(){var dc=_a.charting,du=_a.lang.utils,g=_a.gfx,lin=dc.scaler.linear,_392=4,_393=45;_8.declare("dojox.charting.axis2d.Default",_a.charting.axis2d.Invisible,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0,htmlLabels:true},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null,stroke:{},majorTick:{},minorTick:{},microTick:{},tick:{},font:"",fontColor:"",title:"",titleGap:0,titleFont:"",titleFontColor:"",titleOrientation:""},constructor:function(_394,_395){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_395);du.updateWithPattern(this.opt,_395,this.optionalParams);},getOffsets:function(){var s=this.scaler,_396={l:0,r:0,t:0,b:0};if(!s){return _396;}var o=this.opt,_397=0,a,b,c,d,gl=dc.scaler.common.getNumericLabel,_398=0,ma=s.major,mi=s.minor,ta=this.chart.theme.axis,_399=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_39a=o.titleFont||(ta.tick&&ta.tick.titleFont),_39b=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_39c=this.chart.theme.getTick("major",o),_39d=this.chart.theme.getTick("minor",o),size=_399?g.normalizedLength(g.splitFontString(_399).size):0,_39e=_39a?g.normalizedLength(g.splitFontString(_39a).size):0,_39f=o.rotation%360,_3a0=o.leftBottom,cosr=Math.abs(Math.cos(_39f*Math.PI/180)),sinr=Math.abs(Math.sin(_39f*Math.PI/180));this.trailingSymbol=(o.trailingSymbol===undefined||o.trailingSymbol===null)?this.trailingSymbol:o.trailingSymbol;if(_39f<0){_39f+=360;}if(size){if(this.labels){_397=this._groupLabelWidth(this.labels,_399,o.maxLabelCharCount);}else{_397=this._groupLabelWidth([gl(ma.start,ma.prec,o),gl(ma.start+ma.count*ma.tick,ma.prec,o),gl(mi.start,mi.prec,o),gl(mi.start+mi.count*mi.tick,mi.prec,o)],_399,o.maxLabelCharCount);}_397=o.maxLabelSize?Math.min(o.maxLabelSize,_397):_397;if(this.vertical){var side=_3a0?"l":"r";switch(_39f){case 0:case 180:_396[side]=_397;_396.t=_396.b=size/2;break;case 90:case 270:_396[side]=size;_396.t=_396.b=_397/2;break;default:if(_39f<=_393||(180<_39f&&_39f<=(180+_393))){_396[side]=size*sinr/2+_397*cosr;_396[_3a0?"t":"b"]=size*cosr/2+_397*sinr;_396[_3a0?"b":"t"]=size*cosr/2;}else{if(_39f>(360-_393)||(180>_39f&&_39f>(180-_393))){_396[side]=size*sinr/2+_397*cosr;_396[_3a0?"b":"t"]=size*cosr/2+_397*sinr;_396[_3a0?"t":"b"]=size*cosr/2;}else{if(_39f<90||(180<_39f&&_39f<270)){_396[side]=size*sinr+_397*cosr;_396[_3a0?"t":"b"]=size*cosr+_397*sinr;}else{_396[side]=size*sinr+_397*cosr;_396[_3a0?"b":"t"]=size*cosr+_397*sinr;}}}break;}_396[side]+=_392+Math.max(_39c.length,_39d.length)+(o.title?(_39e+_39b):0);}else{var side=_3a0?"b":"t";switch(_39f){case 0:case 180:_396[side]=size;_396.l=_396.r=_397/2;break;case 90:case 270:_396[side]=_397;_396.l=_396.r=size/2;break;default:if((90-_393)<=_39f&&_39f<=90||(270-_393)<=_39f&&_39f<=270){_396[side]=size*sinr/2+_397*cosr;_396[_3a0?"r":"l"]=size*cosr/2+_397*sinr;_396[_3a0?"l":"r"]=size*cosr/2;}else{if(90<=_39f&&_39f<=(90+_393)||270<=_39f&&_39f<=(270+_393)){_396[side]=size*sinr/2+_397*cosr;_396[_3a0?"l":"r"]=size*cosr/2+_397*sinr;_396[_3a0?"r":"l"]=size*cosr/2;}else{if(_39f<_393||(180<_39f&&_39f<(180-_393))){_396[side]=size*sinr+_397*cosr;_396[_3a0?"r":"l"]=size*cosr+_397*sinr;}else{_396[side]=size*sinr+_397*cosr;_396[_3a0?"l":"r"]=size*cosr+_397*sinr;}}}break;}_396[side]+=_392+Math.max(_39c.length,_39d.length)+(o.title?(_39e+_39b):0);}}if(_397){this._cachedLabelWidth=_397;}return _396;},render:function(dim,_3a1){if(!this.dirty){return this;}var o=this.opt,ta=this.chart.theme.axis,_3a2=o.leftBottom,_3a3=o.rotation%360,_3a4,stop,_3a5,_3a6=0,_3a7,_3a8,_3a9,_3aa,_3ab,_3ac,_3ad=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_3ae=o.titleFont||(ta.tick&&ta.tick.titleFont),_3af=o.fontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"black",_3b0=o.titleFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_3b1=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_3b2=o.titleOrientation||(ta.tick&&ta.tick.titleOrientation)||"axis",_3b3=this.chart.theme.getTick("major",o),_3b4=this.chart.theme.getTick("minor",o),_3b5=this.chart.theme.getTick("micro",o),_3b6=Math.max(_3b3.length,_3b4.length,_3b5.length),_3b7="stroke" in o?o.stroke:ta.stroke,size=_3ad?g.normalizedLength(g.splitFontString(_3ad).size):0,cosr=Math.abs(Math.cos(_3a3*Math.PI/180)),sinr=Math.abs(Math.sin(_3a3*Math.PI/180)),_3b8=_3ae?g.normalizedLength(g.splitFontString(_3ae).size):0;if(_3a3<0){_3a3+=360;}if(this.vertical){_3a4={y:dim.height-_3a1.b};stop={y:_3a1.t};_3a5={y:(dim.height-_3a1.b+_3a1.t)/2};_3a7=size*sinr+(this._cachedLabelWidth||0)*cosr+_392+Math.max(_3b3.length,_3b4.length)+_3b8+_3b1;_3a8={x:0,y:-1};_3ab={x:0,y:0};_3a9={x:1,y:0};_3aa={x:_392,y:0};switch(_3a3){case 0:_3ac="end";_3ab.y=size*0.4;break;case 90:_3ac="middle";_3ab.x=-size;break;case 180:_3ac="start";_3ab.y=-size*0.4;break;case 270:_3ac="middle";break;default:if(_3a3<_393){_3ac="end";_3ab.y=size*0.4;}else{if(_3a3<90){_3ac="end";_3ab.y=size*0.4;}else{if(_3a3<(180-_393)){_3ac="start";}else{if(_3a3<(180+_393)){_3ac="start";_3ab.y=-size*0.4;}else{if(_3a3<270){_3ac="start";_3ab.x=_3a2?0:size*0.4;}else{if(_3a3<(360-_393)){_3ac="end";_3ab.x=_3a2?0:size*0.4;}else{_3ac="end";_3ab.y=size*0.4;}}}}}}}if(_3a2){_3a4.x=stop.x=_3a1.l;_3a6=(_3b2&&_3b2=="away")?90:270;_3a5.x=_3a1.l-_3a7+(_3a6==270?_3b8:0);_3a9.x=-1;_3aa.x=-_3aa.x;}else{_3a4.x=stop.x=dim.width-_3a1.r;_3a6=(_3b2&&_3b2=="axis")?90:270;_3a5.x=dim.width-_3a1.r+_3a7-(_3a6==270?0:_3b8);switch(_3ac){case "start":_3ac="end";break;case "end":_3ac="start";break;case "middle":_3ab.x+=size;break;}}}else{_3a4={x:_3a1.l};stop={x:dim.width-_3a1.r};_3a5={x:(dim.width-_3a1.r+_3a1.l)/2};_3a7=size*cosr+(this._cachedLabelWidth||0)*sinr+_392+Math.max(_3b3.length,_3b4.length)+_3b8+_3b1;_3a8={x:1,y:0};_3ab={x:0,y:0};_3a9={x:0,y:1};_3aa={x:0,y:_392};switch(_3a3){case 0:_3ac="middle";_3ab.y=size;break;case 90:_3ac="start";_3ab.x=-size*0.4;break;case 180:_3ac="middle";break;case 270:_3ac="end";_3ab.x=size*0.4;break;default:if(_3a3<(90-_393)){_3ac="start";_3ab.y=_3a2?size:0;}else{if(_3a3<(90+_393)){_3ac="start";_3ab.x=-size*0.4;}else{if(_3a3<180){_3ac="start";_3ab.y=_3a2?0:-size;}else{if(_3a3<(270-_393)){_3ac="end";_3ab.y=_3a2?0:-size;}else{if(_3a3<(270+_393)){_3ac="end";_3ab.y=_3a2?size*0.4:0;}else{_3ac="end";_3ab.y=_3a2?size:0;}}}}}}if(_3a2){_3a4.y=stop.y=dim.height-_3a1.b;_3a6=(_3b2&&_3b2=="axis")?180:0;_3a5.y=dim.height-_3a1.b+_3a7-(_3a6?_3b8:0);}else{_3a4.y=stop.y=_3a1.t;_3a6=(_3b2&&_3b2=="away")?180:0;_3a5.y=_3a1.t-_3a7+(_3a6?0:_3b8);_3a9.y=-1;_3aa.y=-_3aa.y;switch(_3ac){case "start":_3ac="end";break;case "end":_3ac="start";break;case "middle":_3ab.y-=size;break;}}}this.cleanGroup();try{var s=this.group,c=this.scaler,t=this.ticks,_3b9,f=lin.getTransformerFromModel(this.scaler),_3ba=!_3a6&&!_3a3&&this.opt.htmlLabels&&!_8.isIE&&!_8.isOpera?"html":"gfx",dx=_3a9.x*_3b3.length,dy=_3a9.y*_3b3.length;s.createLine({x1:_3a4.x,y1:_3a4.y,x2:stop.x,y2:stop.y}).setStroke(_3b7);if(o.title){var _3bb=dc.axis2d.common.createText[_3ba](this.chart,s,_3a5.x,_3a5.y,"middle",o.title,_3ae,_3b0);if(_3ba=="html"){this.htmlElements.push(_3bb);}else{_3bb.setTransform(g.matrix.rotategAt(_3a6,_3a5.x,_3a5.y));}}_8.forEach(t.major,function(tick){var _3bc=f(tick.value),elem,x=_3a4.x+_3a8.x*_3bc,y=_3a4.y+_3a8.y*_3bc;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3b3);if(tick.label){var _3bd=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_3ad,o.maxLabelCharCount):{text:tick.label,truncated:false};_3bd=o.maxLabelSize?this.getTextWithLimitLength(_3bd.text,_3ad,o.maxLabelSize,_3bd.truncated):_3bd;elem=dc.axis2d.common.createText[_3ba](this.chart,s,x+dx+_3aa.x+(_3a3?0:_3ab.x),y+dy+_3aa.y+(_3a3?0:_3ab.y),_3ac,_3bd.text,_3ad,_3af);_3bd.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3bd.text,_3ad,_3ba);if(_3ba=="html"){this.htmlElements.push(elem);}else{if(_3a3){elem.setTransform([{dx:_3ab.x,dy:_3ab.y},g.matrix.rotategAt(_3a3,x+dx+_3aa.x,y+dy+_3aa.y)]);}}}},this);dx=_3a9.x*_3b4.length;dy=_3a9.y*_3b4.length;_3b9=c.minMinorStep<=c.minor.tick*c.bounds.scale;_8.forEach(t.minor,function(tick){var _3be=f(tick.value),elem,x=_3a4.x+_3a8.x*_3be,y=_3a4.y+_3a8.y*_3be;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3b4);if(_3b9&&tick.label){var _3bf=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_3ad,o.maxLabelCharCount):{text:tick.label,truncated:false};_3bf=o.maxLabelSize?this.getTextWithLimitLength(_3bf.text,_3ad,o.maxLabelSize,_3bf.truncated):_3bf;elem=dc.axis2d.common.createText[_3ba](this.chart,s,x+dx+_3aa.x+(_3a3?0:_3ab.x),y+dy+_3aa.y+(_3a3?0:_3ab.y),_3ac,_3bf.text,_3ad,_3af);_3bf.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3bf.text,_3ad,_3ba);if(_3ba=="html"){this.htmlElements.push(elem);}else{if(_3a3){elem.setTransform([{dx:_3ab.x,dy:_3ab.y},g.matrix.rotategAt(_3a3,x+dx+_3aa.x,y+dy+_3aa.y)]);}}}},this);dx=_3a9.x*_3b5.length;dy=_3a9.y*_3b5.length;_8.forEach(t.micro,function(tick){var _3c0=f(tick.value),elem,x=_3a4.x+_3a8.x*_3c0,y=_3a4.y+_3a8.y*_3c0;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3b5);},this);}catch(e){}this.dirty=false;return this;},labelTooltip:function(elem,_3c1,_3c2,_3c3,font,_3c4){if(!_9||!_9.Tooltip){return;}var _3c5={type:"rect"},_3c6=["above","below"],_3c7=_a.gfx._base._getTextBox(_3c3,{font:font}).w||0;fontHeight=font?g.normalizedLength(g.splitFontString(font).size):0;if(_3c4=="html"){_8.mixin(_3c5,_8.coords(elem.firstChild,true));_3c5.width=Math.ceil(_3c7);_3c5.height=Math.ceil(fontHeight);this._events.push({shape:_8,handle:_8.connect(elem.firstChild,"onmouseover",this,function(e){_9.showTooltip(_3c2,_3c5,_3c6);})});this._events.push({shape:_8,handle:_8.connect(elem.firstChild,"onmouseout",this,function(e){_9.hideTooltip(_3c5);})});}else{var shp=elem.getShape(),lt=_8.coords(_3c1.node,true);_3c5=_8.mixin(_3c5,{x:shp.x-_3c7/2,y:shp.y});_3c5.x+=lt.x;_3c5.y+=lt.y;_3c5.x=Math.round(_3c5.x);_3c5.y=Math.round(_3c5.y);_3c5.width=Math.ceil(_3c7);_3c5.height=Math.ceil(fontHeight);this._events.push({shape:elem,handle:elem.connect("onmouseenter",this,function(e){_9.showTooltip(_3c2,_3c5,_3c6);})});this._events.push({shape:elem,handle:elem.connect("onmouseleave",this,function(e){_9.hideTooltip(_3c5);})});}}});})();}if(!_8._hasResource["dojox.charting.plot2d.common"]){_8._hasResource["dojox.charting.plot2d.common"]=true;_8.provide("dojox.charting.plot2d.common");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common;_8.mixin(_a.charting.plot2d.common,{makeStroke:function(_3c8){if(!_3c8){return _3c8;}if(typeof _3c8=="string"||_3c8 instanceof _8.Color){_3c8={color:_3c8};}return _a.gfx.makeParameters(_a.gfx.defaultStroke,_3c8);},augmentColor:function(_3c9,_3ca){var t=new _8.Color(_3c9),c=new _8.Color(_3ca);c.a=t.a;return c;},augmentStroke:function(_3cb,_3cc){var s=dc.makeStroke(_3cb);if(s){s.color=dc.augmentColor(s.color,_3cc);}return s;},augmentFill:function(fill,_3cd){var fc,c=new _8.Color(_3cd);if(typeof fill=="string"||fill instanceof _8.Color){return dc.augmentColor(fill,_3cd);}return fill;},defaultStats:{vmin:Number.POSITIVE_INFINITY,vmax:Number.NEGATIVE_INFINITY,hmin:Number.POSITIVE_INFINITY,hmax:Number.NEGATIVE_INFINITY},collectSimpleStats:function(_3ce){var _3cf=_8.delegate(dc.defaultStats);for(var i=0;i<_3ce.length;++i){var run=_3ce[i];for(var j=0;j<run.data.length;j++){if(run.data[j]!==null){if(typeof run.data[j]=="number"){var _3d0=_3cf.vmin,_3d1=_3cf.vmax;if(!("ymin" in run)||!("ymax" in run)){_8.forEach(run.data,function(val,i){if(val!==null){var x=i+1,y=val;if(isNaN(y)){y=0;}_3cf.hmin=Math.min(_3cf.hmin,x);_3cf.hmax=Math.max(_3cf.hmax,x);_3cf.vmin=Math.min(_3cf.vmin,y);_3cf.vmax=Math.max(_3cf.vmax,y);}});}if("ymin" in run){_3cf.vmin=Math.min(_3d0,run.ymin);}if("ymax" in run){_3cf.vmax=Math.max(_3d1,run.ymax);}}else{var _3d2=_3cf.hmin,_3d3=_3cf.hmax,_3d0=_3cf.vmin,_3d1=_3cf.vmax;if(!("xmin" in run)||!("xmax" in run)||!("ymin" in run)||!("ymax" in run)){_8.forEach(run.data,function(val,i){if(val!==null){var x="x" in val?val.x:i+1,y=val.y;if(isNaN(x)){x=0;}if(isNaN(y)){y=0;}_3cf.hmin=Math.min(_3cf.hmin,x);_3cf.hmax=Math.max(_3cf.hmax,x);_3cf.vmin=Math.min(_3cf.vmin,y);_3cf.vmax=Math.max(_3cf.vmax,y);}});}if("xmin" in run){_3cf.hmin=Math.min(_3d2,run.xmin);}if("xmax" in run){_3cf.hmax=Math.max(_3d3,run.xmax);}if("ymin" in run){_3cf.vmin=Math.min(_3d0,run.ymin);}if("ymax" in run){_3cf.vmax=Math.max(_3d1,run.ymax);}}break;}}}return _3cf;},calculateBarSize:function(_3d4,opt,_3d5){if(!_3d5){_3d5=1;}var gap=opt.gap,size=(_3d4-2*gap)/_3d5;if("minBarSize" in opt){size=Math.max(size,opt.minBarSize);}if("maxBarSize" in opt){size=Math.min(size,opt.maxBarSize);}size=Math.max(size,1);gap=(_3d4-size*_3d5)/2;return {size:size,gap:gap};},collectStackedStats:function(_3d6){var _3d7=_8.clone(dc.defaultStats);if(_3d6.length){_3d7.hmin=Math.min(_3d7.hmin,1);_3d7.hmax=df.foldl(_3d6,"seed, run -> Math.max(seed, run.data.length)",_3d7.hmax);for(var i=0;i<_3d7.hmax;++i){var v=_3d6[0].data[i];v=v&&(typeof v=="number"?v:v.y);if(isNaN(v)){v=0;}_3d7.vmin=Math.min(_3d7.vmin,v);for(var j=1;j<_3d6.length;++j){var t=_3d6[j].data[i];t=t&&(typeof t=="number"?t:t.y);if(isNaN(t)){t=0;}v+=t;}_3d7.vmax=Math.max(_3d7.vmax,v);}}return _3d7;},curve:function(a,_3d8){var arr=a.slice(0);if(_3d8=="x"){arr[arr.length]=arr[0];}var p=_8.map(arr,function(item,i){if(i==0){return "M"+item.x+","+item.y;}if(!isNaN(_3d8)){var dx=item.x-arr[i-1].x,dy=arr[i-1].y;return "C"+(item.x-(_3d8-1)*(dx/_3d8))+","+dy+" "+(item.x-(dx/_3d8))+","+item.y+" "+item.x+","+item.y;}else{if(_3d8=="X"||_3d8=="x"||_3d8=="S"){var p0,p1=arr[i-1],p2=arr[i],p3;var bz1x,bz1y,bz2x,bz2y;var f=1/6;if(i==1){if(_3d8=="x"){p0=arr[arr.length-2];}else{p0=p1;}f=1/3;}else{p0=arr[i-2];}if(i==(arr.length-1)){if(_3d8=="x"){p3=arr[1];}else{p3=p2;}f=1/3;}else{p3=arr[i+1];}var p1p2=Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));var p0p2=Math.sqrt((p2.x-p0.x)*(p2.x-p0.x)+(p2.y-p0.y)*(p2.y-p0.y));var p1p3=Math.sqrt((p3.x-p1.x)*(p3.x-p1.x)+(p3.y-p1.y)*(p3.y-p1.y));var _3d9=p0p2*f;var _3da=p1p3*f;if(_3d9>p1p2/2&&_3da>p1p2/2){_3d9=p1p2/2;_3da=p1p2/2;}else{if(_3d9>p1p2/2){_3d9=p1p2/2;_3da=p1p2/2*p1p3/p0p2;}else{if(_3da>p1p2/2){_3da=p1p2/2;_3d9=p1p2/2*p0p2/p1p3;}}}if(_3d8=="S"){if(p0==p1){_3d9=0;}if(p2==p3){_3da=0;}}bz1x=p1.x+_3d9*(p2.x-p0.x)/p0p2;bz1y=p1.y+_3d9*(p2.y-p0.y)/p0p2;bz2x=p2.x-_3da*(p3.x-p1.x)/p1p3;bz2y=p2.y-_3da*(p3.y-p1.y)/p1p3;}}return "C"+(bz1x+","+bz1y+" "+bz2x+","+bz2y+" "+p2.x+","+p2.y);});return p.join(" ");},getLabel:function(_3db,_3dc,_3dd){if(_8.number){return (_3dc?_8.number.format(_3db,{places:_3dd}):_8.number.format(_3db))||"";}return _3dc?_3db.toFixed(_3dd):_3db.toString();}});})();}if(!_8._hasResource["dojox.charting.scaler.primitive"]){_8._hasResource["dojox.charting.scaler.primitive"]=true;_8.provide("dojox.charting.scaler.primitive");_a.charting.scaler.primitive={buildScaler:function(min,max,span,_3de){if(min==max){min-=0.5;max+=0.5;}return {bounds:{lower:min,upper:max,from:min,to:max,scale:span/(max-min),span:span},scaler:_a.charting.scaler.primitive};},buildTicks:function(_3df,_3e0){return {major:[],minor:[],micro:[]};},getTransformerFromModel:function(_3e1){var _3e2=_3e1.bounds.from,_3e3=_3e1.bounds.scale;return function(x){return (x-_3e2)*_3e3;};},getTransformerFromPlot:function(_3e4){var _3e5=_3e4.bounds.from,_3e6=_3e4.bounds.scale;return function(x){return x/_3e6+_3e5;};}};}if(!_8._hasResource["dojox.charting.plot2d._PlotEvents"]){_8._hasResource["dojox.charting.plot2d._PlotEvents"]=true;_8.provide("dojox.charting.plot2d._PlotEvents");_8.declare("dojox.charting.plot2d._PlotEvents",null,{constructor:function(){this._shapeEvents=[];this._eventSeries={};},destroy:function(){this.resetEvents();this.inherited(arguments);},plotEvent:function(o){},raiseEvent:function(o){this.plotEvent(o);var t=_8.delegate(o);t.originalEvent=o.type;t.originalPlot=o.plot;t.type="onindirect";_8.forEach(this.chart.stack,function(plot){if(plot!==this&&plot.plotEvent){t.plot=plot;plot.plotEvent(t);}},this);},connect:function(_3e7,_3e8){this.dirty=true;return _8.connect(this,"plotEvent",_3e7,_3e8);},events:function(){var ls=this.plotEvent._listeners;if(!ls||!ls.length){return false;}for(var i in ls){if(!(i in Array.prototype)){return true;}}return false;},resetEvents:function(){if(this._shapeEvents.length){_8.forEach(this._shapeEvents,function(item){item.shape.disconnect(item.handle);});this._shapeEvents=[];}this.raiseEvent({type:"onplotreset",plot:this});},_connectSingleEvent:function(o,_3e9){this._shapeEvents.push({shape:o.eventMask,handle:o.eventMask.connect(_3e9,this,function(e){o.type=_3e9;o.event=e;this.raiseEvent(o);o.event=null;})});},_connectEvents:function(o){if(o){o.chart=this.chart;o.plot=this;o.hAxis=this.hAxis||null;o.vAxis=this.vAxis||null;o.eventMask=o.eventMask||o.shape;this._connectSingleEvent(o,"onmouseover");this._connectSingleEvent(o,"onmouseout");this._connectSingleEvent(o,"onclick");}},_reconnectEvents:function(_3ea){var a=this._eventSeries[_3ea];if(a){_8.forEach(a,this._connectEvents,this);}},fireEvent:function(_3eb,_3ec,_3ed,_3ee){var s=this._eventSeries[_3eb];if(s&&s.length&&_3ed<s.length){var o=s[_3ed];o.type=_3ec;o.event=_3ee||null;this.raiseEvent(o);o.event=null;}}});}if(!_8._hasResource["dojox.charting.plot2d.Base"]){_8._hasResource["dojox.charting.plot2d.Base"]=true;_8.provide("dojox.charting.plot2d.Base");_8.declare("dojox.charting.plot2d.Base",[_a.charting.Element,_a.charting.plot2d._PlotEvents],{constructor:function(_3ef,_3f0){this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this.series=[];this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){this.series.push(run);return this;},getSeriesStats:function(){return _a.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},isDataDirty:function(){return _8.some(this.series,function(item){return item.dirty;});},performZoom:function(dim,_3f1){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_3f2=dim.height-_3f1.b,_3f3=this._hScaler.bounds,_3f4=(_3f3.from-_3f3.lower)*_3f3.scale,_3f5=this._vScaler.bounds,_3f6=(_3f5.from-_3f5.lower)*_3f5.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_3f4)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_3f6-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=_a.gfx.fx.animateTransform(_8.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_3f1.l*(1-rHScale),_3f2*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));_8.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_3f4,yoffset:_3f6});this.zoomQueue.push(anim);_8.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},render:function(dim,_3f7){return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_3f8){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_3f8.hmin,_3f8.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=_a.charting.scaler.primitive.buildScaler(_3f8.hmin,_3f8.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_3f8.vmin,_3f8.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=_a.charting.scaler.primitive.buildScaler(_3f8.vmin,_3f8.vmax,dim.height);}return this;}});}if(!_8._hasResource["dojox.charting.plot2d.Default"]){_8._hasResource["dojox.charting.plot2d.Default"]=true;_8.provide("dojox.charting.plot2d.Default");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_3f9=df.lambda("item.purgeGroup()");var _3fa=1200;_8.declare("dojox.charting.plot2d.Default",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",lines:true,areas:false,markers:false,tension:"",animate:false},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_3fb,_3fc){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_3fc);du.updateWithPattern(this.opt,_3fc,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_3fd){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_3fd);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_3f9);this._eventSeries={};this.cleanGroup();this.group.setTransform(null);var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_3fe,_3ff,_400,_401=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _402=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_403=[],_404=[],rseg=null,_405,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_406=this._eventSeries[run.name]=new Array(run.data.length);for(var j=0;j<run.data.length;j++){if(run.data[j]!=null){if(!rseg){rseg=[];_404.push(j);_403.push(rseg);}rseg.push(run.data[j]);}else{rseg=null;}}for(var seg=0;seg<_403.length;seg++){if(typeof _403[seg][0]=="number"){_405=_8.map(_403[seg],function(v,i){return {x:ht(i+_404[seg]+1)+_3fd.l,y:dim.height-_3fd.b-vt(v)};},this);}else{_405=_8.map(_403[seg],function(v,i){return {x:ht(v.x)+_3fd.l,y:dim.height-_3fd.b-vt(v.y)};},this);}var _407=this.opt.tension?dc.curve(_405,this.opt.tension):"";if(this.opt.areas&&_405.length>1){var fill=_402.series.fill;var _408=_8.clone(_405);if(this.opt.tension){var _409="L"+_408[_408.length-1].x+","+(dim.height-_3fd.b)+" L"+_408[0].x+","+(dim.height-_3fd.b)+" L"+_408[0].x+","+_408[0].y;run.dyn.fill=s.createPath(_407+" "+_409).setFill(fill).getFill();}else{_408.push({x:_405[_405.length-1].x,y:dim.height-_3fd.b});_408.push({x:_405[0].x,y:dim.height-_3fd.b});_408.push(_405[0]);run.dyn.fill=s.createPolyline(_408).setFill(fill).getFill();}}if(this.opt.lines||this.opt.markers){_3fe=_402.series.stroke;if(_402.series.outline){_3ff=run.dyn.outline=dc.makeStroke(_402.series.outline);_3ff.width=2*_3ff.width+_3fe.width;}}if(this.opt.markers){run.dyn.marker=_402.symbol;}var _40a=null,_40b=null,_40c=null;if(_3fe&&_402.series.shadow&&_405.length>1){var _40d=_402.series.shadow,_40e=_8.map(_405,function(c){return {x:c.x+_40d.dx,y:c.y+_40d.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_40e,this.opt.tension)).setStroke(_40d).getStroke();}else{run.dyn.shadow=s.createPolyline(_40e).setStroke(_40d).getStroke();}}if(this.opt.markers&&_402.marker.shadow){_40d=_402.marker.shadow;_40c=_8.map(_40e,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_402.symbol).setStroke(_40d).setFill(_40d.color);},this);}}if(this.opt.lines&&_405.length>1){if(_3ff){if(this.opt.tension){run.dyn.outline=s.createPath(_407).setStroke(_3ff).getStroke();}else{run.dyn.outline=s.createPolyline(_405).setStroke(_3ff).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_407).setStroke(_3fe).getStroke();}else{run.dyn.stroke=s.createPolyline(_405).setStroke(_3fe).getStroke();}}if(this.opt.markers){_40a=new Array(_405.length);_40b=new Array(_405.length);_3ff=null;if(_402.marker.outline){_3ff=dc.makeStroke(_402.marker.outline);_3ff.width=2*_3ff.width+(_402.marker.stroke?_402.marker.stroke.width:0);}_8.forEach(_405,function(c,i){var path="M"+c.x+" "+c.y+" "+_402.symbol;if(_3ff){_40b[i]=s.createPath(path).setStroke(_3ff);}_40a[i]=s.createPath(path).setStroke(_402.marker.stroke).setFill(_402.marker.fill);},this);run.dyn.markerFill=_402.marker.fill;run.dyn.markerStroke=_402.marker.stroke;if(_401){_8.forEach(_40a,function(s,i){var o={element:"marker",index:i+_404[seg],run:run,shape:s,outline:_40b[i]||null,shadow:_40c&&_40c[i]||null,cx:_405[i].x,cy:_405[i].y};if(typeof _403[seg][0]=="number"){o.x=i+_404[seg]+1;o.y=_403[seg][i];}else{o.x=_403[seg][i].x;o.y=_403[seg][i].y;}this._connectEvents(o);_406[i+_404[seg]]=o;},this);}else{delete this._eventSeries[run.name];}}}run.dirty=false;}if(this.animate){var _40f=this.group;_a.gfx.fx.animateTransform(_8.delegate({shape:_40f,duration:_3fa,transform:[{name:"translate",start:[0,dim.height-_3fd.b],end:[0,0]},{name:"scale",start:[1,0],end:[1,1]},{name:"original"}]},this.animate)).play();}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.Lines"]){_8._hasResource["dojox.charting.plot2d.Lines"]=true;_8.provide("dojox.charting.plot2d.Lines");_8.declare("dojox.charting.plot2d.Lines",_a.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;}});}if(!_8._hasResource["dojox.charting.plot2d.Areas"]){_8._hasResource["dojox.charting.plot2d.Areas"]=true;_8.provide("dojox.charting.plot2d.Areas");_8.declare("dojox.charting.plot2d.Areas",_a.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!_8._hasResource["dojox.charting.plot2d.Markers"]){_8._hasResource["dojox.charting.plot2d.Markers"]=true;_8.provide("dojox.charting.plot2d.Markers");_8.declare("dojox.charting.plot2d.Markers",_a.charting.plot2d.Default,{constructor:function(){this.opt.markers=true;}});}if(!_8._hasResource["dojox.charting.plot2d.MarkersOnly"]){_8._hasResource["dojox.charting.plot2d.MarkersOnly"]=true;_8.provide("dojox.charting.plot2d.MarkersOnly");_8.declare("dojox.charting.plot2d.MarkersOnly",_a.charting.plot2d.Default,{constructor:function(){this.opt.lines=false;this.opt.markers=true;}});}if(!_8._hasResource["dojox.charting.plot2d.Scatter"]){_8._hasResource["dojox.charting.plot2d.Scatter"]=true;_8.provide("dojox.charting.plot2d.Scatter");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_410=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Scatter",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",shadows:null,animate:null},optionalParams:{markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_411,_412){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_412);du.updateWithPattern(this.opt,_412,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_413){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_413);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_410);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_414=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _415=t.next("marker",[this.opt,run]),s=run.group,_416,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);if(typeof run.data[0]=="number"){_416=_8.map(run.data,function(v,i){return {x:ht(i+1)+_413.l,y:dim.height-_413.b-vt(v)};},this);}else{_416=_8.map(run.data,function(v,i){return {x:ht(v.x)+_413.l,y:dim.height-_413.b-vt(v.y)};},this);}var _417=new Array(_416.length),_418=new Array(_416.length),_419=new Array(_416.length);_8.forEach(_416,function(c,i){var _41a=typeof run.data[i]=="number"?t.post(_415,"marker"):t.addMixin(_415,"marker",run.data[i],true),path="M"+c.x+" "+c.y+" "+_41a.symbol;if(_41a.marker.shadow){_417[i]=s.createPath("M"+(c.x+_41a.marker.shadow.dx)+" "+(c.y+_41a.marker.shadow.dy)+" "+_41a.symbol).setStroke(_41a.marker.shadow).setFill(_41a.marker.shadow.color);if(this.animate){this._animateScatter(_417[i],dim.height-_413.b);}}if(_41a.marker.outline){var _41b=dc.makeStroke(_41a.marker.outline);_41b.width=2*_41b.width+_41a.marker.stroke.width;_419[i]=s.createPath(path).setStroke(_41b);if(this.animate){this._animateScatter(_419[i],dim.height-_413.b);}}var _41c=dc.makeStroke(_41a.marker.stroke),fill=this._plotFill(_41a.marker.fill,dim,_413);if(fill&&(fill.type==="linear"||fill.type=="radial")){var _41d=_a.gfx.gradutils.getColor(fill,{x:c.x,y:c.y});if(_41c){_41c.color=_41d;}_418[i]=s.createPath(path).setStroke(_41c).setFill(_41d);}else{_418[i]=s.createPath(path).setStroke(_41c).setFill(fill);}if(this.animate){this._animateScatter(_418[i],dim.height-_413.b);}},this);if(_418.length){run.dyn.stroke=_418[_418.length-1].getStroke();run.dyn.fill=_418[_418.length-1].getFill();}if(_414){var _41e=new Array(_418.length);_8.forEach(_418,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_419&&_419[i]||null,shadow:_417&&_417[i]||null,cx:_416[i].x,cy:_416[i].y};if(typeof run.data[0]=="number"){o.x=i+1;o.y=run.data[i];}else{o.x=run.data[i].x;o.y=run.data[i].y;}this._connectEvents(o);_41e[i]=o;},this);this._eventSeries[run.name]=_41e;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateScatter:function(_41f,_420){_a.gfx.fx.animateTransform(_8.delegate({shape:_41f,duration:1200,transform:[{name:"translate",start:[0,_420],end:[0,0]},{name:"scale",start:[0,0],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.lang.functional.sequence"]){_8._hasResource["dojox.lang.functional.sequence"]=true;_8.provide("dojox.lang.functional.sequence");(function(){var d=_8,df=_a.lang.functional;d.mixin(df,{repeat:function(n,f,z,o){o=o||d.global;f=df.lambda(f);var t=new Array(n),i=1;t[0]=z;for(;i<n;t[i]=z=f.call(o,z),++i){}return t;},until:function(pr,f,z,o){o=o||d.global;f=df.lambda(f);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(z),z=f.call(o,z)){}return t;}});})();}if(!_8._hasResource["dojox.charting.plot2d.Stacked"]){_8._hasResource["dojox.charting.plot2d.Stacked"]=true;_8.provide("dojox.charting.plot2d.Stacked");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common,_421=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Stacked",_a.charting.plot2d.Default,{getSeriesStats:function(){var _422=dc.collectStackedStats(this.series);this._maxRunLength=_422.hmax;return _422;},render:function(dim,_423){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_423);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_421);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_424=this.events(),ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _425=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_426,_427=_8.map(acc,function(v,i){return {x:ht(i+1)+_423.l,y:dim.height-_423.b-vt(v)};},this);var _428=this.opt.tension?dc.curve(_427,this.opt.tension):"";if(this.opt.areas){var _429=_8.clone(_427);if(this.opt.tension){var p=dc.curve(_429,this.opt.tension);p+=" L"+_427[_427.length-1].x+","+(dim.height-_423.b)+" L"+_427[0].x+","+(dim.height-_423.b)+" L"+_427[0].x+","+_427[0].y;run.dyn.fill=s.createPath(p).setFill(_425.series.fill).getFill();}else{_429.push({x:_427[_427.length-1].x,y:dim.height-_423.b});_429.push({x:_427[0].x,y:dim.height-_423.b});_429.push(_427[0]);run.dyn.fill=s.createPolyline(_429).setFill(_425.series.fill).getFill();}}if(this.opt.lines||this.opt.markers){if(_425.series.outline){_426=dc.makeStroke(_425.series.outline);_426.width=2*_426.width+_425.series.stroke.width;}}if(this.opt.markers){run.dyn.marker=_425.symbol;}var _42a,_42b,_42c;if(_425.series.shadow&&_425.series.stroke){var _42d=_425.series.shadow,_42e=_8.map(_427,function(c){return {x:c.x+_42d.dx,y:c.y+_42d.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_42e,this.opt.tension)).setStroke(_42d).getStroke();}else{run.dyn.shadow=s.createPolyline(_42e).setStroke(_42d).getStroke();}}if(this.opt.markers){_42d=_425.marker.shadow;_42c=_8.map(_42e,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_425.symbol).setStroke(_42d).setFill(_42d.color);},this);}}if(this.opt.lines){if(_426){if(this.opt.tension){run.dyn.outline=s.createPath(_428).setStroke(_426).getStroke();}else{run.dyn.outline=s.createPolyline(_427).setStroke(_426).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_428).setStroke(_425.series.stroke).getStroke();}else{run.dyn.stroke=s.createPolyline(_427).setStroke(_425.series.stroke).getStroke();}}if(this.opt.markers){_42a=new Array(_427.length);_42b=new Array(_427.length);_426=null;if(_425.marker.outline){_426=dc.makeStroke(_425.marker.outline);_426.width=2*_426.width+(_425.marker.stroke?_425.marker.stroke.width:0);}_8.forEach(_427,function(c,i){var path="M"+c.x+" "+c.y+" "+_425.symbol;if(_426){_42b[i]=s.createPath(path).setStroke(_426);}_42a[i]=s.createPath(path).setStroke(_425.marker.stroke).setFill(_425.marker.fill);},this);if(_424){var _42f=new Array(_42a.length);_8.forEach(_42a,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_42b[i]||null,shadow:_42c&&_42c[i]||null,cx:_427[i].x,cy:_427[i].y,x:i+1,y:run.data[i]};this._connectEvents(o);_42f[i]=o;},this);this._eventSeries[run.name]=_42f;}else{delete this._eventSeries[run.name];}}run.dirty=false;for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.StackedLines"]){_8._hasResource["dojox.charting.plot2d.StackedLines"]=true;_8.provide("dojox.charting.plot2d.StackedLines");_8.declare("dojox.charting.plot2d.StackedLines",_a.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;}});}if(!_8._hasResource["dojox.charting.plot2d.StackedAreas"]){_8._hasResource["dojox.charting.plot2d.StackedAreas"]=true;_8.provide("dojox.charting.plot2d.StackedAreas");_8.declare("dojox.charting.plot2d.StackedAreas",_a.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!_8._hasResource["dojox.charting.plot2d.Columns"]){_8._hasResource["dojox.charting.plot2d.Columns"]=true;_8.provide("dojox.charting.plot2d.Columns");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_430=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Columns",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_431,_432){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_432);du.updateWithPattern(this.opt,_432,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _433=dc.collectSimpleStats(this.series);_433.hmin-=0.5;_433.hmax+=0.5;return _433;},render:function(dim,_434){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_434);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_430);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_435,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_436=Math.max(0,this._vScaler.bounds.lower),_437=vt(_436),_438=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_435=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _439=t.next("column",[this.opt,run]),s=run.group,_43a=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _43b=run.data[j];if(_43b!==null){var v=typeof _43b=="number"?_43b:_43b.y,vv=vt(v),_43c=vv-_437,h=Math.abs(_43c),_43d=typeof _43b!="number"?t.addMixin(_439,"column",_43b,true):t.post(_439,"column");if(_435>=1&&h>=1){var rect={x:_434.l+ht(j+0.5)+gap,y:dim.height-_434.b-(v>_436?vv:_437),width:_435,height:h};var _43e=this._plotFill(_43d.series.fill,dim,_434);_43e=this._shapeFill(_43e,rect);var _43f=s.createRect(rect).setFill(_43e).setStroke(_43d.series.stroke);run.dyn.fill=_43f.getFill();run.dyn.stroke=_43f.getStroke();if(_438){var o={element:"column",index:j,run:run,shape:_43f,x:j+0.5,y:v};this._connectEvents(o);_43a[j]=o;}if(this.animate){this._animateColumn(_43f,dim.height-_434.b-_437,h);}}}}this._eventSeries[run.name]=_43a;run.dirty=false;}this.dirty=false;return this;},_animateColumn:function(_440,_441,_442){_a.gfx.fx.animateTransform(_8.delegate({shape:_440,duration:1200,transform:[{name:"translate",start:[0,_441-(_441/_442)],end:[0,0]},{name:"scale",start:[1,1/_442],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.StackedColumns"]){_8._hasResource["dojox.charting.plot2d.StackedColumns"]=true;_8.provide("dojox.charting.plot2d.StackedColumns");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common,_443=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.StackedColumns",_a.charting.plot2d.Columns,{getSeriesStats:function(){var _444=dc.collectStackedStats(this.series);this._maxRunLength=_444.hmax;_444.hmin-=0.5;_444.hmax+=0.5;return _444;},render:function(dim,_445){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _446=run.data[j];if(_446!==null){var v=typeof _446=="number"?_446:_446.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_445);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_443);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_447,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_448=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_447=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _449=t.next("column",[this.opt,run]),s=run.group,_44a=new Array(acc.length);for(var j=0;j<acc.length;++j){var _446=run.data[j];if(_446!==null){var v=acc[j],_44b=vt(v),_44c=typeof _446!="number"?t.addMixin(_449,"column",_446,true):t.post(_449,"column");if(_447>=1&&_44b>=1){var rect={x:_445.l+ht(j+0.5)+gap,y:dim.height-_445.b-vt(v),width:_447,height:_44b};var _44d=this._plotFill(_44c.series.fill,dim,_445);_44d=this._shapeFill(_44d,rect);var _44e=s.createRect(rect).setFill(_44d).setStroke(_44c.series.stroke);run.dyn.fill=_44e.getFill();run.dyn.stroke=_44e.getStroke();if(_448){var o={element:"column",index:j,run:run,shape:_44e,x:j+0.5,y:v};this._connectEvents(o);_44a[j]=o;}if(this.animate){this._animateColumn(_44e,dim.height-_445.b,_44b);}}}}this._eventSeries[run.name]=_44a;run.dirty=false;for(var j=0;j<run.data.length;++j){var _446=run.data[j];if(_446!==null){var v=typeof _446=="number"?_446:_446.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.ClusteredColumns"]){_8._hasResource["dojox.charting.plot2d.ClusteredColumns"]=true;_8.provide("dojox.charting.plot2d.ClusteredColumns");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common,_44f=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.ClusteredColumns",_a.charting.plot2d.Columns,{render:function(dim,_450){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_450);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_44f);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_451,_452,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_453=Math.max(0,this._vScaler.bounds.lower),_454=vt(_453),_455=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_451=_452=f.size;for(var i=0;i<this.series.length;++i){var run=this.series[i],_456=_452*i;if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _457=t.next("column",[this.opt,run]),s=run.group,_458=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _459=run.data[j];if(_459!==null){var v=typeof _459=="number"?_459:_459.y,vv=vt(v),_45a=vv-_454,h=Math.abs(_45a),_45b=typeof _459!="number"?t.addMixin(_457,"column",_459,true):t.post(_457,"column");if(_451>=1&&h>=1){var rect={x:_450.l+ht(j+0.5)+gap+_456,y:dim.height-_450.b-(v>_453?vv:_454),width:_451,height:h};var _45c=this._plotFill(_45b.series.fill,dim,_450);_45c=this._shapeFill(_45c,rect);var _45d=s.createRect(rect).setFill(_45c).setStroke(_45b.series.stroke);run.dyn.fill=_45d.getFill();run.dyn.stroke=_45d.getStroke();if(_455){var o={element:"column",index:j,run:run,shape:_45d,x:j+0.5,y:v};this._connectEvents(o);_458[j]=o;}if(this.animate){this._animateColumn(_45d,dim.height-_450.b-_454,h);}}}}this._eventSeries[run.name]=_458;run.dirty=false;}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.Bars"]){_8._hasResource["dojox.charting.plot2d.Bars"]=true;_8.provide("dojox.charting.plot2d.Bars");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_45e=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Bars",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_45f,_460){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_460);du.updateWithPattern(this.opt,_460,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _461=dc.collectSimpleStats(this.series),t;_461.hmin-=0.5;_461.hmax+=0.5;t=_461.hmin,_461.hmin=_461.vmin,_461.vmin=t;t=_461.hmax,_461.hmax=_461.vmax,_461.vmax=t;return _461;},render:function(dim,_462){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_462);}this.dirty=this.isDirty();this.resetEvents();if(this.dirty){_8.forEach(this.series,_45e);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_463,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_464=Math.max(0,this._hScaler.bounds.lower),_465=ht(_464),_466=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_463=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _467=t.next("bar",[this.opt,run]),s=run.group,_468=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _469=run.data[j];if(_469!==null){var v=typeof _469=="number"?_469:_469.y,hv=ht(v),_46a=hv-_465,w=Math.abs(_46a),_46b=typeof _469!="number"?t.addMixin(_467,"bar",_469,true):t.post(_467,"bar");if(w>=1&&_463>=1){var rect={x:_462.l+(v<_464?hv:_465),y:dim.height-_462.b-vt(j+1.5)+gap,width:w,height:_463};var _46c=this._plotFill(_46b.series.fill,dim,_462);_46c=this._shapeFill(_46c,rect);var _46d=s.createRect(rect).setFill(_46c).setStroke(_46b.series.stroke);run.dyn.fill=_46d.getFill();run.dyn.stroke=_46d.getStroke();if(_466){var o={element:"bar",index:j,run:run,shape:_46d,x:v,y:j+1.5};this._connectEvents(o);_468[j]=o;}if(this.animate){this._animateBar(_46d,_462.l+_465,-w);}}}}this._eventSeries[run.name]=_468;run.dirty=false;}this.dirty=false;return this;},_animateBar:function(_46e,_46f,_470){_a.gfx.fx.animateTransform(_8.delegate({shape:_46e,duration:1200,transform:[{name:"translate",start:[_46f-(_46f/_470),0],end:[0,0]},{name:"scale",start:[1/_470,1],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.StackedBars"]){_8._hasResource["dojox.charting.plot2d.StackedBars"]=true;_8.provide("dojox.charting.plot2d.StackedBars");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common,_471=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.StackedBars",_a.charting.plot2d.Bars,{getSeriesStats:function(){var _472=dc.collectStackedStats(this.series),t;this._maxRunLength=_472.hmax;_472.hmin-=0.5;_472.hmax+=0.5;t=_472.hmin,_472.hmin=_472.vmin,_472.vmin=t;t=_472.hmax,_472.hmax=_472.vmax,_472.vmax=t;return _472;},render:function(dim,_473){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _474=run.data[j];if(_474!==null){var v=typeof _474=="number"?_474:_474.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_473);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_471);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_475,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_476=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_475=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _477=t.next("bar",[this.opt,run]),s=run.group,_478=new Array(acc.length);for(var j=0;j<acc.length;++j){var _474=run.data[j];if(_474!==null){var v=acc[j],_479=ht(v),_47a=typeof _474!="number"?t.addMixin(_477,"bar",_474,true):t.post(_477,"bar");if(_479>=1&&_475>=1){var rect={x:_473.l,y:dim.height-_473.b-vt(j+1.5)+gap,width:_479,height:_475};var _47b=this._plotFill(_47a.series.fill,dim,_473);_47b=this._shapeFill(_47b,rect);var _47c=s.createRect(rect).setFill(_47b).setStroke(_47a.series.stroke);run.dyn.fill=_47c.getFill();run.dyn.stroke=_47c.getStroke();if(_476){var o={element:"bar",index:j,run:run,shape:_47c,x:v,y:j+1.5};this._connectEvents(o);_478[j]=o;}if(this.animate){this._animateBar(_47c,_473.l,-_479);}}}}this._eventSeries[run.name]=_478;run.dirty=false;for(var j=0;j<run.data.length;++j){var _474=run.data[j];if(_474!==null){var v=typeof _474=="number"?_474:_474.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.ClusteredBars"]){_8._hasResource["dojox.charting.plot2d.ClusteredBars"]=true;_8.provide("dojox.charting.plot2d.ClusteredBars");(function(){var df=_a.lang.functional,dc=_a.charting.plot2d.common,_47d=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.ClusteredBars",_a.charting.plot2d.Bars,{render:function(dim,_47e){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_47e);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_47d);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_47f,_480,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_481=Math.max(0,this._hScaler.bounds.lower),_482=ht(_481),_483=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_47f=_480=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i],_484=_480*(this.series.length-i-1);if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _485=t.next("bar",[this.opt,run]),s=run.group,_486=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _487=run.data[j];if(_487!==null){var v=typeof _487=="number"?_487:_487.y,hv=ht(v),_488=hv-_482,w=Math.abs(_488),_489=typeof _487!="number"?t.addMixin(_485,"bar",_487,true):t.post(_485,"bar");if(w>=1&&_47f>=1){var rect={x:_47e.l+(v<_481?hv:_482),y:dim.height-_47e.b-vt(j+1.5)+gap+_484,width:w,height:_47f};var _48a=this._plotFill(_489.series.fill,dim,_47e);_48a=this._shapeFill(_48a,rect);var _48b=s.createRect(rect).setFill(_48a).setStroke(_489.series.stroke);run.dyn.fill=_48b.getFill();run.dyn.stroke=_48b.getStroke();if(_483){var o={element:"bar",index:j,run:run,shape:_48b,x:v,y:j+1.5};this._connectEvents(o);_486[j]=o;}if(this.animate){this._animateBar(_48b,_47e.l+_482,-_488);}}}}this._eventSeries[run.name]=_486;run.dirty=false;}this.dirty=false;return this;}});})();}if(!_8._hasResource["dojox.charting.plot2d.Grid"]){_8._hasResource["dojox.charting.plot2d.Grid"]=true;_8.provide("dojox.charting.plot2d.Grid");(function(){var du=_a.lang.utils,dc=_a.charting.plot2d.common;_8.declare("dojox.charting.plot2d.Grid",_a.charting.Element,{defaultParams:{hAxis:"x",vAxis:"y",hMajorLines:true,hMinorLines:false,vMajorLines:true,vMinorLines:false,hStripes:"none",vStripes:"none",animate:null},optionalParams:{},constructor:function(_48c,_48d){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_48d);this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.dirty=true;this.animate=this.opt.animate;this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){return this;},getSeriesStats:function(){return _8.delegate(dc.defaultStats);},initializeScalers:function(){return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},performZoom:function(dim,_48e){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_48f=dim.height-_48e.b,_490=this._hAxis.getScaler().bounds,_491=(_490.from-_490.lower)*_490.scale,_492=this._vAxis.getScaler().bounds,_493=(_492.from-_492.lower)*_492.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_491)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_493-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=_a.gfx.fx.animateTransform(_8.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_48e.l*(1-rHScale),_48f*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));_8.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_491,yoffset:_493});this.zoomQueue.push(anim);_8.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},getRequiredColors:function(){return 0;},render:function(dim,_494){if(this.zoom){return this.performZoom(dim,_494);}this.dirty=this.isDirty();if(!this.dirty){return this;}this.cleanGroup();var s=this.group,ta=this.chart.theme.axis;try{var _495=this._vAxis.getScaler(),vt=_495.scaler.getTransformerFromModel(_495),_496=this._vAxis.getTicks();if(this.opt.hMinorLines){_8.forEach(_496.minor,function(tick){var y=dim.height-_494.b-vt(tick.value);var _497=s.createLine({x1:_494.l,y1:y,x2:dim.width-_494.r,y2:y}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_497,"h",_494.l,_494.r+_494.l-dim.width);}},this);}if(this.opt.hMajorLines){_8.forEach(_496.major,function(tick){var y=dim.height-_494.b-vt(tick.value);var _498=s.createLine({x1:_494.l,y1:y,x2:dim.width-_494.r,y2:y}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_498,"h",_494.l,_494.r+_494.l-dim.width);}},this);}}catch(e){}try{var _499=this._hAxis.getScaler(),ht=_499.scaler.getTransformerFromModel(_499),_496=this._hAxis.getTicks();if(_496&&this.opt.vMinorLines){_8.forEach(_496.minor,function(tick){var x=_494.l+ht(tick.value);var _49a=s.createLine({x1:x,y1:_494.t,x2:x,y2:dim.height-_494.b}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_49a,"v",dim.height-_494.b,dim.height-_494.b-_494.t);}},this);}if(_496&&this.opt.vMajorLines){_8.forEach(_496.major,function(tick){var x=_494.l+ht(tick.value);var _49b=s.createLine({x1:x,y1:_494.t,x2:x,y2:dim.height-_494.b}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_49b,"v",dim.height-_494.b,dim.height-_494.b-_494.t);}},this);}}catch(e){}this.dirty=false;return this;},_animateGrid:function(_49c,type,_49d,size){var _49e=type=="h"?[_49d,0]:[0,_49d];var _49f=type=="h"?[1/size,1]:[1,1/size];_a.gfx.fx.animateTransform(_8.delegate({shape:_49c,duration:1200,transform:[{name:"translate",start:_49e,end:[0,0]},{name:"scale",start:_49f,end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.Pie"]){_8._hasResource["dojox.charting.plot2d.Pie"]=true;_8.provide("dojox.charting.plot2d.Pie");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,da=_a.charting.axis2d.common,g=_a.gfx,m=g.matrix,_4a0=0.2;_8.declare("dojox.charting.plot2d.Pie",[_a.charting.Element,_a.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:20,labelStyle:"default",htmlLabels:true,radGrad:"native",fanSize:5,startAngle:0},optionalParams:{radius:0,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",labelWiring:{}},constructor:function(_4a1,_4a2){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_4a2);du.updateWithPattern(this.opt,_4a2,this.optionalParams);this.run=null;this.dyn=[];},clear:function(){this.dirty=true;this.dyn=[];this.run=null;return this;},setAxis:function(axis){return this;},addSeries:function(run){this.run=run;return this;},getSeriesStats:function(){return _8.delegate(dc.defaultStats);},initializeScalers:function(){return this;},getRequiredColors:function(){return this.run?this.run.data.length:0;},render:function(dim,_4a3){if(!this.dirty){return this;}this.resetEvents();this.dirty=false;this._eventSeries={};this.cleanGroup();var s=this.group,t=this.chart.theme;if(!this.run||!this.run.data.length){return this;}var rx=(dim.width-_4a3.l-_4a3.r)/2,ry=(dim.height-_4a3.t-_4a3.b)/2,r=Math.min(rx,ry),_4a4="font" in this.opt?this.opt.font:t.axis.font,size=_4a4?g.normalizedLength(g.splitFontString(_4a4).size):0,_4a5="fontColor" in this.opt?this.opt.fontColor:t.axis.fontColor,_4a6=m._degToRad(this.opt.startAngle),_4a7=_4a6,step,_4a8,_4a9,_4aa,_4ab,_4ac,run=this.run.data,_4ad=this.events();if(typeof run[0]=="number"){_4a8=df.map(run,"x ? Math.max(x, 0) : 0");if(df.every(_4a8,"<= 0")){return this;}_4a9=df.map(_4a8,"/this",df.foldl(_4a8,"+",0));if(this.opt.labels){_4aa=_8.map(_4a9,function(x){return x>0?this._getLabel(x*100)+"%":"";},this);}}else{_4a8=df.map(run,"x ? Math.max(x.y, 0) : 0");if(df.every(_4a8,"<= 0")){return this;}_4a9=df.map(_4a8,"/this",df.foldl(_4a8,"+",0));if(this.opt.labels){_4aa=_8.map(_4a9,function(x,i){if(x<=0){return "";}var v=run[i];return "text" in v?v.text:this._getLabel(x*100)+"%";},this);}}var _4ae=df.map(run,function(v,i){if(v===null||typeof v=="number"){return t.next("slice",[this.opt,this.run],true);}return t.next("slice",[this.opt,this.run,v],true);},this);if(this.opt.labels){_4ab=df.foldl1(df.map(_4aa,function(_4af,i){var font=_4ae[i].series.font;return _a.gfx._base._getTextBox(_4af,{font:font}).w;},this),"Math.max(a, b)")/2;if(this.opt.labelOffset<0){r=Math.min(rx-2*_4ab,ry-size)+this.opt.labelOffset;}_4ac=r-this.opt.labelOffset;}if("radius" in this.opt){r=this.opt.radius;_4ac=r-this.opt.labelOffset;}var _4b0={cx:_4a3.l+rx,cy:_4a3.t+ry,r:r};this.dyn=[];var _4b1=new Array(_4a9.length);_8.some(_4a9,function(_4b2,i){if(_4b2<=0){return false;}var v=run[i],_4b3=_4ae[i],_4b4;if(_4b2>=1){_4b4=this._plotFill(_4b3.series.fill,dim,_4a3);_4b4=this._shapeFill(_4b4,{x:_4b0.cx-_4b0.r,y:_4b0.cy-_4b0.r,width:2*_4b0.r,height:2*_4b0.r});_4b4=this._pseudoRadialFill(_4b4,{x:_4b0.cx,y:_4b0.cy},_4b0.r);var _4b5=s.createCircle(_4b0).setFill(_4b4).setStroke(_4b3.series.stroke);this.dyn.push({fill:_4b4,stroke:_4b3.series.stroke});if(_4ad){var o={element:"slice",index:i,run:this.run,shape:_4b5,x:i,y:typeof v=="number"?v:v.y,cx:_4b0.cx,cy:_4b0.cy,cr:r};this._connectEvents(o);_4b1[i]=o;}return true;}var end=_4a7+_4b2*2*Math.PI;if(i+1==_4a9.length){end=_4a6+2*Math.PI;}var step=end-_4a7,x1=_4b0.cx+r*Math.cos(_4a7),y1=_4b0.cy+r*Math.sin(_4a7),x2=_4b0.cx+r*Math.cos(end),y2=_4b0.cy+r*Math.sin(end);var _4b6=m._degToRad(this.opt.fanSize);if(_4b3.series.fill&&_4b3.series.fill.type==="radial"&&this.opt.radGrad==="fan"&&step>_4b6){var _4b7=s.createGroup(),_4b8=Math.ceil(step/_4b6),_4b9=step/_4b8;_4b4=this._shapeFill(_4b3.series.fill,{x:_4b0.cx-_4b0.r,y:_4b0.cy-_4b0.r,width:2*_4b0.r,height:2*_4b0.r});for(var j=0;j<_4b8;++j){var _4ba=j==0?x1:_4b0.cx+r*Math.cos(_4a7+(j-_4a0)*_4b9),_4bb=j==0?y1:_4b0.cy+r*Math.sin(_4a7+(j-_4a0)*_4b9),_4bc=j==_4b8-1?x2:_4b0.cx+r*Math.cos(_4a7+(j+1+_4a0)*_4b9),_4bd=j==_4b8-1?y2:_4b0.cy+r*Math.sin(_4a7+(j+1+_4a0)*_4b9),fan=_4b7.createPath({}).moveTo(_4b0.cx,_4b0.cy).lineTo(_4ba,_4bb).arcTo(r,r,0,_4b9>Math.PI,true,_4bc,_4bd).lineTo(_4b0.cx,_4b0.cy).closePath().setFill(this._pseudoRadialFill(_4b4,{x:_4b0.cx,y:_4b0.cy},r,_4a7+(j+0.5)*_4b9,_4a7+(j+0.5)*_4b9));}_4b7.createPath({}).moveTo(_4b0.cx,_4b0.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4b0.cx,_4b0.cy).closePath().setStroke(_4b3.series.stroke);_4b5=_4b7;}else{_4b5=s.createPath({}).moveTo(_4b0.cx,_4b0.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4b0.cx,_4b0.cy).closePath().setStroke(_4b3.series.stroke);var _4b4=_4b3.series.fill;if(_4b4&&_4b4.type==="radial"){_4b4=this._shapeFill(_4b4,{x:_4b0.cx-_4b0.r,y:_4b0.cy-_4b0.r,width:2*_4b0.r,height:2*_4b0.r});if(this.opt.radGrad==="linear"){_4b4=this._pseudoRadialFill(_4b4,{x:_4b0.cx,y:_4b0.cy},r,_4a7,end);}}else{if(_4b4&&_4b4.type==="linear"){_4b4=this._plotFill(_4b4,dim,_4a3);_4b4=this._shapeFill(_4b4,_4b5.getBoundingBox());}}_4b5.setFill(_4b4);}this.dyn.push({fill:_4b4,stroke:_4b3.series.stroke});if(_4ad){var o={element:"slice",index:i,run:this.run,shape:_4b5,x:i,y:typeof v=="number"?v:v.y,cx:_4b0.cx,cy:_4b0.cy,cr:r};this._connectEvents(o);_4b1[i]=o;}_4a7=end;return false;},this);if(this.opt.labels){if(this.opt.labelStyle=="default"){_4a7=_4a6;_8.some(_4a9,function(_4be,i){if(_4be<=0){return false;}var _4bf=_4ae[i];if(_4be>=1){var v=run[i],elem=da.createText[this.opt.htmlLabels&&_a.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4b0.cx,_4b0.cy+size/2,"middle",_4aa[i],_4bf.series.font,_4bf.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}return true;}var end=_4a7+_4be*2*Math.PI,v=run[i];if(i+1==_4a9.length){end=_4a6+2*Math.PI;}var _4c0=(_4a7+end)/2,x=_4b0.cx+_4ac*Math.cos(_4c0),y=_4b0.cy+_4ac*Math.sin(_4c0)+size/2;var elem=da.createText[this.opt.htmlLabels&&_a.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,x,y,"middle",_4aa[i],_4bf.series.font,_4bf.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}_4a7=end;return false;},this);}else{if(this.opt.labelStyle=="columns"){_4a7=_4a6;var _4c1=[];_8.forEach(_4a9,function(_4c2,i){var end=_4a7+_4c2*2*Math.PI;if(i+1==_4a9.length){end=_4a6+2*Math.PI;}var _4c3=(_4a7+end)/2;_4c1.push({angle:_4c3,left:Math.cos(_4c3)<0,theme:_4ae[i],index:i,omit:end-_4a7<0.001});_4a7=end;});var _4c4=_a.gfx._base._getTextBox("a",{font:_4a4}).h;this._getProperLabelRadius(_4c1,_4c4,_4b0.r*1.1);_8.forEach(_4c1,function(_4c5,i){if(!_4c5.omit){var _4c6=_4b0.cx-_4b0.r*2,_4c7=_4b0.cx+_4b0.r*2,_4c8=_a.gfx._base._getTextBox(_4aa[i],{font:_4a4}).w,x=_4b0.cx+_4c5.labelR*Math.cos(_4c5.angle),y=_4b0.cy+_4c5.labelR*Math.sin(_4c5.angle),_4c9=(_4c5.left)?(_4c6+_4c8):(_4c7-_4c8),_4ca=(_4c5.left)?_4c6:_4c9;var _4cb=s.createPath().moveTo(_4b0.cx+_4b0.r*Math.cos(_4c5.angle),_4b0.cy+_4b0.r*Math.sin(_4c5.angle));if(Math.abs(_4c5.labelR*Math.cos(_4c5.angle))<_4b0.r*2-_4c8){_4cb.lineTo(x,y);}_4cb.lineTo(_4c9,y).setStroke(_4c5.theme.series.labelWiring);var elem=da.createText[this.opt.htmlLabels&&_a.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4ca,y,"left",_4aa[i],_4c5.theme.series.font,_4c5.theme.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}},this);}}}var esi=0;this._eventSeries[this.run.name]=df.map(run,function(v){return v<=0?null:_4b1[esi++];});return this;},_getProperLabelRadius:function(_4cc,_4cd,_4ce){var _4cf={},_4d0={},_4d1=1,_4d2=1;if(_4cc.length==1){_4cc[0].labelR=_4ce;return;}for(var i=0;i<_4cc.length;i++){var _4d3=Math.abs(Math.sin(_4cc[i].angle));if(_4cc[i].left){if(_4d1>_4d3){_4d1=_4d3;_4cf=_4cc[i];}}else{if(_4d2>_4d3){_4d2=_4d3;_4d0=_4cc[i];}}}_4cf.labelR=_4d0.labelR=_4ce;this._caculateLabelR(_4cf,_4cc,_4cd);this._caculateLabelR(_4d0,_4cc,_4cd);},_caculateLabelR:function(_4d4,_4d5,_4d6){var i=_4d4.index,_4d7=_4d5.length,_4d8=_4d4.labelR;while(!(_4d5[i%_4d7].left^_4d5[(i+1)%_4d7].left)){if(!_4d5[(i+1)%_4d7].omit){var _4d9=(Math.sin(_4d5[i%_4d7].angle)*_4d8+((_4d5[i%_4d7].left)?(-_4d6):_4d6))/Math.sin(_4d5[(i+1)%_4d7].angle);_4d8=(_4d9<_4d4.labelR)?_4d4.labelR:_4d9;_4d5[(i+1)%_4d7].labelR=_4d8;}i++;}i=_4d4.index,j=(i==0)?_4d7-1:i-1;while(!(_4d5[i].left^_4d5[j].left)){if(!_4d5[j].omit){var _4d9=(Math.sin(_4d5[i].angle)*_4d8+((_4d5[i].left)?_4d6:(-_4d6)))/Math.sin(_4d5[j].angle);_4d8=(_4d9<_4d4.labelR)?_4d4.labelR:_4d9;_4d5[j].labelR=_4d8;}i--;j--;i=(i<0)?i+_4d5.length:i;j=(j<0)?j+_4d5.length:j;}},_getLabel:function(_4da){return dc.getLabel(_4da,this.opt.fixed,this.opt.precision);}});})();}if(!_8._hasResource["dojox.charting.plot2d.Bubble"]){_8._hasResource["dojox.charting.plot2d.Bubble"]=true;_8.provide("dojox.charting.plot2d.Bubble");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_4db=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Bubble",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",animate:null},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_4dc,_4dd){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_4dd);du.updateWithPattern(this.opt,_4dd,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_4de){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_4de);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_4db);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_4df=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}if(typeof run.data[0]=="number"){console.warn("dojox.charting.plot2d.Bubble: the data in the following series cannot be rendered as a bubble chart; ",run);continue;}var _4e0=t.next("circle",[this.opt,run]),s=run.group,_4e1=_8.map(run.data,function(v,i){return v?{x:ht(v.x)+_4de.l,y:dim.height-_4de.b-vt(v.y),radius:this._vScaler.bounds.scale*(v.size/2)}:null;},this);var _4e2=null,_4e3=null,_4e4=null;if(_4e0.series.shadow){_4e4=_8.map(_4e1,function(item){if(item!==null){var _4e5=t.addMixin(_4e0,"circle",item,true),_4e6=_4e5.series.shadow;var _4e7=s.createCircle({cx:item.x+_4e6.dx,cy:item.y+_4e6.dy,r:item.radius}).setStroke(_4e6).setFill(_4e6.color);if(this.animate){this._animateBubble(_4e7,dim.height-_4de.b,item.radius);}return _4e7;}return null;},this);if(_4e4.length){run.dyn.shadow=_4e4[_4e4.length-1].getStroke();}}if(_4e0.series.outline){_4e3=_8.map(_4e1,function(item){if(item!==null){var _4e8=t.addMixin(_4e0,"circle",item,true),_4e9=dc.makeStroke(_4e8.series.outline);_4e9.width=2*_4e9.width+_4e0.series.stroke.width;var _4ea=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setStroke(_4e9);if(this.animate){this._animateBubble(_4ea,dim.height-_4de.b,item.radius);}return _4ea;}return null;},this);if(_4e3.length){run.dyn.outline=_4e3[_4e3.length-1].getStroke();}}_4e2=_8.map(_4e1,function(item){if(item!==null){var _4eb=t.addMixin(_4e0,"circle",item,true),rect={x:item.x-item.radius,y:item.y-item.radius,width:2*item.radius,height:2*item.radius};var _4ec=this._plotFill(_4eb.series.fill,dim,_4de);_4ec=this._shapeFill(_4ec,rect);var _4ed=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setFill(_4ec).setStroke(_4eb.series.stroke);if(this.animate){this._animateBubble(_4ed,dim.height-_4de.b,item.radius);}return _4ed;}return null;},this);if(_4e2.length){run.dyn.fill=_4e2[_4e2.length-1].getFill();run.dyn.stroke=_4e2[_4e2.length-1].getStroke();}if(_4df){var _4ee=new Array(_4e2.length);_8.forEach(_4e2,function(s,i){if(s!==null){var o={element:"circle",index:i,run:run,shape:s,outline:_4e3&&_4e3[i]||null,shadow:_4e4&&_4e4[i]||null,x:run.data[i].x,y:run.data[i].y,r:run.data[i].size/2,cx:_4e1[i].x,cy:_4e1[i].y,cr:_4e1[i].radius};this._connectEvents(o);_4ee[i]=o;}},this);this._eventSeries[run.name]=_4ee;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateBubble:function(_4ef,_4f0,size){_a.gfx.fx.animateTransform(_8.delegate({shape:_4ef,duration:1200,transform:[{name:"translate",start:[0,_4f0],end:[0,0]},{name:"scale",start:[0,1/size],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.Candlesticks"]){_8._hasResource["dojox.charting.plot2d.Candlesticks"]=true;_8.provide("dojox.charting.plot2d.Candlesticks");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_4f1=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.Candlesticks",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_4f2,_4f3){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_4f3);du.updateWithPattern(this.opt,_4f3,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_4f4){var _4f5=_8.delegate(dc.defaultStats);for(var i=0;i<_4f4.length;i++){var run=_4f4[i];if(!run.data.length){continue;}var _4f6=_4f5.vmin,_4f7=_4f5.vmax;if(!("ymin" in run)||!("ymax" in run)){_8.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_4f5.hmin=Math.min(_4f5.hmin,x);_4f5.hmax=Math.max(_4f5.hmax,x);_4f5.vmin=Math.min(_4f5.vmin,val.open,val.close,val.high,val.low);_4f5.vmax=Math.max(_4f5.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_4f5.vmin=Math.min(_4f6,run.ymin);}if("ymax" in run){_4f5.vmax=Math.max(_4f7,run.ymax);}}return _4f5;},getSeriesStats:function(){var _4f8=this.collectStats(this.series);_4f8.hmin-=0.5;_4f8.hmax+=0.5;return _4f8;},render:function(dim,_4f9){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_4f9);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_4f1);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_4fa,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_4fb=Math.max(0,this._vScaler.bounds.lower),_4fc=vt(_4fb),_4fd=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_4fa=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _4fe=t.next("candlestick",[this.opt,run]),s=run.group,_4ff=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _500=t.addMixin(_4fe,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_4f9.l+gap,y=dim.height-_4f9.b,open=vt(v.open),_501=vt(v.close),high=vt(v.high),low=vt(v.low);if("mid" in v){var mid=vt(v.mid);}if(low>high){var tmp=high;high=low;low=tmp;}if(_4fa>=1){var _502=open>_501;var line={x1:_4fa/2,x2:_4fa/2,y1:y-high,y2:y-low},rect={x:0,y:y-Math.max(open,_501),width:_4fa,height:Math.max(_502?open-_501:_501-open,1)};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _503=shape.createGroup();_503.createLine(line).setStroke(_500.series.stroke);_503.createRect(rect).setStroke(_500.series.stroke).setFill(_502?_500.series.fill:"white");if("mid" in v){_503.createLine({x1:(_500.series.stroke.width||1),x2:_4fa-(_500.series.stroke.width||1),y1:y-mid,y2:y-mid}).setStroke(_502?"white":_500.series.stroke);}run.dyn.fill=_500.series.fill;run.dyn.stroke=_500.series.stroke;if(_4fd){var o={element:"candlestick",index:j,run:run,shape:_503,x:x,y:y-Math.max(open,_501),cx:_4fa/2,cy:(y-Math.max(open,_501))+(Math.max(_502?open-_501:_501-open,1)/2),width:_4fa,height:Math.max(_502?open-_501:_501-open,1),data:v};this._connectEvents(o);_4ff[j]=o;}}if(this.animate){this._animateCandlesticks(shape,y-low,high-low);}}}this._eventSeries[run.name]=_4ff;run.dirty=false;}this.dirty=false;return this;},_animateCandlesticks:function(_504,_505,_506){_a.gfx.fx.animateTransform(_8.delegate({shape:_504,duration:1200,transform:[{name:"translate",start:[0,_505-(_505/_506)],end:[0,0]},{name:"scale",start:[1,1/_506],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.OHLC"]){_8._hasResource["dojox.charting.plot2d.OHLC"]=true;_8.provide("dojox.charting.plot2d.OHLC");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,_507=df.lambda("item.purgeGroup()");_8.declare("dojox.charting.plot2d.OHLC",_a.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_508,_509){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_509);du.updateWithPattern(this.opt,_509,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_50a){var _50b=_8.delegate(dc.defaultStats);for(var i=0;i<_50a.length;i++){var run=_50a[i];if(!run.data.length){continue;}var _50c=_50b.vmin,_50d=_50b.vmax;if(!("ymin" in run)||!("ymax" in run)){_8.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_50b.hmin=Math.min(_50b.hmin,x);_50b.hmax=Math.max(_50b.hmax,x);_50b.vmin=Math.min(_50b.vmin,val.open,val.close,val.high,val.low);_50b.vmax=Math.max(_50b.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_50b.vmin=Math.min(_50c,run.ymin);}if("ymax" in run){_50b.vmax=Math.max(_50d,run.ymax);}}return _50b;},getSeriesStats:function(){var _50e=this.collectStats(this.series);_50e.hmin-=0.5;_50e.hmax+=0.5;return _50e;},render:function(dim,_50f){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_50f);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_8.forEach(this.series,_507);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_510,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_511=Math.max(0,this._vScaler.bounds.lower),_512=vt(_511),_513=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_510=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _514=t.next("candlestick",[this.opt,run]),s=run.group,_515=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _516=t.addMixin(_514,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_50f.l+gap,y=dim.height-_50f.b,open=vt(v.open),_517=vt(v.close),high=vt(v.high),low=vt(v.low);if(low>high){var tmp=high;high=low;low=tmp;}if(_510>=1){var hl={x1:_510/2,x2:_510/2,y1:y-high,y2:y-low},op={x1:0,x2:((_510/2)+((_516.series.stroke.width||1)/2)),y1:y-open,y2:y-open},cl={x1:((_510/2)-((_516.series.stroke.width||1)/2)),x2:_510,y1:y-_517,y2:y-_517};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _518=shape.createGroup();_518.createLine(hl).setStroke(_516.series.stroke);_518.createLine(op).setStroke(_516.series.stroke);_518.createLine(cl).setStroke(_516.series.stroke);run.dyn.stroke=_516.series.stroke;if(_513){var o={element:"candlestick",index:j,run:run,shape:_518,x:x,y:y-Math.max(open,_517),cx:_510/2,cy:(y-Math.max(open,_517))+(Math.max(open>_517?open-_517:_517-open,1)/2),width:_510,height:Math.max(open>_517?open-_517:_517-open,1),data:v};this._connectEvents(o);_515[j]=o;}}if(this.animate){this._animateOHLC(shape,y-low,high-low);}}}this._eventSeries[run.name]=_515;run.dirty=false;}this.dirty=false;return this;},_animateOHLC:function(_519,_51a,_51b){_a.gfx.fx.animateTransform(_8.delegate({shape:_519,duration:1200,transform:[{name:"translate",start:[0,_51a-(_51a/_51b)],end:[0,0]},{name:"scale",start:[1,1/_51b],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_8._hasResource["dojox.charting.plot2d.Spider"]){_8._hasResource["dojox.charting.plot2d.Spider"]=true;_8.provide("dojox.charting.plot2d.Spider");_8.experimental("dojox.charting.plot2d.Spider");(function(){var df=_a.lang.functional,du=_a.lang.utils,dc=_a.charting.plot2d.common,da=_a.charting.axis2d.common,g=_a.gfx,m=g.matrix,_51c=0.2;_8.declare("dojox.charting.plot2d.Spider",[_a.charting.Element,_a.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:-10,labelStyle:"default",htmlLabels:true,startAngle:-90,divisions:3,axisColor:"",axisWidth:0,spiderColor:"",spiderWidth:0,seriesWidth:0,seriesFillAlpha:0.2,spiderOrigin:0.16,markerSize:3,spiderType:"polygon",animationType:_8.fx.easing.backOut,axisTickFont:"",axisTickFontColor:"",axisFont:"",axisFontColor:""},optionalParams:{radius:0,font:"",fontColor:""},constructor:function(_51d,_51e){this.opt=_8.clone(this.defaultParams);du.updateWithObject(this.opt,_51e);du.updateWithPattern(this.opt,_51e,this.optionalParams);this.series=[];this.dyn=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};},clear:function(){this.dirty=true;this.dyn=[];this.series=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};return this;},setAxis:function(axis){return this;},addSeries:function(run){var _51f=false;this.series.push(run);for(var key in run.data){var val=run.data[key],data=this.datas[key];if(data){data.vlist.push(val);data.min=Math.min(data.min,val);data.max=Math.max(data.max,val);}else{this.datas[key]={min:val,max:val,vlist:[val]};}}if(this.labelKey.length<=0){for(var key in run.data){this.labelKey.push(key);}}return this;},getSeriesStats:function(){return _a.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_520){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_520.hmin,_520.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=_a.charting.scaler.primitive.buildScaler(_520.hmin,_520.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_520.vmin,_520.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=_a.charting.scaler.primitive.buildScaler(_520.vmin,_520.vmax,dim.height);}return this;},render:function(dim,_521){if(!this.dirty){return this;}this.dirty=false;this.cleanGroup();var s=this.group,t=this.chart.theme;this.resetEvents();if(!this.series||!this.series.length){return this;}var o=this.opt,ta=t.axis,rx=(dim.width-_521.l-_521.r)/2,ry=(dim.height-_521.t-_521.b)/2,r=Math.min(rx,ry),_522=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font)||"normal normal normal 7pt Tahoma",_523=o.axisFont||(ta.tick&&ta.tick.titleFont)||"normal normal normal 11pt Tahoma",_524=o.axisTickFontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"silver",_525=o.axisFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_526=o.axisColor||(ta.tick&&ta.tick.axisColor)||"silver",_527=o.spiderColor||(ta.tick&&ta.tick.spiderColor)||"silver",_528=o.axisWidth||(ta.stroke&&ta.stroke.width)||2,_529=o.spiderWidth||(ta.stroke&&ta.stroke.width)||2,_52a=o.seriesWidth||(ta.stroke&&ta.stroke.width)||2,_52b=g.normalizedLength(g.splitFontString(_523).size),_52c=m._degToRad(o.startAngle),_52d=_52c,step,_52e,_52f,_530,_531,_532,_533,_534,_535,_536,_537,ro=o.spiderOrigin,dv=o.divisions>=3?o.divisions:3,ms=o.markerSize,spt=o.spiderType,at=o.animationType,_538=o.labelOffset<-10?o.labelOffset:-10,_539=0.2;if(o.labels){_530=_8.map(this.series,function(s){return s.name;},this);_531=df.foldl1(df.map(_530,function(_53a,i){var font=t.series.font;return _a.gfx._base._getTextBox(_53a,{font:font}).w;},this),"Math.max(a, b)")/2;r=Math.min(rx-2*_531,ry-_52b)+_538;_532=r-_538;}if("radius" in o){r=o.radius;_532=r-_538;}r/=(1+_539);var _53b={cx:_521.l+rx,cy:_521.t+ry,r:r};for(var i=this.series.length-1;i>=0;i--){var _53c=this.series[i];if(!this.dirty&&!_53c.dirty){t.skip();continue;}_53c.cleanGroup();var run=_53c.data;if(run!==null){var len=this._getObjectLength(run);if(!_533||_533.length<=0){_533=[],_534=[],_537=[];this._buildPoints(_533,len,_53b,r,_52d,true);this._buildPoints(_534,len,_53b,r*ro,_52d,true);this._buildPoints(_537,len,_53b,_532,_52d);if(dv>2){_535=[],_536=[];for(var j=0;j<dv-2;j++){_535[j]=[];this._buildPoints(_535[j],len,_53b,r*(ro+(1-ro)*(j+1)/(dv-1)),_52d,true);_536[j]=r*(ro+(1-ro)*(j+1)/(dv-1));}}}}}var _53d=s.createGroup(),_53e={color:_526,width:_528},_53f={color:_527,width:_529};for(var j=_533.length-1;j>=0;--j){var _540=_533[j],st={x:_540.x+(_540.x-_53b.cx)*_539,y:_540.y+(_540.y-_53b.cy)*_539},nd={x:_540.x+(_540.x-_53b.cx)*_539/2,y:_540.y+(_540.y-_53b.cy)*_539/2};_53d.createLine({x1:_53b.cx,y1:_53b.cy,x2:st.x,y2:st.y}).setStroke(_53e);this._drawArrow(_53d,st,nd,_53e);}var _541=s.createGroup();for(var j=_537.length-1;j>=0;--j){var _540=_537[j],_542=_a.gfx._base._getTextBox(this.labelKey[j],{font:_523}).w||0,_543=this.opt.htmlLabels&&_a.gfx.renderer!="vml"?"html":"gfx";elem=da.createText[_543](this.chart,_541,(!_8._isBodyLtr()&&_543=="html")?(_540.x+_542-dim.width):_540.x,_540.y,"middle",this.labelKey[j],_523,_525);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}var _544=s.createGroup();if(spt=="polygon"){_544.createPolyline(_533).setStroke(_53f);_544.createPolyline(_534).setStroke(_53f);if(_535.length>0){for(var j=_535.length-1;j>=0;--j){_544.createPolyline(_535[j]).setStroke(_53f);}}}else{var _545=this._getObjectLength(this.datas);_544.createCircle({cx:_53b.cx,cy:_53b.cy,r:r}).setStroke(_53f);_544.createCircle({cx:_53b.cx,cy:_53b.cy,r:r*ro}).setStroke(_53f);if(_536.length>0){for(var j=_536.length-1;j>=0;--j){_544.createCircle({cx:_53b.cx,cy:_53b.cy,r:_536[j]}).setStroke(_53f);}}}var _546=s.createGroup(),len=this._getObjectLength(this.datas),k=0;for(var key in this.datas){var data=this.datas[key],min=data.min,max=data.max,_547=max-min,end=_52d+2*Math.PI*k/len;for(var i=0;i<dv;i++){var text=min+_547*i/(dv-1),_540=this._getCoordinate(_53b,r*(ro+(1-ro)*i/(dv-1)),end);text=this._getLabel(text);var _542=_a.gfx._base._getTextBox(text,{font:_522}).w||0,_543=this.opt.htmlLabels&&_a.gfx.renderer!="vml"?"html":"gfx";if(this.opt.htmlLabels){this.htmlElements.push(da.createText[_543](this.chart,_546,(!_8._isBodyLtr()&&_543=="html")?(_540.x+_542-dim.width):_540.x,_540.y,"start",text,_522,_524));}}k++;}this.chart.seriesShapes={};var _548=[];for(var i=this.series.length-1;i>=0;i--){var _53c=this.series[i],run=_53c.data;if(run!==null){var _549=[],k=0,_54a=[];for(var key in run){var data=this.datas[key],min=data.min,max=data.max,_547=max-min,_54b=run[key],end=_52d+2*Math.PI*k/len,_540=this._getCoordinate(_53b,r*(ro+(1-ro)*(_54b-min)/_547),end);_549.push(_540);_54a.push({sname:_53c.name,key:key,data:_54b});k++;}_549[_549.length]=_549[0];_54a[_54a.length]=_54a[0];var _54c=this._getBoundary(_549),_54d=t.next("spider",[o,_53c]),ts=_53c.group,f=g.normalizeColor(_54d.series.fill),sk={color:_54d.series.fill,width:_52a};f.a=o.seriesFillAlpha;_53c.dyn={fill:f,stroke:sk};var osps=this.oldSeriePoints[_53c.name];var cs=this._createSeriesEntry(ts,(osps||_534),_549,f,sk,r,ro,ms,at);this.chart.seriesShapes[_53c.name]=cs;this.oldSeriePoints[_53c.name]=_549;var po={element:"spider_poly",index:i,id:"spider_poly_"+_53c.name,run:_53c,plot:this,shape:cs.poly,parent:ts,brect:_54c,cx:_53b.cx,cy:_53b.cy,cr:r,f:f,s:s};this._connectEvents(po);var so={element:"spider_plot",index:i,id:"spider_plot_"+_53c.name,run:_53c,plot:this,shape:_53c.group};this._connectEvents(so);_8.forEach(cs.circles,function(c,i){var _54e=c.getShape(),co={element:"spider_circle",index:i,id:"spider_circle_"+_53c.name+i,run:_53c,plot:this,shape:c,parent:ts,tdata:_54a[i],cx:_549[i].x,cy:_549[i].y,f:f,s:s};this._connectEvents(co);},this);}}return this;},_createSeriesEntry:function(ts,osps,sps,f,sk,r,ro,ms,at){var _54f=ts.createPolyline(osps).setFill(f).setStroke(sk),_550=[];for(var j=0;j<osps.length;j++){var _551=osps[j],cr=ms;var _552=ts.createCircle({cx:_551.x,cy:_551.y,r:cr}).setFill(f).setStroke(sk);_550.push(_552);}var _553=_8.map(sps,function(np,j){var sp=osps[j],anim=new _8._Animation({duration:1000,easing:at,curve:[sp.y,np.y]});var spl=_54f,sc=_550[j];_8.connect(anim,"onAnimate",function(y){var _554=spl.getShape();_554.points[j].y=y;spl.setShape(_554);var _555=sc.getShape();_555.cy=y;sc.setShape(_555);});return anim;});var _556=_8.map(sps,function(np,j){var sp=osps[j],anim=new _8._Animation({duration:1000,easing:at,curve:[sp.x,np.x]});var spl=_54f,sc=_550[j];_8.connect(anim,"onAnimate",function(x){var _557=spl.getShape();_557.points[j].x=x;spl.setShape(_557);var _558=sc.getShape();_558.cx=x;sc.setShape(_558);});return anim;});var _559=_8.fx.combine(_553.concat(_556));_559.play();return {group:ts,poly:_54f,circles:_550};},plotEvent:function(o){var _55a=o.id?o.id:"default",a;if(_55a in this.animations){a=this.animations[_55a];a.anim&&a.anim.stop(true);}else{a=this.animations[_55a]={};}if(o.element=="spider_poly"){if(!a.color){var _55b=o.shape.getFill();if(!_55b||!(_55b instanceof _8.Color)){return;}a.color={start:_55b,end:_55c(_55b)};}var _55d=a.color.start,end=a.color.end;if(o.type=="onmouseout"){var t=_55d;_55d=end;end=t;}a.anim=_a.gfx.fx.animateFill({shape:o.shape,duration:800,easing:_8.fx.easing.backOut,color:{start:_55d,end:end}});a.anim.play();}else{if(o.element=="spider_circle"){var init,_55e,_55f=1.5;if(o.type=="onmouseover"){init=_a.gfx.matrix.identity;_55e=_55f;var _560={type:"rect"};_560.x=o.cx;_560.y=o.cy;_560.width=_560.height=1;var lt=_8.coords(this.chart.node,true);_560.x+=lt.x;_560.y+=lt.y;_560.x=Math.round(_560.x);_560.y=Math.round(_560.y);_560.width=Math.ceil(_560.width);_560.height=Math.ceil(_560.height);this.aroundRect=_560;var _561=["after","before"];if(_9&&_9.Tooltip){_9.showTooltip(o.tdata.sname+"<br/>"+o.tdata.key+"<br/>"+o.tdata.data,this.aroundRect,_561);}}else{init=_a.gfx.matrix.scaleAt(_55f,o.cx,o.cy);_55e=1/_55f;if(_9&&_9.Tooltip){this.aroundRect&&_9.hideTooltip(this.aroundRect);}}var cs=o.shape.getShape(),init=m.scaleAt(_55f,cs.cx,cs.cy),_562={shape:o.shape,duration:200,easing:_8.fx.easing.backOut,transform:[{name:"scaleAt",start:[1,cs.cx,cs.cy],end:[_55e,cs.cx,cs.cy]},init]};a.anim=_a.gfx.fx.animateTransform(_562);a.anim.play();}else{if(o.element=="spider_plot"){if(o.type=="onmouseover"&&!_8.isIE){o.shape.moveToFront();}}}}},_getBoundary:function(_563){var xmax=_563[0].x,xmin=_563[0].x,ymax=_563[0].y,ymin=_563[0].y;for(var i=0;i<_563.length;i++){var _564=_563[i];xmax=Math.max(_564.x,xmax);ymax=Math.max(_564.y,ymax);xmin=Math.min(_564.x,xmin);ymin=Math.min(_564.y,ymin);}return {x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin};},_drawArrow:function(s,_565,end,_566){var len=Math.sqrt(Math.pow(end.x-_565.x,2)+Math.pow(end.y-_565.y,2)),sin=(end.y-_565.y)/len,cos=(end.x-_565.x)/len,_567={x:end.x+(len/3)*(-sin),y:end.y+(len/3)*cos},_568={x:end.x+(len/3)*sin,y:end.y+(len/3)*(-cos)};s.createPolyline([_565,_567,_568]).setFill(_566.color).setStroke(_566);},_buildPoints:function(_569,_56a,_56b,_56c,_56d,_56e){for(var i=0;i<_56a;i++){var end=_56d+2*Math.PI*i/_56a;_569.push(this._getCoordinate(_56b,_56c,end));}if(_56e){_569.push(this._getCoordinate(_56b,_56c,_56d+2*Math.PI));}},_getCoordinate:function(_56f,_570,_571){return {x:_56f.cx+_570*Math.cos(_571),y:_56f.cy+_570*Math.sin(_571)};},_getObjectLength:function(obj){var _572=0;if(_8.isObject(obj)){for(var key in obj){_572++;}}return _572;},_getLabel:function(_573){return dc.getLabel(_573,this.opt.fixed,this.opt.precision);}});function _55c(_574){var a=new _a.color.Color(_574),x=a.toHsl();if(x.s==0){x.l=x.l<50?100:0;}else{x.s=100;if(x.l<50){x.l=75;}else{if(x.l>75){x.l=50;}else{x.l=x.l-50>75-x.l?50:75;}}}var _574=_a.color.fromHsl(x);_574.a=0.7;return _574;};})();}if(!_8._hasResource["dojox.charting.Chart2D"]){_8._hasResource["dojox.charting.Chart2D"]=true;_8.provide("dojox.charting.Chart2D");_8.deprecated("dojox.charting.Chart2D","Use dojo.charting.Chart instead and require all other components explicitly","2.0");_a.charting.Chart2D=_a.charting.Chart;}if(!_8._hasResource["dojox.charting.widget.Chart2D"]){_8._hasResource["dojox.charting.widget.Chart2D"]=true;_8.provide("dojox.charting.widget.Chart2D");_8.deprecated("dojox.charting.widget.Chart2D","Use dojo.charting.widget.Chart instead and require all other components explicitly","2.0");_a.charting.widget.Chart2D=_a.charting.widget.Chart;}if(!_8._hasResource["dojox.charting.themes.GreySkies"]){_8._hasResource["dojox.charting.themes.GreySkies"]=true;_8.provide("dojox.charting.themes.GreySkies");(function(){var dxc=_a.charting;dxc.themes.GreySkies=new dxc.Theme(dxc.Theme._def);})();}if(!_8._hasResource["dojox.charting.widget.Sparkline"]){_8._hasResource["dojox.charting.widget.Sparkline"]=true;_8.provide("dojox.charting.widget.Sparkline");(function(){var d=_8;_8.declare("dojox.charting.widget.Sparkline",_a.charting.widget.Chart2D,{theme:_a.charting.themes.GreySkies,margins:{l:0,r:0,t:0,b:0},type:"Lines",valueFn:"Number(x)",store:"",field:"",query:"",queryOptions:"",start:"0",count:"Infinity",sort:"",data:"",name:"default",buildRendering:function(){var n=this.srcNodeRef;if(!n.childNodes.length||!d.query("> .axis, > .plot, > .action, > .series",n).length){var plot=document.createElement("div");d.attr(plot,{"class":"plot","name":"default","type":this.type});n.appendChild(plot);var _575=document.createElement("div");d.attr(_575,{"class":"series",plot:"default",name:this.name,start:this.start,count:this.count,valueFn:this.valueFn});d.forEach(["store","field","query","queryOptions","sort","data"],function(i){if(this[i].length){d.attr(_575,i,this[i]);}},this);n.appendChild(_575);}this.inherited(arguments);}});})();}if(!_8._hasResource["dojox.charting.widget.Legend"]){_8._hasResource["dojox.charting.widget.Legend"]=true;_8.provide("dojox.charting.widget.Legend");_8.declare("dojox.charting.widget.Legend",[_9._Widget,_9._Templated],{chartRef:"",horizontal:true,swatchSize:18,templateString:"<table dojoAttachPoint='legendNode' class='dojoxLegendNode' role='group' aria-label='chart legend'><tbody dojoAttachPoint='legendBody'></tbody></table>",legendNode:null,legendBody:null,postCreate:function(){if(!this.chart){if(!this.chartRef){return;}this.chart=_9.byId(this.chartRef);if(!this.chart){var node=_8.byId(this.chartRef);if(node){this.chart=_9.byNode(node);}else{return;}}this.series=this.chart.chart.series;}else{this.series=this.chart.series;}this.refresh();},refresh:function(){var df=_a.lang.functional;if(this._surfaces){_8.forEach(this._surfaces,function(_576){_576.destroy();});}this._surfaces=[];while(this.legendBody.lastChild){_8.destroy(this.legendBody.lastChild);}if(this.horizontal){_8.addClass(this.legendNode,"dojoxLegendHorizontal");this._tr=_8.create("tr",null,this.legendBody);this._inrow=0;}var s=this.series;if(s.length==0){return;}if(s[0].chart.stack[0].declaredClass=="dojox.charting.plot2d.Pie"){var t=s[0].chart.stack[0];if(typeof t.run.data[0]=="number"){var _577=df.map(t.run.data,"Math.max(x, 0)");if(df.every(_577,"<= 0")){return;}var _578=df.map(_577,"/this",df.foldl(_577,"+",0));_8.forEach(_578,function(x,i){this._addLabel(t.dyn[i],t._getLabel(x*100)+"%");},this);}else{_8.forEach(t.run.data,function(x,i){this._addLabel(t.dyn[i],x.legend||x.text||x.y);},this);}}else{_8.forEach(s,function(x){this._addLabel(x.dyn,x.legend||x.name);},this);}},_addLabel:function(dyn,_579){var _57a=_8.create("td"),icon=_8.create("div",null,_57a),text=_8.create("label",null,_57a),div=_8.create("div",{style:{"width":this.swatchSize+"px","height":this.swatchSize+"px","float":"left"}},icon);_8.addClass(icon,"dojoxLegendIcon dijitInline");_8.addClass(text,"dojoxLegendText");if(this._tr){this._tr.appendChild(_57a);if(++this._inrow===this.horizontal){this._tr=_8.create("tr",null,this.legendBody);this._inrow=0;}}else{var tr=_8.create("tr",null,this.legendBody);tr.appendChild(_57a);}this._makeIcon(div,dyn);text.innerHTML=String(_579);},_makeIcon:function(div,dyn){var mb={h:this.swatchSize,w:this.swatchSize};var _57b=_a.gfx.createSurface(div,mb.w,mb.h);this._surfaces.push(_57b);if(dyn.fill){_57b.createRect({x:2,y:2,width:mb.w-4,height:mb.h-4}).setFill(dyn.fill).setStroke(dyn.stroke);}else{if(dyn.stroke||dyn.marker){var line={x1:0,y1:mb.h/2,x2:mb.w,y2:mb.h/2};if(dyn.stroke){_57b.createLine(line).setStroke(dyn.stroke);}if(dyn.marker){var c={x:mb.w/2,y:mb.h/2};if(dyn.stroke){_57b.createPath({path:"M"+c.x+" "+c.y+" "+dyn.marker}).setFill(dyn.stroke.color).setStroke(dyn.stroke);}else{_57b.createPath({path:"M"+c.x+" "+c.y+" "+dyn.marker}).setFill(dyn.color).setStroke(dyn.color);}}}else{_57b.createRect({x:2,y:2,width:mb.w-4,height:mb.h-4}).setStroke("black");_57b.createLine({x1:2,y1:2,x2:mb.w-2,y2:mb.h-2}).setStroke("black");_57b.createLine({x1:2,y1:mb.h-2,x2:mb.w-2,y2:2}).setStroke("black");}}}});}}};});
diff --git a/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js.uncompressed.js b/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js.uncompressed.js
new file mode 100644
index 0000000..62959fd
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/widget/Chart2D.xd.js.uncompressed.js
@@ -0,0 +1,19150 @@
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+dojo.loadInit(function(){
+ // Since loaderInit can be fired before any dojo.provide/require calls,
+ // make sure the dojox.gfx object exists and only run this logic if dojox.gfx.renderer
+ // has not been defined yet.
+ var gfx = dojo.getObject("dojox.gfx", true), sl, flag, match;
+ while(!gfx.renderer){
+ // Have a way to force a GFX renderer, if so desired.
+ // Useful for being able to serialize GFX data in a particular format.
+ if(dojo.config.forceGfxRenderer){
+ dojox.gfx.renderer = dojo.config.forceGfxRenderer;
+ break;
+ }
+ var renderers = (typeof dojo.config.gfxRenderer == "string" ?
+ dojo.config.gfxRenderer : "svg,vml,canvas,silverlight").split(",");
+ for(var i = 0; i < renderers.length; ++i){
+ switch(renderers[i]){
+ case "svg":
+ // the next test is from https://github.com/phiggins42/has.js
+ if("SVGAngle" in dojo.global){
+ dojox.gfx.renderer = "svg";
+ }
+ break;
+ case "vml":
+ if(dojo.isIE){
+ dojox.gfx.renderer = "vml";
+ }
+ break;
+ case "silverlight":
+ try{
+ if(dojo.isIE){
+ sl = new ActiveXObject("AgControl.AgControl");
+ if(sl && sl.IsVersionSupported("1.0")){
+ flag = true;
+ }
+ }else{
+ if(navigator.plugins["Silverlight Plug-In"]){
+ flag = true;
+ }
+ }
+ }catch(e){
+ flag = false;
+ }finally{
+ sl = null;
+ }
+ if(flag){
+ dojox.gfx.renderer = "silverlight";
+ }
+ break;
+ case "canvas":
+ if(dojo.global.CanvasRenderingContext2D){
+ dojox.gfx.renderer = "canvas";
+ }
+ break;
+ }
+ if(gfx.renderer){
+ break;
+ }
+ }
+ break;
+ }
+
+ if(dojo.config.isDebug){
+ console.log("gfx renderer = " + gfx.renderer);
+ }
+
+ // load & initialize renderer
+ if(gfx[gfx.renderer]){
+ // already loaded
+ gfx.switchTo(gfx.renderer);
+ }else{
+ // load
+ gfx.loadAndSwitch = gfx.renderer;
+ dojo["require"]("dojox.gfx." + gfx.renderer);
+ }
+});
+return {depends: [["provide", "dijit._base.manager"],
+["provide", "dojo.Stateful"],
+["provide", "dijit._WidgetBase"],
+["provide", "dojo.window"],
+["provide", "dijit._base.focus"],
+["provide", "dojo.AdapterRegistry"],
+["provide", "dijit._base.place"],
+["provide", "dijit._base.window"],
+["provide", "dijit._base.popup"],
+["provide", "dijit._base.scroll"],
+["provide", "dojo.uacss"],
+["provide", "dijit._base.sniff"],
+["provide", "dijit._base.typematic"],
+["provide", "dijit._base.wai"],
+["provide", "dijit._base"],
+["provide", "dijit._Widget"],
+["provide", "dojox.gfx.matrix"],
+["provide", "dojox.gfx._base"],
+["provide", "dojox.gfx"],
+["provide", "dojox.lang.functional.lambda"],
+["provide", "dojox.lang.functional.array"],
+["provide", "dojox.lang.functional.object"],
+["provide", "dojox.lang.functional"],
+["provide", "dojox.lang.functional.fold"],
+["provide", "dojox.lang.functional.reversed"],
+["provide", "dojox.charting.Element"],
+["provide", "dojo.colors"],
+["provide", "dojox.color._base"],
+["provide", "dojox.color"],
+["provide", "dojox.color.Palette"],
+["provide", "dojox.lang.utils"],
+["provide", "dojox.gfx.gradutils"],
+["provide", "dojox.charting.Theme"],
+["provide", "dojox.charting.Series"],
+["provide", "dojox.charting.axis2d.common"],
+["provide", "dojox.charting.Chart"],
+["provide", "dojox.charting.widget.Chart"],
+["provide", "dojo.fx.easing"],
+["provide", "dojox.gfx.fx"],
+["provide", "dojox.charting.action2d.Base"],
+["provide", "dojox.charting.action2d.Highlight"],
+["provide", "dojo.fx.Toggler"],
+["provide", "dojo.fx"],
+["provide", "dojox.charting.action2d.Magnify"],
+["provide", "dojox.lang.functional.scan"],
+["provide", "dojox.charting.action2d.MoveSlice"],
+["provide", "dojox.charting.action2d.Shake"],
+["provide", "dojo.string"],
+["provide", "dojo.date.stamp"],
+["provide", "dojo.parser"],
+["provide", "dojo.cache"],
+["provide", "dijit._Templated"],
+["provide", "dijit.Tooltip"],
+["provide", "dojox.charting.action2d.Tooltip"],
+["provide", "dojox.charting.scaler.common"],
+["provide", "dojox.charting.scaler.linear"],
+["provide", "dojox.charting.axis2d.Base"],
+["provide", "dojox.charting.axis2d.Invisible"],
+["provide", "dojox.charting.axis2d.Default"],
+["provide", "dojox.charting.plot2d.common"],
+["provide", "dojox.charting.scaler.primitive"],
+["provide", "dojox.charting.plot2d._PlotEvents"],
+["provide", "dojox.charting.plot2d.Base"],
+["provide", "dojox.charting.plot2d.Default"],
+["provide", "dojox.charting.plot2d.Lines"],
+["provide", "dojox.charting.plot2d.Areas"],
+["provide", "dojox.charting.plot2d.Markers"],
+["provide", "dojox.charting.plot2d.MarkersOnly"],
+["provide", "dojox.charting.plot2d.Scatter"],
+["provide", "dojox.lang.functional.sequence"],
+["provide", "dojox.charting.plot2d.Stacked"],
+["provide", "dojox.charting.plot2d.StackedLines"],
+["provide", "dojox.charting.plot2d.StackedAreas"],
+["provide", "dojox.charting.plot2d.Columns"],
+["provide", "dojox.charting.plot2d.StackedColumns"],
+["provide", "dojox.charting.plot2d.ClusteredColumns"],
+["provide", "dojox.charting.plot2d.Bars"],
+["provide", "dojox.charting.plot2d.StackedBars"],
+["provide", "dojox.charting.plot2d.ClusteredBars"],
+["provide", "dojox.charting.plot2d.Grid"],
+["provide", "dojox.charting.plot2d.Pie"],
+["provide", "dojox.charting.plot2d.Bubble"],
+["provide", "dojox.charting.plot2d.Candlesticks"],
+["provide", "dojox.charting.plot2d.OHLC"],
+["provide", "dojox.charting.plot2d.Spider"],
+["provide", "dojox.charting.Chart2D"],
+["provide", "dojox.charting.widget.Chart2D"],
+["provide", "dojox.charting.themes.GreySkies"],
+["provide", "dojox.charting.widget.Sparkline"],
+["provide", "dojox.charting.widget.Legend"]],
+defineResource: function(dojo, dijit, dojox){/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.manager"] = true;
+dojo.provide("dijit._base.manager");
+
+
+
+dojo.declare("dijit.WidgetSet", null, {
+ // summary:
+ // A set of widgets indexed by id. A default instance of this class is
+ // available as `dijit.registry`
+ //
+ // example:
+ // Create a small list of widgets:
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("one"));
+ // | ws.add(dijit.byId("two"));
+ // | // destroy both:
+ // | ws.forEach(function(w){ w.destroy(); });
+ //
+ // example:
+ // Using dijit.registry:
+ // | dijit.registry.forEach(function(w){ /* do something */ });
+
+ constructor: function(){
+ this._hash = {};
+ this.length = 0;
+ },
+
+ add: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Add a widget to this list. If a duplicate ID is detected, a error is thrown.
+ //
+ // widget: dijit._Widget
+ // Any dijit._Widget subclass.
+ if(this._hash[widget.id]){
+ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
+ }
+ this._hash[widget.id] = widget;
+ this.length++;
+ },
+
+ remove: function(/*String*/ id){
+ // summary:
+ // Remove a widget from this WidgetSet. Does not destroy the widget; simply
+ // removes the reference.
+ if(this._hash[id]){
+ delete this._hash[id];
+ this.length--;
+ }
+ },
+
+ forEach: function(/*Function*/ func, /* Object? */thisObj){
+ // summary:
+ // Call specified function for each widget in this set.
+ //
+ // func:
+ // A callback function to run for each item. Is passed the widget, the index
+ // in the iteration, and the full hash, similar to `dojo.forEach`.
+ //
+ // thisObj:
+ // An optional scope parameter
+ //
+ // example:
+ // Using the default `dijit.registry` instance:
+ // | dijit.registry.forEach(function(widget){
+ // | console.log(widget.declaredClass);
+ // | });
+ //
+ // returns:
+ // Returns self, in order to allow for further chaining.
+
+ thisObj = thisObj || dojo.global;
+ var i = 0, id;
+ for(id in this._hash){
+ func.call(thisObj, this._hash[id], i++, this._hash);
+ }
+ return this; // dijit.WidgetSet
+ },
+
+ filter: function(/*Function*/ filter, /* Object? */thisObj){
+ // summary:
+ // Filter down this WidgetSet to a smaller new WidgetSet
+ // Works the same as `dojo.filter` and `dojo.NodeList.filter`
+ //
+ // filter:
+ // Callback function to test truthiness. Is passed the widget
+ // reference and the pseudo-index in the object.
+ //
+ // thisObj: Object?
+ // Option scope to use for the filter function.
+ //
+ // example:
+ // Arbitrary: select the odd widgets in this list
+ // | dijit.registry.filter(function(w, i){
+ // | return i % 2 == 0;
+ // | }).forEach(function(w){ /* odd ones */ });
+
+ thisObj = thisObj || dojo.global;
+ var res = new dijit.WidgetSet(), i = 0, id;
+ for(id in this._hash){
+ var w = this._hash[id];
+ if(filter.call(thisObj, w, i++, this._hash)){
+ res.add(w);
+ }
+ }
+ return res; // dijit.WidgetSet
+ },
+
+ byId: function(/*String*/ id){
+ // summary:
+ // Find a widget in this list by it's id.
+ // example:
+ // Test if an id is in a particular WidgetSet
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("bar"));
+ // | var t = ws.byId("bar") // returns a widget
+ // | var x = ws.byId("foo"); // returns undefined
+
+ return this._hash[id]; // dijit._Widget
+ },
+
+ byClass: function(/*String*/ cls){
+ // summary:
+ // Reduce this widgetset to a new WidgetSet of a particular `declaredClass`
+ //
+ // cls: String
+ // The Class to scan for. Full dot-notated string.
+ //
+ // example:
+ // Find all `dijit.TitlePane`s in a page:
+ // | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); });
+
+ var res = new dijit.WidgetSet(), id, widget;
+ for(id in this._hash){
+ widget = this._hash[id];
+ if(widget.declaredClass == cls){
+ res.add(widget);
+ }
+ }
+ return res; // dijit.WidgetSet
+},
+
+ toArray: function(){
+ // summary:
+ // Convert this WidgetSet into a true Array
+ //
+ // example:
+ // Work with the widget .domNodes in a real Array
+ // | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; });
+
+ var ar = [];
+ for(var id in this._hash){
+ ar.push(this._hash[id]);
+ }
+ return ar; // dijit._Widget[]
+},
+
+ map: function(/* Function */func, /* Object? */thisObj){
+ // summary:
+ // Create a new Array from this WidgetSet, following the same rules as `dojo.map`
+ // example:
+ // | var nodes = dijit.registry.map(function(w){ return w.domNode; });
+ //
+ // returns:
+ // A new array of the returned values.
+ return dojo.map(this.toArray(), func, thisObj); // Array
+ },
+
+ every: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.every` acting explicitly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first false return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(!func.call(thisObj, this._hash[i], x++, this._hash)){
+ return false; // Boolean
+ }
+ }
+ return true; // Boolean
+ },
+
+ some: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.some` acting explictly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first true return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(func.call(thisObj, this._hash[i], x++, this._hash)){
+ return true; // Boolean
+ }
+ }
+ return false; // Boolean
+ }
+
+});
+
+(function(){
+
+ /*=====
+ dijit.registry = {
+ // summary:
+ // A list of widgets on a page.
+ // description:
+ // Is an instance of `dijit.WidgetSet`
+ };
+ =====*/
+ dijit.registry = new dijit.WidgetSet();
+
+ var hash = dijit.registry._hash,
+ attr = dojo.attr,
+ hasAttr = dojo.hasAttr,
+ style = dojo.style;
+
+ dijit.byId = function(/*String|dijit._Widget*/ id){
+ // summary:
+ // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
+ return typeof id == "string" ? hash[id] : id; // dijit._Widget
+ };
+
+ var _widgetTypeCtr = {};
+ dijit.getUniqueId = function(/*String*/widgetType){
+ // summary:
+ // Generates a unique id for a given widgetType
+
+ var id;
+ do{
+ id = widgetType + "_" +
+ (widgetType in _widgetTypeCtr ?
+ ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
+ }while(hash[id]);
+ return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
+ };
+
+ dijit.findWidgets = function(/*DomNode*/ root){
+ // summary:
+ // Search subtree under root returning widgets found.
+ // Doesn't search for nested widgets (ie, widgets inside other widgets).
+
+ var outAry = [];
+
+ function getChildrenHelper(root){
+ for(var node = root.firstChild; node; node = node.nextSibling){
+ if(node.nodeType == 1){
+ var widgetId = node.getAttribute("widgetId");
+ if(widgetId){
+ var widget = hash[widgetId];
+ if(widget){ // may be null on page w/multiple dojo's loaded
+ outAry.push(widget);
+ }
+ }else{
+ getChildrenHelper(node);
+ }
+ }
+ }
+ }
+
+ getChildrenHelper(root);
+ return outAry;
+ };
+
+ dijit._destroyAll = function(){
+ // summary:
+ // Code to destroy all widgets and do other cleanup on page unload
+
+ // Clean up focus manager lingering references to widgets and nodes
+ dijit._curFocus = null;
+ dijit._prevFocus = null;
+ dijit._activeStack = [];
+
+ // Destroy all the widgets, top down
+ dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
+ // Avoid double destroy of widgets like Menu that are attached to <body>
+ // even though they are logically children of other widgets.
+ if(!widget._destroyed){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive();
+ }else if(widget.destroy){
+ widget.destroy();
+ }
+ }
+ });
+ };
+
+ if(dojo.isIE){
+ // Only run _destroyAll() for IE because we think it's only necessary in that case,
+ // and because it causes problems on FF. See bug #3531 for details.
+ dojo.addOnWindowUnload(function(){
+ dijit._destroyAll();
+ });
+ }
+
+ dijit.byNode = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget corresponding to the given DOMNode
+ return hash[node.getAttribute("widgetId")]; // dijit._Widget
+ };
+
+ dijit.getEnclosingWidget = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget whose DOM tree contains the specified DOMNode, or null if
+ // the node is not contained within the DOM tree of any widget
+ while(node){
+ var id = node.getAttribute && node.getAttribute("widgetId");
+ if(id){
+ return hash[id];
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+
+ var shown = (dijit._isElementShown = function(/*Element*/ elem){
+ var s = style(elem);
+ return (s.visibility != "hidden")
+ && (s.visibility != "collapsed")
+ && (s.display != "none")
+ && (attr(elem, "type") != "hidden");
+ });
+
+ dijit.hasDefaultTabStop = function(/*Element*/ elem){
+ // summary:
+ // Tests if element is tab-navigable even without an explicit tabIndex setting
+
+ // No explicit tabIndex setting, need to investigate node type
+ switch(elem.nodeName.toLowerCase()){
+ case "a":
+ // An <a> w/out a tabindex is only navigable if it has an href
+ return hasAttr(elem, "href");
+ case "area":
+ case "button":
+ case "input":
+ case "object":
+ case "select":
+ case "textarea":
+ // These are navigable by default
+ return true;
+ case "iframe":
+ // If it's an editor <iframe> then it's tab navigable.
+ var body;
+ try{
+ // non-IE
+ var contentDocument = elem.contentDocument;
+ if("designMode" in contentDocument && contentDocument.designMode == "on"){
+ return true;
+ }
+ body = contentDocument.body;
+ }catch(e1){
+ // contentWindow.document isn't accessible within IE7/8
+ // if the iframe.src points to a foreign url and this
+ // page contains an element, that could get focus
+ try{
+ body = elem.contentWindow.document.body;
+ }catch(e2){
+ return false;
+ }
+ }
+ return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
+ default:
+ return elem.contentEditable == 'true';
+ }
+ };
+
+ var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
+ // summary:
+ // Tests if an element is tab-navigable
+
+ // TODO: convert (and rename method) to return effective tabIndex; will save time in _getTabNavigable()
+ if(attr(elem, "disabled")){
+ return false;
+ }else if(hasAttr(elem, "tabIndex")){
+ // Explicit tab index setting
+ return attr(elem, "tabIndex") >= 0; // boolean
+ }else{
+ // No explicit tabIndex setting, so depends on node type
+ return dijit.hasDefaultTabStop(elem);
+ }
+ });
+
+ dijit._getTabNavigable = function(/*DOMNode*/ root){
+ // summary:
+ // Finds descendants of the specified root node.
+ //
+ // description:
+ // Finds the following descendants of the specified root node:
+ // * the first tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the last tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the first element in document order with the lowest
+ // positive tabIndex value
+ // * the last element in document order with the highest
+ // positive tabIndex value
+ var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
+ function radioName(node) {
+ // If this element is part of a radio button group, return the name for that group.
+ return node && node.tagName.toLowerCase() == "input" &&
+ node.type && node.type.toLowerCase() == "radio" &&
+ node.name && node.name.toLowerCase();
+ }
+ var walkTree = function(/*DOMNode*/parent){
+ dojo.query("> *", parent).forEach(function(child){
+ // Skip hidden elements, and also non-HTML elements (those in custom namespaces) in IE,
+ // since show() invokes getAttribute("type"), which crash on VML nodes in IE.
+ if((dojo.isIE && child.scopeName!=="HTML") || !shown(child)){
+ return;
+ }
+
+ if(isTabNavigable(child)){
+ var tabindex = attr(child, "tabIndex");
+ if(!hasAttr(child, "tabIndex") || tabindex == 0){
+ if(!first){ first = child; }
+ last = child;
+ }else if(tabindex > 0){
+ if(!lowest || tabindex < lowestTabindex){
+ lowestTabindex = tabindex;
+ lowest = child;
+ }
+ if(!highest || tabindex >= highestTabindex){
+ highestTabindex = tabindex;
+ highest = child;
+ }
+ }
+ var rn = radioName(child);
+ if(dojo.attr(child, "checked") && rn) {
+ radioSelected[rn] = child;
+ }
+ }
+ if(child.nodeName.toUpperCase() != 'SELECT'){
+ walkTree(child);
+ }
+ });
+ };
+ if(shown(root)){ walkTree(root) }
+ function rs(node) {
+ // substitute checked radio button for unchecked one, if there is a checked one with the same name.
+ return radioSelected[radioName(node)] || node;
+ }
+ return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
+ }
+ dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is first in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.lowest ? elems.lowest : elems.first; // DomNode
+ };
+
+ dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is last in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.last ? elems.last : elems.highest; // DomNode
+ };
+
+ /*=====
+ dojo.mixin(dijit, {
+ // defaultDuration: Integer
+ // The default animation speed (in ms) to use for all Dijit
+ // transitional animations, unless otherwise specified
+ // on a per-instance basis. Defaults to 200, overrided by
+ // `djConfig.defaultDuration`
+ defaultDuration: 200
+ });
+ =====*/
+
+ dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo.Stateful"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.Stateful"] = true;
+dojo.provide("dojo.Stateful");
+
+
+
+dojo.declare("dojo.Stateful", null, {
+ // summary:
+ // Base class for objects that provide named properties with optional getter/setter
+ // control and the ability to watch for property changes
+ // example:
+ // | var obj = new dojo.Stateful();
+ // | obj.watch("foo", function(){
+ // | console.log("foo changed to " + this.get("foo"));
+ // | });
+ // | obj.set("foo","bar");
+ postscript: function(mixin){
+ if(mixin){
+ dojo.mixin(this, mixin);
+ }
+ },
+
+ get: function(/*String*/name){
+ // summary:
+ // Get a property on a Stateful instance.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property on a Stateful object. The property may
+ // potentially be retrieved via a getter method in subclasses. In the base class
+ // this just retrieves the object's property.
+ // For example:
+ // | stateful = new dojo.Stateful({foo: 3});
+ // | stateful.get("foo") // returns 3
+ // | stateful.foo // returns 3
+
+ return this[name];
+ },
+ set: function(/*String*/name, /*Object*/value){
+ // summary:
+ // Set a property on a Stateful instance
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a stateful object and notifies any watchers of
+ // the property. A programmatic setter may be defined in subclasses.
+ // For example:
+ // | stateful = new dojo.Stateful();
+ // | stateful.watch(function(name, oldValue, value){
+ // | // this will be called on the set below
+ // | }
+ // | stateful.set(foo, 5);
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myObj.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ return this;
+ },
+ watch: function(/*String?*/name, /*Function*/callback){
+ // summary:
+ // Watches a property for changes
+ // name:
+ // Indicates the property to watch. This is optional (the callback may be the
+ // only parameter), and if omitted, all the properties will be watched
+ // returns:
+ // An object handle for the watch. The unwatch method of this object
+ // can be used to discontinue watching this property:
+ // | var watchHandle = obj.watch("foo", callback);
+ // | watchHandle.unwatch(); // callback won't be called now
+ // callback:
+ // The function to execute when the property changes. This will be called after
+ // the property has been changed. The callback will be called with the |this|
+ // set to the instance, the first argument as the name of the property, the
+ // second argument as the old value and the third argument as the new value.
+
+ var callbacks = this._watchCallbacks;
+ if(!callbacks){
+ var self = this;
+ callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
+ var notify = function(propertyCallbacks){
+ if(propertyCallbacks){
+ propertyCallbacks = propertyCallbacks.slice();
+ for(var i = 0, l = propertyCallbacks.length; i < l; i++){
+ try{
+ propertyCallbacks[i].call(self, name, oldValue, value);
+ }catch(e){
+ console.error(e);
+ }
+ }
+ }
+ };
+ notify(callbacks['_' + name]);
+ if(!ignoreCatchall){
+ notify(callbacks["*"]); // the catch-all
+ }
+ }; // we use a function instead of an object so it will be ignored by JSON conversion
+ }
+ if(!callback && typeof name === "function"){
+ callback = name;
+ name = "*";
+ }else{
+ // prepend with dash to prevent name conflicts with function (like "name" property)
+ name = '_' + name;
+ }
+ var propertyCallbacks = callbacks[name];
+ if(typeof propertyCallbacks !== "object"){
+ propertyCallbacks = callbacks[name] = [];
+ }
+ propertyCallbacks.push(callback);
+ return {
+ unwatch: function(){
+ propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
+ }
+ };
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dijit._WidgetBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._WidgetBase"] = true;
+dojo.provide("dijit._WidgetBase");
+
+
+
+
+
+(function(){
+
+dojo.declare("dijit._WidgetBase", dojo.Stateful, {
+ // summary:
+ // Future base class for all Dijit widgets.
+ // _Widget extends this class adding support for various features needed by desktop.
+
+ // id: [const] String
+ // A unique, opaque ID string that can be assigned by users or by the
+ // system. If the developer passes an ID which is known not to be
+ // unique, the specified ID is ignored and the system-generated ID is
+ // used instead.
+ id: "",
+
+ // lang: [const] String
+ // Rarely used. Overrides the default Dojo locale used to render this widget,
+ // as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
+ // Value must be among the list of locales specified during by the Dojo bootstrap,
+ // formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
+ lang: "",
+
+ // dir: [const] String
+ // Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
+ // attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
+ // default direction.
+ dir: "",
+
+ // class: String
+ // HTML class attribute
+ "class": "",
+
+ // style: String||Object
+ // HTML style attributes as cssText string or name/value hash
+ style: "",
+
+ // title: String
+ // HTML title attribute.
+ //
+ // For form widgets this specifies a tooltip to display when hovering over
+ // the widget (just like the native HTML title attribute).
+ //
+ // For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
+ // etc., it's used to specify the tab label, accordion pane title, etc.
+ title: "",
+
+ // tooltip: String
+ // When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
+ // this specifies the tooltip to appear when the mouse is hovered over that text.
+ tooltip: "",
+
+ // baseClass: [protected] String
+ // Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
+ // widget state.
+ baseClass: "",
+
+ // srcNodeRef: [readonly] DomNode
+ // pointer to original DOM node
+ srcNodeRef: null,
+
+ // domNode: [readonly] DomNode
+ // This is our visible representation of the widget! Other DOM
+ // Nodes may by assigned to other properties, usually through the
+ // template system's dojoAttachPoint syntax, but the domNode
+ // property is the canonical "top level" node in widget UI.
+ domNode: null,
+
+ // containerNode: [readonly] DomNode
+ // Designates where children of the source DOM node will be placed.
+ // "Children" in this case refers to both DOM nodes and widgets.
+ // For example, for myWidget:
+ //
+ // | <div dojoType=myWidget>
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ // | </div>
+ //
+ // containerNode would point to:
+ //
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ //
+ // In templated widgets, "containerNode" is set via a
+ // dojoAttachPoint assignment.
+ //
+ // containerNode must be defined for any widget that accepts innerHTML
+ // (like ContentPane or BorderContainer or even Button), and conversely
+ // is null for widgets that don't, like TextBox.
+ containerNode: null,
+
+/*=====
+ // _started: Boolean
+ // startup() has completed.
+ _started: false,
+=====*/
+
+ // attributeMap: [protected] Object
+ // attributeMap sets up a "binding" between attributes (aka properties)
+ // of the widget and the widget's DOM.
+ // Changes to widget attributes listed in attributeMap will be
+ // reflected into the DOM.
+ //
+ // For example, calling set('title', 'hello')
+ // on a TitlePane will automatically cause the TitlePane's DOM to update
+ // with the new title.
+ //
+ // attributeMap is a hash where the key is an attribute of the widget,
+ // and the value reflects a binding to a:
+ //
+ // - DOM node attribute
+ // | focus: {node: "focusNode", type: "attribute"}
+ // Maps this.focus to this.focusNode.focus
+ //
+ // - DOM node innerHTML
+ // | title: { node: "titleNode", type: "innerHTML" }
+ // Maps this.title to this.titleNode.innerHTML
+ //
+ // - DOM node innerText
+ // | title: { node: "titleNode", type: "innerText" }
+ // Maps this.title to this.titleNode.innerText
+ //
+ // - DOM node CSS class
+ // | myClass: { node: "domNode", type: "class" }
+ // Maps this.myClass to this.domNode.className
+ //
+ // If the value is an array, then each element in the array matches one of the
+ // formats of the above list.
+ //
+ // There are also some shorthands for backwards compatibility:
+ // - string --> { node: string, type: "attribute" }, for example:
+ // | "focusNode" ---> { node: "focusNode", type: "attribute" }
+ // - "" --> { node: "domNode", type: "attribute" }
+ attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
+
+ // _blankGif: [protected] String
+ // Path to a blank 1x1 image.
+ // Used by <img> nodes in templates that really get their image via CSS background-image.
+ _blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
+
+ //////////// INITIALIZATION METHODS ///////////////////////////////////////
+
+ postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
+ // summary:
+ // Kicks off widget instantiation. See create() for details.
+ // tags:
+ // private
+ this.create(params, srcNodeRef);
+ },
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // summary:
+ // Kick off the life-cycle of a widget
+ // params:
+ // Hash of initialization parameters for widget, including
+ // scalar values (like title, duration etc.) and functions,
+ // typically callbacks like onClick.
+ // srcNodeRef:
+ // If a srcNodeRef (DOM node) is specified:
+ // - use srcNodeRef.innerHTML as my contents
+ // - if this is a behavioral widget then apply behavior
+ // to that srcNodeRef
+ // - otherwise, replace srcNodeRef with my generated DOM
+ // tree
+ // description:
+ // Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate,
+ // etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget
+ // for a discussion of the widget creation lifecycle.
+ //
+ // Of course, adventurous developers could override create entirely, but this should
+ // only be done as a last resort.
+ // tags:
+ // private
+
+ // store pointer to original DOM tree
+ this.srcNodeRef = dojo.byId(srcNodeRef);
+
+ // For garbage collection. An array of handles returned by Widget.connect()
+ // Each handle returned from Widget.connect() is an array of handles from dojo.connect()
+ this._connects = [];
+
+ // For garbage collection. An array of handles returned by Widget.subscribe()
+ // The handle returned from Widget.subscribe() is the handle returned from dojo.subscribe()
+ this._subscribes = [];
+
+ // mix in our passed parameters
+ if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
+ if(params){
+ this.params = params;
+ dojo._mixin(this, params);
+ }
+ this.postMixInProperties();
+
+ // generate an id for the widget if one wasn't specified
+ // (be sure to do this before buildRendering() because that function might
+ // expect the id to be there.)
+ if(!this.id){
+ this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
+ }
+ dijit.registry.add(this);
+
+ this.buildRendering();
+
+ if(this.domNode){
+ // Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
+ // Also calls custom setters for all attributes with custom setters.
+ this._applyAttributes();
+
+ // If srcNodeRef was specified, then swap out original srcNode for this widget's DOM tree.
+ // For 2.0, move this after postCreate(). postCreate() shouldn't depend on the
+ // widget being attached to the DOM since it isn't when a widget is created programmatically like
+ // new MyWidget({}). See #11635.
+ var source = this.srcNodeRef;
+ if(source && source.parentNode && this.domNode !== source){
+ source.parentNode.replaceChild(this.domNode, source);
+ }
+ }
+
+ if(this.domNode){
+ // Note: for 2.0 may want to rename widgetId to dojo._scopeName + "_widgetId",
+ // assuming that dojo._scopeName even exists in 2.0
+ this.domNode.setAttribute("widgetId", this.id);
+ }
+ this.postCreate();
+
+ // If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
+ if(this.srcNodeRef && !this.srcNodeRef.parentNode){
+ delete this.srcNodeRef;
+ }
+
+ this._created = true;
+ },
+
+ _applyAttributes: function(){
+ // summary:
+ // Step during widget creation to copy all widget attributes to the
+ // DOM as per attributeMap and _setXXXAttr functions.
+ // description:
+ // Skips over blank/false attribute values, unless they were explicitly specified
+ // as parameters to the widget, since those are the default anyway,
+ // and setting tabIndex="" is different than not setting tabIndex at all.
+ //
+ // It processes the attributes in the attribute map first, and then
+ // it goes through and processes the attributes for the _setXXXAttr
+ // functions that have been specified
+ // tags:
+ // private
+ var condAttrApply = function(attr, scope){
+ if((scope.params && attr in scope.params) || scope[attr]){
+ scope.set(attr, scope[attr]);
+ }
+ };
+
+ // Do the attributes in attributeMap
+ for(var attr in this.attributeMap){
+ condAttrApply(attr, this);
+ }
+
+ // And also any attributes with custom setters
+ dojo.forEach(this._getSetterAttributes(), function(a){
+ if(!(a in this.attributeMap)){
+ condAttrApply(a, this);
+ }
+ }, this);
+ },
+
+ _getSetterAttributes: function(){
+ // summary:
+ // Returns list of attributes with custom setters for this widget
+ var ctor = this.constructor;
+ if(!ctor._setterAttrs){
+ var r = (ctor._setterAttrs = []),
+ attrs,
+ proto = ctor.prototype;
+ for(var fxName in proto){
+ if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
+ r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
+ }
+ }
+ }
+ return ctor._setterAttrs; // String[]
+ },
+
+ postMixInProperties: function(){
+ // summary:
+ // Called after the parameters to the widget have been read-in,
+ // but before the widget template is instantiated. Especially
+ // useful to set properties that are referenced in the widget
+ // template.
+ // tags:
+ // protected
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget, setting this.domNode
+ // description:
+ // Most widgets will mixin `dijit._Templated`, which implements this
+ // method.
+ // tags:
+ // protected
+
+ if(!this.domNode){
+ // Create root node if it wasn't created by _Templated
+ this.domNode = this.srcNodeRef || dojo.create('div');
+ }
+
+ // baseClass is a single class name or occasionally a space-separated list of names.
+ // Add those classes to the DOMNode. If RTL mode then also add with Rtl suffix.
+ // TODO: make baseClass custom setter
+ if(this.baseClass){
+ var classes = this.baseClass.split(" ");
+ if(!this.isLeftToRight()){
+ classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
+ }
+ dojo.addClass(this.domNode, classes);
+ }
+ },
+
+ postCreate: function(){
+ // summary:
+ // Processing after the DOM fragment is created
+ // description:
+ // Called after the DOM fragment has been created, but not necessarily
+ // added to the document. Do not include any operations which rely on
+ // node dimensions or placement.
+ // tags:
+ // protected
+ },
+
+ startup: function(){
+ // summary:
+ // Processing after the DOM fragment is added to the document
+ // description:
+ // Called after a widget and its children have been created and added to the page,
+ // and all related widgets have finished their create() cycle, up through postCreate().
+ // This is useful for composite widgets that need to control or layout sub-widgets.
+ // Many layout widgets can use this as a wiring phase.
+ this._started = true;
+ },
+
+ //////////// DESTROY FUNCTIONS ////////////////////////////////
+
+ destroyRecursive: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroy this widget and its descendants
+ // description:
+ // This is the generic "destructor" function that all widget users
+ // should call to cleanly discard with a widget. Once a widget is
+ // destroyed, it is removed from the manager object.
+ // preserveDom:
+ // If true, this method will leave the original DOM structure
+ // alone of descendant Widgets. Note: This will NOT work with
+ // dijit._Templated widgets.
+
+ this._beingDestroyed = true;
+ this.destroyDescendants(preserveDom);
+ this.destroy(preserveDom);
+ },
+
+ destroy: function(/*Boolean*/ preserveDom){
+ // summary:
+ // Destroy this widget, but not its descendants.
+ // This method will, however, destroy internal widgets such as those used within a template.
+ // preserveDom: Boolean
+ // If true, this method will leave the original DOM structure alone.
+ // Note: This will not yet work with _Templated widgets
+
+ this._beingDestroyed = true;
+ this.uninitialize();
+ var d = dojo,
+ dfe = d.forEach,
+ dun = d.unsubscribe;
+ dfe(this._connects, function(array){
+ dfe(array, d.disconnect);
+ });
+ dfe(this._subscribes, function(handle){
+ dun(handle);
+ });
+
+ // destroy widgets created as part of template, etc.
+ dfe(this._supportingWidgets || [], function(w){
+ if(w.destroyRecursive){
+ w.destroyRecursive();
+ }else if(w.destroy){
+ w.destroy();
+ }
+ });
+
+ this.destroyRendering(preserveDom);
+ dijit.registry.remove(this.id);
+ this._destroyed = true;
+ },
+
+ destroyRendering: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroys the DOM nodes associated with this widget
+ // preserveDom:
+ // If true, this method will leave the original DOM structure alone
+ // during tear-down. Note: this will not work with _Templated
+ // widgets yet.
+ // tags:
+ // protected
+
+ if(this.bgIframe){
+ this.bgIframe.destroy(preserveDom);
+ delete this.bgIframe;
+ }
+
+ if(this.domNode){
+ if(preserveDom){
+ dojo.removeAttr(this.domNode, "widgetId");
+ }else{
+ dojo.destroy(this.domNode);
+ }
+ delete this.domNode;
+ }
+
+ if(this.srcNodeRef){
+ if(!preserveDom){
+ dojo.destroy(this.srcNodeRef);
+ }
+ delete this.srcNodeRef;
+ }
+ },
+
+ destroyDescendants: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Recursively destroy the children of this widget and their
+ // descendants.
+ // preserveDom:
+ // If true, the preserveDom attribute is passed to all descendant
+ // widget's .destroy() method. Not for use with _Templated
+ // widgets.
+
+ // get all direct descendants and destroy them recursively
+ dojo.forEach(this.getChildren(), function(widget){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive(preserveDom);
+ }
+ });
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Stub function. Override to implement custom widget tear-down
+ // behavior.
+ // tags:
+ // protected
+ return false;
+ },
+
+ ////////////////// GET/SET, CUSTOM SETTERS, ETC. ///////////////////
+
+ _setClassAttr: function(/*String*/ value){
+ // summary:
+ // Custom setter for the CSS "class" attribute
+ // tags:
+ // protected
+ var mapNode = this[this.attributeMap["class"] || 'domNode'];
+ dojo.replaceClass(mapNode, value, this["class"]);
+ this._set("class", value);
+ },
+
+ _setStyleAttr: function(/*String||Object*/ value){
+ // summary:
+ // Sets the style attribute of the widget according to value,
+ // which is either a hash like {height: "5px", width: "3px"}
+ // or a plain string
+ // description:
+ // Determines which node to set the style on based on style setting
+ // in attributeMap.
+ // tags:
+ // protected
+
+ var mapNode = this[this.attributeMap.style || 'domNode'];
+
+ // Note: technically we should revert any style setting made in a previous call
+ // to his method, but that's difficult to keep track of.
+
+ if(dojo.isObject(value)){
+ dojo.style(mapNode, value);
+ }else{
+ if(mapNode.style.cssText){
+ mapNode.style.cssText += "; " + value;
+ }else{
+ mapNode.style.cssText = value;
+ }
+ }
+
+ this._set("style", value);
+ },
+
+ _attrToDom: function(/*String*/ attr, /*String*/ value){
+ // summary:
+ // Reflect a widget attribute (title, tabIndex, duration etc.) to
+ // the widget DOM, as specified in attributeMap.
+ // Note some attributes like "type"
+ // cannot be processed this way as they are not mutable.
+ //
+ // tags:
+ // private
+
+ var commands = this.attributeMap[attr];
+ dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
+
+ // Get target node and what we are doing to that node
+ var mapNode = this[command.node || command || "domNode"]; // DOM node
+ var type = command.type || "attribute"; // class, innerHTML, innerText, or attribute
+
+ switch(type){
+ case "attribute":
+ if(dojo.isFunction(value)){ // functions execute in the context of the widget
+ value = dojo.hitch(this, value);
+ }
+
+ // Get the name of the DOM node attribute; usually it's the same
+ // as the name of the attribute in the widget (attr), but can be overridden.
+ // Also maps handler names to lowercase, like onSubmit --> onsubmit
+ var attrName = command.attribute ? command.attribute :
+ (/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
+
+ dojo.attr(mapNode, attrName, value);
+ break;
+ case "innerText":
+ mapNode.innerHTML = "";
+ mapNode.appendChild(dojo.doc.createTextNode(value));
+ break;
+ case "innerHTML":
+ mapNode.innerHTML = value;
+ break;
+ case "class":
+ dojo.replaceClass(mapNode, value, this[attr]);
+ break;
+ }
+ }, this);
+ },
+
+ get: function(name){
+ // summary:
+ // Get a property from a widget.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property from a widget. The property may
+ // potentially be retrieved via a getter method. If no getter is defined, this
+ // just retrieves the object's property.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_getFooAttr", calling:
+ // | myWidget.get("foo");
+ // would be equivalent to writing:
+ // | widget._getFooAttr();
+ // and:
+ // | myWidget.get("bar");
+ // would be equivalent to writing:
+ // | widget.bar;
+ var names = this._getAttrNames(name);
+ return this[names.g] ? this[names.g]() : this[name];
+ },
+
+ set: function(name, value){
+ // summary:
+ // Set a property on a widget
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a widget which may potentially be handled by a
+ // setter in the widget.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_setFooAttr", calling:
+ // | myWidget.set("foo", "Howdy!");
+ // would be equivalent to writing:
+ // | widget._setFooAttr("Howdy!");
+ // and:
+ // | myWidget.set("bar", 3);
+ // would be equivalent to writing:
+ // | widget.bar = 3;
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myWidget.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var names = this._getAttrNames(name);
+ if(this[names.s]){
+ // use the explicit setter
+ var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
+ }else{
+ // if param is specified as DOM node attribute, copy it
+ if(name in this.attributeMap){
+ this._attrToDom(name, value);
+ }
+ this._set(name, value);
+ }
+ return result || this;
+ },
+
+ _attrPairNames: {}, // shared between all widgets
+ _getAttrNames: function(name){
+ // summary:
+ // Helper function for get() and set().
+ // Caches attribute name values so we don't do the string ops every time.
+ // tags:
+ // private
+
+ var apn = this._attrPairNames;
+ if(apn[name]){ return apn[name]; }
+ var uc = name.charAt(0).toUpperCase() + name.substr(1);
+ return (apn[name] = {
+ n: name+"Node",
+ s: "_set"+uc+"Attr",
+ g: "_get"+uc+"Attr"
+ });
+ },
+
+ _set: function(/*String*/ name, /*anything*/ value){
+ // summary:
+ // Helper function to set new value for specified attribute, and call handlers
+ // registered with watch() if the value has changed.
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks && this._created && value !== oldValue){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ },
+
+ toString: function(){
+ // summary:
+ // Returns a string that represents the widget
+ // description:
+ // When a widget is cast to a string, this method will be used to generate the
+ // output. Currently, it does not implement any sort of reversible
+ // serialization.
+ return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
+ },
+
+ getDescendants: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // This method should generally be avoided as it returns widgets declared in templates, which are
+ // supposed to be internal/hidden, but it's left here for back-compat reasons.
+
+ return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : []; // dijit._Widget[]
+ },
+
+ getChildren: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // Does not return nested widgets, nor widgets that are part of this widget's template.
+ return this.containerNode ? dijit.findWidgets(this.containerNode) : []; // dijit._Widget[]
+ },
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var handles = [dojo._connect(obj, event, this, method)];
+ this._connects.push(handles);
+ return handles; // _Widget.Handle
+ },
+
+ disconnect: function(/* _Widget.Handle */ handles){
+ // summary:
+ // Disconnects handle created by `connect`.
+ // Also removes handle from this widget's list of connects.
+ // tags:
+ // protected
+ for(var i=0; i<this._connects.length; i++){
+ if(this._connects[i] == handles){
+ dojo.forEach(handles, dojo.disconnect);
+ this._connects.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ subscribe: function(
+ /*String*/ topic,
+ /*String|Function*/ method){
+ // summary:
+ // Subscribes to the specified topic and calls the specified method
+ // of this object and registers for unsubscribe() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.subscribe, except with the
+ // implicit use of this widget as the target object.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when /my/topic is published, this button changes its label to
+ // | // be the parameter of the topic.
+ // | btn.subscribe("/my/topic", function(v){
+ // | this.set("label", v);
+ // | });
+ var handle = dojo.subscribe(topic, this, method);
+
+ // return handles for Any widget that may need them
+ this._subscribes.push(handle);
+ return handle;
+ },
+
+ unsubscribe: function(/*Object*/ handle){
+ // summary:
+ // Unsubscribes handle created by this.subscribe.
+ // Also removes handle from this widget's list of subscriptions
+ for(var i=0; i<this._subscribes.length; i++){
+ if(this._subscribes[i] == handle){
+ dojo.unsubscribe(handle);
+ this._subscribes.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ isLeftToRight: function(){
+ // summary:
+ // Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
+ // tags:
+ // protected
+ return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr(); //Boolean
+ },
+
+ placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
+ // summary:
+ // Place this widget's domNode reference somewhere in the DOM based
+ // on standard dojo.place conventions, or passing a Widget reference that
+ // contains and addChild member.
+ //
+ // description:
+ // A convenience function provided in all _Widgets, providing a simple
+ // shorthand mechanism to put an existing (or newly created) Widget
+ // somewhere in the dom, and allow chaining.
+ //
+ // reference:
+ // The String id of a domNode, a domNode reference, or a reference to a Widget posessing
+ // an addChild method.
+ //
+ // position:
+ // If passed a string or domNode reference, the position argument
+ // accepts a string just as dojo.place does, one of: "first", "last",
+ // "before", or "after".
+ //
+ // If passed a _Widget reference, and that widget reference has an ".addChild" method,
+ // it will be called passing this widget instance into that method, supplying the optional
+ // position index passed.
+ //
+ // returns:
+ // dijit._Widget
+ // Provides a useful return of the newly created dijit._Widget instance so you
+ // can "chain" this function by instantiating, placing, then saving the return value
+ // to a variable.
+ //
+ // example:
+ // | // create a Button with no srcNodeRef, and place it in the body:
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
+ // | // now, 'button' is still the widget reference to the newly created button
+ // | dojo.connect(button, "onClick", function(e){ console.log('click'); });
+ //
+ // example:
+ // | // create a button out of a node with id="src" and append it to id="wrapper":
+ // | var button = new dijit.form.Button({},"src").placeAt("wrapper");
+ //
+ // example:
+ // | // place a new button as the first element of some div
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
+ //
+ // example:
+ // | // create a contentpane and add it to a TabContainer
+ // | var tc = dijit.byId("myTabs");
+ // | new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
+
+ if(reference.declaredClass && reference.addChild){
+ reference.addChild(this, position);
+ }else{
+ dojo.place(this.domNode, reference, position);
+ }
+ return this;
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.window"] = true;
+dojo.provide("dojo.window");
+
+
+dojo.getObject("window", true, dojo);
+
+dojo.window.getBox = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ var scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;
+
+ // get scroll position
+ var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work
+ return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };
+};
+
+dojo.window.get = function(doc){
+ // summary:
+ // Get window object associated with document doc
+
+ // In some IE versions (at least 6.0), document.parentWindow does not return a
+ // reference to the real window object (maybe a copy), so we must fix it as well
+ // We use IE specific execScript to attach the real window reference to
+ // document._parentWindow for later use
+ if(dojo.isIE && window !== document.parentWindow){
+ /*
+ In IE 6, only the variable "window" can be used to connect events (others
+ may be only copies).
+ */
+ doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
+ //to prevent memory leak, unset it after use
+ //another possibility is to add an onUnload handler which seems overkill to me (liucougar)
+ var win = doc._parentWindow;
+ doc._parentWindow = null;
+ return win; // Window
+ }
+
+ return doc.parentWindow || doc.defaultView; // Window
+};
+
+dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+
+ // don't rely on node.scrollIntoView working just because the function is there
+
+ try{ // catch unexpected/unrecreatable errors (#7808) since we can recover using a semi-acceptable native method
+ node = dojo.byId(node);
+ var doc = node.ownerDocument || dojo.doc,
+ body = doc.body || dojo.body(),
+ html = doc.documentElement || body.parentNode,
+ isIE = dojo.isIE, isWK = dojo.isWebKit;
+ // if an untested browser, then use the native method
+ if((!(dojo.isMoz || isIE || isWK || dojo.isOpera) || node == body || node == html) && (typeof node.scrollIntoView != "undefined")){
+ node.scrollIntoView(false); // short-circuit to native if possible
+ return;
+ }
+ var backCompat = doc.compatMode == 'BackCompat',
+ clientAreaRoot = backCompat? body : html,
+ scrollRoot = isWK ? body : clientAreaRoot,
+ rootWidth = clientAreaRoot.clientWidth,
+ rootHeight = clientAreaRoot.clientHeight,
+ rtl = !dojo._isBodyLtr(),
+ nodePos = pos || dojo.position(node),
+ el = node.parentNode,
+ isFixed = function(el){
+ return ((isIE <= 6 || (isIE && backCompat))? false : (dojo.style(el, 'position').toLowerCase() == "fixed"));
+ };
+ if(isFixed(node)){ return; } // nothing to do
+
+ while(el){
+ if(el == body){ el = scrollRoot; }
+ var elPos = dojo.position(el),
+ fixedPos = isFixed(el);
+
+ if(el == scrollRoot){
+ elPos.w = rootWidth; elPos.h = rootHeight;
+ if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
+ if(elPos.x < 0 || !isIE){ elPos.x = 0; } // IE can have values > 0
+ if(elPos.y < 0 || !isIE){ elPos.y = 0; }
+ }else{
+ var pb = dojo._getPadBorderExtents(el);
+ elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
+ }
+
+ if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
+ var clientSize = el.clientWidth,
+ scrollBarSize = elPos.w - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.w = clientSize;
+ if(isIE && rtl){ elPos.x += scrollBarSize; }
+ }
+ clientSize = el.clientHeight;
+ scrollBarSize = elPos.h - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.h = clientSize;
+ }
+ }
+ if(fixedPos){ // bounded by viewport, not parents
+ if(elPos.y < 0){
+ elPos.h += elPos.y; elPos.y = 0;
+ }
+ if(elPos.x < 0){
+ elPos.w += elPos.x; elPos.x = 0;
+ }
+ if(elPos.y + elPos.h > rootHeight){
+ elPos.h = rootHeight - elPos.y;
+ }
+ if(elPos.x + elPos.w > rootWidth){
+ elPos.w = rootWidth - elPos.x;
+ }
+ }
+ // calculate overflow in all 4 directions
+ var l = nodePos.x - elPos.x, // beyond left: < 0
+ t = nodePos.y - Math.max(elPos.y, 0), // beyond top: < 0
+ r = l + nodePos.w - elPos.w, // beyond right: > 0
+ bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
+ if(r * l > 0){
+ var s = Math[l < 0? "max" : "min"](l, r);
+ nodePos.x += el.scrollLeft;
+ el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ nodePos.x -= el.scrollLeft;
+ }
+ if(bot * t > 0){
+ nodePos.y += el.scrollTop;
+ el.scrollTop += Math[t < 0? "max" : "min"](t, bot);
+ nodePos.y -= el.scrollTop;
+ }
+ el = (el != scrollRoot) && !fixedPos && el.parentNode;
+ }
+ }catch(error){
+ console.error('scrollIntoView: ' + error);
+ node.scrollIntoView(false);
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.focus"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.focus"] = true;
+dojo.provide("dijit._base.focus");
+
+
+
+
+
+// summary:
+// These functions are used to query or set the focus and selection.
+//
+// Also, they trace when widgets become activated/deactivated,
+// so that the widget can fire _onFocus/_onBlur events.
+// "Active" here means something similar to "focused", but
+// "focus" isn't quite the right word because we keep track of
+// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
+// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
+// on the Menu or a MenuItem, since they are considered part of the
+// ComboButton widget. It only happens when focus is shifted
+// somewhere completely different.
+
+dojo.mixin(dijit, {
+ // _curFocus: DomNode
+ // Currently focused item on screen
+ _curFocus: null,
+
+ // _prevFocus: DomNode
+ // Previously focused item on screen
+ _prevFocus: null,
+
+ isCollapsed: function(){
+ // summary:
+ // Returns true if there is no text selected
+ return dijit.getBookmark().isCollapsed;
+ },
+
+ getBookmark: function(){
+ // summary:
+ // Retrieves a bookmark that can be used with moveToBookmark to return to the same range
+ var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
+
+ if(dojo.global.getSelection){
+ //W3C Range API for selections.
+ sel = dojo.global.getSelection();
+ if(sel){
+ if(sel.isCollapsed){
+ tg = cf? cf.tagName : "";
+ if(tg){
+ //Create a fake rangelike item to restore selections.
+ tg = tg.toLowerCase();
+ if(tg == "textarea" ||
+ (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
+ sel = {
+ start: cf.selectionStart,
+ end: cf.selectionEnd,
+ node: cf,
+ pRange: true
+ };
+ return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
+ }
+ }
+ bm = {isCollapsed:true};
+ }else{
+ rg = sel.getRangeAt(0);
+ bm = {isCollapsed: false, mark: rg.cloneRange()};
+ }
+ }
+ }else if(sel){
+ // If the current focus was a input of some sort and no selection, don't bother saving
+ // a native bookmark. This is because it causes issues with dialog/page selection restore.
+ // So, we need to create psuedo bookmarks to work with.
+ tg = cf ? cf.tagName : "";
+ tg = tg.toLowerCase();
+ if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
+ if(sel.type && sel.type.toLowerCase() == "none"){
+ return {
+ isCollapsed: true,
+ mark: null
+ }
+ }else{
+ rg = sel.createRange();
+ return {
+ isCollapsed: rg.text && rg.text.length?false:true,
+ mark: {
+ range: rg,
+ pRange: true
+ }
+ };
+ }
+ }
+ bm = {};
+
+ //'IE' way for selections.
+ try{
+ // createRange() throws exception when dojo in iframe
+ //and nothing selected, see #9632
+ rg = sel.createRange();
+ bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
+ }catch(e){
+ bm.isCollapsed = true;
+ return bm;
+ }
+ if(sel.type.toUpperCase() == 'CONTROL'){
+ if(rg.length){
+ bm.mark=[];
+ var i=0,len=rg.length;
+ while(i<len){
+ bm.mark.push(rg.item(i++));
+ }
+ }else{
+ bm.isCollapsed = true;
+ bm.mark = null;
+ }
+ }else{
+ bm.mark = rg.getBookmark();
+ }
+ }else{
+ console.warn("No idea how to store the current selection for this browser!");
+ }
+ return bm; // Object
+ },
+
+ moveToBookmark: function(/*Object*/bookmark){
+ // summary:
+ // Moves current selection to a bookmark
+ // bookmark:
+ // This should be a returned object from dijit.getBookmark()
+
+ var _doc = dojo.doc,
+ mark = bookmark.mark;
+ if(mark){
+ if(dojo.global.getSelection){
+ //W3C Rangi API (FF, WebKit, Opera, etc)
+ var sel = dojo.global.getSelection();
+ if(sel && sel.removeAllRanges){
+ if(mark.pRange){
+ var r = mark;
+ var n = r.node;
+ n.selectionStart = r.start;
+ n.selectionEnd = r.end;
+ }else{
+ sel.removeAllRanges();
+ sel.addRange(mark);
+ }
+ }else{
+ console.warn("No idea how to restore selection for this browser!");
+ }
+ }else if(_doc.selection && mark){
+ //'IE' way.
+ var rg;
+ if(mark.pRange){
+ rg = mark.range;
+ }else if(dojo.isArray(mark)){
+ rg = _doc.body.createControlRange();
+ //rg.addElement does not have call/apply method, so can not call it directly
+ //rg is not available in "range.addElement(item)", so can't use that either
+ dojo.forEach(mark, function(n){
+ rg.addElement(n);
+ });
+ }else{
+ rg = _doc.body.createTextRange();
+ rg.moveToBookmark(mark);
+ }
+ rg.select();
+ }
+ }
+ },
+
+ getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
+ // summary:
+ // Called as getFocus(), this returns an Object showing the current focus
+ // and selected text.
+ //
+ // Called as getFocus(widget), where widget is a (widget representing) a button
+ // that was just pressed, it returns where focus was before that button
+ // was pressed. (Pressing the button may have either shifted focus to the button,
+ // or removed focus altogether.) In this case the selected text is not returned,
+ // since it can't be accurately determined.
+ //
+ // menu: dijit._Widget or {domNode: DomNode} structure
+ // The button that was just pressed. If focus has disappeared or moved
+ // to this button, returns the previous focus. In this case the bookmark
+ // information is already lost, and null is returned.
+ //
+ // openedForWindow:
+ // iframe in which menu was opened
+ //
+ // returns:
+ // A handle to restore focus/selection, to be passed to `dijit.focus`
+ var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
+ return {
+ node: node,
+ bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
+ openedForWindow: openedForWindow
+ }; // Object
+ },
+
+ focus: function(/*Object || DomNode */ handle){
+ // summary:
+ // Sets the focused node and the selection according to argument.
+ // To set focus to an iframe's content, pass in the iframe itself.
+ // handle:
+ // object returned by get(), or a DomNode
+
+ if(!handle){ return; }
+
+ var node = "node" in handle ? handle.node : handle, // because handle is either DomNode or a composite object
+ bookmark = handle.bookmark,
+ openedForWindow = handle.openedForWindow,
+ collapsed = bookmark ? bookmark.isCollapsed : false;
+
+ // Set the focus
+ // Note that for iframe's we need to use the <iframe> to follow the parentNode chain,
+ // but we need to set focus to iframe.contentWindow
+ if(node){
+ var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
+ if(focusNode && focusNode.focus){
+ try{
+ // Gecko throws sometimes if setting focus is impossible,
+ // node not displayed or something like that
+ focusNode.focus();
+ }catch(e){/*quiet*/}
+ }
+ dijit._onFocusNode(node);
+ }
+
+ // set the selection
+ // do not need to restore if current selection is not empty
+ // (use keyboard to select a menu item) or if previous selection was collapsed
+ // as it may cause focus shift (Esp in IE).
+ if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
+ if(openedForWindow){
+ openedForWindow.focus();
+ }
+ try{
+ dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
+ }catch(e2){
+ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
+ }
+ }
+ },
+
+ // _activeStack: dijit._Widget[]
+ // List of currently active widgets (focused widget and it's ancestors)
+ _activeStack: [],
+
+ registerIframe: function(/*DomNode*/ iframe){
+ // summary:
+ // Registers listeners on the specified iframe so that any click
+ // or focus event on that iframe (or anything in it) is reported
+ // as a focus/click event on the <iframe> itself.
+ // description:
+ // Currently only used by editor.
+ // returns:
+ // Handle to pass to unregisterIframe()
+ return dijit.registerWin(iframe.contentWindow, iframe);
+ },
+
+ unregisterIframe: function(/*Object*/ handle){
+ // summary:
+ // Unregisters listeners on the specified iframe created by registerIframe.
+ // After calling be sure to delete or null out the handle itself.
+ // handle:
+ // Handle returned by registerIframe()
+
+ dijit.unregisterWin(handle);
+ },
+
+ registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
+ // summary:
+ // Registers listeners on the specified window (either the main
+ // window or an iframe's window) to detect when the user has clicked somewhere
+ // or focused somewhere.
+ // description:
+ // Users should call registerIframe() instead of this method.
+ // targetWindow:
+ // If specified this is the window associated with the iframe,
+ // i.e. iframe.contentWindow.
+ // effectiveNode:
+ // If specified, report any focus events inside targetWindow as
+ // an event on effectiveNode, rather than on evt.target.
+ // returns:
+ // Handle to pass to unregisterWin()
+
+ // TODO: make this function private in 2.0; Editor/users should call registerIframe(),
+
+ var mousedownListener = function(evt){
+ dijit._justMouseDowned = true;
+ setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
+
+ // workaround weird IE bug where the click is on an orphaned node
+ // (first time clicking a Select/DropDownButton inside a TooltipDialog)
+ if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
+ return;
+ }
+
+ dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
+ };
+ //dojo.connect(targetWindow, "onscroll", ???);
+
+ // Listen for blur and focus events on targetWindow's document.
+ // IIRC, I'm using attachEvent() rather than dojo.connect() because focus/blur events don't bubble
+ // through dojo.connect(), and also maybe to catch the focus events early, before onfocus handlers
+ // fire.
+ // Connect to <html> (rather than document) on IE to avoid memory leaks, but document on other browsers because
+ // (at least for FF) the focus event doesn't fire on <html> or <body>.
+ var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
+ if(doc){
+ if(dojo.isIE){
+ targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
+ var activateListener = function(evt){
+ // IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
+ // Should consider those more like a mouse-click than a focus....
+ if(evt.srcElement.tagName.toLowerCase() != "#document" &&
+ dijit.isTabNavigable(evt.srcElement)){
+ dijit._onFocusNode(effectiveNode || evt.srcElement);
+ }else{
+ dijit._onTouchNode(effectiveNode || evt.srcElement);
+ }
+ };
+ doc.attachEvent('onactivate', activateListener);
+ var deactivateListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.srcElement);
+ };
+ doc.attachEvent('ondeactivate', deactivateListener);
+
+ return function(){
+ targetWindow.document.detachEvent('onmousedown', mousedownListener);
+ doc.detachEvent('onactivate', activateListener);
+ doc.detachEvent('ondeactivate', deactivateListener);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }else{
+ doc.body.addEventListener('mousedown', mousedownListener, true);
+ var focusListener = function(evt){
+ dijit._onFocusNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('focus', focusListener, true);
+ var blurListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('blur', blurListener, true);
+
+ return function(){
+ doc.body.removeEventListener('mousedown', mousedownListener, true);
+ doc.removeEventListener('focus', focusListener, true);
+ doc.removeEventListener('blur', blurListener, true);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }
+ }
+ },
+
+ unregisterWin: function(/*Handle*/ handle){
+ // summary:
+ // Unregisters listeners on the specified window (either the main
+ // window or an iframe's window) according to handle returned from registerWin().
+ // After calling be sure to delete or null out the handle itself.
+
+ // Currently our handle is actually a function
+ handle && handle();
+ },
+
+ _onBlurNode: function(/*DomNode*/ node){
+ // summary:
+ // Called when focus leaves a node.
+ // Usually ignored, _unless_ it *isn't* follwed by touching another node,
+ // which indicates that we tabbed off the last field on the page,
+ // in which case every widget is marked inactive
+ dijit._prevFocus = dijit._curFocus;
+ dijit._curFocus = null;
+
+ if(dijit._justMouseDowned){
+ // the mouse down caused a new widget to be marked as active; this blur event
+ // is coming late, so ignore it.
+ return;
+ }
+
+ // if the blur event isn't followed by a focus event then mark all widgets as inactive.
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ }
+ dijit._clearActiveWidgetsTimer = setTimeout(function(){
+ delete dijit._clearActiveWidgetsTimer;
+ dijit._setStack([]);
+ dijit._prevFocus = null;
+ }, 100);
+ },
+
+ _onTouchNode: function(/*DomNode*/ node, /*String*/ by){
+ // summary:
+ // Callback when node is focused or mouse-downed
+ // node:
+ // The node that was touched.
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ // ignore the recent blurNode event
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ delete dijit._clearActiveWidgetsTimer;
+ }
+
+ // compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
+ var newStack=[];
+ try{
+ while(node){
+ var popupParent = dojo.attr(node, "dijitPopupParent");
+ if(popupParent){
+ node=dijit.byId(popupParent).domNode;
+ }else if(node.tagName && node.tagName.toLowerCase() == "body"){
+ // is this the root of the document or just the root of an iframe?
+ if(node === dojo.body()){
+ // node is the root of the main document
+ break;
+ }
+ // otherwise, find the iframe this node refers to (can't access it via parentNode,
+ // need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
+ node=dojo.window.get(node.ownerDocument).frameElement;
+ }else{
+ // if this node is the root node of a widget, then add widget id to stack,
+ // except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
+ // to support MenuItem)
+ var id = node.getAttribute && node.getAttribute("widgetId"),
+ widget = id && dijit.byId(id);
+ if(widget && !(by == "mouse" && widget.get("disabled"))){
+ newStack.unshift(id);
+ }
+ node=node.parentNode;
+ }
+ }
+ }catch(e){ /* squelch */ }
+
+ dijit._setStack(newStack, by);
+ },
+
+ _onFocusNode: function(/*DomNode*/ node){
+ // summary:
+ // Callback when node is focused
+
+ if(!node){
+ return;
+ }
+
+ if(node.nodeType == 9){
+ // Ignore focus events on the document itself. This is here so that
+ // (for example) clicking the up/down arrows of a spinner
+ // (which don't get focus) won't cause that widget to blur. (FF issue)
+ return;
+ }
+
+ dijit._onTouchNode(node);
+
+ if(node == dijit._curFocus){ return; }
+ if(dijit._curFocus){
+ dijit._prevFocus = dijit._curFocus;
+ }
+ dijit._curFocus = node;
+ dojo.publish("focusNode", [node]);
+ },
+
+ _setStack: function(/*String[]*/ newStack, /*String*/ by){
+ // summary:
+ // The stack of active widgets has changed. Send out appropriate events and records new stack.
+ // newStack:
+ // array of widget id's, starting from the top (outermost) widget
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ var oldStack = dijit._activeStack;
+ dijit._activeStack = newStack;
+
+ // compare old stack to new stack to see how many elements they have in common
+ for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
+ if(oldStack[nCommon] != newStack[nCommon]){
+ break;
+ }
+ }
+
+ var widget;
+ // for all elements that have gone out of focus, send blur event
+ for(var i=oldStack.length-1; i>=nCommon; i--){
+ widget = dijit.byId(oldStack[i]);
+ if(widget){
+ widget._focused = false;
+ widget.set("focused", false);
+ widget._hasBeenBlurred = true;
+ if(widget._onBlur){
+ widget._onBlur(by);
+ }
+ dojo.publish("widgetBlur", [widget, by]);
+ }
+ }
+
+ // for all element that have come into focus, send focus event
+ for(i=nCommon; i<newStack.length; i++){
+ widget = dijit.byId(newStack[i]);
+ if(widget){
+ widget._focused = true;
+ widget.set("focused", true);
+ if(widget._onFocus){
+ widget._onFocus(by);
+ }
+ dojo.publish("widgetFocus", [widget, by]);
+ }
+ }
+ }
+});
+
+// register top window and all the iframes it contains
+dojo.addOnLoad(function(){
+ var handle = dijit.registerWin(window);
+ if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ dijit.unregisterWin(handle);
+ handle = null;
+ })
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.AdapterRegistry"] = true;
+dojo.provide("dojo.AdapterRegistry");
+
+
+
+dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
+ // summary:
+ // A registry to make contextual calling/searching easier.
+ // description:
+ // Objects of this class keep list of arrays in the form [name, check,
+ // wrap, directReturn] that are used to determine what the contextual
+ // result of a set of checked arguments is. All check/wrap functions
+ // in this registry should be of the same arity.
+ // example:
+ // | // create a new registry
+ // | var reg = new dojo.AdapterRegistry();
+ // | reg.register("handleString",
+ // | dojo.isString,
+ // | function(str){
+ // | // do something with the string here
+ // | }
+ // | );
+ // | reg.register("handleArr",
+ // | dojo.isArray,
+ // | function(arr){
+ // | // do something with the array here
+ // | }
+ // | );
+ // |
+ // | // now we can pass reg.match() *either* an array or a string and
+ // | // the value we pass will get handled by the right function
+ // | reg.match("someValue"); // will call the first function
+ // | reg.match(["someValue"]); // will call the second
+
+ this.pairs = [];
+ this.returnWrappers = returnWrappers || false; // Boolean
+};
+
+dojo.extend(dojo.AdapterRegistry, {
+ register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
+ // summary:
+ // register a check function to determine if the wrap function or
+ // object gets selected
+ // name:
+ // a way to identify this matcher.
+ // check:
+ // a function that arguments are passed to from the adapter's
+ // match() function. The check function should return true if the
+ // given arguments are appropriate for the wrap function.
+ // directReturn:
+ // If directReturn is true, the value passed in for wrap will be
+ // returned instead of being called. Alternately, the
+ // AdapterRegistry can be set globally to "return not call" using
+ // the returnWrappers property. Either way, this behavior allows
+ // the registry to act as a "search" function instead of a
+ // function interception library.
+ // override:
+ // If override is given and true, the check function will be given
+ // highest priority. Otherwise, it will be the lowest priority
+ // adapter.
+ this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
+ },
+
+ match: function(/* ... */){
+ // summary:
+ // Find an adapter for the given arguments. If no suitable adapter
+ // is found, throws an exception. match() accepts any number of
+ // arguments, all of which are passed to all matching functions
+ // from the registered pairs.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[1].apply(this, arguments)){
+ if((pair[3])||(this.returnWrappers)){
+ return pair[2];
+ }else{
+ return pair[2].apply(this, arguments);
+ }
+ }
+ }
+ throw new Error("No match found");
+ },
+
+ unregister: function(name){
+ // summary: Remove a named adapter from the registry
+
+ // FIXME: this is kind of a dumb way to handle this. On a large
+ // registry this will be slow-ish and we can use the name as a lookup
+ // should we choose to trade memory for speed.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[0] == name){
+ this.pairs.splice(i, 1);
+ return true;
+ }
+ }
+ return false;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.place"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.place"] = true;
+dojo.provide("dijit._base.place");
+
+
+
+
+
+dijit.getViewport = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ return dojo.window.getBox();
+};
+
+/*=====
+dijit.__Position = function(){
+ // x: Integer
+ // horizontal coordinate in pixels, relative to document body
+ // y: Integer
+ // vertical coordinate in pixels, relative to document body
+
+ thix.x = x;
+ this.y = y;
+}
+=====*/
+
+
+dijit.placeOnScreen = function(
+ /* DomNode */ node,
+ /* dijit.__Position */ pos,
+ /* String[] */ corners,
+ /* dijit.__Position? */ padding){
+ // summary:
+ // Positions one of the node's corners at specified position
+ // such that node is fully visible in viewport.
+ // description:
+ // NOTE: node is assumed to be absolutely or relatively positioned.
+ // pos:
+ // Object like {x: 10, y: 20}
+ // corners:
+ // Array of Strings representing order to try corners in, like ["TR", "BL"].
+ // Possible values are:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ // padding:
+ // set padding to put some buffer around the element you want to position.
+ // example:
+ // Try to place node's top right corner at (10,20).
+ // If that makes node go (partially) off screen, then try placing
+ // bottom left corner at (10,20).
+ // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])
+
+ var choices = dojo.map(corners, function(corner){
+ var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
+ if(padding){
+ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
+ c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
+ }
+ return c;
+ });
+
+ return dijit._place(node, choices);
+}
+
+dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
+ // summary:
+ // Given a list of spots to put node, put it at the first spot where it fits,
+ // of if it doesn't fit anywhere then the place with the least overflow
+ // choices: Array
+ // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }
+ // Above example says to put the top-left corner of the node at (10,20)
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)
+ // for things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ // It also passes in the available size for the popup, which is useful for tooltips to
+ // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing
+ // how much the popup had to be modified to fit into the available space. This is used to determine
+ // what the best placement is.
+ // aroundNodeCoords: Object
+ // Size of aroundNode, ex: {w: 200, h: 50}
+
+ // get {x: 10, y: 10, w: 100, h:100} type obj representing position of
+ // viewport over document
+ var view = dojo.window.getBox();
+
+ // This won't work if the node is inside a <div style="position: relative">,
+ // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong
+ // and also it might get cutoff)
+ if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
+ dojo.body().appendChild(node);
+ }
+
+ var best = null;
+ dojo.some(choices, function(choice){
+ var corner = choice.corner;
+ var pos = choice.pos;
+ var overflow = 0;
+
+ // calculate amount of space available given specified position of node
+ var spaceAvailable = {
+ w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
+ h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
+ };
+
+ // configure node to be displayed in given position relative to button
+ // (need to do this in order to get an accurate size for the node, because
+ // a tooltip's size changes based on position, due to triangle)
+ if(layoutNode){
+ var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
+ overflow = typeof res == "undefined" ? 0 : res;
+ }
+
+ // get node's size
+ var style = node.style;
+ var oldDisplay = style.display;
+ var oldVis = style.visibility;
+ style.visibility = "hidden";
+ style.display = "";
+ var mb = dojo.marginBox(node);
+ style.display = oldDisplay;
+ style.visibility = oldVis;
+
+ // coordinates and size of node with specified corner placed at pos,
+ // and clipped by viewport
+ var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
+ startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
+ endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
+ endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
+ width = endX - startX,
+ height = endY - startY;
+
+ overflow += (mb.w - width) + (mb.h - height);
+
+ if(best == null || overflow < best.overflow){
+ best = {
+ corner: corner,
+ aroundCorner: choice.aroundCorner,
+ x: startX,
+ y: startY,
+ w: width,
+ h: height,
+ overflow: overflow,
+ spaceAvailable: spaceAvailable
+ };
+ }
+
+ return !overflow;
+ });
+
+ // In case the best position is not the last one we checked, need to call
+ // layoutNode() again.
+ if(best.overflow && layoutNode){
+ layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
+ }
+
+ // And then position the node. Do this last, after the layoutNode() above
+ // has sized the node, due to browser quirks when the viewport is scrolled
+ // (specifically that a Tooltip will shrink to fit as though the window was
+ // scrolled to the left).
+ //
+ // In RTL mode, set style.right rather than style.left so in the common case,
+ // window resizes move the popup along with the aroundNode.
+ var l = dojo._isBodyLtr(),
+ s = node.style;
+ s.top = best.y + "px";
+ s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
+
+ return best;
+}
+
+dijit.placeOnScreenAroundNode = function(
+ /* DomNode */ node,
+ /* DomNode */ aroundNode,
+ /* Object */ aroundCorners,
+ /* Function? */ layoutNode){
+
+ // summary:
+ // Position node adjacent or kitty-corner to aroundNode
+ // such that it's fully visible in viewport.
+ //
+ // description:
+ // Place node such that corner of node touches a corner of
+ // aroundNode, and that node is fully visible.
+ //
+ // aroundCorners:
+ // Ordered list of pairs of corners to try matching up.
+ // Each pair of corners is represented as a key/value in the hash,
+ // where the key corresponds to the aroundNode's corner, and
+ // the value corresponds to the node's corner:
+ //
+ // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...}
+ //
+ // The following strings are used to represent the four corners:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ //
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner)
+ // For things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ //
+ // example:
+ // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});
+ // This will try to position node such that node's top-left corner is at the same position
+ // as the bottom left corner of the aroundNode (ie, put node below
+ // aroundNode, with left edges aligned). If that fails it will try to put
+ // the bottom-right corner of node where the top right corner of aroundNode is
+ // (ie, put node above aroundNode, with right edges aligned)
+ //
+
+ // get coordinates of aroundNode
+ aroundNode = dojo.byId(aroundNode);
+ var aroundNodePos = dojo.position(aroundNode, true);
+
+ // place the node around the calculated rectangle
+ return dijit._placeOnScreenAroundRect(node,
+ aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h, // rectangle
+ aroundCorners, layoutNode);
+};
+
+/*=====
+dijit.__Rectangle = function(){
+ // x: Integer
+ // horizontal offset in pixels, relative to document body
+ // y: Integer
+ // vertical offset in pixels, relative to document body
+ // width: Integer
+ // width in pixels
+ // height: Integer
+ // height in pixels
+
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+}
+=====*/
+
+
+dijit.placeOnScreenAroundRectangle = function(
+ /* DomNode */ node,
+ /* dijit.__Rectangle */ aroundRect,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except that the "around"
+ // parameter is an arbitrary rectangle on the screen (x, y, width, height)
+ // instead of a dom node.
+
+ return dijit._placeOnScreenAroundRect(node,
+ aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
+ aroundCorners, layoutNode);
+};
+
+dijit._placeOnScreenAroundRect = function(
+ /* DomNode */ node,
+ /* Number */ x,
+ /* Number */ y,
+ /* Number */ width,
+ /* Number */ height,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
+ // of a rectangle to place node adjacent to.
+
+ // TODO: combine with placeOnScreenAroundRectangle()
+
+ // Generate list of possible positions for node
+ var choices = [];
+ for(var nodeCorner in aroundCorners){
+ choices.push( {
+ aroundCorner: nodeCorner,
+ corner: aroundCorners[nodeCorner],
+ pos: {
+ x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
+ y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
+ }
+ });
+ }
+
+ return dijit._place(node, choices, layoutNode, {w: width, h: height});
+};
+
+dijit.placementRegistry= new dojo.AdapterRegistry();
+dijit.placementRegistry.register("node",
+ function(n, x){
+ return typeof x == "object" &&
+ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
+ },
+ dijit.placeOnScreenAroundNode);
+dijit.placementRegistry.register("rect",
+ function(n, x){
+ return typeof x == "object" &&
+ "x" in x && "y" in x && "width" in x && "height" in x;
+ },
+ dijit.placeOnScreenAroundRectangle);
+
+dijit.placeOnScreenAroundElement = function(
+ /* DomNode */ node,
+ /* Object */ aroundElement,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
+ // for the "around" argument and finds a proper processor to place a node.
+
+ return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
+};
+
+dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
+ // summary:
+ // Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit.placeOnScreenAroundElement.
+ //
+ // position: String[]
+ // This variable controls the position of the drop down.
+ // It's an array of strings with the following values:
+ //
+ // * before: places drop down to the left of the target node/widget, or to the right in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * after: places drop down to the right of the target node/widget, or to the left in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * above: drop down goes above target node
+ // * below: drop down goes below target node
+ //
+ // The list is positions is tried, in order, until a position is found where the drop down fits
+ // within the viewport.
+ //
+ // leftToRight: Boolean
+ // Whether the popup will be displaying in leftToRight mode.
+ //
+ var align = {};
+ dojo.forEach(position, function(pos){
+ switch(pos){
+ case "after":
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
+ break;
+ case "before":
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
+ break;
+ case "below-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "below":
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
+ break;
+ case "above-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "above":
+ default:
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
+ align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
+ break;
+ }
+ });
+ return align;
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.window"] = true;
+dojo.provide("dijit._base.window");
+
+
+
+
+dijit.getDocumentWindow = function(doc){
+ return dojo.window.get(doc);
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.popup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.popup"] = true;
+dojo.provide("dijit._base.popup");
+
+
+
+
+
+
+/*=====
+dijit.popup.__OpenArgs = function(){
+ // popup: Widget
+ // widget to display
+ // parent: Widget
+ // the button etc. that is displaying this popup
+ // around: DomNode
+ // DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
+ // x: Integer
+ // Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // y: Integer
+ // Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // orient: Object|String
+ // When the around parameter is specified, orient should be an
+ // ordered list of tuples of the form (around-node-corner, popup-node-corner).
+ // dijit.popup.open() tries to position the popup according to each tuple in the list, in order,
+ // until the popup appears fully within the viewport.
+ //
+ // The default value is {BL:'TL', TL:'BL'}, which represents a list of two tuples:
+ // 1. (BL, TL)
+ // 2. (TL, BL)
+ // where BL means "bottom left" and "TL" means "top left".
+ // So by default, it first tries putting the popup below the around node, left-aligning them,
+ // and then tries to put it above the around node, still left-aligning them. Note that the
+ // default is horizontally reversed when in RTL mode.
+ //
+ // When an (x,y) position is specified rather than an around node, orient is either
+ // "R" or "L". R (for right) means that it tries to put the popup to the right of the mouse,
+ // specifically positioning the popup's top-right corner at the mouse position, and if that doesn't
+ // fit in the viewport, then it tries, in order, the bottom-right corner, the top left corner,
+ // and the top-right corner.
+ // onCancel: Function
+ // callback when user has canceled the popup by
+ // 1. hitting ESC or
+ // 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
+ // i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
+ // onClose: Function
+ // callback whenever this popup is closed
+ // onExecute: Function
+ // callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
+ // padding: dijit.__Position
+ // adding a buffer around the opening position. This is only useful when around is not set.
+ this.popup = popup;
+ this.parent = parent;
+ this.around = around;
+ this.x = x;
+ this.y = y;
+ this.orient = orient;
+ this.onCancel = onCancel;
+ this.onClose = onClose;
+ this.onExecute = onExecute;
+ this.padding = padding;
+}
+=====*/
+
+dijit.popup = {
+ // summary:
+ // This singleton is used to show/hide widgets as popups.
+
+ // _stack: dijit._Widget[]
+ // Stack of currently popped up widgets.
+ // (someone opened _stack[0], and then it opened _stack[1], etc.)
+ _stack: [],
+
+ // _beginZIndex: Number
+ // Z-index of the first popup. (If first popup opens other
+ // popups they get a higher z-index.)
+ _beginZIndex: 1000,
+
+ _idGen: 1,
+
+ _createWrapper: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Initialization for widgets that will be used as popups.
+ // Puts widget inside a wrapper DIV (if not already in one),
+ // and returns pointer to that wrapper DIV.
+
+ var wrapper = widget.declaredClass ? widget._popupWrapper : (dojo.hasClass(widget.parentNode, "dijitPopup") && widget.parentNode),
+ node = widget.domNode || widget;
+
+ if(!wrapper){
+ // Create wrapper <div> for when this widget [in the future] will be used as a popup.
+ // This is done early because of IE bugs where creating/moving DOM nodes causes focus
+ // to go wonky, see tests/robot/Toolbar.html to reproduce
+ wrapper = dojo.create("div",{
+ "class":"dijitPopup",
+ style:{ display: "none"},
+ role: "presentation"
+ }, dojo.body());
+ wrapper.appendChild(node);
+
+ var s = node.style;
+ s.display = "";
+ s.visibility = "";
+ s.position = "";
+ s.top = "0px";
+
+ if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
+ widget._popupWrapper = wrapper;
+ dojo.connect(widget, "destroy", function(){
+ dojo.destroy(wrapper);
+ delete widget._popupWrapper;
+ });
+ }
+ }
+
+ return wrapper;
+ },
+
+ moveOffScreen: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Moves the popup widget off-screen.
+ // Do not use this method to hide popups when not in use, because
+ // that will create an accessibility issue: the offscreen popup is
+ // still in the tabbing order.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, {
+ visibility: "hidden",
+ top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
+ display: ""
+ });
+ },
+
+ hide: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Hide this popup widget (until it is ready to be shown).
+ // Initialization for widgets that will be used as popups
+ //
+ // Also puts widget inside a wrapper DIV (if not already in one)
+ //
+ // If popup widget needs to layout it should
+ // do so when it is made visible, and popup._onShow() is called.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, "display", "none");
+ },
+
+ getTopPopup: function(){
+ // summary:
+ // Compute the closest ancestor popup that's *not* a child of another popup.
+ // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
+ var stack = this._stack;
+ for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
+ /* do nothing, just trying to get right value for pi */
+ }
+ return stack[pi];
+ },
+
+ open: function(/*dijit.popup.__OpenArgs*/ args){
+ // summary:
+ // Popup the widget at the specified position
+ //
+ // example:
+ // opening at the mouse position
+ // | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
+ //
+ // example:
+ // opening the widget as a dropdown
+ // | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
+ //
+ // Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
+ // (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
+
+ var stack = this._stack,
+ widget = args.popup,
+ orient = args.orient || (
+ (args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
+ {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
+ {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
+ ),
+ around = args.around,
+ id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
+
+ // If we are opening a new popup that isn't a child of a currently opened popup, then
+ // close currently opened popup(s). This should happen automatically when the old popups
+ // gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
+ while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
+ dijit.popup.close(stack[stack.length-1].widget);
+ }
+
+ // Get pointer to popup wrapper, and create wrapper if it doesn't exist
+ var wrapper = this._createWrapper(widget);
+
+
+ dojo.attr(wrapper, {
+ id: id,
+ style: {
+ zIndex: this._beginZIndex + stack.length
+ },
+ "class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
+ dijitPopupParent: args.parent ? args.parent.id : ""
+ });
+
+ if(dojo.isIE || dojo.isMoz){
+ if(!widget.bgIframe){
+ // setting widget.bgIframe triggers cleanup in _Widget.destroy()
+ widget.bgIframe = new dijit.BackgroundIframe(wrapper);
+ }
+ }
+
+ // position the wrapper node and make it visible
+ var best = around ?
+ dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
+ dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
+
+ wrapper.style.display = "";
+ wrapper.style.visibility = "visible";
+ widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
+
+ var handlers = [];
+
+ // provide default escape and tab key handling
+ // (this will work for any widget, not just menu)
+ handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
+ if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
+ dojo.stopEvent(evt);
+ args.onCancel();
+ }else if(evt.charOrCode === dojo.keys.TAB){
+ dojo.stopEvent(evt);
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onCancel){
+ topPopup.onCancel();
+ }
+ }
+ }));
+
+ // watch for cancel/execute events on the popup and notify the caller
+ // (for a menu, "execute" means clicking an item)
+ if(widget.onCancel){
+ handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
+ }
+
+ handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onExecute){
+ topPopup.onExecute();
+ }
+ }));
+
+ stack.push({
+ widget: widget,
+ parent: args.parent,
+ onExecute: args.onExecute,
+ onCancel: args.onCancel,
+ onClose: args.onClose,
+ handlers: handlers
+ });
+
+ if(widget.onOpen){
+ // TODO: in 2.0 standardize onShow() (used by StackContainer) and onOpen() (used here)
+ widget.onOpen(best);
+ }
+
+ return best;
+ },
+
+ close: function(/*dijit._Widget?*/ popup){
+ // summary:
+ // Close specified popup and any popups that it parented.
+ // If no popup is specified, closes all popups.
+
+ var stack = this._stack;
+
+ // Basically work backwards from the top of the stack closing popups
+ // until we hit the specified popup, but IIRC there was some issue where closing
+ // a popup would cause others to close too. Thus if we are trying to close B in [A,B,C]
+ // closing C might close B indirectly and then the while() condition will run where stack==[A]...
+ // so the while condition is constructed defensively.
+ while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
+ (!popup && stack.length)){
+ var top = stack.pop(),
+ widget = top.widget,
+ onClose = top.onClose;
+
+ if(widget.onClose){
+ // TODO: in 2.0 standardize onHide() (used by StackContainer) and onClose() (used here)
+ widget.onClose();
+ }
+ dojo.forEach(top.handlers, dojo.disconnect);
+
+ // Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
+ if(widget && widget.domNode){
+ this.hide(widget);
+ }
+
+ if(onClose){
+ onClose();
+ }
+ }
+ }
+};
+
+// TODO: remove dijit._frames, it isn't being used much, since popups never release their
+// iframes (see [22236])
+dijit._frames = new function(){
+ // summary:
+ // cache of iframes
+
+ var queue = [];
+
+ this.pop = function(){
+ var iframe;
+ if(queue.length){
+ iframe = queue.pop();
+ iframe.style.display="";
+ }else{
+ if(dojo.isIE < 9){
+ var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
+ var html="<iframe src='" + burl + "'"
+ + " style='position: absolute; left: 0px; top: 0px;"
+ + "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
+ iframe = dojo.doc.createElement(html);
+ }else{
+ iframe = dojo.create("iframe");
+ iframe.src = 'javascript:""';
+ iframe.className = "dijitBackgroundIframe";
+ dojo.style(iframe, "opacity", 0.1);
+ }
+ iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
+ dijit.setWaiRole(iframe,"presentation");
+ }
+ return iframe;
+ };
+
+ this.push = function(iframe){
+ iframe.style.display="none";
+ queue.push(iframe);
+ }
+}();
+
+
+dijit.BackgroundIframe = function(/*DomNode*/ node){
+ // summary:
+ // For IE/FF z-index schenanigans. id attribute is required.
+ //
+ // description:
+ // new dijit.BackgroundIframe(node)
+ // Makes a background iframe as a child of node, that fills
+ // area (and position) of node
+
+ if(!node.id){ throw new Error("no id"); }
+ if(dojo.isIE || dojo.isMoz){
+ var iframe = (this.iframe = dijit._frames.pop());
+ node.appendChild(iframe);
+ if(dojo.isIE<7 || dojo.isQuirks){
+ this.resize(node);
+ this._conn = dojo.connect(node, 'onresize', this, function(){
+ this.resize(node);
+ });
+ }else{
+ dojo.style(iframe, {
+ width: '100%',
+ height: '100%'
+ });
+ }
+ }
+};
+
+dojo.extend(dijit.BackgroundIframe, {
+ resize: function(node){
+ // summary:
+ // Resize the iframe so it's the same size as node.
+ // Needed on IE6 and IE/quirks because height:100% doesn't work right.
+ if(this.iframe){
+ dojo.style(this.iframe, {
+ width: node.offsetWidth + 'px',
+ height: node.offsetHeight + 'px'
+ });
+ }
+ },
+ destroy: function(){
+ // summary:
+ // destroy the iframe
+ if(this._conn){
+ dojo.disconnect(this._conn);
+ this._conn = null;
+ }
+ if(this.iframe){
+ dijit._frames.push(this.iframe);
+ delete this.iframe;
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.scroll"] = true;
+dojo.provide("dijit._base.scroll");
+
+
+
+
+dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+ // Deprecated, use `dojo.window.scrollIntoView` instead.
+
+ dojo.window.scrollIntoView(node, pos);
+};
+
+}
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dijit._base.typematic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.typematic"] = true;
+dojo.provide("dijit._base.typematic");
+
+
+
+dijit.typematic = {
+ // summary:
+ // These functions are used to repetitively call a user specified callback
+ // method when a specific key or mouse click over a specific DOM node is
+ // held down for a specific amount of time.
+ // Only 1 such event is allowed to occur on the browser page at 1 time.
+
+ _fireEventAndReload: function(){
+ this._timer = null;
+ this._callback(++this._count, this._node, this._evt);
+
+ // Schedule next event, timer is at most minDelay (default 10ms) to avoid
+ // browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
+ this._currentTimeout = Math.max(
+ this._currentTimeout < 0 ? this._initialDelay :
+ (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
+ this._minDelay);
+ this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
+ },
+
+ trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start a timed, repeating callback sequence.
+ // If already started, the function call is ignored.
+ // This method is not normally called by the user but can be
+ // when the normal listener code is insufficient.
+ // evt:
+ // key or mouse event object to pass to the user callback
+ // _this:
+ // pointer to the user's widget space.
+ // node:
+ // the DOM node object to pass the the callback function
+ // callback:
+ // function to call until the sequence is stopped called with 3 parameters:
+ // count:
+ // integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
+ // node:
+ // the DOM node object passed in
+ // evt:
+ // key or mouse event object
+ // obj:
+ // user space object used to uniquely identify each typematic sequence
+ // subsequentDelay (optional):
+ // if > 1, the number of milliseconds until the 3->n events occur
+ // or else the fractional time multiplier for the next event's delay, default=0.9
+ // initialDelay (optional):
+ // the number of milliseconds until the 2nd event occurs, default=500ms
+ // minDelay (optional):
+ // the maximum delay in milliseconds for event to fire, default=10ms
+ if(obj != this._obj){
+ this.stop();
+ this._initialDelay = initialDelay || 500;
+ this._subsequentDelay = subsequentDelay || 0.90;
+ this._minDelay = minDelay || 10;
+ this._obj = obj;
+ this._evt = evt;
+ this._node = node;
+ this._currentTimeout = -1;
+ this._count = -1;
+ this._callback = dojo.hitch(_this, callback);
+ this._fireEventAndReload();
+ this._evt = dojo.mixin({faux: true}, evt);
+ }
+ },
+
+ stop: function(){
+ // summary:
+ // Stop an ongoing timed, repeating callback sequence.
+ if(this._timer){
+ clearTimeout(this._timer);
+ this._timer = null;
+ }
+ if(this._obj){
+ this._callback(-1, this._node, this._evt);
+ this._obj = null;
+ }
+ },
+
+ addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key.
+ // See also the trigger method for other parameters.
+ // keyObject:
+ // an object defining the key to listen for:
+ // charOrCode:
+ // the printable character (string) or keyCode (number) to listen for.
+ // keyCode:
+ // (deprecated - use charOrCode) the keyCode (number) to listen for (implies charCode = 0).
+ // charCode:
+ // (deprecated - use charOrCode) the charCode (number) to listen for.
+ // ctrlKey:
+ // desired ctrl key state to initiate the callback sequence:
+ // - pressed (true)
+ // - released (false)
+ // - either (unspecified)
+ // altKey:
+ // same as ctrlKey but for the alt key
+ // shiftKey:
+ // same as ctrlKey but for the shift key
+ // returns:
+ // an array of dojo.connect handles
+ if(keyObject.keyCode){
+ keyObject.charOrCode = keyObject.keyCode;
+ dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }else if(keyObject.charCode){
+ keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
+ dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }
+ return [
+ dojo.connect(node, "onkeypress", this, function(evt){
+ if(evt.charOrCode == keyObject.charOrCode &&
+ (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
+ (keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
+ (keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) && // IE doesn't even set metaKey
+ (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
+ }else if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ }),
+ dojo.connect(node, "onkeyup", this, function(evt){
+ if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ })
+ ];
+ },
+
+ addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a typematic mouse click.
+ // See the trigger method for other parameters.
+ // returns:
+ // an array of dojo.connect handles
+ var dc = dojo.connect;
+ return [
+ dc(node, "mousedown", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ }),
+ dc(node, "mouseup", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mouseout", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mousemove", this, function(evt){
+ evt.preventDefault();
+ }),
+ dc(node, "dblclick", this, function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.isIE){
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
+ }
+ })
+ ];
+ },
+
+ addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key and mouseclick.
+ // This is a thin wrapper to addKeyListener and addMouseListener.
+ // See the addMouseListener and addKeyListener methods for other parameters.
+ // mouseNode:
+ // the DOM node object to listen on for mouse events.
+ // keyNode:
+ // the DOM node object to listen on for key events.
+ // returns:
+ // an array of dojo.connect handles
+ return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
+ this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.wai"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.wai"] = true;
+dojo.provide("dijit._base.wai");
+
+
+
+dijit.wai = {
+ onload: function(){
+ // summary:
+ // Detects if we are in high-contrast mode or not
+
+ // This must be a named function and not an anonymous
+ // function, so that the widget parsing code can make sure it
+ // registers its onload function after this function.
+ // DO NOT USE "this" within this function.
+
+ // create div for testing if high contrast mode is on or images are turned off
+ var div = dojo.create("div",{
+ id: "a11yTestNode",
+ style:{
+ cssText:'border: 1px solid;'
+ + 'border-color:red green;'
+ + 'position: absolute;'
+ + 'height: 5px;'
+ + 'top: -999px;'
+ + 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
+ }
+ }, dojo.body());
+
+ // test it
+ var cs = dojo.getComputedStyle(div);
+ if(cs){
+ var bkImg = cs.backgroundImage;
+ var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
+ dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
+ if(dojo.isIE){
+ div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
+ }else{
+ dojo.body().removeChild(div);
+ }
+ }
+ }
+};
+
+// Test if computer is in high contrast mode.
+// Make sure the a11y test runs first, before widgets are instantiated.
+if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up
+ dojo._loaders.unshift(dijit.wai.onload);
+}
+
+dojo.mixin(dijit, {
+ hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
+ // summary:
+ // Determines if an element has a particular role.
+ // returns:
+ // True if elem has the specific role attribute and false if not.
+ // For backwards compatibility if role parameter not provided,
+ // returns true if has a role
+ var waiRole = this.getWaiRole(elem);
+ return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
+ },
+
+ getWaiRole: function(/*Element*/ elem){
+ // summary:
+ // Gets the role for an element (which should be a wai role).
+ // returns:
+ // The role of elem or an empty string if elem
+ // does not have a role.
+ return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
+ },
+
+ setWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Sets the role on an element.
+ // description:
+ // Replace existing role attribute with new role.
+
+ dojo.attr(elem, "role", role);
+ },
+
+ removeWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Removes the specified role from an element.
+ // Removes role attribute if no specific role provided (for backwards compat.)
+
+ var roleValue = dojo.attr(elem, "role");
+ if(!roleValue){ return; }
+ if(role){
+ var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
+ dojo.attr(elem, "role", t);
+ }else{
+ elem.removeAttribute("role");
+ }
+ },
+
+ hasWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Determines if an element has a given state.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // true if elem has a value for the given state and
+ // false if it does not.
+
+ return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
+ },
+
+ getWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Gets the value of a state on an element.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // The value of the requested state on elem
+ // or an empty string if elem has no value for state.
+
+ return elem.getAttribute("aria-"+state) || "";
+ },
+
+ setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
+ // summary:
+ // Sets a state on an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.setAttribute("aria-"+state, value);
+ },
+
+ removeWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Removes a state from an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.removeAttribute("aria-"+state);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base"] = true;
+dojo.provide("dijit._base");
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dijit._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Widget"] = true;
+dojo.provide("dijit._Widget");
+
+
+
+
+
+
+////////////////// DEFERRED CONNECTS ///////////////////
+
+// This code is to assist deferring dojo.connect() calls in widgets (connecting to events on the widgets'
+// DOM nodes) until someone actually needs to monitor that event.
+dojo.connect(dojo, "_connect",
+ function(/*dijit._Widget*/ widget, /*String*/ event){
+ if(widget && dojo.isFunction(widget._onConnect)){
+ widget._onConnect(event);
+ }
+ });
+
+dijit._connectOnUseEventHandler = function(/*Event*/ event){};
+
+////////////////// ONDIJITCLICK SUPPORT ///////////////////
+
+// Keep track of where the last keydown event was, to help avoid generating
+// spurious ondijitclick events when:
+// 1. focus is on a <button> or <a>
+// 2. user presses then releases the ENTER key
+// 3. onclick handler fires and shifts focus to another node, with an ondijitclick handler
+// 4. onkeyup event fires, causing the ondijitclick handler to fire
+dijit._lastKeyDownNode = null;
+if(dojo.isIE){
+ (function(){
+ var keydownCallback = function(evt){
+ dijit._lastKeyDownNode = evt.srcElement;
+ };
+ dojo.doc.attachEvent('onkeydown', keydownCallback);
+ dojo.addOnWindowUnload(function(){
+ dojo.doc.detachEvent('onkeydown', keydownCallback);
+ });
+ })();
+}else{
+ dojo.doc.addEventListener('keydown', function(evt){
+ dijit._lastKeyDownNode = evt.target;
+ }, true);
+}
+
+(function(){
+
+dojo.declare("dijit._Widget", dijit._WidgetBase, {
+ // summary:
+ // Base class for all Dijit widgets.
+ //
+ // Extends _WidgetBase, adding support for:
+ // - deferred connections
+ // A call like dojo.connect(myWidget, "onMouseMove", func)
+ // will essentially do a dojo.connect(myWidget.domNode, "onMouseMove", func)
+ // - ondijitclick
+ // Support new dojoAttachEvent="ondijitclick: ..." that is triggered by a mouse click or a SPACE/ENTER keypress
+ // - focus related functions
+ // In particular, the onFocus()/onBlur() callbacks. Driven internally by
+ // dijit/_base/focus.js.
+ // - deprecated methods
+ // - onShow(), onHide(), onClose()
+ //
+ // Also, by loading code in dijit/_base, turns on:
+ // - browser sniffing (putting browser id like .dj_ie on <html> node)
+ // - high contrast mode sniffing (add .dijit_a11y class to <body> if machine is in high contrast mode)
+
+
+ ////////////////// DEFERRED CONNECTS ///////////////////
+
+ // _deferredConnects: [protected] Object
+ // attributeMap addendum for event handlers that should be connected only on first use
+ _deferredConnects: {
+ onClick: "",
+ onDblClick: "",
+ onKeyDown: "",
+ onKeyPress: "",
+ onKeyUp: "",
+ onMouseMove: "",
+ onMouseDown: "",
+ onMouseOut: "",
+ onMouseOver: "",
+ onMouseLeave: "",
+ onMouseEnter: "",
+ onMouseUp: ""
+ },
+
+ onClick: dijit._connectOnUseEventHandler,
+ /*=====
+ onClick: function(event){
+ // summary:
+ // Connect to this function to receive notifications of mouse click events.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onDblClick: dijit._connectOnUseEventHandler,
+ /*=====
+ onDblClick: function(event){
+ // summary:
+ // Connect to this function to receive notifications of mouse double click events.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyDown: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyDown: function(event){
+ // summary:
+ // Connect to this function to receive notifications of keys being pressed down.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyPress: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyPress: function(event){
+ // summary:
+ // Connect to this function to receive notifications of printable keys being typed.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyUp: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyUp: function(event){
+ // summary:
+ // Connect to this function to receive notifications of keys being released.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseDown: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseDown: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse button is pressed down.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseMove: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseMove: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseOut: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseOut: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseOver: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseOver: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseLeave: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseLeave: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves off of this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseEnter: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseEnter: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves onto this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseUp: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseUp: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse button is released.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // To avoid double-connects, remove entries from _deferredConnects
+ // that have been setup manually by a subclass (ex, by dojoAttachEvent).
+ // If a subclass has redefined a callback (ex: onClick) then assume it's being
+ // connected to manually.
+ this._deferredConnects = dojo.clone(this._deferredConnects);
+ for(var attr in this.attributeMap){
+ delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects
+ }
+ for(attr in this._deferredConnects){
+ if(this[attr] !== dijit._connectOnUseEventHandler){
+ delete this._deferredConnects[attr]; // redefined, probably dojoAttachEvent exists
+ }
+ }
+
+ this.inherited(arguments);
+
+ if(this.domNode){
+ // If the developer has specified a handler as a widget parameter
+ // (ex: new Button({onClick: ...})
+ // then naturally need to connect from DOM node to that handler immediately,
+ for(attr in this.params){
+ this._onConnect(attr);
+ }
+ }
+ },
+
+ _onConnect: function(/*String*/ event){
+ // summary:
+ // Called when someone connects to one of my handlers.
+ // "Turn on" that handler if it isn't active yet.
+ //
+ // This is also called for every single initialization parameter
+ // so need to do nothing for parameters like "id".
+ // tags:
+ // private
+ if(event in this._deferredConnects){
+ var mapNode = this[this._deferredConnects[event] || 'domNode'];
+ this.connect(mapNode, event.toLowerCase(), event);
+ delete this._deferredConnects[event];
+ }
+ },
+
+ ////////////////// FOCUS RELATED ///////////////////
+ // _onFocus() and _onBlur() are called by the focus manager
+
+ // focused: [readonly] Boolean
+ // This widget or a widget it contains has focus, or is "active" because
+ // it was recently clicked.
+ focused: false,
+
+ isFocusable: function(){
+ // summary:
+ // Return true if this widget can currently be focused
+ // and false if not
+ return this.focus && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ onFocus: function(){
+ // summary:
+ // Called when the widget becomes "active" because
+ // it or a widget inside of it either has focus, or has recently
+ // been clicked.
+ // tags:
+ // callback
+ },
+
+ onBlur: function(){
+ // summary:
+ // Called when the widget stops being "active" because
+ // focus moved to something outside of it, or the user
+ // clicked somewhere outside of it, or the widget was
+ // hidden.
+ // tags:
+ // callback
+ },
+
+ _onFocus: function(e){
+ // summary:
+ // This is where widgets do processing for when they are active,
+ // such as changing CSS classes. See onFocus() for more details.
+ // tags:
+ // protected
+ this.onFocus();
+ },
+
+ _onBlur: function(){
+ // summary:
+ // This is where widgets do processing for when they stop being active,
+ // such as changing CSS classes. See onBlur() for more details.
+ // tags:
+ // protected
+ this.onBlur();
+ },
+
+ ////////////////// DEPRECATED METHODS ///////////////////
+
+ setAttribute: function(/*String*/ attr, /*anything*/ value){
+ // summary:
+ // Deprecated. Use set() instead.
+ // tags:
+ // deprecated
+ dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0");
+ this.set(attr, value);
+ },
+
+ attr: function(/*String|Object*/name, /*Object?*/value){
+ // summary:
+ // Set or get properties on a widget instance.
+ // name:
+ // The property to get or set. If an object is passed here and not
+ // a string, its keys are used as names of attributes to be set
+ // and the value of the object as values to set in the widget.
+ // value:
+ // Optional. If provided, attr() operates as a setter. If omitted,
+ // the current value of the named property is returned.
+ // description:
+ // This method is deprecated, use get() or set() directly.
+
+ // Print deprecation warning but only once per calling function
+ if(dojo.config.isDebug){
+ var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
+ caller = (arguments.callee.caller || "unknown caller").toString();
+ if(!alreadyCalledHash[caller]){
+ dojo.deprecated(this.declaredClass + "::attr() is deprecated. Use get() or set() instead, called from " +
+ caller, "", "2.0");
+ alreadyCalledHash[caller] = true;
+ }
+ }
+
+ var args = arguments.length;
+ if(args >= 2 || typeof name === "object"){ // setter
+ return this.set.apply(this, arguments);
+ }else{ // getter
+ return this.get(name);
+ }
+ },
+
+ ////////////////// ONDIJITCLICK SUPPORT ///////////////////
+
+ // nodesWithKeyClick: [private] String[]
+ // List of nodes that correctly handle click events via native browser support,
+ // and don't need dijit's help
+ nodesWithKeyClick: ["input", "button"],
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // This version of connect also provides a special "ondijitclick"
+ // event which triggers on a click or space or enter keyup.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var d = dojo,
+ dc = d._connect,
+ handles = this.inherited(arguments, [obj, event == "ondijitclick" ? "onclick" : event, method]);
+
+ if(event == "ondijitclick"){
+ // add key based click activation for unsupported nodes.
+ // do all processing onkey up to prevent spurious clicks
+ // for details see comments at top of this file where _lastKeyDownNode is defined
+ if(d.indexOf(this.nodesWithKeyClick, obj.nodeName.toLowerCase()) == -1){ // is NOT input or button
+ var m = d.hitch(this, method);
+ handles.push(
+ dc(obj, "onkeydown", this, function(e){
+ //console.log(this.id + ": onkeydown, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
+ if((e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
+ !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
+ // needed on IE for when focus changes between keydown and keyup - otherwise dropdown menus do not work
+ dijit._lastKeyDownNode = e.target;
+
+ // Stop event to prevent scrolling on space key in IE.
+ // But don't do this for _HasDropDown because it surpresses the onkeypress
+ // event needed to open the drop down when the user presses the SPACE key.
+ if(!("openDropDown" in this && obj == this._buttonNode)){
+ e.preventDefault();
+ }
+ }
+ }),
+ dc(obj, "onkeyup", this, function(e){
+ //console.log(this.id + ": onkeyup, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
+ if( (e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
+ e.target == dijit._lastKeyDownNode && // === breaks greasemonkey
+ !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
+ //need reset here or have problems in FF when focus returns to trigger element after closing popup/alert
+ dijit._lastKeyDownNode = null;
+ return m(e);
+ }
+ })
+ );
+ }
+ }
+
+ return handles; // _Widget.Handle
+ },
+
+ ////////////////// MISCELLANEOUS METHODS ///////////////////
+
+ _onShow: function(){
+ // summary:
+ // Internal method called when this widget is made visible.
+ // See `onShow` for details.
+ this.onShow();
+ },
+
+ onShow: function(){
+ // summary:
+ // Called when this widget becomes the selected pane in a
+ // `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
+ // `dijit.layout.AccordionContainer`, etc.
+ //
+ // Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
+ // tags:
+ // callback
+ },
+
+ onHide: function(){
+ // summary:
+ // Called when another widget becomes the selected pane in a
+ // `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
+ // `dijit.layout.AccordionContainer`, etc.
+ //
+ // Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
+ // tags:
+ // callback
+ },
+
+ onClose: function(){
+ // summary:
+ // Called when this widget is being displayed as a popup (ex: a Calendar popped
+ // up from a DateTextBox), and it is hidden.
+ // This is called from the dijit.popup code, and should not be called directly.
+ //
+ // Also used as a parameter for children of `dijit.layout.StackContainer` or subclasses.
+ // Callback if a user tries to close the child. Child will be closed if this function returns true.
+ // tags:
+ // extension
+
+ return true; // Boolean
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.gfx.matrix"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.gfx.matrix"] = true;
+dojo.provide("dojox.gfx.matrix");
+
+(function(){
+ var m = dojox.gfx.matrix;
+
+ // candidates for dojox.math:
+ var _degToRadCache = {};
+ m._degToRad = function(degree){
+ return _degToRadCache[degree] || (_degToRadCache[degree] = (Math.PI * degree / 180));
+ };
+ m._radToDeg = function(radian){ return radian / Math.PI * 180; };
+
+ m.Matrix2D = function(arg){
+ // summary: a 2D matrix object
+ // description: Normalizes a 2D matrix-like object. If arrays is passed,
+ // all objects of the array are normalized and multiplied sequentially.
+ // arg: Object
+ // a 2D matrix-like object, a number, or an array of such objects
+ if(arg){
+ if(typeof arg == "number"){
+ this.xx = this.yy = arg;
+ }else if(arg instanceof Array){
+ if(arg.length > 0){
+ var matrix = m.normalize(arg[0]);
+ // combine matrices
+ for(var i = 1; i < arg.length; ++i){
+ var l = matrix, r = dojox.gfx.matrix.normalize(arg[i]);
+ matrix = new m.Matrix2D();
+ matrix.xx = l.xx * r.xx + l.xy * r.yx;
+ matrix.xy = l.xx * r.xy + l.xy * r.yy;
+ matrix.yx = l.yx * r.xx + l.yy * r.yx;
+ matrix.yy = l.yx * r.xy + l.yy * r.yy;
+ matrix.dx = l.xx * r.dx + l.xy * r.dy + l.dx;
+ matrix.dy = l.yx * r.dx + l.yy * r.dy + l.dy;
+ }
+ dojo.mixin(this, matrix);
+ }
+ }else{
+ dojo.mixin(this, arg);
+ }
+ }
+ };
+
+ // the default (identity) matrix, which is used to fill in missing values
+ dojo.extend(m.Matrix2D, {xx: 1, xy: 0, yx: 0, yy: 1, dx: 0, dy: 0});
+
+ dojo.mixin(m, {
+ // summary: class constants, and methods of dojox.gfx.matrix
+
+ // matrix constants
+
+ // identity: dojox.gfx.matrix.Matrix2D
+ // an identity matrix constant: identity * (x, y) == (x, y)
+ identity: new m.Matrix2D(),
+
+ // flipX: dojox.gfx.matrix.Matrix2D
+ // a matrix, which reflects points at x = 0 line: flipX * (x, y) == (-x, y)
+ flipX: new m.Matrix2D({xx: -1}),
+
+ // flipY: dojox.gfx.matrix.Matrix2D
+ // a matrix, which reflects points at y = 0 line: flipY * (x, y) == (x, -y)
+ flipY: new m.Matrix2D({yy: -1}),
+
+ // flipXY: dojox.gfx.matrix.Matrix2D
+ // a matrix, which reflects points at the origin of coordinates: flipXY * (x, y) == (-x, -y)
+ flipXY: new m.Matrix2D({xx: -1, yy: -1}),
+
+ // matrix creators
+
+ translate: function(a, b){
+ // summary: forms a translation matrix
+ // description: The resulting matrix is used to translate (move) points by specified offsets.
+ // a: Number: an x coordinate value
+ // b: Number: a y coordinate value
+ if(arguments.length > 1){
+ return new m.Matrix2D({dx: a, dy: b}); // dojox.gfx.matrix.Matrix2D
+ }
+ // branch
+ // a: dojox.gfx.Point: a point-like object, which specifies offsets for both dimensions
+ // b: null
+ return new m.Matrix2D({dx: a.x, dy: a.y}); // dojox.gfx.matrix.Matrix2D
+ },
+ scale: function(a, b){
+ // summary: forms a scaling matrix
+ // description: The resulting matrix is used to scale (magnify) points by specified offsets.
+ // a: Number: a scaling factor used for the x coordinate
+ // b: Number: a scaling factor used for the y coordinate
+ if(arguments.length > 1){
+ return new m.Matrix2D({xx: a, yy: b}); // dojox.gfx.matrix.Matrix2D
+ }
+ if(typeof a == "number"){
+ // branch
+ // a: Number: a uniform scaling factor used for the both coordinates
+ // b: null
+ return new m.Matrix2D({xx: a, yy: a}); // dojox.gfx.matrix.Matrix2D
+ }
+ // branch
+ // a: dojox.gfx.Point: a point-like object, which specifies scale factors for both dimensions
+ // b: null
+ return new m.Matrix2D({xx: a.x, yy: a.y}); // dojox.gfx.matrix.Matrix2D
+ },
+ rotate: function(angle){
+ // summary: forms a rotating matrix
+ // description: The resulting matrix is used to rotate points
+ // around the origin of coordinates (0, 0) by specified angle.
+ // angle: Number: an angle of rotation in radians (>0 for CW)
+ var c = Math.cos(angle);
+ var s = Math.sin(angle);
+ return new m.Matrix2D({xx: c, xy: -s, yx: s, yy: c}); // dojox.gfx.matrix.Matrix2D
+ },
+ rotateg: function(degree){
+ // summary: forms a rotating matrix
+ // description: The resulting matrix is used to rotate points
+ // around the origin of coordinates (0, 0) by specified degree.
+ // See dojox.gfx.matrix.rotate() for comparison.
+ // degree: Number: an angle of rotation in degrees (>0 for CW)
+ return m.rotate(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D
+ },
+ skewX: function(angle) {
+ // summary: forms an x skewing matrix
+ // description: The resulting matrix is used to skew points in the x dimension
+ // around the origin of coordinates (0, 0) by specified angle.
+ // angle: Number: an skewing angle in radians
+ return new m.Matrix2D({xy: Math.tan(angle)}); // dojox.gfx.matrix.Matrix2D
+ },
+ skewXg: function(degree){
+ // summary: forms an x skewing matrix
+ // description: The resulting matrix is used to skew points in the x dimension
+ // around the origin of coordinates (0, 0) by specified degree.
+ // See dojox.gfx.matrix.skewX() for comparison.
+ // degree: Number: an skewing angle in degrees
+ return m.skewX(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D
+ },
+ skewY: function(angle){
+ // summary: forms a y skewing matrix
+ // description: The resulting matrix is used to skew points in the y dimension
+ // around the origin of coordinates (0, 0) by specified angle.
+ // angle: Number: an skewing angle in radians
+ return new m.Matrix2D({yx: Math.tan(angle)}); // dojox.gfx.matrix.Matrix2D
+ },
+ skewYg: function(degree){
+ // summary: forms a y skewing matrix
+ // description: The resulting matrix is used to skew points in the y dimension
+ // around the origin of coordinates (0, 0) by specified degree.
+ // See dojox.gfx.matrix.skewY() for comparison.
+ // degree: Number: an skewing angle in degrees
+ return m.skewY(m._degToRad(degree)); // dojox.gfx.matrix.Matrix2D
+ },
+ reflect: function(a, b){
+ // summary: forms a reflection matrix
+ // description: The resulting matrix is used to reflect points around a vector,
+ // which goes through the origin.
+ // a: dojox.gfx.Point: a point-like object, which specifies a vector of reflection
+ // b: null
+ if(arguments.length == 1){
+ b = a.y;
+ a = a.x;
+ }
+ // branch
+ // a: Number: an x coordinate value
+ // b: Number: a y coordinate value
+
+ // make a unit vector
+ var a2 = a * a, b2 = b * b, n2 = a2 + b2, xy = 2 * a * b / n2;
+ return new m.Matrix2D({xx: 2 * a2 / n2 - 1, xy: xy, yx: xy, yy: 2 * b2 / n2 - 1}); // dojox.gfx.matrix.Matrix2D
+ },
+ project: function(a, b){
+ // summary: forms an orthogonal projection matrix
+ // description: The resulting matrix is used to project points orthogonally on a vector,
+ // which goes through the origin.
+ // a: dojox.gfx.Point: a point-like object, which specifies a vector of projection
+ // b: null
+ if(arguments.length == 1){
+ b = a.y;
+ a = a.x;
+ }
+ // branch
+ // a: Number: an x coordinate value
+ // b: Number: a y coordinate value
+
+ // make a unit vector
+ var a2 = a * a, b2 = b * b, n2 = a2 + b2, xy = a * b / n2;
+ return new m.Matrix2D({xx: a2 / n2, xy: xy, yx: xy, yy: b2 / n2}); // dojox.gfx.matrix.Matrix2D
+ },
+
+ // ensure matrix 2D conformance
+ normalize: function(matrix){
+ // summary: converts an object to a matrix, if necessary
+ // description: Converts any 2D matrix-like object or an array of
+ // such objects to a valid dojox.gfx.matrix.Matrix2D object.
+ // matrix: Object: an object, which is converted to a matrix, if necessary
+ return (matrix instanceof m.Matrix2D) ? matrix : new m.Matrix2D(matrix); // dojox.gfx.matrix.Matrix2D
+ },
+
+ // common operations
+
+ clone: function(matrix){
+ // summary: creates a copy of a 2D matrix
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object to be cloned
+ var obj = new m.Matrix2D();
+ for(var i in matrix){
+ if(typeof(matrix[i]) == "number" && typeof(obj[i]) == "number" && obj[i] != matrix[i]) obj[i] = matrix[i];
+ }
+ return obj; // dojox.gfx.matrix.Matrix2D
+ },
+ invert: function(matrix){
+ // summary: inverts a 2D matrix
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object to be inverted
+ var M = m.normalize(matrix),
+ D = M.xx * M.yy - M.xy * M.yx,
+ M = new m.Matrix2D({
+ xx: M.yy/D, xy: -M.xy/D,
+ yx: -M.yx/D, yy: M.xx/D,
+ dx: (M.xy * M.dy - M.yy * M.dx) / D,
+ dy: (M.yx * M.dx - M.xx * M.dy) / D
+ });
+ return M; // dojox.gfx.matrix.Matrix2D
+ },
+ _multiplyPoint: function(matrix, x, y){
+ // summary: applies a matrix to a point
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied
+ // x: Number: an x coordinate of a point
+ // y: Number: a y coordinate of a point
+ return {x: matrix.xx * x + matrix.xy * y + matrix.dx, y: matrix.yx * x + matrix.yy * y + matrix.dy}; // dojox.gfx.Point
+ },
+ multiplyPoint: function(matrix, /* Number||Point */ a, /* Number, optional */ b){
+ // summary: applies a matrix to a point
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied
+ // a: Number: an x coordinate of a point
+ // b: Number: a y coordinate of a point
+ var M = m.normalize(matrix);
+ if(typeof a == "number" && typeof b == "number"){
+ return m._multiplyPoint(M, a, b); // dojox.gfx.Point
+ }
+ // branch
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix object to be applied
+ // a: dojox.gfx.Point: a point
+ // b: null
+ return m._multiplyPoint(M, a.x, a.y); // dojox.gfx.Point
+ },
+ multiply: function(matrix){
+ // summary: combines matrices by multiplying them sequentially in the given order
+ // matrix: dojox.gfx.matrix.Matrix2D...: a 2D matrix-like object,
+ // all subsequent arguments are matrix-like objects too
+ var M = m.normalize(matrix);
+ // combine matrices
+ for(var i = 1; i < arguments.length; ++i){
+ var l = M, r = m.normalize(arguments[i]);
+ M = new m.Matrix2D();
+ M.xx = l.xx * r.xx + l.xy * r.yx;
+ M.xy = l.xx * r.xy + l.xy * r.yy;
+ M.yx = l.yx * r.xx + l.yy * r.yx;
+ M.yy = l.yx * r.xy + l.yy * r.yy;
+ M.dx = l.xx * r.dx + l.xy * r.dy + l.dx;
+ M.dy = l.yx * r.dx + l.yy * r.dy + l.dy;
+ }
+ return M; // dojox.gfx.matrix.Matrix2D
+ },
+
+ // high level operations
+
+ _sandwich: function(matrix, x, y){
+ // summary: applies a matrix at a centrtal point
+ // matrix: dojox.gfx.matrix.Matrix2D: a 2D matrix-like object, which is applied at a central point
+ // x: Number: an x component of the central point
+ // y: Number: a y component of the central point
+ return m.multiply(m.translate(x, y), matrix, m.translate(-x, -y)); // dojox.gfx.matrix.Matrix2D
+ },
+ scaleAt: function(a, b, c, d){
+ // summary: scales a picture using a specified point as a center of scaling
+ // description: Compare with dojox.gfx.matrix.scale().
+ // a: Number: a scaling factor used for the x coordinate
+ // b: Number: a scaling factor used for the y coordinate
+ // c: Number: an x component of a central point
+ // d: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) uniform scale factor, Point
+ // 2) uniform scale factor, x, y
+ // 3) x scale, y scale, Point
+ // 4) x scale, y scale, x, y
+
+ switch(arguments.length){
+ case 4:
+ // a and b are scale factor components, c and d are components of a point
+ return m._sandwich(m.scale(a, b), c, d); // dojox.gfx.matrix.Matrix2D
+ case 3:
+ if(typeof c == "number"){
+ // branch
+ // a: Number: a uniform scaling factor used for both coordinates
+ // b: Number: an x component of a central point
+ // c: Number: a y component of a central point
+ // d: null
+ return m._sandwich(m.scale(a), b, c); // dojox.gfx.matrix.Matrix2D
+ }
+ // branch
+ // a: Number: a scaling factor used for the x coordinate
+ // b: Number: a scaling factor used for the y coordinate
+ // c: dojox.gfx.Point: a central point
+ // d: null
+ return m._sandwich(m.scale(a, b), c.x, c.y); // dojox.gfx.matrix.Matrix2D
+ }
+ // branch
+ // a: Number: a uniform scaling factor used for both coordinates
+ // b: dojox.gfx.Point: a central point
+ // c: null
+ // d: null
+ return m._sandwich(m.scale(a), b.x, b.y); // dojox.gfx.matrix.Matrix2D
+ },
+ rotateAt: function(angle, a, b){
+ // summary: rotates a picture using a specified point as a center of rotation
+ // description: Compare with dojox.gfx.matrix.rotate().
+ // angle: Number: an angle of rotation in radians (>0 for CW)
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) rotation angle in radians, Point
+ // 2) rotation angle in radians, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.rotate(angle), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // angle: Number: an angle of rotation in radians (>0 for CCW)
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.rotate(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ },
+ rotategAt: function(degree, a, b){
+ // summary: rotates a picture using a specified point as a center of rotation
+ // description: Compare with dojox.gfx.matrix.rotateg().
+ // degree: Number: an angle of rotation in degrees (>0 for CW)
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) rotation angle in degrees, Point
+ // 2) rotation angle in degrees, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.rotateg(degree), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // degree: Number: an angle of rotation in degrees (>0 for CCW)
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.rotateg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ },
+ skewXAt: function(angle, a, b){
+ // summary: skews a picture along the x axis using a specified point as a center of skewing
+ // description: Compare with dojox.gfx.matrix.skewX().
+ // angle: Number: an skewing angle in radians
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) skew angle in radians, Point
+ // 2) skew angle in radians, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.skewX(angle), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // angle: Number: an skewing angle in radians
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.skewX(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ },
+ skewXgAt: function(degree, a, b){
+ // summary: skews a picture along the x axis using a specified point as a center of skewing
+ // description: Compare with dojox.gfx.matrix.skewXg().
+ // degree: Number: an skewing angle in degrees
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) skew angle in degrees, Point
+ // 2) skew angle in degrees, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.skewXg(degree), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // degree: Number: an skewing angle in degrees
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.skewXg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ },
+ skewYAt: function(angle, a, b){
+ // summary: skews a picture along the y axis using a specified point as a center of skewing
+ // description: Compare with dojox.gfx.matrix.skewY().
+ // angle: Number: an skewing angle in radians
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) skew angle in radians, Point
+ // 2) skew angle in radians, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.skewY(angle), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // angle: Number: an skewing angle in radians
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.skewY(angle), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ },
+ skewYgAt: function(/* Number */ degree, /* Number||Point */ a, /* Number, optional */ b){
+ // summary: skews a picture along the y axis using a specified point as a center of skewing
+ // description: Compare with dojox.gfx.matrix.skewYg().
+ // degree: Number: an skewing angle in degrees
+ // a: Number: an x component of a central point
+ // b: Number: a y component of a central point
+
+ // accepts several signatures:
+ // 1) skew angle in degrees, Point
+ // 2) skew angle in degrees, x, y
+
+ if(arguments.length > 2){
+ return m._sandwich(m.skewYg(degree), a, b); // dojox.gfx.matrix.Matrix2D
+ }
+
+ // branch
+ // degree: Number: an skewing angle in degrees
+ // a: dojox.gfx.Point: a central point
+ // b: null
+ return m._sandwich(m.skewYg(degree), a.x, a.y); // dojox.gfx.matrix.Matrix2D
+ }
+
+ //TODO: rect-to-rect mapping, scale-to-fit (isotropic and anisotropic versions)
+
+ });
+})();
+
+// propagate Matrix2D up
+dojox.gfx.Matrix2D = dojox.gfx.matrix.Matrix2D;
+
+}
+
+if(!dojo._hasResource["dojox.gfx._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.gfx._base"] = true;
+dojo.provide("dojox.gfx._base");
+
+(function(){
+ var g = dojox.gfx, b = g._base;
+
+ // candidates for dojox.style (work on VML and SVG nodes)
+ g._hasClass = function(/*DomNode*/node, /*String*/classStr){
+ // summary:
+ // Returns whether or not the specified classes are a portion of the
+ // class list currently applied to the node.
+ // return (new RegExp('(^|\\s+)'+classStr+'(\\s+|$)')).test(node.className) // Boolean
+ var cls = node.getAttribute("className");
+ return cls && (" " + cls + " ").indexOf(" " + classStr + " ") >= 0; // Boolean
+ };
+ g._addClass = function(/*DomNode*/node, /*String*/classStr){
+ // summary:
+ // Adds the specified classes to the end of the class list on the
+ // passed node.
+ var cls = node.getAttribute("className") || "";
+ if(!cls || (" " + cls + " ").indexOf(" " + classStr + " ") < 0){
+ node.setAttribute("className", cls + (cls ? " " : "") + classStr);
+ }
+ };
+ g._removeClass = function(/*DomNode*/node, /*String*/classStr){
+ // summary: Removes classes from node.
+ var cls = node.getAttribute("className");
+ if(cls){
+ node.setAttribute(
+ "className",
+ cls.replace(new RegExp('(^|\\s+)' + classStr + '(\\s+|$)'), "$1$2")
+ );
+ }
+ };
+
+ // candidate for dojox.html.metrics (dynamic font resize handler is not implemented here)
+
+ // derived from Morris John's emResized measurer
+ b._getFontMeasurements = function(){
+ // summary:
+ // Returns an object that has pixel equivilents of standard font
+ // size values.
+ var heights = {
+ '1em': 0, '1ex': 0, '100%': 0, '12pt': 0, '16px': 0, 'xx-small': 0,
+ 'x-small': 0, 'small': 0, 'medium': 0, 'large': 0, 'x-large': 0,
+ 'xx-large': 0
+ };
+
+ if(dojo.isIE){
+ // we do a font-size fix if and only if one isn't applied already.
+ // NOTE: If someone set the fontSize on the HTML Element, this will kill it.
+ dojo.doc.documentElement.style.fontSize="100%";
+ }
+
+ // set up the measuring node.
+ var div = dojo.create("div", {style: {
+ position: "absolute",
+ left: "0",
+ top: "-100px",
+ width: "30px",
+ height: "1000em",
+ borderWidth: "0",
+ margin: "0",
+ padding: "0",
+ outline: "none",
+ lineHeight: "1",
+ overflow: "hidden"
+ }}, dojo.body());
+
+ // do the measurements.
+ for(var p in heights){
+ div.style.fontSize = p;
+ heights[p] = Math.round(div.offsetHeight * 12/16) * 16/12 / 1000;
+ }
+
+ dojo.body().removeChild(div);
+ return heights; // object
+ };
+
+ var fontMeasurements = null;
+
+ b._getCachedFontMeasurements = function(recalculate){
+ if(recalculate || !fontMeasurements){
+ fontMeasurements = b._getFontMeasurements();
+ }
+ return fontMeasurements;
+ };
+
+ // candidate for dojox.html.metrics
+
+ var measuringNode = null, empty = {};
+ b._getTextBox = function( /*String*/ text,
+ /*Object*/ style,
+ /*String?*/ className){
+ var m, s, al = arguments.length;
+ if(!measuringNode){
+ measuringNode = dojo.create("div", {style: {
+ position: "absolute",
+ top: "-10000px",
+ left: "0"
+ }}, dojo.body());
+ }
+ m = measuringNode;
+ // reset styles
+ m.className = "";
+ s = m.style;
+ s.borderWidth = "0";
+ s.margin = "0";
+ s.padding = "0";
+ s.outline = "0";
+ // set new style
+ if(al > 1 && style){
+ for(var i in style){
+ if(i in empty){ continue; }
+ s[i] = style[i];
+ }
+ }
+ // set classes
+ if(al > 2 && className){
+ m.className = className;
+ }
+ // take a measure
+ m.innerHTML = text;
+
+ if(m["getBoundingClientRect"]){
+ var bcr = m.getBoundingClientRect();
+ return {l: bcr.left, t: bcr.top, w: bcr.width || (bcr.right - bcr.left), h: bcr.height || (bcr.bottom - bcr.top)};
+ }else{
+ return dojo.marginBox(m);
+ }
+ };
+
+ // candidate for dojo.dom
+
+ var uniqueId = 0;
+ b._getUniqueId = function(){
+ // summary: returns a unique string for use with any DOM element
+ var id;
+ do{
+ id = dojo._scopeName + "Unique" + (++uniqueId);
+ }while(dojo.byId(id));
+ return id;
+ };
+})();
+
+dojo.mixin(dojox.gfx, {
+ // summary:
+ // defines constants, prototypes, and utility functions
+
+ // default shapes, which are used to fill in missing parameters
+ defaultPath: {
+ type: "path", path: ""
+ },
+ defaultPolyline: {
+ type: "polyline", points: []
+ },
+ defaultRect: {
+ type: "rect", x: 0, y: 0, width: 100, height: 100, r: 0
+ },
+ defaultEllipse: {
+ type: "ellipse", cx: 0, cy: 0, rx: 200, ry: 100
+ },
+ defaultCircle: {
+ type: "circle", cx: 0, cy: 0, r: 100
+ },
+ defaultLine: {
+ type: "line", x1: 0, y1: 0, x2: 100, y2: 100
+ },
+ defaultImage: {
+ type: "image", x: 0, y: 0, width: 0, height: 0, src: ""
+ },
+ defaultText: {
+ type: "text", x: 0, y: 0, text: "", align: "start",
+ decoration: "none", rotated: false, kerning: true
+ },
+ defaultTextPath: {
+ type: "textpath", text: "", align: "start",
+ decoration: "none", rotated: false, kerning: true
+ },
+
+ // default geometric attributes
+ defaultStroke: {
+ type: "stroke", color: "black", style: "solid", width: 1,
+ cap: "butt", join: 4
+ },
+ defaultLinearGradient: {
+ type: "linear", x1: 0, y1: 0, x2: 100, y2: 100,
+ colors: [
+ { offset: 0, color: "black" }, { offset: 1, color: "white" }
+ ]
+ },
+ defaultRadialGradient: {
+ type: "radial", cx: 0, cy: 0, r: 100,
+ colors: [
+ { offset: 0, color: "black" }, { offset: 1, color: "white" }
+ ]
+ },
+ defaultPattern: {
+ type: "pattern", x: 0, y: 0, width: 0, height: 0, src: ""
+ },
+ defaultFont: {
+ type: "font", style: "normal", variant: "normal",
+ weight: "normal", size: "10pt", family: "serif"
+ },
+
+ getDefault: (function(){
+ var typeCtorCache = {};
+ // a memoized delegate()
+ return function(/*String*/ type){
+ var t = typeCtorCache[type];
+ if(t){
+ return new t();
+ }
+ t = typeCtorCache[type] = new Function;
+ t.prototype = dojox.gfx[ "default" + type ];
+ return new t();
+ }
+ })(),
+
+ normalizeColor: function(/*Color*/ color){
+ // summary:
+ // converts any legal color representation to normalized
+ // dojo.Color object
+ return (color instanceof dojo.Color) ? color : new dojo.Color(color); // dojo.Color
+ },
+ normalizeParameters: function(existed, update){
+ // summary:
+ // updates an existing object with properties from an "update"
+ // object
+ // existed: Object
+ // the "target" object to be updated
+ // update: Object
+ // the "update" object, whose properties will be used to update
+ // the existed object
+ if(update){
+ var empty = {};
+ for(var x in existed){
+ if(x in update && !(x in empty)){
+ existed[x] = update[x];
+ }
+ }
+ }
+ return existed; // Object
+ },
+ makeParameters: function(defaults, update){
+ // summary:
+ // copies the original object, and all copied properties from the
+ // "update" object
+ // defaults: Object
+ // the object to be cloned before updating
+ // update: Object
+ // the object, which properties are to be cloned during updating
+ if(!update){
+ // return dojo.clone(defaults);
+ return dojo.delegate(defaults);
+ }
+ var result = {};
+ for(var i in defaults){
+ if(!(i in result)){
+ result[i] = dojo.clone((i in update) ? update[i] : defaults[i]);
+ }
+ }
+ return result; // Object
+ },
+ formatNumber: function(x, addSpace){
+ // summary: converts a number to a string using a fixed notation
+ // x: Number: number to be converted
+ // addSpace: Boolean?: if it is true, add a space before a positive number
+ var val = x.toString();
+ if(val.indexOf("e") >= 0){
+ val = x.toFixed(4);
+ }else{
+ var point = val.indexOf(".");
+ if(point >= 0 && val.length - point > 5){
+ val = x.toFixed(4);
+ }
+ }
+ if(x < 0){
+ return val; // String
+ }
+ return addSpace ? " " + val : val; // String
+ },
+ // font operations
+ makeFontString: function(font){
+ // summary: converts a font object to a CSS font string
+ // font: Object: font object (see dojox.gfx.defaultFont)
+ return font.style + " " + font.variant + " " + font.weight + " " + font.size + " " + font.family; // Object
+ },
+ splitFontString: function(str){
+ // summary:
+ // converts a CSS font string to a font object
+ // description:
+ // Converts a CSS font string to a gfx font object. The CSS font
+ // string components should follow the W3C specified order
+ // (see http://www.w3.org/TR/CSS2/fonts.html#font-shorthand):
+ // style, variant, weight, size, optional line height (will be
+ // ignored), and family.
+ // str: String
+ // a CSS font string
+ var font = dojox.gfx.getDefault("Font");
+ var t = str.split(/\s+/);
+ do{
+ if(t.length < 5){ break; }
+ font.style = t[0];
+ font.variant = t[1];
+ font.weight = t[2];
+ var i = t[3].indexOf("/");
+ font.size = i < 0 ? t[3] : t[3].substring(0, i);
+ var j = 4;
+ if(i < 0){
+ if(t[4] == "/"){
+ j = 6;
+ }else if(t[4].charAt(0) == "/"){
+ j = 5;
+ }
+ }
+ if(j < t.length){
+ font.family = t.slice(j).join(" ");
+ }
+ }while(false);
+ return font; // Object
+ },
+ // length operations
+ cm_in_pt: 72 / 2.54, // Number: points per centimeter
+ mm_in_pt: 7.2 / 2.54, // Number: points per millimeter
+ px_in_pt: function(){
+ // summary: returns a number of pixels per point
+ return dojox.gfx._base._getCachedFontMeasurements()["12pt"] / 12; // Number
+ },
+ pt2px: function(len){
+ // summary: converts points to pixels
+ // len: Number: a value in points
+ return len * dojox.gfx.px_in_pt(); // Number
+ },
+ px2pt: function(len){
+ // summary: converts pixels to points
+ // len: Number: a value in pixels
+ return len / dojox.gfx.px_in_pt(); // Number
+ },
+ normalizedLength: function(len) {
+ // summary: converts any length value to pixels
+ // len: String: a length, e.g., "12pc"
+ if(len.length == 0) return 0;
+ if(len.length > 2){
+ var px_in_pt = dojox.gfx.px_in_pt();
+ var val = parseFloat(len);
+ switch(len.slice(-2)){
+ case "px": return val;
+ case "pt": return val * px_in_pt;
+ case "in": return val * 72 * px_in_pt;
+ case "pc": return val * 12 * px_in_pt;
+ case "mm": return val * dojox.gfx.mm_in_pt * px_in_pt;
+ case "cm": return val * dojox.gfx.cm_in_pt * px_in_pt;
+ }
+ }
+ return parseFloat(len); // Number
+ },
+
+ // a constant used to split a SVG/VML path into primitive components
+ pathVmlRegExp: /([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,
+ pathSvgRegExp: /([A-Za-z])|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g,
+
+ equalSources: function(a, b){
+ // summary: compares event sources, returns true if they are equal
+ return a && b && a == b;
+ },
+
+ switchTo: function(renderer){
+ var ns = dojox.gfx[renderer];
+ if(ns){
+ dojo.forEach(["Group", "Rect", "Ellipse", "Circle", "Line",
+ "Polyline", "Image", "Text", "Path", "TextPath",
+ "Surface", "createSurface"], function(name){
+ dojox.gfx[name] = ns[name];
+ });
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.gfx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.gfx"] = true;
+dojo.provide("dojox.gfx");
+
+
+
+
+;
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.lambda"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.lambda"] = true;
+dojo.provide("dojox.lang.functional.lambda");
+
+// This module adds high-level functions and related constructs:
+// - anonymous functions built from the string
+
+// Acknoledgements:
+// - lambda() is based on work by Oliver Steele
+// (http://osteele.com/sources/javascript/functional/functional.js)
+// which was published under MIT License
+
+// Notes:
+// - lambda() produces functions, which after the compilation step are
+// as fast as regular JS functions (at least theoretically).
+
+// Lambda input values:
+// - returns functions unchanged
+// - converts strings to functions
+// - converts arrays to a functional composition
+
+(function(){
+ var df = dojox.lang.functional, lcache = {};
+
+ // split() is augmented on IE6 to ensure the uniform behavior
+ var split = "ab".split(/a*/).length > 1 ? String.prototype.split :
+ function(sep){
+ var r = this.split.call(this, sep),
+ m = sep.exec(this);
+ if(m && m.index == 0){ r.unshift(""); }
+ return r;
+ };
+
+ var lambda = function(/*String*/ s){
+ var args = [], sects = split.call(s, /\s*->\s*/m);
+ if(sects.length > 1){
+ while(sects.length){
+ s = sects.pop();
+ args = sects.pop().split(/\s*,\s*|\s+/m);
+ if(sects.length){ sects.push("(function(" + args + "){return (" + s + ")})"); }
+ }
+ }else if(s.match(/\b_\b/)){
+ args = ["_"];
+ }else{
+ var l = s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/m),
+ r = s.match(/[+\-*\/%&|\^\.=<>!]\s*$/m);
+ if(l || r){
+ if(l){
+ args.push("$1");
+ s = "$1" + s;
+ }
+ if(r){
+ args.push("$2");
+ s = s + "$2";
+ }
+ }else{
+ // the point of the long regex below is to exclude all well-known
+ // lower-case words from the list of potential arguments
+ var vars = s.
+ replace(/(?:\b[A-Z]|\.[a-zA-Z_$])[a-zA-Z_$\d]*|[a-zA-Z_$][a-zA-Z_$\d]*:|this|true|false|null|undefined|typeof|instanceof|in|delete|new|void|arguments|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|dojo|dijit|dojox|window|document|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g, "").
+ match(/([a-z_$][a-z_$\d]*)/gi) || [], t = {};
+ dojo.forEach(vars, function(v){
+ if(!(v in t)){
+ args.push(v);
+ t[v] = 1;
+ }
+ });
+ }
+ }
+ return {args: args, body: s}; // Object
+ };
+
+ var compose = function(/*Array*/ a){
+ return a.length ?
+ function(){
+ var i = a.length - 1, x = df.lambda(a[i]).apply(this, arguments);
+ for(--i; i >= 0; --i){ x = df.lambda(a[i]).call(this, x); }
+ return x;
+ }
+ :
+ // identity
+ function(x){ return x; };
+ };
+
+ dojo.mixin(df, {
+ // lambda
+ rawLambda: function(/*String*/ s){
+ // summary:
+ // builds a function from a snippet, or array (composing),
+ // returns an object describing the function; functions are
+ // passed through unmodified.
+ // description:
+ // This method is to normalize a functional representation (a
+ // text snippet) to an object that contains an array of
+ // arguments, and a body , which is used to calculate the
+ // returning value.
+ return lambda(s); // Object
+ },
+ buildLambda: function(/*String*/ s){
+ // summary:
+ // builds a function from a snippet, returns a string, which
+ // represents the function.
+ // description:
+ // This method returns a textual representation of a function
+ // built from the snippet. It is meant to be evaled in the
+ // proper context, so local variables can be pulled from the
+ // environment.
+ s = lambda(s);
+ return "function(" + s.args.join(",") + "){return (" + s.body + ");}"; // String
+ },
+ lambda: function(/*Function|String|Array*/ s){
+ // summary:
+ // builds a function from a snippet, or array (composing),
+ // returns a function object; functions are passed through
+ // unmodified.
+ // description:
+ // This method is used to normalize a functional
+ // representation (a text snippet, an array, or a function) to
+ // a function object.
+ if(typeof s == "function"){ return s; }
+ if(s instanceof Array){ return compose(s); }
+ if(s in lcache){ return lcache[s]; }
+ s = lambda(s);
+ return lcache[s] = new Function(s.args, "return (" + s.body + ");"); // Function
+ },
+ clearLambdaCache: function(){
+ // summary:
+ // clears internal cache of lambdas
+ lcache = {};
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.array"] = true;
+dojo.provide("dojox.lang.functional.array");
+
+
+
+// This module adds high-level functions and related constructs:
+// - array-processing functions similar to standard JS functions
+
+// Notes:
+// - this module provides JS standard methods similar to high-level functions in dojo/_base/array.js:
+// forEach, map, filter, every, some
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+// - operate on dense arrays
+// - take a string as the array argument
+// - take an iterator objects as the array argument
+
+(function(){
+ var d = dojo, df = dojox.lang.functional, empty = {};
+
+ d.mixin(df, {
+ // JS 1.6 standard array functions, which can take a lambda as a parameter.
+ // Consider using dojo._base.array functions, if you don't need the lambda support.
+ filter: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates a new array with all elements that pass the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var t = [], v, i, n;
+ if(d.isArray(a)){
+ // array
+ for(i = 0, n = a.length; i < n; ++i){
+ v = a[i];
+ if(f.call(o, v, i, a)){ t.push(v); }
+ }
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ for(i = 0; a.hasNext();){
+ v = a.next();
+ if(f.call(o, v, i++, a)){ t.push(v); }
+ }
+ }else{
+ // object/dictionary
+ for(i in a){
+ if(!(i in empty)){
+ v = a[i];
+ if(f.call(o, v, i, a)){ t.push(v); }
+ }
+ }
+ }
+ return t; // Array
+ },
+ forEach: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: executes a provided function once per array element.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var i, n;
+ if(d.isArray(a)){
+ // array
+ for(i = 0, n = a.length; i < n; f.call(o, a[i], i, a), ++i);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ for(i = 0; a.hasNext(); f.call(o, a.next(), i++, a));
+ }else{
+ // object/dictionary
+ for(i in a){
+ if(!(i in empty)){
+ f.call(o, a[i], i, a);
+ }
+ }
+ }
+ return o; // Object
+ },
+ map: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates a new array with the results of calling
+ // a provided function on every element in this array.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var t, n, i;
+ if(d.isArray(a)){
+ // array
+ t = new Array(n = a.length);
+ for(i = 0; i < n; t[i] = f.call(o, a[i], i, a), ++i);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ t = [];
+ for(i = 0; a.hasNext(); t.push(f.call(o, a.next(), i++, a)));
+ }else{
+ // object/dictionary
+ t = [];
+ for(i in a){
+ if(!(i in empty)){
+ t.push(f.call(o, a[i], i, a));
+ }
+ }
+ }
+ return t; // Array
+ },
+ every: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: tests whether all elements in the array pass the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var i, n;
+ if(d.isArray(a)){
+ // array
+ for(i = 0, n = a.length; i < n; ++i){
+ if(!f.call(o, a[i], i, a)){
+ return false; // Boolean
+ }
+ }
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ for(i = 0; a.hasNext();){
+ if(!f.call(o, a.next(), i++, a)){
+ return false; // Boolean
+ }
+ }
+ }else{
+ // object/dictionary
+ for(i in a){
+ if(!(i in empty)){
+ if(!f.call(o, a[i], i, a)){
+ return false; // Boolean
+ }
+ }
+ }
+ }
+ return true; // Boolean
+ },
+ some: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: tests whether some element in the array passes the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var i, n;
+ if(d.isArray(a)){
+ // array
+ for(i = 0, n = a.length; i < n; ++i){
+ if(f.call(o, a[i], i, a)){
+ return true; // Boolean
+ }
+ }
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ for(i = 0; a.hasNext();){
+ if(f.call(o, a.next(), i++, a)){
+ return true; // Boolean
+ }
+ }
+ }else{
+ // object/dictionary
+ for(i in a){
+ if(!(i in empty)){
+ if(f.call(o, a[i], i, a)){
+ return true; // Boolean
+ }
+ }
+ }
+ }
+ return false; // Boolean
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.object"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.object"] = true;
+dojo.provide("dojox.lang.functional.object");
+
+
+
+// This module adds high-level functions and related constructs:
+// - object/dictionary helpers
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+// - skip all attributes that are present in the empty object
+// (IE and/or 3rd-party libraries).
+
+(function(){
+ var d = dojo, df = dojox.lang.functional, empty = {};
+
+ d.mixin(df, {
+ // object helpers
+ keys: function(/*Object*/ obj){
+ // summary: returns an array of all keys in the object
+ var t = [];
+ for(var i in obj){
+ if(!(i in empty)){
+ t.push(i);
+ }
+ }
+ return t; // Array
+ },
+ values: function(/*Object*/ obj){
+ // summary: returns an array of all values in the object
+ var t = [];
+ for(var i in obj){
+ if(!(i in empty)){
+ t.push(obj[i]);
+ }
+ }
+ return t; // Array
+ },
+ filterIn: function(/*Object*/ obj, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates new object with all attributes that pass the test
+ // implemented by the provided function.
+ o = o || d.global; f = df.lambda(f);
+ var t = {}, v, i;
+ for(i in obj){
+ if(!(i in empty)){
+ v = obj[i];
+ if(f.call(o, v, i, obj)){ t[i] = v; }
+ }
+ }
+ return t; // Object
+ },
+ forIn: function(/*Object*/ obj, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: iterates over all object attributes.
+ o = o || d.global; f = df.lambda(f);
+ for(var i in obj){
+ if(!(i in empty)){
+ f.call(o, obj[i], i, obj);
+ }
+ }
+ return o; // Object
+ },
+ mapIn: function(/*Object*/ obj, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates new object with the results of calling
+ // a provided function on every attribute in this object.
+ o = o || d.global; f = df.lambda(f);
+ var t = {}, i;
+ for(i in obj){
+ if(!(i in empty)){
+ t[i] = f.call(o, obj[i], i, obj);
+ }
+ }
+ return t; // Object
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional"] = true;
+dojo.provide("dojox.lang.functional");
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.fold"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.fold"] = true;
+dojo.provide("dojox.lang.functional.fold");
+
+
+
+// This module adds high-level functions and related constructs:
+// - "fold" family of functions
+
+// Notes:
+// - missing high-level functions are provided with the compatible API:
+// foldl, foldl1, foldr, foldr1
+// - missing JS standard functions are provided with the compatible API:
+// reduce, reduceRight
+// - the fold's counterpart: unfold
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+// - operate on dense arrays
+// - take a string as the array argument
+// - take an iterator objects as the array argument (only foldl, foldl1, and reduce)
+
+(function(){
+ var d = dojo, df = dojox.lang.functional, empty = {};
+
+ d.mixin(df, {
+ // classic reduce-class functions
+ foldl: function(/*Array|String|Object*/ a, /*Function*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right using a seed value as a starting point; returns the final
+ // value.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var i, n;
+ if(d.isArray(a)){
+ // array
+ for(i = 0, n = a.length; i < n; z = f.call(o, z, a[i], i, a), ++i);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ for(i = 0; a.hasNext(); z = f.call(o, z, a.next(), i++, a));
+ }else{
+ // object/dictionary
+ for(i in a){
+ if(!(i in empty)){
+ z = f.call(o, z, a[i], i, a);
+ }
+ }
+ }
+ return z; // Object
+ },
+ foldl1: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns the final value.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var z, i, n;
+ if(d.isArray(a)){
+ // array
+ z = a[0];
+ for(i = 1, n = a.length; i < n; z = f.call(o, z, a[i], i, a), ++i);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ if(a.hasNext()){
+ z = a.next();
+ for(i = 1; a.hasNext(); z = f.call(o, z, a.next(), i++, a));
+ }
+ }else{
+ // object/dictionary
+ var first = true;
+ for(i in a){
+ if(!(i in empty)){
+ if(first){
+ z = a[i];
+ first = false;
+ }else{
+ z = f.call(o, z, a[i], i, a);
+ }
+ }
+ }
+ }
+ return z; // Object
+ },
+ foldr: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from right
+ // to left using a seed value as a starting point; returns the final
+ // value.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ for(var i = a.length; i > 0; --i, z = f.call(o, z, a[i], i, a));
+ return z; // Object
+ },
+ foldr1: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from right
+ // to left; returns the final value.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var n = a.length, z = a[n - 1], i = n - 1;
+ for(; i > 0; --i, z = f.call(o, z, a[i], i, a));
+ return z; // Object
+ },
+ // JS 1.8 standard array functions, which can take a lambda as a parameter.
+ reduce: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ z){
+ // summary: apply a function simultaneously against two values of the array
+ // (from left-to-right) as to reduce it to a single value.
+ return arguments.length < 3 ? df.foldl1(a, f) : df.foldl(a, f, z); // Object
+ },
+ reduceRight: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ z){
+ // summary: apply a function simultaneously against two values of the array
+ // (from right-to-left) as to reduce it to a single value.
+ return arguments.length < 3 ? df.foldr1(a, f) : df.foldr(a, f, z); // Object
+ },
+ // the fold's counterpart: unfold
+ unfold: function(/*Function|String|Array*/ pr, /*Function|String|Array*/ f,
+ /*Function|String|Array*/ g, /*Object*/ z, /*Object?*/ o){
+ // summary: builds an array by unfolding a value
+ o = o || d.global; f = df.lambda(f); g = df.lambda(g); pr = df.lambda(pr);
+ var t = [];
+ for(; !pr.call(o, z); t.push(f.call(o, z)), z = g.call(o, z));
+ return t; // Array
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.reversed"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.reversed"] = true;
+dojo.provide("dojox.lang.functional.reversed");
+
+
+
+// This module adds high-level functions and related constructs:
+// - reversed versions of array-processing functions similar to standard JS functions
+
+// Notes:
+// - this module provides reversed versions of standard array-processing functions:
+// forEachRev, mapRev, filterRev
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+// - operate on dense arrays
+// - take a string as the array argument
+
+(function(){
+ var d = dojo, df = dojox.lang.functional;
+
+ d.mixin(df, {
+ // JS 1.6 standard array functions, which can take a lambda as a parameter.
+ // Consider using dojo._base.array functions, if you don't need the lambda support.
+ filterRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates a new array with all elements that pass the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var t = [], v, i = a.length - 1;
+ for(; i >= 0; --i){
+ v = a[i];
+ if(f.call(o, v, i, a)){ t.push(v); }
+ }
+ return t; // Array
+ },
+ forEachRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: executes a provided function once per array element.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ for(var i = a.length - 1; i >= 0; f.call(o, a[i], i, a), --i);
+ },
+ mapRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: creates a new array with the results of calling
+ // a provided function on every element in this array.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var n = a.length, t = new Array(n), i = n - 1, j = 0;
+ for(; i >= 0; t[j++] = f.call(o, a[i], i, a), --i);
+ return t; // Array
+ },
+ everyRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: tests whether all elements in the array pass the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ for(var i = a.length - 1; i >= 0; --i){
+ if(!f.call(o, a[i], i, a)){
+ return false; // Boolean
+ }
+ }
+ return true; // Boolean
+ },
+ someRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: tests whether some element in the array passes the test
+ // implemented by the provided function.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ for(var i = a.length - 1; i >= 0; --i){
+ if(f.call(o, a[i], i, a)){
+ return true; // Boolean
+ }
+ }
+ return false; // Boolean
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.Element"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.Element"] = true;
+dojo.provide("dojox.charting.Element");
+
+
+
+dojo.declare("dojox.charting.Element", null, {
+ // summary:
+ // A base class that is used to build other elements of a chart, such as
+ // a series.
+ // chart: dojox.charting.Chart2D
+ // The parent chart for this element.
+ // group: dojox.gfx.Group
+ // The visual GFX group representing this element.
+ // htmlElement: Array
+ // Any DOMNodes used as a part of this element (such as HTML-based labels).
+ // dirty: Boolean
+ // A flag indicating whether or not this element needs to be rendered.
+
+ chart: null,
+ group: null,
+ htmlElements: null,
+ dirty: true,
+
+ constructor: function(chart){
+ // summary:
+ // Creates a new charting element.
+ // chart: dojox.charting.Chart2D
+ // The chart that this element belongs to.
+ this.chart = chart;
+ this.group = null;
+ this.htmlElements = [];
+ this.dirty = true;
+ this.trailingSymbol = "...";
+ this._events = [];
+ },
+ createGroup: function(creator){
+ // summary:
+ // Convenience function to create a new dojox.gfx.Group.
+ // creator: dojox.gfx.Surface?
+ // An optional surface in which to create this group.
+ // returns: dojox.charting.Element
+ // A reference to this object for functional chaining.
+ if(!creator){ creator = this.chart.surface; }
+ if(!this.group){
+ this.group = creator.createGroup();
+ }
+ return this; // dojox.charting.Element
+ },
+ purgeGroup: function(){
+ // summary:
+ // Clear any elements out of our group, and destroy the group.
+ // returns: dojox.charting.Element
+ // A reference to this object for functional chaining.
+ this.destroyHtmlElements();
+ if(this.group){
+ this.group.clear();
+ this.group.removeShape();
+ this.group = null;
+ }
+ this.dirty = true;
+ if(this._events.length){
+ dojo.forEach(this._events, function(item){
+ item.shape.disconnect(item.handle);
+ });
+ this._events = [];
+ }
+ return this; // dojox.charting.Element
+ },
+ cleanGroup: function(creator){
+ // summary:
+ // Clean any elements (HTML or GFX-based) out of our group, and create a new one.
+ // creator: dojox.gfx.Surface?
+ // An optional surface to work with.
+ // returns: dojox.charting.Element
+ // A reference to this object for functional chaining.
+ this.destroyHtmlElements();
+ if(!creator){ creator = this.chart.surface; }
+ if(this.group){
+ this.group.clear();
+ }else{
+ this.group = creator.createGroup();
+ }
+ this.dirty = true;
+ return this; // dojox.charting.Element
+ },
+ destroyHtmlElements: function(){
+ // summary:
+ // Destroy any DOMNodes that may have been created as a part of this element.
+ if(this.htmlElements.length){
+ dojo.forEach(this.htmlElements, dojo.destroy);
+ this.htmlElements = [];
+ }
+ },
+ destroy: function(){
+ // summary:
+ // API addition to conform to the rest of the Dojo Toolkit's standard.
+ this.purgeGroup();
+ },
+ //text utilities
+ getTextWidth: function(s, font){
+ return dojox.gfx._base._getTextBox(s, {font: font}).w || 0;
+ },
+ getTextWithLimitLength: function(s, font, limitWidth, truncated){
+ // summary:
+ // Get the truncated string based on the limited width in px(dichotomy algorithm)
+ // s: String?
+ // candidate text.
+ // font: String?
+ // text's font style.
+ // limitWidth: Number?
+ // text limited width in px.
+ // truncated: Boolean?
+ // whether the input text(s) has already been truncated.
+ // returns: Object
+ // {
+ // text: processed text, maybe truncated or not
+ // truncated: whether text has been truncated
+ // }
+ if (!s || s.length <= 0) {
+ return {
+ text: "",
+ truncated: truncated || false
+ };
+ }
+ if(!limitWidth || limitWidth <= 0){
+ return {
+ text: s,
+ truncated: truncated || false
+ };
+ }
+ var delta = 2,
+ //golden section for dichotomy algorithm
+ trucPercentage = 0.618,
+ minStr = s.substring(0,1) + this.trailingSymbol,
+ minWidth = this.getTextWidth(minStr, font);
+ if (limitWidth <= minWidth) {
+ return {
+ text: minStr,
+ truncated: true
+ };
+ }
+ var width = this.getTextWidth(s, font);
+ if(width <= limitWidth){
+ return {
+ text: s,
+ truncated: truncated || false
+ };
+ }else{
+ var begin = 0,
+ end = s.length;
+ while(begin < end){
+ if(end - begin <= delta ){
+ while (this.getTextWidth(s.substring(0, begin) + this.trailingSymbol, font) > limitWidth) {
+ begin -= 1;
+ }
+ return {
+ text: (s.substring(0,begin) + this.trailingSymbol),
+ truncated: true
+ };
+ }
+ var index = begin + Math.round((end - begin) * trucPercentage),
+ widthIntercepted = this.getTextWidth(s.substring(0, index), font);
+ if(widthIntercepted < limitWidth){
+ begin = index;
+ end = end;
+ }else{
+ begin = begin;
+ end = index;
+ }
+ }
+ }
+ },
+ getTextWithLimitCharCount: function(s, font, wcLimit, truncated){
+ // summary:
+ // Get the truncated string based on the limited character count(dichotomy algorithm)
+ // s: String?
+ // candidate text.
+ // font: String?
+ // text's font style.
+ // wcLimit: Number?
+ // text limited character count.
+ // truncated: Boolean?
+ // whether the input text(s) has already been truncated.
+ // returns: Object
+ // {
+ // text: processed text, maybe truncated or not
+ // truncated: whether text has been truncated
+ // }
+ if (!s || s.length <= 0) {
+ return {
+ text: "",
+ truncated: truncated || false
+ };
+ }
+ if(!wcLimit || wcLimit <= 0 || s.length <= wcLimit){
+ return {
+ text: s,
+ truncated: truncated || false
+ };
+ }
+ return {
+ text: s.substring(0, wcLimit) + this.trailingSymbol,
+ truncated: true
+ };
+ },
+ // fill utilities
+ _plotFill: function(fill, dim, offsets){
+ // process a plot-wide fill
+ if(!fill || !fill.type || !fill.space){
+ return fill;
+ }
+ var space = fill.space;
+ switch(fill.type){
+ case "linear":
+ if(space === "plot" || space === "shapeX" || space === "shapeY"){
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill);
+ fill.space = space;
+ // process dimensions
+ if(space === "plot" || space === "shapeX"){
+ // process Y
+ var span = dim.height - offsets.t - offsets.b;
+ fill.y1 = offsets.t + span * fill.y1 / 100;
+ fill.y2 = offsets.t + span * fill.y2 / 100;
+ }
+ if(space === "plot" || space === "shapeY"){
+ // process X
+ var span = dim.width - offsets.l - offsets.r;
+ fill.x1 = offsets.l + span * fill.x1 / 100;
+ fill.x2 = offsets.l + span * fill.x2 / 100;
+ }
+ }
+ break;
+ case "radial":
+ if(space === "plot"){
+ // this one is used exclusively for scatter charts
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill);
+ fill.space = space;
+ // process both dimensions
+ var spanX = dim.width - offsets.l - offsets.r,
+ spanY = dim.height - offsets.t - offsets.b;
+ fill.cx = offsets.l + spanX * fill.cx / 100;
+ fill.cy = offsets.t + spanY * fill.cy / 100;
+ fill.r = fill.r * Math.sqrt(spanX * spanX + spanY * spanY) / 200;
+ }
+ break;
+ case "pattern":
+ if(space === "plot" || space === "shapeX" || space === "shapeY"){
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill);
+ fill.space = space;
+ // process dimensions
+ if(space === "plot" || space === "shapeX"){
+ // process Y
+ var span = dim.height - offsets.t - offsets.b;
+ fill.y = offsets.t + span * fill.y / 100;
+ fill.height = span * fill.height / 100;
+ }
+ if(space === "plot" || space === "shapeY"){
+ // process X
+ var span = dim.width - offsets.l - offsets.r;
+ fill.x = offsets.l + span * fill.x / 100;
+ fill.width = span * fill.width / 100;
+ }
+ }
+ break;
+ }
+ return fill;
+ },
+ _shapeFill: function(fill, bbox){
+ // process shape-specific fill
+ if(!fill || !fill.space){
+ return fill;
+ }
+ var space = fill.space;
+ switch(fill.type){
+ case "linear":
+ if(space === "shape" || space === "shapeX" || space === "shapeY"){
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill);
+ fill.space = space;
+ // process dimensions
+ if(space === "shape" || space === "shapeX"){
+ // process X
+ var span = bbox.width;
+ fill.x1 = bbox.x + span * fill.x1 / 100;
+ fill.x2 = bbox.x + span * fill.x2 / 100;
+ }
+ if(space === "shape" || space === "shapeY"){
+ // process Y
+ var span = bbox.height;
+ fill.y1 = bbox.y + span * fill.y1 / 100;
+ fill.y2 = bbox.y + span * fill.y2 / 100;
+ }
+ }
+ break;
+ case "radial":
+ if(space === "shape"){
+ // this one is used exclusively for bubble charts and pie charts
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill);
+ fill.space = space;
+ // process both dimensions
+ fill.cx = bbox.x + bbox.width / 2;
+ fill.cy = bbox.y + bbox.height / 2;
+ fill.r = fill.r * bbox.width / 200;
+ }
+ break;
+ case "pattern":
+ if(space === "shape" || space === "shapeX" || space === "shapeY"){
+ // clone a fill so we can modify properly directly
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill);
+ fill.space = space;
+ // process dimensions
+ if(space === "shape" || space === "shapeX"){
+ // process X
+ var span = bbox.width;
+ fill.x = bbox.x + span * fill.x / 100;
+ fill.width = span * fill.width / 100;
+ }
+ if(space === "shape" || space === "shapeY"){
+ // process Y
+ var span = bbox.height;
+ fill.y = bbox.y + span * fill.y / 100;
+ fill.height = span * fill.height / 100;
+ }
+ }
+ break;
+ }
+ return fill;
+ },
+ _pseudoRadialFill: function(fill, center, radius, start, end){
+ // process pseudo-radial fills
+ if(!fill || fill.type !== "radial" || fill.space !== "shape"){
+ return fill;
+ }
+ // clone and normalize fill
+ var space = fill.space;
+ fill = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill);
+ fill.space = space;
+ if(arguments.length < 4){
+ // process both dimensions
+ fill.cx = center.x;
+ fill.cy = center.y;
+ fill.r = fill.r * radius / 100;
+ return fill;
+ }
+ // convert to a linear gradient
+ var angle = arguments.length < 5 ? start : (end + start) / 2;
+ return {
+ type: "linear",
+ x1: center.x,
+ y1: center.y,
+ x2: center.x + fill.r * radius * Math.cos(angle) / 100,
+ y2: center.y + fill.r * radius * Math.sin(angle) / 100,
+ colors: fill.colors
+ };
+ return fill;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.colors"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.colors"] = true;
+dojo.provide("dojo.colors");
+
+
+dojo.getObject("colors", true, dojo);
+
+//TODO: this module appears to break naming conventions
+
+/*=====
+dojo.colors = {
+ // summary: Color utilities
+}
+=====*/
+
+(function(){
+ // this is a standard conversion prescribed by the CSS3 Color Module
+ var hue2rgb = function(m1, m2, h){
+ if(h < 0){ ++h; }
+ if(h > 1){ --h; }
+ var h6 = 6 * h;
+ if(h6 < 1){ return m1 + (m2 - m1) * h6; }
+ if(2 * h < 1){ return m2; }
+ if(3 * h < 2){ return m1 + (m2 - m1) * (2 / 3 - h) * 6; }
+ return m1;
+ };
+
+ dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
+ // summary:
+ // get rgb(a) array from css-style color declarations
+ // description:
+ // this function can handle all 4 CSS3 Color Module formats: rgb,
+ // rgba, hsl, hsla, including rgb(a) with percentage values.
+ var m = color.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);
+ if(m){
+ var c = m[2].split(/\s*,\s*/), l = c.length, t = m[1], a;
+ if((t == "rgb" && l == 3) || (t == "rgba" && l == 4)){
+ var r = c[0];
+ if(r.charAt(r.length - 1) == "%"){
+ // 3 rgb percentage values
+ a = dojo.map(c, function(x){
+ return parseFloat(x) * 2.56;
+ });
+ if(l == 4){ a[3] = c[3]; }
+ return dojo.colorFromArray(a, obj); // dojo.Color
+ }
+ return dojo.colorFromArray(c, obj); // dojo.Color
+ }
+ if((t == "hsl" && l == 3) || (t == "hsla" && l == 4)){
+ // normalize hsl values
+ var H = ((parseFloat(c[0]) % 360) + 360) % 360 / 360,
+ S = parseFloat(c[1]) / 100,
+ L = parseFloat(c[2]) / 100,
+ // calculate rgb according to the algorithm
+ // recommended by the CSS3 Color Module
+ m2 = L <= 0.5 ? L * (S + 1) : L + S - L * S,
+ m1 = 2 * L - m2;
+ a = [
+ hue2rgb(m1, m2, H + 1 / 3) * 256,
+ hue2rgb(m1, m2, H) * 256,
+ hue2rgb(m1, m2, H - 1 / 3) * 256,
+ 1
+ ];
+ if(l == 4){ a[3] = c[3]; }
+ return dojo.colorFromArray(a, obj); // dojo.Color
+ }
+ }
+ return null; // dojo.Color
+ };
+
+ var confine = function(c, low, high){
+ // summary:
+ // sanitize a color component by making sure it is a number,
+ // and clamping it to valid values
+ c = Number(c);
+ return isNaN(c) ? high : c < low ? low : c > high ? high : c; // Number
+ };
+
+ dojo.Color.prototype.sanitize = function(){
+ // summary: makes sure that the object has correct attributes
+ var t = this;
+ t.r = Math.round(confine(t.r, 0, 255));
+ t.g = Math.round(confine(t.g, 0, 255));
+ t.b = Math.round(confine(t.b, 0, 255));
+ t.a = confine(t.a, 0, 1);
+ return this; // dojo.Color
+ };
+})();
+
+
+dojo.colors.makeGrey = function(/*Number*/ g, /*Number?*/ a){
+ // summary: creates a greyscale color with an optional alpha
+ return dojo.colorFromArray([g, g, g, a]);
+};
+
+// mixin all CSS3 named colors not already in _base, along with SVG 1.0 variant spellings
+dojo.mixin(dojo.Color.named, {
+ aliceblue: [240,248,255],
+ antiquewhite: [250,235,215],
+ aquamarine: [127,255,212],
+ azure: [240,255,255],
+ beige: [245,245,220],
+ bisque: [255,228,196],
+ blanchedalmond: [255,235,205],
+ blueviolet: [138,43,226],
+ brown: [165,42,42],
+ burlywood: [222,184,135],
+ cadetblue: [95,158,160],
+ chartreuse: [127,255,0],
+ chocolate: [210,105,30],
+ coral: [255,127,80],
+ cornflowerblue: [100,149,237],
+ cornsilk: [255,248,220],
+ crimson: [220,20,60],
+ cyan: [0,255,255],
+ darkblue: [0,0,139],
+ darkcyan: [0,139,139],
+ darkgoldenrod: [184,134,11],
+ darkgray: [169,169,169],
+ darkgreen: [0,100,0],
+ darkgrey: [169,169,169],
+ darkkhaki: [189,183,107],
+ darkmagenta: [139,0,139],
+ darkolivegreen: [85,107,47],
+ darkorange: [255,140,0],
+ darkorchid: [153,50,204],
+ darkred: [139,0,0],
+ darksalmon: [233,150,122],
+ darkseagreen: [143,188,143],
+ darkslateblue: [72,61,139],
+ darkslategray: [47,79,79],
+ darkslategrey: [47,79,79],
+ darkturquoise: [0,206,209],
+ darkviolet: [148,0,211],
+ deeppink: [255,20,147],
+ deepskyblue: [0,191,255],
+ dimgray: [105,105,105],
+ dimgrey: [105,105,105],
+ dodgerblue: [30,144,255],
+ firebrick: [178,34,34],
+ floralwhite: [255,250,240],
+ forestgreen: [34,139,34],
+ gainsboro: [220,220,220],
+ ghostwhite: [248,248,255],
+ gold: [255,215,0],
+ goldenrod: [218,165,32],
+ greenyellow: [173,255,47],
+ grey: [128,128,128],
+ honeydew: [240,255,240],
+ hotpink: [255,105,180],
+ indianred: [205,92,92],
+ indigo: [75,0,130],
+ ivory: [255,255,240],
+ khaki: [240,230,140],
+ lavender: [230,230,250],
+ lavenderblush: [255,240,245],
+ lawngreen: [124,252,0],
+ lemonchiffon: [255,250,205],
+ lightblue: [173,216,230],
+ lightcoral: [240,128,128],
+ lightcyan: [224,255,255],
+ lightgoldenrodyellow: [250,250,210],
+ lightgray: [211,211,211],
+ lightgreen: [144,238,144],
+ lightgrey: [211,211,211],
+ lightpink: [255,182,193],
+ lightsalmon: [255,160,122],
+ lightseagreen: [32,178,170],
+ lightskyblue: [135,206,250],
+ lightslategray: [119,136,153],
+ lightslategrey: [119,136,153],
+ lightsteelblue: [176,196,222],
+ lightyellow: [255,255,224],
+ limegreen: [50,205,50],
+ linen: [250,240,230],
+ magenta: [255,0,255],
+ mediumaquamarine: [102,205,170],
+ mediumblue: [0,0,205],
+ mediumorchid: [186,85,211],
+ mediumpurple: [147,112,219],
+ mediumseagreen: [60,179,113],
+ mediumslateblue: [123,104,238],
+ mediumspringgreen: [0,250,154],
+ mediumturquoise: [72,209,204],
+ mediumvioletred: [199,21,133],
+ midnightblue: [25,25,112],
+ mintcream: [245,255,250],
+ mistyrose: [255,228,225],
+ moccasin: [255,228,181],
+ navajowhite: [255,222,173],
+ oldlace: [253,245,230],
+ olivedrab: [107,142,35],
+ orange: [255,165,0],
+ orangered: [255,69,0],
+ orchid: [218,112,214],
+ palegoldenrod: [238,232,170],
+ palegreen: [152,251,152],
+ paleturquoise: [175,238,238],
+ palevioletred: [219,112,147],
+ papayawhip: [255,239,213],
+ peachpuff: [255,218,185],
+ peru: [205,133,63],
+ pink: [255,192,203],
+ plum: [221,160,221],
+ powderblue: [176,224,230],
+ rosybrown: [188,143,143],
+ royalblue: [65,105,225],
+ saddlebrown: [139,69,19],
+ salmon: [250,128,114],
+ sandybrown: [244,164,96],
+ seagreen: [46,139,87],
+ seashell: [255,245,238],
+ sienna: [160,82,45],
+ skyblue: [135,206,235],
+ slateblue: [106,90,205],
+ slategray: [112,128,144],
+ slategrey: [112,128,144],
+ snow: [255,250,250],
+ springgreen: [0,255,127],
+ steelblue: [70,130,180],
+ tan: [210,180,140],
+ thistle: [216,191,216],
+ tomato: [255,99,71],
+ transparent: [0, 0, 0, 0],
+ turquoise: [64,224,208],
+ violet: [238,130,238],
+ wheat: [245,222,179],
+ whitesmoke: [245,245,245],
+ yellowgreen: [154,205,50]
+});
+
+}
+
+if(!dojo._hasResource["dojox.color._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.color._base"] = true;
+dojo.provide("dojox.color._base");
+
+
+// alias all the dojo.Color mechanisms
+dojox.color.Color=dojo.Color;
+dojox.color.blend=dojo.blendColors;
+dojox.color.fromRgb=dojo.colorFromRgb;
+dojox.color.fromHex=dojo.colorFromHex;
+dojox.color.fromArray=dojo.colorFromArray;
+dojox.color.fromString=dojo.colorFromString;
+
+// alias the dojo.colors mechanisms
+dojox.color.greyscale=dojo.colors.makeGrey;
+
+// static methods
+dojo.mixin(dojox.color, {
+ fromCmy: function(/* Object|Array|int */cyan, /*int*/magenta, /*int*/yellow){
+ // summary
+ // Create a dojox.color.Color from a CMY defined color.
+ // All colors should be expressed as 0-100 (percentage)
+
+ if(dojo.isArray(cyan)){
+ magenta=cyan[1], yellow=cyan[2], cyan=cyan[0];
+ } else if(dojo.isObject(cyan)){
+ magenta=cyan.m, yellow=cyan.y, cyan=cyan.c;
+ }
+ cyan/=100, magenta/=100, yellow/=100;
+
+ var r=1-cyan, g=1-magenta, b=1-yellow;
+ return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) }); // dojox.color.Color
+ },
+
+ fromCmyk: function(/* Object|Array|int */cyan, /*int*/magenta, /*int*/yellow, /*int*/black){
+ // summary
+ // Create a dojox.color.Color from a CMYK defined color.
+ // All colors should be expressed as 0-100 (percentage)
+
+ if(dojo.isArray(cyan)){
+ magenta=cyan[1], yellow=cyan[2], black=cyan[3], cyan=cyan[0];
+ } else if(dojo.isObject(cyan)){
+ magenta=cyan.m, yellow=cyan.y, black=cyan.b, cyan=cyan.c;
+ }
+ cyan/=100, magenta/=100, yellow/=100, black/=100;
+ var r,g,b;
+ r = 1-Math.min(1, cyan*(1-black)+black);
+ g = 1-Math.min(1, magenta*(1-black)+black);
+ b = 1-Math.min(1, yellow*(1-black)+black);
+ return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) }); // dojox.color.Color
+ },
+
+ fromHsl: function(/* Object|Array|int */hue, /* int */saturation, /* int */luminosity){
+ // summary
+ // Create a dojox.color.Color from an HSL defined color.
+ // hue from 0-359 (degrees), saturation and luminosity 0-100.
+
+ if(dojo.isArray(hue)){
+ saturation=hue[1], luminosity=hue[2], hue=hue[0];
+ } else if(dojo.isObject(hue)){
+ saturation=hue.s, luminosity=hue.l, hue=hue.h;
+ }
+ saturation/=100;
+ luminosity/=100;
+
+ while(hue<0){ hue+=360; }
+ while(hue>=360){ hue-=360; }
+
+ var r, g, b;
+ if(hue<120){
+ r=(120-hue)/60, g=hue/60, b=0;
+ } else if (hue<240){
+ r=0, g=(240-hue)/60, b=(hue-120)/60;
+ } else {
+ r=(hue-240)/60, g=0, b=(360-hue)/60;
+ }
+
+ r=2*saturation*Math.min(r, 1)+(1-saturation);
+ g=2*saturation*Math.min(g, 1)+(1-saturation);
+ b=2*saturation*Math.min(b, 1)+(1-saturation);
+ if(luminosity<0.5){
+ r*=luminosity, g*=luminosity, b*=luminosity;
+ }else{
+ r=(1-luminosity)*r+2*luminosity-1;
+ g=(1-luminosity)*g+2*luminosity-1;
+ b=(1-luminosity)*b+2*luminosity-1;
+ }
+ return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) }); // dojox.color.Color
+ },
+
+ fromHsv: function(/* Object|Array|int */hue, /* int */saturation, /* int */value){
+ // summary
+ // Create a dojox.color.Color from an HSV defined color.
+ // hue from 0-359 (degrees), saturation and value 0-100.
+
+ if(dojo.isArray(hue)){
+ saturation=hue[1], value=hue[2], hue=hue[0];
+ } else if (dojo.isObject(hue)){
+ saturation=hue.s, value=hue.v, hue=hue.h;
+ }
+
+ if(hue==360){ hue=0; }
+ saturation/=100;
+ value/=100;
+
+ var r, g, b;
+ if(saturation==0){
+ r=value, b=value, g=value;
+ }else{
+ var hTemp=hue/60, i=Math.floor(hTemp), f=hTemp-i;
+ var p=value*(1-saturation);
+ var q=value*(1-(saturation*f));
+ var t=value*(1-(saturation*(1-f)));
+ switch(i){
+ case 0:{ r=value, g=t, b=p; break; }
+ case 1:{ r=q, g=value, b=p; break; }
+ case 2:{ r=p, g=value, b=t; break; }
+ case 3:{ r=p, g=q, b=value; break; }
+ case 4:{ r=t, g=p, b=value; break; }
+ case 5:{ r=value, g=p, b=q; break; }
+ }
+ }
+ return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) }); // dojox.color.Color
+ }
+});
+
+// Conversions directly on dojox.color.Color
+dojo.extend(dojox.color.Color, {
+ toCmy: function(){
+ // summary
+ // Convert this Color to a CMY definition.
+ var cyan=1-(this.r/255), magenta=1-(this.g/255), yellow=1-(this.b/255);
+ return { c:Math.round(cyan*100), m:Math.round(magenta*100), y:Math.round(yellow*100) }; // Object
+ },
+
+ toCmyk: function(){
+ // summary
+ // Convert this Color to a CMYK definition.
+ var cyan, magenta, yellow, black;
+ var r=this.r/255, g=this.g/255, b=this.b/255;
+ black = Math.min(1-r, 1-g, 1-b);
+ cyan = (1-r-black)/(1-black);
+ magenta = (1-g-black)/(1-black);
+ yellow = (1-b-black)/(1-black);
+ return { c:Math.round(cyan*100), m:Math.round(magenta*100), y:Math.round(yellow*100), b:Math.round(black*100) }; // Object
+ },
+
+ toHsl: function(){
+ // summary
+ // Convert this Color to an HSL definition.
+ var r=this.r/255, g=this.g/255, b=this.b/255;
+ var min = Math.min(r, b, g), max = Math.max(r, g, b);
+ var delta = max-min;
+ var h=0, s=0, l=(min+max)/2;
+ if(l>0 && l<1){
+ s = delta/((l<0.5)?(2*l):(2-2*l));
+ }
+ if(delta>0){
+ if(max==r && max!=g){
+ h+=(g-b)/delta;
+ }
+ if(max==g && max!=b){
+ h+=(2+(b-r)/delta);
+ }
+ if(max==b && max!=r){
+ h+=(4+(r-g)/delta);
+ }
+ h*=60;
+ }
+ return { h:h, s:Math.round(s*100), l:Math.round(l*100) }; // Object
+ },
+
+ toHsv: function(){
+ // summary
+ // Convert this Color to an HSV definition.
+ var r=this.r/255, g=this.g/255, b=this.b/255;
+ var min = Math.min(r, b, g), max = Math.max(r, g, b);
+ var delta = max-min;
+ var h = null, s = (max==0)?0:(delta/max);
+ if(s==0){
+ h = 0;
+ }else{
+ if(r==max){
+ h = 60*(g-b)/delta;
+ }else if(g==max){
+ h = 120 + 60*(b-r)/delta;
+ }else{
+ h = 240 + 60*(r-g)/delta;
+ }
+
+ if(h<0){ h+=360; }
+ }
+ return { h:h, s:Math.round(s*100), v:Math.round(max*100) }; // Object
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.color"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.color"] = true;
+dojo.provide("dojox.color");
+
+
+}
+
+if(!dojo._hasResource["dojox.color.Palette"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.color.Palette"] = true;
+dojo.provide("dojox.color.Palette");
+
+
+(function(){
+ var dxc = dojox.color;
+ /***************************************************************
+ * dojox.color.Palette
+ *
+ * The Palette object is loosely based on the color palettes
+ * at Kuler (http://kuler.adobe.com). They are 5 color palettes
+ * with the base color considered to be the third color in the
+ * palette (for generation purposes).
+ *
+ * Palettes can be generated from well-known algorithms or they
+ * can be manually created by passing an array to the constructor.
+ *
+ * Palettes can be transformed, using a set of specific params
+ * similar to the way shapes can be transformed with dojox.gfx.
+ * However, unlike with transformations in dojox.gfx, transforming
+ * a palette will return you a new Palette object, in effect
+ * a clone of the original.
+ ***************************************************************/
+
+ // ctor ----------------------------------------------------------------------------
+ dxc.Palette = function(/* String|Array|dojox.color.Color|dojox.color.Palette */base){
+ // summary:
+ // An object that represents a palette of colors.
+ // description:
+ // A Palette is a representation of a set of colors. While the standard
+ // number of colors contained in a palette is 5, it can really handle any
+ // number of colors.
+ //
+ // A palette is useful for the ability to transform all the colors in it
+ // using a simple object-based approach. In addition, you can generate
+ // palettes using dojox.color.Palette.generate; these generated palettes
+ // are based on the palette generators at http://kuler.adobe.com.
+ //
+ // colors: dojox.color.Color[]
+ // The actual color references in this palette.
+ this.colors = [];
+ if(base instanceof dojox.color.Palette){
+ this.colors = base.colors.slice(0);
+ }
+ else if(base instanceof dojox.color.Color){
+ this.colors = [ null, null, base, null, null ];
+ }
+ else if(dojo.isArray(base)){
+ this.colors = dojo.map(base.slice(0), function(item){
+ if(dojo.isString(item)){ return new dojox.color.Color(item); }
+ return item;
+ });
+ }
+ else if (dojo.isString(base)){
+ this.colors = [ null, null, new dojox.color.Color(base), null, null ];
+ }
+ }
+
+ // private functions ---------------------------------------------------------------
+
+ // transformations
+ function tRGBA(p, param, val){
+ var ret = new dojox.color.Palette();
+ ret.colors = [];
+ dojo.forEach(p.colors, function(item){
+ var r=(param=="dr")?item.r+val:item.r,
+ g=(param=="dg")?item.g+val:item.g,
+ b=(param=="db")?item.b+val:item.b,
+ a=(param=="da")?item.a+val:item.a
+ ret.colors.push(new dojox.color.Color({
+ r: Math.min(255, Math.max(0, r)),
+ g: Math.min(255, Math.max(0, g)),
+ b: Math.min(255, Math.max(0, b)),
+ a: Math.min(1, Math.max(0, a))
+ }));
+ });
+ return ret;
+ }
+
+ function tCMY(p, param, val){
+ var ret = new dojox.color.Palette();
+ ret.colors = [];
+ dojo.forEach(p.colors, function(item){
+ var o=item.toCmy(),
+ c=(param=="dc")?o.c+val:o.c,
+ m=(param=="dm")?o.m+val:o.m,
+ y=(param=="dy")?o.y+val:o.y;
+ ret.colors.push(dojox.color.fromCmy(
+ Math.min(100, Math.max(0, c)),
+ Math.min(100, Math.max(0, m)),
+ Math.min(100, Math.max(0, y))
+ ));
+ });
+ return ret;
+ }
+
+ function tCMYK(p, param, val){
+ var ret = new dojox.color.Palette();
+ ret.colors = [];
+ dojo.forEach(p.colors, function(item){
+ var o=item.toCmyk(),
+ c=(param=="dc")?o.c+val:o.c,
+ m=(param=="dm")?o.m+val:o.m,
+ y=(param=="dy")?o.y+val:o.y,
+ k=(param=="dk")?o.b+val:o.b;
+ ret.colors.push(dojox.color.fromCmyk(
+ Math.min(100, Math.max(0, c)),
+ Math.min(100, Math.max(0, m)),
+ Math.min(100, Math.max(0, y)),
+ Math.min(100, Math.max(0, k))
+ ));
+ });
+ return ret;
+ }
+
+ function tHSL(p, param, val){
+ var ret = new dojox.color.Palette();
+ ret.colors = [];
+ dojo.forEach(p.colors, function(item){
+ var o=item.toHsl(),
+ h=(param=="dh")?o.h+val:o.h,
+ s=(param=="ds")?o.s+val:o.s,
+ l=(param=="dl")?o.l+val:o.l;
+ ret.colors.push(dojox.color.fromHsl(h%360, Math.min(100, Math.max(0, s)), Math.min(100, Math.max(0, l))));
+ });
+ return ret;
+ }
+
+ function tHSV(p, param, val){
+ var ret = new dojox.color.Palette();
+ ret.colors = [];
+ dojo.forEach(p.colors, function(item){
+ var o=item.toHsv(),
+ h=(param=="dh")?o.h+val:o.h,
+ s=(param=="ds")?o.s+val:o.s,
+ v=(param=="dv")?o.v+val:o.v;
+ ret.colors.push(dojox.color.fromHsv(h%360, Math.min(100, Math.max(0, s)), Math.min(100, Math.max(0, v))));
+ });
+ return ret;
+ }
+
+ // helper functions
+ function rangeDiff(val, low, high){
+ // given the value in a range from 0 to high, find the equiv
+ // using the range low to high.
+ return high-((high-val)*((high-low)/high));
+ }
+
+ // object methods ---------------------------------------------------------------
+ dojo.extend(dxc.Palette, {
+ transform: function(/* dojox.color.Palette.__transformArgs */kwArgs){
+ // summary:
+ // Transform the palette using a specific transformation function
+ // and a set of transformation parameters.
+ // description:
+ // {palette}.transform is a simple way to uniformly transform
+ // all of the colors in a palette using any of 5 formulae:
+ // RGBA, HSL, HSV, CMYK or CMY.
+ //
+ // Once the forumula to be used is determined, you can pass any
+ // number of parameters based on the formula "d"[param]; for instance,
+ // { use: "rgba", dr: 20, dg: -50 } will take all of the colors in
+ // palette, add 20 to the R value and subtract 50 from the G value.
+ //
+ // Unlike other types of transformations, transform does *not* alter
+ // the original palette but will instead return a new one.
+ var fn=tRGBA; // the default transform function.
+ if(kwArgs.use){
+ // we are being specific about the algo we want to use.
+ var use=kwArgs.use.toLowerCase();
+ if(use.indexOf("hs")==0){
+ if(use.charAt(2)=="l"){ fn=tHSL; }
+ else { fn=tHSV; }
+ }
+ else if(use.indexOf("cmy")==0){
+ if(use.charAt(3)=="k"){ fn=tCMYK; }
+ else { fn=tCMY; }
+ }
+ }
+ // try to guess the best choice.
+ else if("dc" in kwArgs || "dm" in kwArgs || "dy" in kwArgs){
+ if("dk" in kwArgs){ fn = tCMYK; }
+ else { fn = tCMY; }
+ }
+ else if("dh" in kwArgs || "ds" in kwArgs){
+ if("dv" in kwArgs){ fn = tHSV; }
+ else { fn = tHSL; }
+ }
+
+ var palette = this;
+ for(var p in kwArgs){
+ // ignore use
+ if(p=="use"){ continue; }
+ palette = fn(palette, p, kwArgs[p]);
+ }
+ return palette; // dojox.color.Palette
+ },
+ clone: function(){
+ // summary:
+ // Clones the current palette.
+ return new dxc.Palette(this); // dojox.color.Palette
+ }
+ });
+
+/*=====
+dojox.color.Palette.__transformArgs = function(use, dr, dg, db, da, dc, dm, dy, dk, dh, ds, dv, dl){
+ // summary:
+ // The keywords argument to be passed to the dojox.color.Palette.transform function. Note that
+ // while all arguments are optional, *some* arguments must be passed. The basic concept is that
+ // you pass a delta value for a specific aspect of a color model (or multiple aspects of the same
+ // color model); for instance, if you wish to transform a palette based on the HSV color model,
+ // you would pass one of "dh", "ds", or "dv" as a value.
+ //
+ // use: String?
+ // Specify the color model to use for the transformation. Can be "rgb", "rgba", "hsv", "hsl", "cmy", "cmyk".
+ // dr: Number?
+ // The delta to be applied to the red aspect of the RGB/RGBA color model.
+ // dg: Number?
+ // The delta to be applied to the green aspect of the RGB/RGBA color model.
+ // db: Number?
+ // The delta to be applied to the blue aspect of the RGB/RGBA color model.
+ // da: Number?
+ // The delta to be applied to the alpha aspect of the RGBA color model.
+ // dc: Number?
+ // The delta to be applied to the cyan aspect of the CMY/CMYK color model.
+ // dm: Number?
+ // The delta to be applied to the magenta aspect of the CMY/CMYK color model.
+ // dy: Number?
+ // The delta to be applied to the yellow aspect of the CMY/CMYK color model.
+ // dk: Number?
+ // The delta to be applied to the black aspect of the CMYK color model.
+ // dh: Number?
+ // The delta to be applied to the hue aspect of the HSL/HSV color model.
+ // ds: Number?
+ // The delta to be applied to the saturation aspect of the HSL/HSV color model.
+ // dl: Number?
+ // The delta to be applied to the luminosity aspect of the HSL color model.
+ // dv: Number?
+ // The delta to be applied to the value aspect of the HSV color model.
+ this.use = use;
+ this.dr = dr;
+ this.dg = dg;
+ this.db = db;
+ this.da = da;
+ this.dc = dc;
+ this.dm = dm;
+ this.dy = dy;
+ this.dk = dk;
+ this.dh = dh;
+ this.ds = ds;
+ this.dl = dl;
+ this.dv = dv;
+}
+dojox.color.Palette.__generatorArgs = function(base){
+ // summary:
+ // The keyword arguments object used to create a palette based on a base color.
+ //
+ // base: dojo.Color
+ // The base color to be used to generate the palette.
+ this.base = base;
+}
+dojox.color.Palette.__analogousArgs = function(base, high, low){
+ // summary:
+ // The keyword arguments object that is used to create a 5 color palette based on the
+ // analogous rules as implemented at http://kuler.adobe.com, using the HSV color model.
+ //
+ // base: dojo.Color
+ // The base color to be used to generate the palette.
+ // high: Number?
+ // The difference between the hue of the base color and the highest hue. In degrees, default is 60.
+ // low: Number?
+ // The difference between the hue of the base color and the lowest hue. In degrees, default is 18.
+ this.base = base;
+ this.high = high;
+ this.low = low;
+}
+dojox.color.Palette.__splitComplementaryArgs = function(base, da){
+ // summary:
+ // The keyword arguments object used to create a palette based on the split complementary rules
+ // as implemented at http://kuler.adobe.com.
+ //
+ // base: dojo.Color
+ // The base color to be used to generate the palette.
+ // da: Number?
+ // The delta angle to be used to determine where the split for the complementary rules happen.
+ // In degrees, the default is 30.
+ this.base = base;
+ this.da = da;
+}
+=====*/
+ dojo.mixin(dxc.Palette, {
+ generators: {
+ analogous:function(/* dojox.color.Palette.__analogousArgs */args){
+ // summary:
+ // Create a 5 color palette based on the analogous rules as implemented at
+ // http://kuler.adobe.com.
+ var high=args.high||60, // delta between base hue and highest hue (subtracted from base)
+ low=args.low||18, // delta between base hue and lowest hue (added to base)
+ base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv=base.toHsv();
+
+ // generate our hue angle differences
+ var h=[
+ (hsv.h+low+360)%360,
+ (hsv.h+Math.round(low/2)+360)%360,
+ hsv.h,
+ (hsv.h-Math.round(high/2)+360)%360,
+ (hsv.h-high+360)%360
+ ];
+
+ var s1=Math.max(10, (hsv.s<=95)?hsv.s+5:(100-(hsv.s-95))),
+ s2=(hsv.s>1)?hsv.s-1:21-hsv.s,
+ v1=(hsv.v>=92)?hsv.v-9:Math.max(hsv.v+9, 20),
+ v2=(hsv.v<=90)?Math.max(hsv.v+5, 20):(95+Math.ceil((hsv.v-90)/2)),
+ s=[ s1, s2, hsv.s, s1, s1 ],
+ v=[ v1, v2, hsv.v, v1, v2 ]
+
+ return new dxc.Palette(dojo.map(h, function(hue, i){
+ return dojox.color.fromHsv(hue, s[i], v[i]);
+ })); // dojox.color.Palette
+ },
+
+ monochromatic: function(/* dojox.color.Palette.__generatorArgs */args){
+ // summary:
+ // Create a 5 color palette based on the monochromatic rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv = base.toHsv();
+
+ // figure out the saturation and value
+ var s1 = (hsv.s-30>9)?hsv.s-30:hsv.s+30,
+ s2 = hsv.s,
+ v1 = rangeDiff(hsv.v, 20, 100),
+ v2 = (hsv.v-20>20)?hsv.v-20:hsv.v+60,
+ v3 = (hsv.v-50>20)?hsv.v-50:hsv.v+30;
+
+ return new dxc.Palette([
+ dojox.color.fromHsv(hsv.h, s1, v1),
+ dojox.color.fromHsv(hsv.h, s2, v3),
+ base,
+ dojox.color.fromHsv(hsv.h, s1, v3),
+ dojox.color.fromHsv(hsv.h, s2, v2)
+ ]); // dojox.color.Palette
+ },
+
+ triadic: function(/* dojox.color.Palette.__generatorArgs */args){
+ // summary:
+ // Create a 5 color palette based on the triadic rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv = base.toHsv();
+
+ var h1 = (hsv.h+57+360)%360,
+ h2 = (hsv.h-157+360)%360,
+ s1 = (hsv.s>20)?hsv.s-10:hsv.s+10,
+ s2 = (hsv.s>90)?hsv.s-10:hsv.s+10,
+ s3 = (hsv.s>95)?hsv.s-5:hsv.s+5,
+ v1 = (hsv.v-20>20)?hsv.v-20:hsv.v+20,
+ v2 = (hsv.v-30>20)?hsv.v-30:hsv.v+30,
+ v3 = (hsv.v-30>70)?hsv.v-30:hsv.v+30;
+
+ return new dxc.Palette([
+ dojox.color.fromHsv(h1, s1, hsv.v),
+ dojox.color.fromHsv(hsv.h, s2, v2),
+ base,
+ dojox.color.fromHsv(h2, s2, v1),
+ dojox.color.fromHsv(h2, s3, v3)
+ ]); // dojox.color.Palette
+ },
+
+ complementary: function(/* dojox.color.Palette.__generatorArgs */args){
+ // summary:
+ // Create a 5 color palette based on the complementary rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv = base.toHsv();
+
+ var h1 = ((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,
+ s1 = Math.max(hsv.s-10, 0),
+ s2 = rangeDiff(hsv.s, 10, 100),
+ s3 = Math.min(100, hsv.s+20),
+ v1 = Math.min(100, hsv.v+30),
+ v2 = (hsv.v>20)?hsv.v-30:hsv.v+30;
+
+ return new dxc.Palette([
+ dojox.color.fromHsv(hsv.h, s1, v1),
+ dojox.color.fromHsv(hsv.h, s2, v2),
+ base,
+ dojox.color.fromHsv(h1, s3, v2),
+ dojox.color.fromHsv(h1, hsv.s, hsv.v)
+ ]); // dojox.color.Palette
+ },
+
+ splitComplementary: function(/* dojox.color.Palette.__splitComplementaryArgs */args){
+ // summary:
+ // Create a 5 color palette based on the split complementary rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ dangle = args.da || 30,
+ hsv = base.toHsv();
+
+ var baseh = ((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,
+ h1 = (baseh-dangle+360)%360,
+ h2 = (baseh+dangle)%360,
+ s1 = Math.max(hsv.s-10, 0),
+ s2 = rangeDiff(hsv.s, 10, 100),
+ s3 = Math.min(100, hsv.s+20),
+ v1 = Math.min(100, hsv.v+30),
+ v2 = (hsv.v>20)?hsv.v-30:hsv.v+30;
+
+ return new dxc.Palette([
+ dojox.color.fromHsv(h1, s1, v1),
+ dojox.color.fromHsv(h1, s2, v2),
+ base,
+ dojox.color.fromHsv(h2, s3, v2),
+ dojox.color.fromHsv(h2, hsv.s, hsv.v)
+ ]); // dojox.color.Palette
+ },
+
+ compound: function(/* dojox.color.Palette.__generatorArgs */args){
+ // summary:
+ // Create a 5 color palette based on the compound rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv = base.toHsv();
+
+ var h1 = ((hsv.h*2)+18<360)?(hsv.h*2)+18:Math.floor(hsv.h/2)-18,
+ h2 = ((hsv.h*2)+120<360)?(hsv.h*2)+120:Math.floor(hsv.h/2)-120,
+ h3 = ((hsv.h*2)+99<360)?(hsv.h*2)+99:Math.floor(hsv.h/2)-99,
+ s1 = (hsv.s-40>10)?hsv.s-40:hsv.s+40,
+ s2 = (hsv.s-10>80)?hsv.s-10:hsv.s+10,
+ s3 = (hsv.s-25>10)?hsv.s-25:hsv.s+25,
+ v1 = (hsv.v-40>10)?hsv.v-40:hsv.v+40,
+ v2 = (hsv.v-20>80)?hsv.v-20:hsv.v+20,
+ v3 = Math.max(hsv.v, 20);
+
+ return new dxc.Palette([
+ dojox.color.fromHsv(h1, s1, v1),
+ dojox.color.fromHsv(h1, s2, v2),
+ base,
+ dojox.color.fromHsv(h2, s3, v3),
+ dojox.color.fromHsv(h3, s2, v2)
+ ]); // dojox.color.Palette
+ },
+
+ shades: function(/* dojox.color.Palette.__generatorArgs */args){
+ // summary:
+ // Create a 5 color palette based on the shades rules as implemented at
+ // http://kuler.adobe.com.
+ var base = dojo.isString(args.base)?new dojox.color.Color(args.base):args.base,
+ hsv = base.toHsv();
+
+ var s = (hsv.s==100 && hsv.v==0)?0:hsv.s,
+ v1 = (hsv.v-50>20)?hsv.v-50:hsv.v+30,
+ v2 = (hsv.v-25>=20)?hsv.v-25:hsv.v+55,
+ v3 = (hsv.v-75>=20)?hsv.v-75:hsv.v+5,
+ v4 = Math.max(hsv.v-10, 20);
+
+ return new dxc.Palette([
+ new dojox.color.fromHsv(hsv.h, s, v1),
+ new dojox.color.fromHsv(hsv.h, s, v2),
+ base,
+ new dojox.color.fromHsv(hsv.h, s, v3),
+ new dojox.color.fromHsv(hsv.h, s, v4)
+ ]); // dojox.color.Palette
+ }
+ },
+ generate: function(/* String|dojox.color.Color */base, /* Function|String */type){
+ // summary:
+ // Generate a new Palette using any of the named functions in
+ // dojox.color.Palette.generators or an optional function definition. Current
+ // generators include "analogous", "monochromatic", "triadic", "complementary",
+ // "splitComplementary", and "shades".
+ if(dojo.isFunction(type)){
+ return type({ base: base }); // dojox.color.Palette
+ }
+ else if(dxc.Palette.generators[type]){
+ return dxc.Palette.generators[type]({ base: base }); // dojox.color.Palette
+ }
+ throw new Error("dojox.color.Palette.generate: the specified generator ('" + type + "') does not exist.");
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.utils"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.utils"] = true;
+dojo.provide("dojox.lang.utils");
+
+(function(){
+ var empty = {}, du = dojox.lang.utils, opts = Object.prototype.toString;
+
+ var clone = function(o){
+ if(o){
+ switch(opts.call(o)){
+ case "[object Array]":
+ return o.slice(0);
+ case "[object Object]":
+ return dojo.delegate(o);
+ }
+ }
+ return o;
+ }
+
+ dojo.mixin(du, {
+ coerceType: function(target, source){
+ // summary: Coerces one object to the type of another.
+ // target: Object: object, which typeof result is used to coerce "source" object.
+ // source: Object: object, which will be forced to change type.
+ switch(typeof target){
+ case "number": return Number(eval("(" + source + ")"));
+ case "string": return String(source);
+ case "boolean": return Boolean(eval("(" + source + ")"));
+ }
+ return eval("(" + source + ")");
+ },
+
+ updateWithObject: function(target, source, conv){
+ // summary: Updates an existing object in place with properties from an "source" object.
+ // target: Object: the "target" object to be updated
+ // source: Object: the "source" object, whose properties will be used to source the existed object.
+ // conv: Boolean?: force conversion to the original type
+ if(!source){ return target; }
+ for(var x in target){
+ if(x in source && !(x in empty)){
+ var t = target[x];
+ if(t && typeof t == "object"){
+ du.updateWithObject(t, source[x], conv);
+ }else{
+ target[x] = conv ? du.coerceType(t, source[x]) : clone(source[x]);
+ }
+ }
+ }
+ return target; // Object
+ },
+
+ updateWithPattern: function(target, source, pattern, conv){
+ // summary: Updates an existing object in place with properties from an "source" object.
+ // target: Object: the "target" object to be updated
+ // source: Object: the "source" object, whose properties will be used to source the existed object.
+ // pattern: Object: object, whose properties will be used to pull values from the "source"
+ // conv: Boolean?: force conversion to the original type
+ if(!source || !pattern){ return target; }
+ for(var x in pattern){
+ if(x in source && !(x in empty)){
+ target[x] = conv ? du.coerceType(pattern[x], source[x]) : clone(source[x]);
+ }
+ }
+ return target; // Object
+ },
+
+ merge: function(object, mixin){
+ // summary: Merge two objects structurally, mixin properties will override object's properties.
+ // object: Object: original object.
+ // mixin: Object: additional object, which properties will override object's properties.
+ if(mixin){
+ var otype = opts.call(object), mtype = opts.call(mixin), t, i, l, m;
+ switch(mtype){
+ case "[object Array]":
+ if(mtype == otype){
+ t = new Array(Math.max(object.length, mixin.length));
+ for(i = 0, l = t.length; i < l; ++i){
+ t[i] = du.merge(object[i], mixin[i]);
+ }
+ return t;
+ }
+ return mixin.slice(0);
+ case "[object Object]":
+ if(mtype == otype && object){
+ t = dojo.delegate(object);
+ for(i in mixin){
+ if(i in object){
+ l = object[i];
+ m = mixin[i];
+ if(m !== l){
+ t[i] = du.merge(l, m);
+ }
+ }else{
+ t[i] = dojo.clone(mixin[i]);
+ }
+ }
+ return t;
+ }
+ return dojo.clone(mixin);
+ }
+ }
+ return mixin;
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.gfx.gradutils"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.gfx.gradutils"] = true;
+dojo.provide("dojox.gfx.gradutils");
+
+
+
+// Various generic utilities to deal with a linear gradient
+
+(function(){
+ var d = dojo, m = dojox.gfx.matrix, C = d.Color;
+
+ function findColor(o, c){
+ if(o <= 0){
+ return c[0].color;
+ }
+ var len = c.length;
+ if(o >= 1){
+ return c[len - 1].color;
+ }
+ //TODO: use binary search
+ for(var i = 0; i < len; ++i){
+ var stop = c[i];
+ if(stop.offset >= o){
+ if(i){
+ var prev = c[i - 1];
+ return d.blendColors(new C(prev.color), new C(stop.color),
+ (o - prev.offset) / (stop.offset - prev.offset));
+ }
+ return stop.color;
+ }
+ }
+ return c[len - 1].color;
+ }
+
+ dojox.gfx.gradutils.getColor = function(fill, pt){
+ // summary:
+ // sample a color from a gradient using a point
+ // fill: Object:
+ // fill object
+ // pt: dojox.gfx.Point:
+ // point where to sample a color
+ var o;
+ if(fill){
+ switch(fill.type){
+ case "linear":
+ var angle = Math.atan2(fill.y2 - fill.y1, fill.x2 - fill.x1),
+ rotation = m.rotate(-angle),
+ projection = m.project(fill.x2 - fill.x1, fill.y2 - fill.y1),
+ p = m.multiplyPoint(projection, pt),
+ pf1 = m.multiplyPoint(projection, fill.x1, fill.y1),
+ pf2 = m.multiplyPoint(projection, fill.x2, fill.y2),
+ scale = m.multiplyPoint(rotation, pf2.x - pf1.x, pf2.y - pf1.y).x,
+ o = m.multiplyPoint(rotation, p.x - pf1.x, p.y - pf1.y).x / scale;
+ break;
+ case "radial":
+ var dx = pt.x - fill.cx, dy = pt.y - fill.cy,
+ o = Math.sqrt(dx * dx + dy * dy) / fill.r;
+ break;
+ }
+ return findColor(o, fill.colors); // dojo.Color
+ }
+ // simple color
+ return new C(fill || [0, 0, 0, 0]); // dojo.Color
+ };
+
+ dojox.gfx.gradutils.reverse = function(fill){
+ // summary:
+ // reverses a gradient
+ // fill: Object:
+ // fill object
+ if(fill){
+ switch(fill.type){
+ case "linear":
+ case "radial":
+ fill = dojo.delegate(fill);
+ if(fill.colors){
+ var c = fill.colors, l = c.length, i = 0, stop,
+ n = fill.colors = new Array(c.length);
+ for(; i < l; ++i){
+ stop = c[i];
+ n[i] = {
+ offset: 1 - stop.offset,
+ color: stop.color
+ };
+ }
+ n.sort(function(a, b){ return a.offset - b.offset; });
+ }
+ break;
+ }
+ }
+ return fill; // Object
+ };
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.Theme"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.Theme"] = true;
+dojo.provide("dojox.charting.Theme");
+
+
+
+
+
+
+dojo.declare("dojox.charting.Theme", null, {
+ // summary:
+ // A Theme is a pre-defined object, primarily JSON-based, that makes up the definitions to
+ // style a chart.
+ //
+ // description:
+ // While you can set up style definitions on a chart directly (usually through the various add methods
+ // on a dojox.charting.Chart2D object), a Theme simplifies this manual setup by allowing you to
+ // pre-define all of the various visual parameters of each element in a chart.
+ //
+ // Most of the properties of a Theme are straight-forward; if something is line-based (such as
+ // an axis or the ticks on an axis), they will be defined using basic stroke parameters. Likewise,
+ // if an element is primarily block-based (such as the background of a chart), it will be primarily
+ // fill-based.
+ //
+ // In addition (for convenience), a Theme definition does not have to contain the entire JSON-based
+ // structure. Each theme is built on top of a default theme (which serves as the basis for the theme
+ // "GreySkies"), and is mixed into the default theme object. This allows you to create a theme based,
+ // say, solely on colors for data series.
+ //
+ // Defining a new theme is relatively easy; see any of the themes in dojox.charting.themes for examples
+ // on how to define your own.
+ //
+ // When you set a theme on a chart, the theme itself is deep-cloned. This means that you cannot alter
+ // the theme itself after setting the theme value on a chart, and expect it to change your chart. If you
+ // are looking to make alterations to a theme for a chart, the suggestion would be to create your own
+ // theme, based on the one you want to use, that makes those alterations before it is applied to a chart.
+ //
+ // Finally, a Theme contains a number of functions to facilitate rendering operations on a chart--the main
+ // helper of which is the ~next~ method, in which a chart asks for the information for the next data series
+ // to be rendered.
+ //
+ // A note on colors:
+ // The Theme constructor was on the use of dojox.color.Palette (in general) for creating a visually distinct
+ // set of colors for usage in a chart. A palette is usually comprised of 5 different color definitions, and
+ // no more. If you have a need to render a chart with more than 5 data elements, you can simply "push"
+ // new color definitions into the theme's .color array. Make sure that you do that with the actual
+ // theme object from a Chart, and not in the theme itself (i.e. either do that before using .setTheme
+ // on a chart).
+ //
+ // example:
+ // The default theme (and structure) looks like so:
+ // | // all objects are structs used directly in dojox.gfx
+ // | chart:{
+ // | stroke: null,
+ // | fill: "white",
+ // | pageStyle: null // suggested page style as an object suitable for dojo.style()
+ // | },
+ // | plotarea:{
+ // | stroke: null,
+ // | fill: "white"
+ // | },
+ // | axis:{
+ // | stroke: { // the axis itself
+ // | color: "#333",
+ // | width: 1
+ // | },
+ // | tick: { // used as a foundation for all ticks
+ // | color: "#666",
+ // | position: "center",
+ // | font: "normal normal normal 7pt Tahoma", // labels on axis
+ // | fontColor: "#333" // color of labels
+ // | },
+ // | majorTick: { // major ticks on axis, and used for major gridlines
+ // | width: 1,
+ // | length: 6
+ // | },
+ // | minorTick: { // minor ticks on axis, and used for minor gridlines
+ // | width: 0.8,
+ // | length: 3
+ // | },
+ // | microTick: { // minor ticks on axis, and used for minor gridlines
+ // | width: 0.5,
+ // | length: 1
+ // | }
+ // | },
+ // | series: {
+ // | stroke: {width: 1.5, color: "#333"}, // line
+ // | outline: {width: 0.1, color: "#ccc"}, // outline
+ // | //shadow: {dx: 1, dy: 1, width: 2, color: [0, 0, 0, 0.3]},
+ // | shadow: null, // no shadow
+ // | fill: "#ccc", // fill, if appropriate
+ // | font: "normal normal normal 8pt Tahoma", // if there's a label
+ // | fontColor: "#000" // color of labels
+ // | labelWiring: {width: 1, color: "#ccc"}, // connect marker and target data item(slice, column, bar...)
+ // | },
+ // | marker: { // any markers on a series
+ // | symbol: "m-3,3 l3,-6 3,6 z", // symbol
+ // | stroke: {width: 1.5, color: "#333"}, // stroke
+ // | outline: {width: 0.1, color: "#ccc"}, // outline
+ // | shadow: null, // no shadow
+ // | fill: "#ccc", // fill if needed
+ // | font: "normal normal normal 8pt Tahoma", // label
+ // | fontColor: "#000"
+ // | }
+ //
+ // example:
+ // Defining a new theme is pretty simple:
+ // | dojox.charting.themes.Grasslands = new dojox.charting.Theme({
+ // | colors: [ "#70803a", "#dde574", "#788062", "#b1cc5d", "#eff2c2" ]
+ // | });
+ // |
+ // | myChart.setTheme(dojox.charting.themes.Grasslands);
+
+ shapeSpaces: {shape: 1, shapeX: 1, shapeY: 1},
+
+ constructor: function(kwArgs){
+ // summary:
+ // Initialize a theme using the keyword arguments. Note that the arguments
+ // look like the example (above), and may include a few more parameters.
+ kwArgs = kwArgs || {};
+
+ // populate theme with defaults updating them if needed
+ var def = dojox.charting.Theme.defaultTheme;
+ dojo.forEach(["chart", "plotarea", "axis", "series", "marker"], function(name){
+ this[name] = dojo.delegate(def[name], kwArgs[name]);
+ }, this);
+
+ // personalize theme
+ if(kwArgs.seriesThemes && kwArgs.seriesThemes.length){
+ this.colors = null;
+ this.seriesThemes = kwArgs.seriesThemes.slice(0);
+ }else{
+ this.seriesThemes = null;
+ this.colors = (kwArgs.colors || dojox.charting.Theme.defaultColors).slice(0);
+ }
+ this.markerThemes = null;
+ if(kwArgs.markerThemes && kwArgs.markerThemes.length){
+ this.markerThemes = kwArgs.markerThemes.slice(0);
+ }
+ this.markers = kwArgs.markers ? dojo.clone(kwArgs.markers) : dojo.delegate(dojox.charting.Theme.defaultMarkers);
+
+ // set flags
+ this.noGradConv = kwArgs.noGradConv;
+ this.noRadialConv = kwArgs.noRadialConv;
+ if(kwArgs.reverseFills){
+ this.reverseFills();
+ }
+
+ // private housekeeping
+ this._current = 0;
+ this._buildMarkerArray();
+ },
+
+ clone: function(){
+ // summary:
+ // Clone the current theme.
+ // returns: dojox.charting.Theme
+ // The cloned theme; any alterations made will not affect the original.
+ var theme = new dojox.charting.Theme({
+ // theme components
+ chart: this.chart,
+ plotarea: this.plotarea,
+ axis: this.axis,
+ series: this.series,
+ marker: this.marker,
+ // individual arrays
+ colors: this.colors,
+ markers: this.markers,
+ seriesThemes: this.seriesThemes,
+ markerThemes: this.markerThemes,
+ // flags
+ noGradConv: this.noGradConv,
+ noRadialConv: this.noRadialConv
+ });
+ // copy custom methods
+ dojo.forEach(
+ ["clone", "clear", "next", "skip", "addMixin", "post", "getTick"],
+ function(name){
+ if(this.hasOwnProperty(name)){
+ theme[name] = this[name];
+ }
+ },
+ this
+ );
+ return theme; // dojox.charting.Theme
+ },
+
+ clear: function(){
+ // summary:
+ // Clear and reset the internal pointer to start fresh.
+ this._current = 0;
+ },
+
+ next: function(elementType, mixin, doPost){
+ // summary:
+ // Get the next color or series theme.
+ // elementType: String?
+ // An optional element type (for use with series themes)
+ // mixin: Object?
+ // An optional object to mix into the theme.
+ // doPost: Boolean?
+ // A flag to post-process the results.
+ // returns: Object
+ // An object of the structure { series, marker, symbol }
+ var merge = dojox.lang.utils.merge, series, marker;
+ if(this.colors){
+ series = dojo.delegate(this.series);
+ marker = dojo.delegate(this.marker);
+ var color = new dojo.Color(this.colors[this._current % this.colors.length]), old;
+ // modify the stroke
+ if(series.stroke && series.stroke.color){
+ series.stroke = dojo.delegate(series.stroke);
+ old = new dojo.Color(series.stroke.color);
+ series.stroke.color = new dojo.Color(color);
+ series.stroke.color.a = old.a;
+ }else{
+ series.stroke = {color: color};
+ }
+ if(marker.stroke && marker.stroke.color){
+ marker.stroke = dojo.delegate(marker.stroke);
+ old = new dojo.Color(marker.stroke.color);
+ marker.stroke.color = new dojo.Color(color);
+ marker.stroke.color.a = old.a;
+ }else{
+ marker.stroke = {color: color};
+ }
+ // modify the fill
+ if(!series.fill || series.fill.type){
+ series.fill = color;
+ }else{
+ old = new dojo.Color(series.fill);
+ series.fill = new dojo.Color(color);
+ series.fill.a = old.a;
+ }
+ if(!marker.fill || marker.fill.type){
+ marker.fill = color;
+ }else{
+ old = new dojo.Color(marker.fill);
+ marker.fill = new dojo.Color(color);
+ marker.fill.a = old.a;
+ }
+ }else{
+ series = this.seriesThemes ?
+ merge(this.series, this.seriesThemes[this._current % this.seriesThemes.length]) :
+ this.series;
+ marker = this.markerThemes ?
+ merge(this.marker, this.markerThemes[this._current % this.markerThemes.length]) :
+ series;
+ }
+
+ var symbol = marker && marker.symbol || this._markers[this._current % this._markers.length];
+
+ var theme = {series: series, marker: marker, symbol: symbol};
+
+ // advance the counter
+ ++this._current;
+
+ if(mixin){
+ theme = this.addMixin(theme, elementType, mixin);
+ }
+ if(doPost){
+ theme = this.post(theme, elementType);
+ }
+
+ return theme; // Object
+ },
+
+ skip: function(){
+ // summary:
+ // Skip the next internal color.
+ ++this._current;
+ },
+
+ addMixin: function(theme, elementType, mixin, doPost){
+ // summary:
+ // Add a mixin object to the passed theme and process.
+ // theme: dojox.charting.Theme
+ // The theme to mixin to.
+ // elementType: String
+ // The type of element in question. Can be "line", "bar" or "circle"
+ // mixin: Object|Array
+ // The object or objects to mix into the theme.
+ // doPost: Boolean
+ // If true, run the new theme through the post-processor.
+ // returns: dojox.charting.Theme
+ // The new theme.
+ if(dojo.isArray(mixin)){
+ dojo.forEach(mixin, function(m){
+ theme = this.addMixin(theme, elementType, m);
+ }, this);
+ }else{
+ var t = {};
+ if("color" in mixin){
+ if(elementType == "line" || elementType == "area"){
+ dojo.setObject("series.stroke.color", mixin.color, t);
+ dojo.setObject("marker.stroke.color", mixin.color, t);
+ }else{
+ dojo.setObject("series.fill", mixin.color, t);
+ }
+ }
+ dojo.forEach(["stroke", "outline", "shadow", "fill", "font", "fontColor", "labelWiring"], function(name){
+ var markerName = "marker" + name.charAt(0).toUpperCase() + name.substr(1),
+ b = markerName in mixin;
+ if(name in mixin){
+ dojo.setObject("series." + name, mixin[name], t);
+ if(!b){
+ dojo.setObject("marker." + name, mixin[name], t);
+ }
+ }
+ if(b){
+ dojo.setObject("marker." + name, mixin[markerName], t);
+ }
+ });
+ if("marker" in mixin){
+ t.symbol = mixin.marker;
+ }
+ theme = dojox.lang.utils.merge(theme, t);
+ }
+ if(doPost){
+ theme = this.post(theme, elementType);
+ }
+ return theme; // dojox.charting.Theme
+ },
+
+ post: function(theme, elementType){
+ // summary:
+ // Process any post-shape fills.
+ // theme: dojox.charting.Theme
+ // The theme to post process with.
+ // elementType: String
+ // The type of element being filled. Can be "bar" or "circle".
+ // returns: dojox.charting.Theme
+ // The post-processed theme.
+ var fill = theme.series.fill, t;
+ if(!this.noGradConv && this.shapeSpaces[fill.space] && fill.type == "linear"){
+ if(elementType == "bar"){
+ // transpose start and end points
+ t = {
+ x1: fill.y1,
+ y1: fill.x1,
+ x2: fill.y2,
+ y2: fill.x2
+ };
+ }else if(!this.noRadialConv && fill.space == "shape" && (elementType == "slice" || elementType == "circle")){
+ // switch to radial
+ t = {
+ type: "radial",
+ cx: 0,
+ cy: 0,
+ r: 100
+ };
+ }
+ if(t){
+ return dojox.lang.utils.merge(theme, {series: {fill: t}});
+ }
+ }
+ return theme; // dojox.charting.Theme
+ },
+
+ getTick: function(name, mixin){
+ // summary:
+ // Calculates and merges tick parameters.
+ // name: String
+ // Tick name, can be "major", "minor", or "micro".
+ // mixin: Object?
+ // Optional object to mix in to the tick.
+ var tick = this.axis.tick, tickName = name + "Tick";
+ merge = dojox.lang.utils.merge;
+ if(tick){
+ if(this.axis[tickName]){
+ tick = merge(tick, this.axis[tickName]);
+ }
+ }else{
+ tick = this.axis[tickName];
+ }
+ if(mixin){
+ if(tick){
+ if(mixin[tickName]){
+ tick = merge(tick, mixin[tickName]);
+ }
+ }else{
+ tick = mixin[tickName];
+ }
+ }
+ return tick; // Object
+ },
+
+ inspectObjects: function(f){
+ dojo.forEach(["chart", "plotarea", "axis", "series", "marker"], function(name){
+ f(this[name]);
+ }, this);
+ if(this.seriesThemes){
+ dojo.forEach(this.seriesThemes, f);
+ }
+ if(this.markerThemes){
+ dojo.forEach(this.markerThemes, f);
+ }
+ },
+
+ reverseFills: function(){
+ this.inspectObjects(function(o){
+ if(o && o.fill){
+ o.fill = dojox.gfx.gradutils.reverse(o.fill);
+ }
+ });
+ },
+
+ addMarker:function(/*String*/ name, /*String*/ segment){
+ // summary:
+ // Add a custom marker to this theme.
+ // example:
+ // | myTheme.addMarker("Ellipse", foo);
+ this.markers[name] = segment;
+ this._buildMarkerArray();
+ },
+
+ setMarkers:function(/*Object*/ obj){
+ // summary:
+ // Set all the markers of this theme at once. obj should be a
+ // dictionary of keys and path segments.
+ //
+ // example:
+ // | myTheme.setMarkers({ "CIRCLE": foo });
+ this.markers = obj;
+ this._buildMarkerArray();
+ },
+
+ _buildMarkerArray: function(){
+ this._markers = [];
+ for(var p in this.markers){
+ this._markers.push(this.markers[p]);
+ }
+ }
+});
+
+/*=====
+dojox.charting.Theme.__DefineColorArgs = function(num, colors, hue, saturation, low, high, base, generator){
+ // summary:
+ // The arguments object that can be passed to define colors for a theme.
+ // num: Number?
+ // The number of colors to generate. Defaults to 5.
+ // colors: String[]|dojo.Color[]?
+ // A pre-defined set of colors; this is passed through to the Theme directly.
+ // hue: Number?
+ // A hue to base the generated colors from (a number from 0 - 359).
+ // saturation: Number?
+ // If a hue is passed, this is used for the saturation value (0 - 100).
+ // low: Number?
+ // An optional value to determine the lowest value used to generate a color (HSV model)
+ // high: Number?
+ // An optional value to determine the highest value used to generate a color (HSV model)
+ // base: String|dojo.Color?
+ // A base color to use if we are defining colors using dojox.color.Palette
+ // generator: String?
+ // The generator function name from dojox.color.Palette.
+ this.num = num;
+ this.colors = colors;
+ this.hue = hue;
+ this.saturation = saturation;
+ this.low = low;
+ this.high = high;
+ this.base = base;
+ this.generator = generator;
+}
+=====*/
+dojo.mixin(dojox.charting.Theme, {
+ defaultMarkers: {
+ CIRCLE: "m-3,0 c0,-4 6,-4 6,0 m-6,0 c0,4 6,4 6,0",
+ SQUARE: "m-3,-3 l0,6 6,0 0,-6 z",
+ DIAMOND: "m0,-3 l3,3 -3,3 -3,-3 z",
+ CROSS: "m0,-3 l0,6 m-3,-3 l6,0",
+ X: "m-3,-3 l6,6 m0,-6 l-6,6",
+ TRIANGLE: "m-3,3 l3,-6 3,6 z",
+ TRIANGLE_INVERTED: "m-3,-3 l3,6 3,-6 z"
+ },
+
+ defaultColors:[
+ // gray skies
+ "#54544c", "#858e94", "#6e767a", "#948585", "#474747"
+ ],
+
+ defaultTheme: {
+ // all objects are structs used directly in dojox.gfx
+ chart:{
+ stroke: null,
+ fill: "white",
+ pageStyle: null,
+ titleGap: 20,
+ titlePos: "top",
+ titleFont: "normal normal bold 14pt Tahoma", // labels on axis
+ titleFontColor: "#333"
+ },
+ plotarea:{
+ stroke: null,
+ fill: "white"
+ },
+ // TODO: label rotation on axis
+ axis:{
+ stroke: { // the axis itself
+ color: "#333",
+ width: 1
+ },
+ tick: { // used as a foundation for all ticks
+ color: "#666",
+ position: "center",
+ font: "normal normal normal 7pt Tahoma", // labels on axis
+ fontColor: "#333", // color of labels
+ titleGap: 15,
+ titleFont: "normal normal normal 11pt Tahoma", // labels on axis
+ titleFontColor: "#333", // color of labels
+ titleOrientation: "axis" // "axis": facing the axis, "away": facing away
+ },
+ majorTick: { // major ticks on axis, and used for major gridlines
+ width: 1,
+ length: 6
+ },
+ minorTick: { // minor ticks on axis, and used for minor gridlines
+ width: 0.8,
+ length: 3
+ },
+ microTick: { // minor ticks on axis, and used for minor gridlines
+ width: 0.5,
+ length: 1
+ }
+ },
+ series: {
+ // used as a "main" theme for series, sThemes augment it
+ stroke: {width: 1.5, color: "#333"}, // line
+ outline: {width: 0.1, color: "#ccc"}, // outline
+ //shadow: {dx: 1, dy: 1, width: 2, color: [0, 0, 0, 0.3]},
+ shadow: null, // no shadow
+ fill: "#ccc", // fill, if appropriate
+ font: "normal normal normal 8pt Tahoma", // if there's a label
+ fontColor: "#000", // color of labels
+ labelWiring: {width: 1, color: "#ccc"} // connect marker and target data item(slice, column, bar...)
+ },
+ marker: { // any markers on a series
+ stroke: {width: 1.5, color: "#333"}, // stroke
+ outline: {width: 0.1, color: "#ccc"}, // outline
+ //shadow: {dx: 1, dy: 1, width: 2, color: [0, 0, 0, 0.3]},
+ shadow: null, // no shadow
+ fill: "#ccc", // fill if needed
+ font: "normal normal normal 8pt Tahoma", // label
+ fontColor: "#000"
+ }
+ },
+
+ defineColors: function(kwArgs){
+ // summary:
+ // Generate a set of colors for the theme based on keyword
+ // arguments.
+ // kwArgs: dojox.charting.Theme.__DefineColorArgs
+ // The arguments object used to define colors.
+ // returns: dojo.Color[]
+ // An array of colors for use in a theme.
+ //
+ // example:
+ // | var colors = dojox.charting.Theme.defineColors({
+ // | base: "#369",
+ // | generator: "compound"
+ // | });
+ //
+ // example:
+ // | var colors = dojox.charting.Theme.defineColors({
+ // | hue: 60,
+ // | saturation: 90,
+ // | low: 30,
+ // | high: 80
+ // | });
+ kwArgs = kwArgs || {};
+ var c = [], n = kwArgs.num || 5; // the number of colors to generate
+ if(kwArgs.colors){
+ // we have an array of colors predefined, so fix for the number of series.
+ var l = kwArgs.colors.length;
+ for(var i = 0; i < n; i++){
+ c.push(kwArgs.colors[i % l]);
+ }
+ return c; // dojo.Color[]
+ }
+ if(kwArgs.hue){
+ // single hue, generate a set based on brightness
+ var s = kwArgs.saturation || 100; // saturation
+ var st = kwArgs.low || 30;
+ var end = kwArgs.high || 90;
+ // we'd like it to be a little on the darker side.
+ var l = (end + st) / 2;
+ // alternately, use "shades"
+ return dojox.color.Palette.generate(
+ dojox.color.fromHsv(kwArgs.hue, s, l), "monochromatic"
+ ).colors;
+ }
+ if(kwArgs.generator){
+ // pass a base color and the name of a generator
+ return dojox.color.Palette.generate(kwArgs.base, kwArgs.generator).colors;
+ }
+ return c; // dojo.Color[]
+ },
+
+ generateGradient: function(fillPattern, colorFrom, colorTo){
+ var fill = dojo.delegate(fillPattern);
+ fill.colors = [
+ {offset: 0, color: colorFrom},
+ {offset: 1, color: colorTo}
+ ];
+ return fill;
+ },
+
+ generateHslColor: function(color, luminance){
+ color = new dojox.color.Color(color);
+ var hsl = color.toHsl(),
+ result = dojox.color.fromHsl(hsl.h, hsl.s, luminance);
+ result.a = color.a; // add missing opacity
+ return result;
+ },
+
+ generateHslGradient: function(color, fillPattern, lumFrom, lumTo){
+ color = new dojox.color.Color(color);
+ var hsl = color.toHsl(),
+ colorFrom = dojox.color.fromHsl(hsl.h, hsl.s, lumFrom),
+ colorTo = dojox.color.fromHsl(hsl.h, hsl.s, lumTo);
+ colorFrom.a = colorTo.a = color.a; // add missing opacity
+ return dojox.charting.Theme.generateGradient(fillPattern, colorFrom, colorTo); // Object
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.Series"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.Series"] = true;
+dojo.provide("dojox.charting.Series");
+
+
+/*=====
+dojox.charting.__SeriesCtorArgs = function(plot){
+ // summary:
+ // An optional arguments object that can be used in the Series constructor.
+ // plot: String?
+ // The plot (by name) that this series belongs to.
+ this.plot = plot;
+}
+=====*/
+dojo.declare("dojox.charting.Series", dojox.charting.Element, {
+ // summary:
+ // An object representing a series of data for plotting on a chart.
+ constructor: function(chart, data, kwArgs){
+ // summary:
+ // Create a new data series object for use within charting.
+ // chart: dojox.charting.Chart2D
+ // The chart that this series belongs to.
+ // data: Array|Object:
+ // The array of data points (either numbers or objects) that
+ // represents the data to be drawn. Or it can be an object. In
+ // the latter case, it should have a property "data" (an array),
+ // destroy(), and setSeriesObject().
+ // kwArgs: dojox.charting.__SeriesCtorArgs?
+ // An optional keyword arguments object to set details for this series.
+ dojo.mixin(this, kwArgs);
+ if(typeof this.plot != "string"){ this.plot = "default"; }
+ this.update(data);
+ },
+
+ clear: function(){
+ // summary:
+ // Clear the calculated additional parameters set on this series.
+ this.dyn = {};
+ },
+
+ update: function(data){
+ // summary:
+ // Set data and make this object dirty, so it can be redrawn.
+ // data: Array|Object:
+ // The array of data points (either numbers or objects) that
+ // represents the data to be drawn. Or it can be an object. In
+ // the latter case, it should have a property "data" (an array),
+ // destroy(), and setSeriesObject().
+ if(dojo.isArray(data)){
+ this.data = data;
+ }else{
+ this.source = data;
+ this.data = this.source.data;
+ if(this.source.setSeriesObject){
+ this.source.setSeriesObject(this);
+ }
+ }
+ this.dirty = true;
+ this.clear();
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.axis2d.common"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.axis2d.common"] = true;
+dojo.provide("dojox.charting.axis2d.common");
+
+
+
+(function(){
+ var g = dojox.gfx;
+
+ var clearNode = function(s){
+ s.marginLeft = "0px";
+ s.marginTop = "0px";
+ s.marginRight = "0px";
+ s.marginBottom = "0px";
+ s.paddingLeft = "0px";
+ s.paddingTop = "0px";
+ s.paddingRight = "0px";
+ s.paddingBottom = "0px";
+ s.borderLeftWidth = "0px";
+ s.borderTopWidth = "0px";
+ s.borderRightWidth = "0px";
+ s.borderBottomWidth = "0px";
+ };
+
+ var getBoxWidth = function(n){
+ // marginBox is incredibly slow, so avoid it if we can
+ if(n["getBoundingClientRect"]){
+ var bcr = n.getBoundingClientRect();
+ return bcr.width || (bcr.right - bcr.left);
+ }else{
+ return dojo.marginBox(n).w;
+ }
+ };
+
+ dojo.mixin(dojox.charting.axis2d.common, {
+ // summary:
+ // Common methods to be used by any axis. This is considered "static".
+ createText: {
+ gfx: function(chart, creator, x, y, align, text, font, fontColor){
+ // summary:
+ // Use dojox.gfx to create any text.
+ // chart: dojox.charting.Chart2D
+ // The chart to create the text into.
+ // creator: dojox.gfx.Surface
+ // The graphics surface to use for creating the text.
+ // x: Number
+ // Where to create the text along the x axis (CSS left).
+ // y: Number
+ // Where to create the text along the y axis (CSS top).
+ // align: String
+ // How to align the text. Can be "left", "right", "center".
+ // text: String
+ // The text to render.
+ // font: String
+ // The font definition, a la CSS "font".
+ // fontColor: String|dojo.Color
+ // The color of the resultant text.
+ // returns: dojox.gfx.Text
+ // The resultant GFX object.
+ return creator.createText({
+ x: x, y: y, text: text, align: align
+ }).setFont(font).setFill(fontColor); // dojox.gfx.Text
+ },
+ html: function(chart, creator, x, y, align, text, font, fontColor, labelWidth){
+ // summary:
+ // Use the HTML DOM to create any text.
+ // chart: dojox.charting.Chart2D
+ // The chart to create the text into.
+ // creator: dojox.gfx.Surface
+ // The graphics surface to use for creating the text.
+ // x: Number
+ // Where to create the text along the x axis (CSS left).
+ // y: Number
+ // Where to create the text along the y axis (CSS top).
+ // align: String
+ // How to align the text. Can be "left", "right", "center".
+ // text: String
+ // The text to render.
+ // font: String
+ // The font definition, a la CSS "font".
+ // fontColor: String|dojo.Color
+ // The color of the resultant text.
+ // labelWidth: Number?
+ // The maximum width of the resultant DOM node.
+ // returns: DOMNode
+ // The resultant DOMNode (a "div" element).
+
+ // setup the text node
+ var p = dojo.doc.createElement("div"), s = p.style, boxWidth;
+ clearNode(s);
+ s.font = font;
+ p.innerHTML = String(text).replace(/\s/g, "&nbsp;");
+ s.color = fontColor;
+ // measure the size
+ s.position = "absolute";
+ s.left = "-10000px";
+ dojo.body().appendChild(p);
+ var size = g.normalizedLength(g.splitFontString(font).size);
+
+ // do we need to calculate the label width?
+ if(!labelWidth){
+ boxWidth = getBoxWidth(p);
+ }
+
+ // new settings for the text node
+ dojo.body().removeChild(p);
+
+ s.position = "relative";
+ if(labelWidth){
+ s.width = labelWidth + "px";
+ // s.border = "1px dotted grey";
+ switch(align){
+ case "middle":
+ s.textAlign = "center";
+ s.left = (x - labelWidth / 2) + "px";
+ break;
+ case "end":
+ s.textAlign = "right";
+ s.left = (x - labelWidth) + "px";
+ break;
+ default:
+ s.left = x + "px";
+ s.textAlign = "left";
+ break;
+ }
+ }else{
+ switch(align){
+ case "middle":
+ s.left = Math.floor(x - boxWidth / 2) + "px";
+ // s.left = Math.floor(x - p.offsetWidth / 2) + "px";
+ break;
+ case "end":
+ s.left = Math.floor(x - boxWidth) + "px";
+ // s.left = Math.floor(x - p.offsetWidth) + "px";
+ break;
+ //case "start":
+ default:
+ s.left = Math.floor(x) + "px";
+ break;
+ }
+ }
+ s.top = Math.floor(y - size) + "px";
+ s.whiteSpace = "nowrap"; // hack for WebKit
+ // setup the wrapper node
+ var wrap = dojo.doc.createElement("div"), w = wrap.style;
+ clearNode(w);
+ w.width = "0px";
+ w.height = "0px";
+ // insert nodes
+ wrap.appendChild(p)
+ chart.node.insertBefore(wrap, chart.node.firstChild);
+ return wrap; // DOMNode
+ }
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.Chart"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.Chart"] = true;
+dojo.provide("dojox.charting.Chart");
+
+
+
+
+
+
+
+
+
+
+
+/*=====
+dojox.charting.__ChartCtorArgs = function(margins, stroke, fill, delayInMs){
+ // summary:
+ // The keyword arguments that can be passed in a Chart constructor.
+ //
+ // margins: Object?
+ // Optional margins for the chart, in the form of { l, t, r, b}.
+ // stroke: dojox.gfx.Stroke?
+ // An optional outline/stroke for the chart.
+ // fill: dojox.gfx.Fill?
+ // An optional fill for the chart.
+ // delayInMs: Number
+ // Delay in ms for delayedRender(). Default: 200.
+ this.margins = margins;
+ this.stroke = stroke;
+ this.fill = fill;
+ this.delayInMs = delayInMs;
+}
+ =====*/
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting, g = dojox.gfx,
+ clear = df.lambda("item.clear()"),
+ purge = df.lambda("item.purgeGroup()"),
+ destroy = df.lambda("item.destroy()"),
+ makeClean = df.lambda("item.dirty = false"),
+ makeDirty = df.lambda("item.dirty = true"),
+ getName = df.lambda("item.name");
+
+ dojo.declare("dojox.charting.Chart", null, {
+ // summary:
+ // The main chart object in dojox.charting. This will create a two dimensional
+ // chart based on dojox.gfx.
+ //
+ // description:
+ // dojox.charting.Chart is the primary object used for any kind of charts. It
+ // is simple to create--just pass it a node reference, which is used as the
+ // container for the chart--and a set of optional keyword arguments and go.
+ //
+ // Note that like most of dojox.gfx, most of dojox.charting.Chart's methods are
+ // designed to return a reference to the chart itself, to allow for functional
+ // chaining. This makes defining everything on a Chart very easy to do.
+ //
+ // example:
+ // Create an area chart, with smoothing.
+ // | new dojox.charting.Chart(node))
+ // | .addPlot("default", { type: "Areas", tension: "X" })
+ // | .setTheme(dojox.charting.themes.Shrooms)
+ // | .addSeries("Series A", [1, 2, 0.5, 1.5, 1, 2.8, 0.4])
+ // | .addSeries("Series B", [2.6, 1.8, 2, 1, 1.4, 0.7, 2])
+ // | .addSeries("Series C", [6.3, 1.8, 3, 0.5, 4.4, 2.7, 2])
+ // | .render();
+ //
+ // example:
+ // The form of data in a data series can take a number of forms: a simple array,
+ // an array of objects {x,y}, or something custom (as determined by the plot).
+ // Here's an example of a Candlestick chart, which expects an object of
+ // { open, high, low, close }.
+ // | new dojox.charting.Chart(node))
+ // | .addPlot("default", {type: "Candlesticks", gap: 1})
+ // | .addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true})
+ // | .addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true})
+ // | .addSeries("Series A", [
+ // | { open: 20, close: 16, high: 22, low: 8 },
+ // | { open: 16, close: 22, high: 26, low: 6, mid: 18 },
+ // | { open: 22, close: 18, high: 22, low: 11, mid: 21 },
+ // | { open: 18, close: 29, high: 32, low: 14, mid: 27 },
+ // | { open: 29, close: 24, high: 29, low: 13, mid: 27 },
+ // | { open: 24, close: 8, high: 24, low: 5 },
+ // | { open: 8, close: 16, high: 22, low: 2 },
+ // | { open: 16, close: 12, high: 19, low: 7 },
+ // | { open: 12, close: 20, high: 22, low: 8 },
+ // | { open: 20, close: 16, high: 22, low: 8 },
+ // | { open: 16, close: 22, high: 26, low: 6, mid: 18 },
+ // | { open: 22, close: 18, high: 22, low: 11, mid: 21 },
+ // | { open: 18, close: 29, high: 32, low: 14, mid: 27 },
+ // | { open: 29, close: 24, high: 29, low: 13, mid: 27 },
+ // | { open: 24, close: 8, high: 24, low: 5 },
+ // | { open: 8, close: 16, high: 22, low: 2 },
+ // | { open: 16, close: 12, high: 19, low: 7 },
+ // | { open: 12, close: 20, high: 22, low: 8 },
+ // | { open: 20, close: 16, high: 22, low: 8 },
+ // | { open: 16, close: 22, high: 26, low: 6 },
+ // | { open: 22, close: 18, high: 22, low: 11 },
+ // | { open: 18, close: 29, high: 32, low: 14 },
+ // | { open: 29, close: 24, high: 29, low: 13 },
+ // | { open: 24, close: 8, high: 24, low: 5 },
+ // | { open: 8, close: 16, high: 22, low: 2 },
+ // | { open: 16, close: 12, high: 19, low: 7 },
+ // | { open: 12, close: 20, high: 22, low: 8 },
+ // | { open: 20, close: 16, high: 22, low: 8 }
+ // | ],
+ // | { stroke: { color: "green" }, fill: "lightgreen" }
+ // | )
+ // | .render();
+ //
+ // theme: dojox.charting.Theme?
+ // An optional theme to use for styling the chart.
+ // axes: dojox.charting.Axis{}?
+ // A map of axes for use in plotting a chart.
+ // stack: dojox.charting.plot2d.Base[]
+ // A stack of plotters.
+ // plots: dojox.charting.plot2d.Base{}
+ // A map of plotter indices
+ // series: dojox.charting.Series[]
+ // The stack of data runs used to create plots.
+ // runs: dojox.charting.Series{}
+ // A map of series indices
+ // margins: Object?
+ // The margins around the chart. Default is { l:10, t:10, r:10, b:10 }.
+ // stroke: dojox.gfx.Stroke?
+ // The outline of the chart (stroke in vector graphics terms).
+ // fill: dojox.gfx.Fill?
+ // The color for the chart.
+ // node: DOMNode
+ // The container node passed to the constructor.
+ // surface: dojox.gfx.Surface
+ // The main graphics surface upon which a chart is drawn.
+ // dirty: Boolean
+ // A boolean flag indicating whether or not the chart needs to be updated/re-rendered.
+ // coords: Object
+ // The coordinates on a page of the containing node, as returned from dojo.coords.
+
+ constructor: function(/* DOMNode */node, /* dojox.charting.__ChartCtorArgs? */kwArgs){
+ // summary:
+ // The constructor for a new Chart. Initializes all parameters used for a chart.
+ // returns: dojox.charting.Chart
+ // The newly created chart.
+
+ // initialize parameters
+ if(!kwArgs){ kwArgs = {}; }
+ this.margins = kwArgs.margins ? kwArgs.margins : {l: 10, t: 10, r: 10, b: 10};
+ this.stroke = kwArgs.stroke;
+ this.fill = kwArgs.fill;
+ this.delayInMs = kwArgs.delayInMs || 200;
+ this.title = kwArgs.title;
+ this.titleGap = kwArgs.titleGap;
+ this.titlePos = kwArgs.titlePos;
+ this.titleFont = kwArgs.titleFont;
+ this.titleFontColor = kwArgs.titleFontColor;
+ this.chartTitle = null;
+
+ // default initialization
+ this.theme = null;
+ this.axes = {}; // map of axes
+ this.stack = []; // stack of plotters
+ this.plots = {}; // map of plotter indices
+ this.series = []; // stack of data runs
+ this.runs = {}; // map of data run indices
+ this.dirty = true;
+ this.coords = null;
+
+ // create a surface
+ this.node = dojo.byId(node);
+ var box = dojo.marginBox(node);
+ this.surface = g.createSurface(this.node, box.w || 400, box.h || 300);
+ },
+ destroy: function(){
+ // summary:
+ // Cleanup when a chart is to be destroyed.
+ // returns: void
+ dojo.forEach(this.series, destroy);
+ dojo.forEach(this.stack, destroy);
+ df.forIn(this.axes, destroy);
+ if(this.chartTitle && this.chartTitle.tagName){
+ // destroy title if it is a DOM node
+ dojo.destroy(this.chartTitle);
+ }
+ this.surface.destroy();
+ },
+ getCoords: function(){
+ // summary:
+ // Get the coordinates and dimensions of the containing DOMNode, as
+ // returned by dojo.coords.
+ // returns: Object
+ // The resulting coordinates of the chart. See dojo.coords for details.
+ if(!this.coords){
+ this.coords = dojo.coords(this.node, true);
+ }
+ return this.coords; // Object
+ },
+ setTheme: function(theme){
+ // summary:
+ // Set a theme of the chart.
+ // theme: dojox.charting.Theme
+ // The theme to be used for visual rendering.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ this.theme = theme.clone();
+ this.dirty = true;
+ return this; // dojox.charting.Chart
+ },
+ addAxis: function(name, kwArgs){
+ // summary:
+ // Add an axis to the chart, for rendering.
+ // name: String
+ // The name of the axis.
+ // kwArgs: dojox.charting.axis2d.__AxisCtorArgs?
+ // An optional keyword arguments object for use in defining details of an axis.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var axis, axisType = kwArgs && kwArgs.type || "Default";
+ if(typeof axisType == "string"){
+ if(!dc.axis2d || !dc.axis2d[axisType]){
+ throw Error("Can't find axis: " + axisType + " - didn't you forget to dojo" + ".require() it?");
+ }
+ axis = new dc.axis2d[axisType](this, kwArgs);
+ }else{
+ axis = new axisType(this, kwArgs);
+ }
+ axis.name = name;
+ axis.dirty = true;
+ if(name in this.axes){
+ this.axes[name].destroy();
+ }
+ this.axes[name] = axis;
+ this.dirty = true;
+ return this; // dojox.charting.Chart
+ },
+ getAxis: function(name){
+ // summary:
+ // Get the given axis, by name.
+ // name: String
+ // The name the axis was defined by.
+ // returns: dojox.charting.axis2d.Default
+ // The axis as stored in the chart's axis map.
+ return this.axes[name]; // dojox.charting.axis2d.Default
+ },
+ removeAxis: function(name){
+ // summary:
+ // Remove the axis that was defined using name.
+ // name: String
+ // The axis name, as defined in addAxis.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.axes){
+ // destroy the axis
+ this.axes[name].destroy();
+ delete this.axes[name];
+ // mark the chart as dirty
+ this.dirty = true;
+ }
+ return this; // dojox.charting.Chart
+ },
+ addPlot: function(name, kwArgs){
+ // summary:
+ // Add a new plot to the chart, defined by name and using the optional keyword arguments object.
+ // Note that dojox.charting assumes the main plot to be called "default"; if you do not have
+ // a plot called "default" and attempt to add data series to the chart without specifying the
+ // plot to be rendered on, you WILL get errors.
+ // name: String
+ // The name of the plot to be added to the chart. If you only plan on using one plot, call it "default".
+ // kwArgs: dojox.charting.plot2d.__PlotCtorArgs
+ // An object with optional parameters for the plot in question.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var plot, plotType = kwArgs && kwArgs.type || "Default";
+ if(typeof plotType == "string"){
+ if(!dc.plot2d || !dc.plot2d[plotType]){
+ throw Error("Can't find plot: " + plotType + " - didn't you forget to dojo" + ".require() it?");
+ }
+ plot = new dc.plot2d[plotType](this, kwArgs);
+ }else{
+ plot = new plotType(this, kwArgs);
+ }
+ plot.name = name;
+ plot.dirty = true;
+ if(name in this.plots){
+ this.stack[this.plots[name]].destroy();
+ this.stack[this.plots[name]] = plot;
+ }else{
+ this.plots[name] = this.stack.length;
+ this.stack.push(plot);
+ }
+ this.dirty = true;
+ return this; // dojox.charting.Chart
+ },
+ removePlot: function(name){
+ // summary:
+ // Remove the plot defined using name from the chart's plot stack.
+ // name: String
+ // The name of the plot as defined using addPlot.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.plots){
+ // get the index and remove the name
+ var index = this.plots[name];
+ delete this.plots[name];
+ // destroy the plot
+ this.stack[index].destroy();
+ // remove the plot from the stack
+ this.stack.splice(index, 1);
+ // update indices to reflect the shift
+ df.forIn(this.plots, function(idx, name, plots){
+ if(idx > index){
+ plots[name] = idx - 1;
+ }
+ });
+ // remove all related series
+ var ns = dojo.filter(this.series, function(run){ return run.plot != name; });
+ if(ns.length < this.series.length){
+ // kill all removed series
+ dojo.forEach(this.series, function(run){
+ if(run.plot == name){
+ run.destroy();
+ }
+ });
+ // rebuild all necessary data structures
+ this.runs = {};
+ dojo.forEach(ns, function(run, index){
+ this.runs[run.plot] = index;
+ }, this);
+ this.series = ns;
+ }
+ // mark the chart as dirty
+ this.dirty = true;
+ }
+ return this; // dojox.charting.Chart
+ },
+ getPlotOrder: function(){
+ // summary:
+ // Returns an array of plot names in the current order
+ // (the top-most plot is the first).
+ // returns: Array
+ return df.map(this.stack, getName); // Array
+ },
+ setPlotOrder: function(newOrder){
+ // summary:
+ // Sets new order of plots. newOrder cannot add or remove
+ // plots. Wrong names, or dups are ignored.
+ // newOrder: Array:
+ // Array of plot names compatible with getPlotOrder().
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var names = {},
+ order = df.filter(newOrder, function(name){
+ if(!(name in this.plots) || (name in names)){
+ return false;
+ }
+ names[name] = 1;
+ return true;
+ }, this);
+ if(order.length < this.stack.length){
+ df.forEach(this.stack, function(plot){
+ var name = plot.name;
+ if(!(name in names)){
+ order.push(name);
+ }
+ });
+ }
+ var newStack = df.map(order, function(name){
+ return this.stack[this.plots[name]];
+ }, this);
+ df.forEach(newStack, function(plot, i){
+ this.plots[plot.name] = i;
+ }, this);
+ this.stack = newStack;
+ this.dirty = true;
+ return this; // dojox.charting.Chart
+ },
+ movePlotToFront: function(name){
+ // summary:
+ // Moves a given plot to front.
+ // name: String:
+ // Plot's name to move.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.plots){
+ var index = this.plots[name];
+ if(index){
+ var newOrder = this.getPlotOrder();
+ newOrder.splice(index, 1);
+ newOrder.unshift(name);
+ return this.setPlotOrder(newOrder); // dojox.charting.Chart
+ }
+ }
+ return this; // dojox.charting.Chart
+ },
+ movePlotToBack: function(name){
+ // summary:
+ // Moves a given plot to back.
+ // name: String:
+ // Plot's name to move.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.plots){
+ var index = this.plots[name];
+ if(index < this.stack.length - 1){
+ var newOrder = this.getPlotOrder();
+ newOrder.splice(index, 1);
+ newOrder.push(name);
+ return this.setPlotOrder(newOrder); // dojox.charting.Chart
+ }
+ }
+ return this; // dojox.charting.Chart
+ },
+ addSeries: function(name, data, kwArgs){
+ // summary:
+ // Add a data series to the chart for rendering.
+ // name: String:
+ // The name of the data series to be plotted.
+ // data: Array|Object:
+ // The array of data points (either numbers or objects) that
+ // represents the data to be drawn. Or it can be an object. In
+ // the latter case, it should have a property "data" (an array),
+ // destroy(), and setSeriesObject().
+ // kwArgs: dojox.charting.__SeriesCtorArgs?:
+ // An optional keyword arguments object that will be mixed into
+ // the resultant series object.
+ // returns: dojox.charting.Chart:
+ // A reference to the current chart for functional chaining.
+ var run = new dc.Series(this, data, kwArgs);
+ run.name = name;
+ if(name in this.runs){
+ this.series[this.runs[name]].destroy();
+ this.series[this.runs[name]] = run;
+ }else{
+ this.runs[name] = this.series.length;
+ this.series.push(run);
+ }
+ this.dirty = true;
+ // fix min/max
+ if(!("ymin" in run) && "min" in run){ run.ymin = run.min; }
+ if(!("ymax" in run) && "max" in run){ run.ymax = run.max; }
+ return this; // dojox.charting.Chart
+ },
+ removeSeries: function(name){
+ // summary:
+ // Remove the series defined by name from the chart.
+ // name: String
+ // The name of the series as defined by addSeries.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.runs){
+ // get the index and remove the name
+ var index = this.runs[name];
+ delete this.runs[name];
+ // destroy the run
+ this.series[index].destroy();
+ // remove the run from the stack of series
+ this.series.splice(index, 1);
+ // update indices to reflect the shift
+ df.forIn(this.runs, function(idx, name, runs){
+ if(idx > index){
+ runs[name] = idx - 1;
+ }
+ });
+ this.dirty = true;
+ }
+ return this; // dojox.charting.Chart
+ },
+ updateSeries: function(name, data){
+ // summary:
+ // Update the given series with a new set of data points.
+ // name: String
+ // The name of the series as defined in addSeries.
+ // data: Array|Object:
+ // The array of data points (either numbers or objects) that
+ // represents the data to be drawn. Or it can be an object. In
+ // the latter case, it should have a property "data" (an array),
+ // destroy(), and setSeriesObject().
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.runs){
+ var run = this.series[this.runs[name]];
+ run.update(data);
+ this._invalidateDependentPlots(run.plot, false);
+ this._invalidateDependentPlots(run.plot, true);
+ }
+ return this; // dojox.charting.Chart
+ },
+ getSeriesOrder: function(plotName){
+ // summary:
+ // Returns an array of series names in the current order
+ // (the top-most series is the first) within a plot.
+ // plotName: String:
+ // Plot's name.
+ // returns: Array
+ return df.map(df.filter(this.series, function(run){
+ return run.plot == plotName;
+ }), getName);
+ },
+ setSeriesOrder: function(newOrder){
+ // summary:
+ // Sets new order of series within a plot. newOrder cannot add
+ // or remove series. Wrong names, or dups are ignored.
+ // newOrder: Array:
+ // Array of series names compatible with getPlotOrder(). All
+ // series should belong to the same plot.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var plotName, names = {},
+ order = df.filter(newOrder, function(name){
+ if(!(name in this.runs) || (name in names)){
+ return false;
+ }
+ var run = this.series[this.runs[name]];
+ if(plotName){
+ if(run.plot != plotName){
+ return false;
+ }
+ }else{
+ plotName = run.plot;
+ }
+ names[name] = 1;
+ return true;
+ }, this);
+ df.forEach(this.series, function(run){
+ var name = run.name;
+ if(!(name in names) && run.plot == plotName){
+ order.push(name);
+ }
+ });
+ var newSeries = df.map(order, function(name){
+ return this.series[this.runs[name]];
+ }, this);
+ this.series = newSeries.concat(df.filter(this.series, function(run){
+ return run.plot != plotName;
+ }));
+ df.forEach(this.series, function(run, i){
+ this.runs[run.name] = i;
+ }, this);
+ this.dirty = true;
+ return this; // dojox.charting.Chart
+ },
+ moveSeriesToFront: function(name){
+ // summary:
+ // Moves a given series to front of a plot.
+ // name: String:
+ // Series' name to move.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.runs){
+ var index = this.runs[name],
+ newOrder = this.getSeriesOrder(this.series[index].plot);
+ if(name != newOrder[0]){
+ newOrder.splice(index, 1);
+ newOrder.unshift(name);
+ return this.setSeriesOrder(newOrder); // dojox.charting.Chart
+ }
+ }
+ return this; // dojox.charting.Chart
+ },
+ moveSeriesToBack: function(name){
+ // summary:
+ // Moves a given series to back of a plot.
+ // name: String:
+ // Series' name to move.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(name in this.runs){
+ var index = this.runs[name],
+ newOrder = this.getSeriesOrder(this.series[index].plot);
+ if(name != newOrder[newOrder.length - 1]){
+ newOrder.splice(index, 1);
+ newOrder.push(name);
+ return this.setSeriesOrder(newOrder); // dojox.charting.Chart
+ }
+ }
+ return this; // dojox.charting.Chart
+ },
+ resize: function(width, height){
+ // summary:
+ // Resize the chart to the dimensions of width and height.
+ // description:
+ // Resize the chart and its surface to the width and height dimensions.
+ // If no width/height or box is provided, resize the surface to the marginBox of the chart.
+ // width: Number
+ // The new width of the chart.
+ // height: Number
+ // The new height of the chart.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var box;
+ switch(arguments.length){
+ // case 0, do not resize the div, just the surface
+ case 1:
+ // argument, override node box
+ box = dojo.mixin({}, width);
+ dojo.marginBox(this.node, box);
+ break;
+ case 2:
+ box = {w: width, h: height};
+ // argument, override node box
+ dojo.marginBox(this.node, box);
+ break;
+ }
+ // in all cases take back the computed box
+ box = dojo.marginBox(this.node);
+ // and set it on the surface
+ this.surface.setDimensions(box.w, box.h);
+ this.dirty = true;
+ this.coords = null;
+ return this.render(); // dojox.charting.Chart
+ },
+ getGeometry: function(){
+ // summary:
+ // Returns a map of information about all axes in a chart and what they represent
+ // in terms of scaling (see dojox.charting.axis2d.Default.getScaler).
+ // returns: Object
+ // An map of geometry objects, a one-to-one mapping of axes.
+ var ret = {};
+ df.forIn(this.axes, function(axis){
+ if(axis.initialized()){
+ ret[axis.name] = {
+ name: axis.name,
+ vertical: axis.vertical,
+ scaler: axis.scaler,
+ ticks: axis.ticks
+ };
+ }
+ });
+ return ret; // Object
+ },
+ setAxisWindow: function(name, scale, offset, zoom){
+ // summary:
+ // Zooms an axis and all dependent plots. Can be used to zoom in 1D.
+ // name: String
+ // The name of the axis as defined by addAxis.
+ // scale: Number
+ // The scale on the target axis.
+ // offset: Number
+ // Any offest, as measured by axis tick
+ // zoom: Boolean|Object?
+ // The chart zooming animation trigger. This is null by default,
+ // e.g. {duration: 1200}, or just set true.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ var axis = this.axes[name];
+ if(axis){
+ axis.setWindow(scale, offset);
+ dojo.forEach(this.stack,function(plot){
+ if(plot.hAxis == name || plot.vAxis == name){
+ plot.zoom = zoom;
+ }
+ })
+ }
+ return this; // dojox.charting.Chart
+ },
+ setWindow: function(sx, sy, dx, dy, zoom){
+ // summary:
+ // Zooms in or out any plots in two dimensions.
+ // sx: Number
+ // The scale for the x axis.
+ // sy: Number
+ // The scale for the y axis.
+ // dx: Number
+ // The pixel offset on the x axis.
+ // dy: Number
+ // The pixel offset on the y axis.
+ // zoom: Boolean|Object?
+ // The chart zooming animation trigger. This is null by default,
+ // e.g. {duration: 1200}, or just set true.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(!("plotArea" in this)){
+ this.calculateGeometry();
+ }
+ df.forIn(this.axes, function(axis){
+ var scale, offset, bounds = axis.getScaler().bounds,
+ s = bounds.span / (bounds.upper - bounds.lower);
+ if(axis.vertical){
+ scale = sy;
+ offset = dy / s / scale;
+ }else{
+ scale = sx;
+ offset = dx / s / scale;
+ }
+ axis.setWindow(scale, offset);
+ });
+ dojo.forEach(this.stack, function(plot){ plot.zoom = zoom; });
+ return this; // dojox.charting.Chart
+ },
+ zoomIn: function(name, range){
+ // summary:
+ // Zoom the chart to a specific range on one axis. This calls render()
+ // directly as a convenience method.
+ // name: String
+ // The name of the axis as defined by addAxis.
+ // range: Array
+ // The end points of the zoom range, measured in axis ticks.
+ var axis = this.axes[name];
+ if(axis){
+ var scale, offset, bounds = axis.getScaler().bounds;
+ var lower = Math.min(range[0],range[1]);
+ var upper = Math.max(range[0],range[1]);
+ lower = range[0] < bounds.lower ? bounds.lower : lower;
+ upper = range[1] > bounds.upper ? bounds.upper : upper;
+ scale = (bounds.upper - bounds.lower) / (upper - lower);
+ offset = lower - bounds.lower;
+ this.setAxisWindow(name, scale, offset);
+ this.render();
+ }
+ },
+ calculateGeometry: function(){
+ // summary:
+ // Calculate the geometry of the chart based on the defined axes of
+ // a chart.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(this.dirty){
+ return this.fullGeometry();
+ }
+
+ // calculate geometry
+ var dirty = dojo.filter(this.stack, function(plot){
+ return plot.dirty ||
+ (plot.hAxis && this.axes[plot.hAxis].dirty) ||
+ (plot.vAxis && this.axes[plot.vAxis].dirty);
+ }, this);
+ calculateAxes(dirty, this.plotArea);
+
+ return this; // dojox.charting.Chart
+ },
+ fullGeometry: function(){
+ // summary:
+ // Calculate the full geometry of the chart. This includes passing
+ // over all major elements of a chart (plots, axes, series, container)
+ // in order to ensure proper rendering.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ this._makeDirty();
+
+ // clear old values
+ dojo.forEach(this.stack, clear);
+
+ // rebuild new connections, and add defaults
+
+ // set up a theme
+ if(!this.theme){
+ this.setTheme(new dojox.charting.Theme(dojox.charting._def));
+ }
+
+ // assign series
+ dojo.forEach(this.series, function(run){
+ if(!(run.plot in this.plots)){
+ if(!dc.plot2d || !dc.plot2d.Default){
+ throw Error("Can't find plot: Default - didn't you forget to dojo" + ".require() it?");
+ }
+ var plot = new dc.plot2d.Default(this, {});
+ plot.name = run.plot;
+ this.plots[run.plot] = this.stack.length;
+ this.stack.push(plot);
+ }
+ this.stack[this.plots[run.plot]].addSeries(run);
+ }, this);
+ // assign axes
+ dojo.forEach(this.stack, function(plot){
+ if(plot.hAxis){
+ plot.setAxis(this.axes[plot.hAxis]);
+ }
+ if(plot.vAxis){
+ plot.setAxis(this.axes[plot.vAxis]);
+ }
+ }, this);
+
+ // calculate geometry
+
+ // 1st pass
+ var dim = this.dim = this.surface.getDimensions();
+ dim.width = g.normalizedLength(dim.width);
+ dim.height = g.normalizedLength(dim.height);
+ df.forIn(this.axes, clear);
+ calculateAxes(this.stack, dim);
+
+ // assumption: we don't have stacked axes yet
+ var offsets = this.offsets = { l: 0, r: 0, t: 0, b: 0 };
+ df.forIn(this.axes, function(axis){
+ df.forIn(axis.getOffsets(), function(o, i){ offsets[i] += o; });
+ });
+ // add title area
+ if(this.title){
+ this.titleGap = (this.titleGap==0) ? 0 : this.titleGap || this.theme.chart.titleGap || 20;
+ this.titlePos = this.titlePos || this.theme.chart.titlePos || "top";
+ this.titleFont = this.titleFont || this.theme.chart.titleFont;
+ this.titleFontColor = this.titleFontColor || this.theme.chart.titleFontColor || "black";
+ var tsize = g.normalizedLength(g.splitFontString(this.titleFont).size);
+ offsets[this.titlePos=="top" ? "t":"b"] += (tsize + this.titleGap);
+ }
+ // add margins
+ df.forIn(this.margins, function(o, i){ offsets[i] += o; });
+
+ // 2nd pass with realistic dimensions
+ this.plotArea = {
+ width: dim.width - offsets.l - offsets.r,
+ height: dim.height - offsets.t - offsets.b
+ };
+ df.forIn(this.axes, clear);
+ calculateAxes(this.stack, this.plotArea);
+
+ return this; // dojox.charting.Chart
+ },
+ render: function(){
+ // summary:
+ // Render the chart according to the current information defined. This should
+ // be the last call made when defining/creating a chart, or if data within the
+ // chart has been changed.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(this.theme){
+ this.theme.clear();
+ }
+
+ if(this.dirty){
+ return this.fullRender();
+ }
+
+ this.calculateGeometry();
+
+ // go over the stack backwards
+ df.forEachRev(this.stack, function(plot){ plot.render(this.dim, this.offsets); }, this);
+
+ // go over axes
+ df.forIn(this.axes, function(axis){ axis.render(this.dim, this.offsets); }, this);
+
+ this._makeClean();
+
+ // BEGIN FOR HTML CANVAS
+ if(this.surface.render){ this.surface.render(); };
+ // END FOR HTML CANVAS
+
+ return this; // dojox.charting.Chart
+ },
+ fullRender: function(){
+ // summary:
+ // Force a full rendering of the chart, including full resets on the chart itself.
+ // You should not call this method directly unless absolutely necessary.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+
+ // calculate geometry
+ this.fullGeometry();
+ var offsets = this.offsets, dim = this.dim, rect;
+
+ // get required colors
+ //var requiredColors = df.foldl(this.stack, "z + plot.getRequiredColors()", 0);
+ //this.theme.defineColors({num: requiredColors, cache: false});
+
+ // clear old shapes
+ dojo.forEach(this.series, purge);
+ df.forIn(this.axes, purge);
+ dojo.forEach(this.stack, purge);
+ if(this.chartTitle && this.chartTitle.tagName){
+ // destroy title if it is a DOM node
+ dojo.destroy(this.chartTitle);
+ }
+ this.surface.clear();
+ this.chartTitle = null;
+
+ // generate shapes
+
+ // draw a plot background
+ var t = this.theme,
+ fill = t.plotarea && t.plotarea.fill,
+ stroke = t.plotarea && t.plotarea.stroke,
+ rect = {
+ x: offsets.l - 1, y: offsets.t - 1,
+ width: dim.width - offsets.l - offsets.r + 2,
+ height: dim.height - offsets.t - offsets.b + 2
+ };
+ if(fill){
+ fill = dc.Element.prototype._shapeFill(dc.Element.prototype._plotFill(fill, dim, offsets), rect);
+ this.surface.createRect(rect).setFill(fill);
+ }
+ if(stroke){
+ this.surface.createRect({
+ x: offsets.l, y: offsets.t,
+ width: dim.width - offsets.l - offsets.r + 1,
+ height: dim.height - offsets.t - offsets.b + 1
+ }).setStroke(stroke);
+ }
+
+ // go over the stack backwards
+ df.foldr(this.stack, function(z, plot){ return plot.render(dim, offsets), 0; }, 0);
+
+ // pseudo-clipping: matting
+ fill = this.fill !== undefined ? this.fill : (t.chart && t.chart.fill);
+ stroke = this.stroke !== undefined ? this.stroke : (t.chart && t.chart.stroke);
+
+ // TRT: support for "inherit" as a named value in a theme.
+ if(fill == "inherit"){
+ // find the background color of the nearest ancestor node, and use that explicitly.
+ var node = this.node, fill = new dojo.Color(dojo.style(node, "backgroundColor"));
+ while(fill.a==0 && node!=document.documentElement){
+ fill = new dojo.Color(dojo.style(node, "backgroundColor"));
+ node = node.parentNode;
+ }
+ }
+
+ if(fill){
+ fill = dc.Element.prototype._plotFill(fill, dim, offsets);
+ if(offsets.l){ // left
+ rect = {
+ width: offsets.l,
+ height: dim.height + 1
+ };
+ this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill, rect));
+ }
+ if(offsets.r){ // right
+ rect = {
+ x: dim.width - offsets.r,
+ width: offsets.r + 1,
+ height: dim.height + 2
+ };
+ this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill, rect));
+ }
+ if(offsets.t){ // top
+ rect = {
+ width: dim.width + 1,
+ height: offsets.t
+ };
+ this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill, rect));
+ }
+ if(offsets.b){ // bottom
+ rect = {
+ y: dim.height - offsets.b,
+ width: dim.width + 1,
+ height: offsets.b + 2
+ };
+ this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill, rect));
+ }
+ }
+ if(stroke){
+ this.surface.createRect({
+ width: dim.width - 1,
+ height: dim.height - 1
+ }).setStroke(stroke);
+ }
+
+ //create title: Whether to make chart title as a widget which extends dojox.charting.Element?
+ if(this.title){
+ var forceHtmlLabels = (g.renderer == "canvas"),
+ labelType = forceHtmlLabels || !dojo.isIE && !dojo.isOpera ? "html" : "gfx",
+ tsize = g.normalizedLength(g.splitFontString(this.titleFont).size);
+ this.chartTitle = dc.axis2d.common.createText[labelType](
+ this,
+ this.surface,
+ dim.width/2,
+ this.titlePos=="top" ? tsize + this.margins.t : dim.height - this.margins.b,
+ "middle",
+ this.title,
+ this.titleFont,
+ this.titleFontColor
+ );
+ }
+
+ // go over axes
+ df.forIn(this.axes, function(axis){ axis.render(dim, offsets); });
+
+ this._makeClean();
+
+ // BEGIN FOR HTML CANVAS
+ if(this.surface.render){ this.surface.render(); };
+ // END FOR HTML CANVAS
+
+ return this; // dojox.charting.Chart
+ },
+ delayedRender: function(){
+ // summary:
+ // Delayed render, which is used to collect multiple updates
+ // within a delayInMs time window.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+
+ if(!this._delayedRenderHandle){
+ this._delayedRenderHandle = setTimeout(
+ dojo.hitch(this, function(){
+ clearTimeout(this._delayedRenderHandle);
+ this._delayedRenderHandle = null;
+ this.render();
+ }),
+ this.delayInMs
+ );
+ }
+
+ return this; // dojox.charting.Chart
+ },
+ connectToPlot: function(name, object, method){
+ // summary:
+ // A convenience method to connect a function to a plot.
+ // name: String
+ // The name of the plot as defined by addPlot.
+ // object: Object
+ // The object to be connected.
+ // method: Function
+ // The function to be executed.
+ // returns: Array
+ // A handle to the connection, as defined by dojo.connect (see dojo.connect).
+ return name in this.plots ? this.stack[this.plots[name]].connect(object, method) : null; // Array
+ },
+ fireEvent: function(seriesName, eventName, index){
+ // summary:
+ // Fires a synthetic event for a series item.
+ // seriesName: String:
+ // Series name.
+ // eventName: String:
+ // Event name to simulate: onmouseover, onmouseout, onclick.
+ // index: Number:
+ // Valid data value index for the event.
+ // returns: dojox.charting.Chart
+ // A reference to the current chart for functional chaining.
+ if(seriesName in this.runs){
+ var plotName = this.series[this.runs[seriesName]].plot;
+ if(plotName in this.plots){
+ var plot = this.stack[this.plots[plotName]];
+ if(plot){
+ plot.fireEvent(seriesName, eventName, index);
+ }
+ }
+ }
+ return this; // dojox.charting.Chart
+ },
+ _makeClean: function(){
+ // reset dirty flags
+ dojo.forEach(this.axes, makeClean);
+ dojo.forEach(this.stack, makeClean);
+ dojo.forEach(this.series, makeClean);
+ this.dirty = false;
+ },
+ _makeDirty: function(){
+ // reset dirty flags
+ dojo.forEach(this.axes, makeDirty);
+ dojo.forEach(this.stack, makeDirty);
+ dojo.forEach(this.series, makeDirty);
+ this.dirty = true;
+ },
+ _invalidateDependentPlots: function(plotName, /* Boolean */ verticalAxis){
+ if(plotName in this.plots){
+ var plot = this.stack[this.plots[plotName]], axis,
+ axisName = verticalAxis ? "vAxis" : "hAxis";
+ if(plot[axisName]){
+ axis = this.axes[plot[axisName]];
+ if(axis && axis.dependOnData()){
+ axis.dirty = true;
+ // find all plots and mark them dirty
+ dojo.forEach(this.stack, function(p){
+ if(p[axisName] && p[axisName] == plot[axisName]){
+ p.dirty = true;
+ }
+ });
+ }
+ }else{
+ plot.dirty = true;
+ }
+ }
+ }
+ });
+
+ function hSection(stats){
+ return {min: stats.hmin, max: stats.hmax};
+ }
+
+ function vSection(stats){
+ return {min: stats.vmin, max: stats.vmax};
+ }
+
+ function hReplace(stats, h){
+ stats.hmin = h.min;
+ stats.hmax = h.max;
+ }
+
+ function vReplace(stats, v){
+ stats.vmin = v.min;
+ stats.vmax = v.max;
+ }
+
+ function combineStats(target, source){
+ if(target && source){
+ target.min = Math.min(target.min, source.min);
+ target.max = Math.max(target.max, source.max);
+ }
+ return target || source;
+ }
+
+ function calculateAxes(stack, plotArea){
+ var plots = {}, axes = {};
+ dojo.forEach(stack, function(plot){
+ var stats = plots[plot.name] = plot.getSeriesStats();
+ if(plot.hAxis){
+ axes[plot.hAxis] = combineStats(axes[plot.hAxis], hSection(stats));
+ }
+ if(plot.vAxis){
+ axes[plot.vAxis] = combineStats(axes[plot.vAxis], vSection(stats));
+ }
+ });
+ dojo.forEach(stack, function(plot){
+ var stats = plots[plot.name];
+ if(plot.hAxis){
+ hReplace(stats, axes[plot.hAxis]);
+ }
+ if(plot.vAxis){
+ vReplace(stats, axes[plot.vAxis]);
+ }
+ plot.initializeScalers(plotArea, stats);
+ });
+ }
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.widget.Chart"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.widget.Chart"] = true;
+dojo.provide("dojox.charting.widget.Chart");
+
+
+
+
+
+(function(){
+ var collectParams, collectAxisParams, collectPlotParams,
+ collectActionParams, collectDataParams,
+ notNull = function(o){ return o; },
+ df = dojox.lang.functional,
+ du = dojox.lang.utils,
+ dc = dojox.charting,
+ d = dojo;
+
+ dojo.declare("dojox.charting.widget.Chart", dijit._Widget, {
+ // parameters for the markup
+
+ // theme for the chart
+ theme: null,
+
+ // margins for the chart: {l: 10, r: 10, t: 10, b: 10}
+ margins: null,
+
+ // chart area
+ stroke: null,
+ fill: null,
+
+ // methods
+
+ buildRendering: function(){
+ var n = this.domNode = this.srcNodeRef;
+
+ // collect chart parameters
+ var axes = d.query("> .axis", n).map(collectAxisParams).filter(notNull),
+ plots = d.query("> .plot", n).map(collectPlotParams).filter(notNull),
+ actions = d.query("> .action", n).map(collectActionParams).filter(notNull),
+ series = d.query("> .series", n).map(collectDataParams).filter(notNull);
+
+ // build the chart
+ n.innerHTML = "";
+ var c = this.chart = new dc.Chart(n, {
+ margins: this.margins,
+ stroke: this.stroke,
+ fill: this.fill
+ });
+
+ // add collected parameters
+ if(this.theme){
+ c.setTheme(this.theme);
+ }
+ axes.forEach(function(axis){
+ c.addAxis(axis.name, axis.kwArgs);
+ });
+ plots.forEach(function(plot){
+ c.addPlot(plot.name, plot.kwArgs);
+ });
+
+ this.actions = actions.map(function(action){
+ return new action.action(c, action.plot, action.kwArgs)
+ });
+
+ var render = df.foldl(series, function(render, series){
+ if(series.type == "data"){
+ c.addSeries(series.name, series.data, series.kwArgs);
+ render = true;
+ }else{
+ c.addSeries(series.name, [0], series.kwArgs);
+ var kw = {};
+ du.updateWithPattern(
+ kw,
+ series.kwArgs,
+ {
+ "query": "",
+ "queryOptions": null,
+ "start": 0,
+ "count": 1 //,
+ // "sort": []
+ },
+ true
+ );
+ if(series.kwArgs.sort){
+ // sort is a complex object type and doesn't survive coercian
+ kw.sort = dojo.clone(series.kwArgs.sort);
+ }
+ d.mixin(kw, {
+ onComplete: function(data){
+ var values;
+ if("valueFn" in series.kwArgs){
+ var fn = series.kwArgs.valueFn;
+ values = d.map(data, function(x){
+ return fn(series.data.getValue(x, series.field, 0));
+ });
+ }else{
+ values = d.map(data, function(x){
+ return series.data.getValue(x, series.field, 0);
+ });
+ }
+ c.addSeries(series.name, values, series.kwArgs).render();
+ }
+ });
+ series.data.fetch(kw);
+ }
+ return render;
+ }, false);
+ if(render){ c.render(); }
+ },
+ destroy: function(){
+ // summary: properly destroy the widget
+ this.chart.destroy();
+ this.inherited(arguments);
+ },
+ resize: function(box){
+ // summary:
+ // Resize the widget.
+ // description:
+ // Resize the domNode and the widget surface to the dimensions of a box of the following form:
+ // `{ l: 50, t: 200, w: 300: h: 150 }`
+ // If no box is provided, resize the surface to the marginBox of the domNode.
+ // box:
+ // If passed, denotes the new size of the widget.
+ this.chart.resize(box);
+ }
+ });
+
+ collectParams = function(node, type, kw){
+ var dp = eval("(" + type + ".prototype.defaultParams)");
+ var x, attr;
+ for(x in dp){
+ if(x in kw){ continue; }
+ attr = node.getAttribute(x);
+ kw[x] = du.coerceType(dp[x], attr == null || typeof attr == "undefined" ? dp[x] : attr);
+ }
+ var op = eval("(" + type + ".prototype.optionalParams)");
+ for(x in op){
+ if(x in kw){ continue; }
+ attr = node.getAttribute(x);
+ if(attr != null){
+ kw[x] = du.coerceType(op[x], attr);
+ }
+ }
+ };
+
+ collectAxisParams = function(node){
+ var name = node.getAttribute("name"), type = node.getAttribute("type");
+ if(!name){ return null; }
+ var o = {name: name, kwArgs: {}}, kw = o.kwArgs;
+ if(type){
+ if(dc.axis2d[type]){
+ type = dojox._scopeName + ".charting.axis2d." + type;
+ }
+ var axis = eval("(" + type + ")");
+ if(axis){ kw.type = axis; }
+ }else{
+ type = dojox._scopeName + ".charting.axis2d.Default";
+ }
+ collectParams(node, type, kw);
+ // compatibility conversions
+ if(kw.font || kw.fontColor){
+ if(!kw.tick){
+ kw.tick = {};
+ }
+ if(kw.font){
+ kw.tick.font = kw.font;
+ }
+ if(kw.fontColor){
+ kw.tick.fontColor = kw.fontColor;
+ }
+ }
+ return o;
+ };
+
+ collectPlotParams = function(node){
+ // var name = d.attr(node, "name"), type = d.attr(node, "type");
+ var name = node.getAttribute("name"), type = node.getAttribute("type");
+ if(!name){ return null; }
+ var o = {name: name, kwArgs: {}}, kw = o.kwArgs;
+ if(type){
+ if(dc.plot2d && dc.plot2d[type]){
+ type = dojox._scopeName + ".charting.plot2d." + type;
+ }
+ var plot = eval("(" + type + ")");
+ if(plot){ kw.type = plot; }
+ }else{
+ type = dojox._scopeName + ".charting.plot2d.Default";
+ }
+ collectParams(node, type, kw);
+ return o;
+ };
+
+ collectActionParams = function(node){
+ // var plot = d.attr(node, "plot"), type = d.attr(node, "type");
+ var plot = node.getAttribute("plot"), type = node.getAttribute("type");
+ if(!plot){ plot = "default"; }
+ var o = {plot: plot, kwArgs: {}}, kw = o.kwArgs;
+ if(type){
+ if(dc.action2d[type]){
+ type = dojox._scopeName + ".charting.action2d." + type;
+ }
+ var action = eval("(" + type + ")");
+ if(!action){ return null; }
+ o.action = action;
+ }else{
+ return null;
+ }
+ collectParams(node, type, kw);
+ return o;
+ };
+
+ collectDataParams = function(node){
+ var ga = d.partial(d.attr, node);
+ var name = ga("name");
+ if(!name){ return null; }
+ var o = { name: name, kwArgs: {} }, kw = o.kwArgs, t;
+ t = ga("plot");
+ if(t != null){ kw.plot = t; }
+ t = ga("marker");
+ if(t != null){ kw.marker = t; }
+ t = ga("stroke");
+ if(t != null){ kw.stroke = eval("(" + t + ")"); }
+ t = ga("outline");
+ if(t != null){ kw.outline = eval("(" + t + ")"); }
+ t = ga("shadow");
+ if(t != null){ kw.shadow = eval("(" + t + ")"); }
+ t = ga("fill");
+ if(t != null){ kw.fill = eval("(" + t + ")"); }
+ t = ga("font");
+ if(t != null){ kw.font = t; }
+ t = ga("fontColor");
+ if(t != null){ kw.fontColor = eval("(" + t + ")"); }
+ t = ga("legend");
+ if(t != null){ kw.legend = t; }
+ t = ga("data");
+ if(t != null){
+ o.type = "data";
+ o.data = t ? dojo.map(String(t).split(','), Number) : [];
+ return o;
+ }
+ t = ga("array");
+ if(t != null){
+ o.type = "data";
+ o.data = eval("(" + t + ")");
+ return o;
+ }
+ t = ga("store");
+ if(t != null){
+ o.type = "store";
+ o.data = eval("(" + t + ")");
+ t = ga("field");
+ o.field = t != null ? t : "value";
+ t = ga("query");
+ if(!!t){ kw.query = t; }
+ t = ga("queryOptions");
+ if(!!t){ kw.queryOptions = eval("(" + t + ")"); }
+ t = ga("start");
+ if(!!t){ kw.start = Number(t); }
+ t = ga("count");
+ if(!!t){ kw.count = Number(t); }
+ t = ga("sort");
+ if(!!t){ kw.sort = eval("("+t+")"); }
+ t = ga("valueFn");
+ if(!!t){ kw.valueFn = df.lambda(t); }
+ return o;
+ }
+ return null;
+ };
+})();
+
+}
+
+if(!dojo._hasResource["dojo.fx.easing"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.easing"] = true;
+dojo.provide("dojo.fx.easing");
+
+
+dojo.getObject("fx.easing", true, dojo);
+
+dojo.fx.easing = {
+ // summary:
+ // Collection of easing functions to use beyond the default
+ // `dojo._defaultEasing` function.
+ //
+ // description:
+ //
+ // Easing functions are used to manipulate the iteration through
+ // an `dojo.Animation`s _Line. _Line being the properties of an Animation,
+ // and the easing function progresses through that Line determing
+ // how quickly (or slowly) it should go. Or more accurately: modify
+ // the value of the _Line based on the percentage of animation completed.
+ //
+ // All functions follow a simple naming convention of "ease type" + "when".
+ // If the name of the function ends in Out, the easing described appears
+ // towards the end of the animation. "In" means during the beginning,
+ // and InOut means both ranges of the Animation will applied, both
+ // beginning and end.
+ //
+ // One does not call the easing function directly, it must be passed to
+ // the `easing` property of an animation.
+ //
+ // example:
+ // |
+ // | var anim = dojo.fadeOut({
+ // | node: 'node',
+ // | duration: 2000,
+ // | // note there is no ()
+ // | easing: dojo.fx.easing.quadIn
+ // | }).play();
+ //
+
+ linear: function(/* Decimal? */n){
+ // summary: A linear easing function
+ return n;
+ },
+
+ quadIn: function(/* Decimal? */n){
+ return Math.pow(n, 2);
+ },
+
+ quadOut: function(/* Decimal? */n){
+ return n * (n - 2) * -1;
+ },
+
+ quadInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 2) / 2; }
+ return -1 * ((--n) * (n - 2) - 1) / 2;
+ },
+
+ cubicIn: function(/* Decimal? */n){
+ return Math.pow(n, 3);
+ },
+
+ cubicOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 3) + 1;
+ },
+
+ cubicInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 3) / 2; }
+ n -= 2;
+ return (Math.pow(n, 3) + 2) / 2;
+ },
+
+ quartIn: function(/* Decimal? */n){
+ return Math.pow(n, 4);
+ },
+
+ quartOut: function(/* Decimal? */n){
+ return -1 * (Math.pow(n - 1, 4) - 1);
+ },
+
+ quartInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 4) / 2; }
+ n -= 2;
+ return -1 / 2 * (Math.pow(n, 4) - 2);
+ },
+
+ quintIn: function(/* Decimal? */n){
+ return Math.pow(n, 5);
+ },
+
+ quintOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 5) + 1;
+ },
+
+ quintInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 5) / 2; };
+ n -= 2;
+ return (Math.pow(n, 5) + 2) / 2;
+ },
+
+ sineIn: function(/* Decimal? */n){
+ return -1 * Math.cos(n * (Math.PI / 2)) + 1;
+ },
+
+ sineOut: function(/* Decimal? */n){
+ return Math.sin(n * (Math.PI / 2));
+ },
+
+ sineInOut: function(/* Decimal? */n){
+ return -1 * (Math.cos(Math.PI * n) - 1) / 2;
+ },
+
+ expoIn: function(/* Decimal? */n){
+ return (n == 0) ? 0 : Math.pow(2, 10 * (n - 1));
+ },
+
+ expoOut: function(/* Decimal? */n){
+ return (n == 1) ? 1 : (-1 * Math.pow(2, -10 * n) + 1);
+ },
+
+ expoInOut: function(/* Decimal? */n){
+ if(n == 0){ return 0; }
+ if(n == 1){ return 1; }
+ n = n * 2;
+ if(n < 1){ return Math.pow(2, 10 * (n - 1)) / 2; }
+ --n;
+ return (-1 * Math.pow(2, -10 * n) + 2) / 2;
+ },
+
+ circIn: function(/* Decimal? */n){
+ return -1 * (Math.sqrt(1 - Math.pow(n, 2)) - 1);
+ },
+
+ circOut: function(/* Decimal? */n){
+ n = n - 1;
+ return Math.sqrt(1 - Math.pow(n, 2));
+ },
+
+ circInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return -1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) - 1); }
+ n -= 2;
+ return 1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) + 1);
+ },
+
+ backIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that starts away from the target,
+ // and quickly accelerates towards the end value.
+ //
+ // Use caution when the easing will cause values to become
+ // negative as some properties cannot be set to negative values.
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n - s);
+ },
+
+ backOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // description:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // Use caution when the easing will cause values to become negative as some
+ // properties cannot be set to negative values.
+
+ n = n - 1;
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n + s) + 1;
+ },
+
+ backInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function combining the effects of `backIn` and `backOut`
+ //
+ // description:
+ // An easing function combining the effects of `backIn` and `backOut`.
+ // Use caution when the easing will cause values to become negative
+ // as some properties cannot be set to negative values.
+ var s = 1.70158 * 1.525;
+ n = n * 2;
+ if(n < 1){ return (Math.pow(n, 2) * ((s + 1) * n - s)) / 2; }
+ n-=2;
+ return (Math.pow(n, 2) * ((s + 1) * n + s) + 2) / 2;
+ },
+
+ elasticIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function the elastically snaps from the start value
+ //
+ // description:
+ // An easing function the elastically snaps from the start value
+ //
+ // Use caution when the elasticity will cause values to become negative
+ // as some properties cannot be set to negative values.
+ if(n == 0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ n = n - 1;
+ return -1 * Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p);
+ },
+
+ elasticOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // description:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n==0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ return Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p) + 1;
+ },
+
+ elasticInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // description:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n == 0) return 0;
+ n = n * 2;
+ if(n == 2) return 1;
+ var p = .3 * 1.5;
+ var s = p / 4;
+ if(n < 1){
+ n -= 1;
+ return -.5 * (Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p));
+ }
+ n -= 1;
+ return .5 * (Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p)) + 1;
+ },
+
+ bounceIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the beginning of an Animation
+ return (1 - dojo.fx.easing.bounceOut(1 - n)); // Decimal
+ },
+
+ bounceOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the end of an Animation
+ var s = 7.5625;
+ var p = 2.75;
+ var l;
+ if(n < (1 / p)){
+ l = s * Math.pow(n, 2);
+ }else if(n < (2 / p)){
+ n -= (1.5 / p);
+ l = s * Math.pow(n, 2) + .75;
+ }else if(n < (2.5 / p)){
+ n -= (2.25 / p);
+ l = s * Math.pow(n, 2) + .9375;
+ }else{
+ n -= (2.625 / p);
+ l = s * Math.pow(n, 2) + .984375;
+ }
+ return l;
+ },
+
+ bounceInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' at the beginning and end of the Animation
+ if(n < 0.5){ return dojo.fx.easing.bounceIn(n * 2) / 2; }
+ return (dojo.fx.easing.bounceOut(n * 2 - 1) / 2) + 0.5; // Decimal
+ }
+};
+
+}
+
+if(!dojo._hasResource["dojox.gfx.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.gfx.fx"] = true;
+dojo.provide("dojox.gfx.fx");
+
+
+
+(function(){
+ var d = dojo, g = dojox.gfx, m = g.matrix;
+
+ // Generic interpolators. Should they be moved to dojox.fx?
+
+ function InterpolNumber(start, end){
+ this.start = start, this.end = end;
+ }
+ InterpolNumber.prototype.getValue = function(r){
+ return (this.end - this.start) * r + this.start;
+ };
+
+ function InterpolUnit(start, end, units){
+ this.start = start, this.end = end;
+ this.units = units;
+ }
+ InterpolUnit.prototype.getValue = function(r){
+ return (this.end - this.start) * r + this.start + this.units;
+ };
+
+ function InterpolColor(start, end){
+ this.start = start, this.end = end;
+ this.temp = new dojo.Color();
+ }
+ InterpolColor.prototype.getValue = function(r){
+ return d.blendColors(this.start, this.end, r, this.temp);
+ };
+
+ function InterpolValues(values){
+ this.values = values;
+ this.length = values.length;
+ }
+ InterpolValues.prototype.getValue = function(r){
+ return this.values[Math.min(Math.floor(r * this.length), this.length - 1)];
+ };
+
+ function InterpolObject(values, def){
+ this.values = values;
+ this.def = def ? def : {};
+ }
+ InterpolObject.prototype.getValue = function(r){
+ var ret = dojo.clone(this.def);
+ for(var i in this.values){
+ ret[i] = this.values[i].getValue(r);
+ }
+ return ret;
+ };
+
+ function InterpolTransform(stack, original){
+ this.stack = stack;
+ this.original = original;
+ }
+ InterpolTransform.prototype.getValue = function(r){
+ var ret = [];
+ dojo.forEach(this.stack, function(t){
+ if(t instanceof m.Matrix2D){
+ ret.push(t);
+ return;
+ }
+ if(t.name == "original" && this.original){
+ ret.push(this.original);
+ return;
+ }
+ if(!(t.name in m)){ return; }
+ var f = m[t.name];
+ if(typeof f != "function"){
+ // constant
+ ret.push(f);
+ return;
+ }
+ var val = dojo.map(t.start, function(v, i){
+ return (t.end[i] - v) * r + v;
+ }),
+ matrix = f.apply(m, val);
+ if(matrix instanceof m.Matrix2D){
+ ret.push(matrix);
+ }
+ }, this);
+ return ret;
+ };
+
+ var transparent = new d.Color(0, 0, 0, 0);
+
+ function getColorInterpol(prop, obj, name, def){
+ if(prop.values){
+ return new InterpolValues(prop.values);
+ }
+ var value, start, end;
+ if(prop.start){
+ start = g.normalizeColor(prop.start);
+ }else{
+ start = value = obj ? (name ? obj[name] : obj) : def;
+ }
+ if(prop.end){
+ end = g.normalizeColor(prop.end);
+ }else{
+ if(!value){
+ value = obj ? (name ? obj[name] : obj) : def;
+ }
+ end = value;
+ }
+ return new InterpolColor(start, end);
+ }
+
+ function getNumberInterpol(prop, obj, name, def){
+ if(prop.values){
+ return new InterpolValues(prop.values);
+ }
+ var value, start, end;
+ if(prop.start){
+ start = prop.start;
+ }else{
+ start = value = obj ? obj[name] : def;
+ }
+ if(prop.end){
+ end = prop.end;
+ }else{
+ if(typeof value != "number"){
+ value = obj ? obj[name] : def;
+ }
+ end = value;
+ }
+ return new InterpolNumber(start, end);
+ }
+
+ g.fx.animateStroke = function(/*Object*/ args){
+ // summary:
+ // Returns an animation which will change stroke properties over time
+ // example:
+ // | dojox.gfx.fx.animateStroke{{
+ // | shape: shape,
+ // | duration: 500,
+ // | color: {start: "red", end: "green"},
+ // | width: {end: 15},
+ // | join: {values: ["miter", "bevel", "round"]}
+ // | }).play();
+ if(!args.easing){ args.easing = d._defaultEasing; }
+ var anim = new d.Animation(args), shape = args.shape, stroke;
+ d.connect(anim, "beforeBegin", anim, function(){
+ stroke = shape.getStroke();
+ var prop = args.color, values = {}, value, start, end;
+ if(prop){
+ values.color = getColorInterpol(prop, stroke, "color", transparent);
+ }
+ prop = args.style;
+ if(prop && prop.values){
+ values.style = new InterpolValues(prop.values);
+ }
+ prop = args.width;
+ if(prop){
+ values.width = getNumberInterpol(prop, stroke, "width", 1);
+ }
+ prop = args.cap;
+ if(prop && prop.values){
+ values.cap = new InterpolValues(prop.values);
+ }
+ prop = args.join;
+ if(prop){
+ if(prop.values){
+ values.join = new InterpolValues(prop.values);
+ }else{
+ start = prop.start ? prop.start : (stroke && stroke.join || 0);
+ end = prop.end ? prop.end : (stroke && stroke.join || 0);
+ if(typeof start == "number" && typeof end == "number"){
+ values.join = new InterpolNumber(start, end);
+ }
+ }
+ }
+ this.curve = new InterpolObject(values, stroke);
+ });
+ d.connect(anim, "onAnimate", shape, "setStroke");
+ return anim; // dojo.Animation
+ };
+
+ g.fx.animateFill = function(/*Object*/ args){
+ // summary:
+ // Returns an animation which will change fill color over time.
+ // Only solid fill color is supported at the moment
+ // example:
+ // | dojox.gfx.fx.animateFill{{
+ // | shape: shape,
+ // | duration: 500,
+ // | color: {start: "red", end: "green"}
+ // | }).play();
+ if(!args.easing){ args.easing = d._defaultEasing; }
+ var anim = new d.Animation(args), shape = args.shape, fill;
+ d.connect(anim, "beforeBegin", anim, function(){
+ fill = shape.getFill();
+ var prop = args.color, values = {};
+ if(prop){
+ this.curve = getColorInterpol(prop, fill, "", transparent);
+ }
+ });
+ d.connect(anim, "onAnimate", shape, "setFill");
+ return anim; // dojo.Animation
+ };
+
+ g.fx.animateFont = function(/*Object*/ args){
+ // summary:
+ // Returns an animation which will change font properties over time
+ // example:
+ // | dojox.gfx.fx.animateFont{{
+ // | shape: shape,
+ // | duration: 500,
+ // | variant: {values: ["normal", "small-caps"]},
+ // | size: {end: 10, units: "pt"}
+ // | }).play();
+ if(!args.easing){ args.easing = d._defaultEasing; }
+ var anim = new d.Animation(args), shape = args.shape, font;
+ d.connect(anim, "beforeBegin", anim, function(){
+ font = shape.getFont();
+ var prop = args.style, values = {}, value, start, end;
+ if(prop && prop.values){
+ values.style = new InterpolValues(prop.values);
+ }
+ prop = args.variant;
+ if(prop && prop.values){
+ values.variant = new InterpolValues(prop.values);
+ }
+ prop = args.weight;
+ if(prop && prop.values){
+ values.weight = new InterpolValues(prop.values);
+ }
+ prop = args.family;
+ if(prop && prop.values){
+ values.family = new InterpolValues(prop.values);
+ }
+ prop = args.size;
+ if(prop && prop.units){
+ start = parseFloat(prop.start ? prop.start : (shape.font && shape.font.size || "0"));
+ end = parseFloat(prop.end ? prop.end : (shape.font && shape.font.size || "0"));
+ values.size = new InterpolUnit(start, end, prop.units);
+ }
+ this.curve = new InterpolObject(values, font);
+ });
+ d.connect(anim, "onAnimate", shape, "setFont");
+ return anim; // dojo.Animation
+ };
+
+ g.fx.animateTransform = function(/*Object*/ args){
+ // summary:
+ // Returns an animation which will change transformation over time
+ // example:
+ // | dojox.gfx.fx.animateTransform{{
+ // | shape: shape,
+ // | duration: 500,
+ // | transform: [
+ // | {name: "translate", start: [0, 0], end: [200, 200]},
+ // | {name: "original"}
+ // | ]
+ // | }).play();
+ if(!args.easing){ args.easing = d._defaultEasing; }
+ var anim = new d.Animation(args), shape = args.shape, original;
+ d.connect(anim, "beforeBegin", anim, function(){
+ original = shape.getTransform();
+ this.curve = new InterpolTransform(args.transform, original);
+ });
+ d.connect(anim, "onAnimate", shape, "setTransform");
+ return anim; // dojo.Animation
+ };
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Base"] = true;
+dojo.provide("dojox.charting.action2d.Base");
+
+
+
+
+
+/*=====
+dojox.charting.action2d.__BaseCtorArgs = function(duration, easing){
+ // summary:
+ // The base keyword arguments object for creating an action2d.
+ // duration: Number?
+ // The amount of time in milliseconds for an animation to last. Default is 400.
+ // easing: dojo.fx.easing.*?
+ // An easing object (see dojo.fx.easing) for use in an animation. The
+ // default is dojo.fx.easing.backOut.
+ this.duration = duration;
+ this.easing = easing;
+}
+=====*/
+(function(){
+ var DEFAULT_DURATION = 400, // ms
+ DEFAULT_EASING = dojo.fx.easing.backOut,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.Base", null, {
+
+ overOutEvents: {onmouseover: 1, onmouseout: 1},
+
+ constructor: function(chart, plot, kwargs){
+ // summary:
+ // Create a new base Action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action applies to.
+ // plot: String?
+ // The name of the plot this action belongs to. If none is passed "default" is assumed.
+ // kwargs: dojox.charting.action2d.__BaseCtorArgs?
+ // Optional arguments for the action.
+ this.chart = chart;
+ this.plot = plot || "default";
+ this.anim = {};
+
+ // process common optional named parameters
+ if(!kwargs){ kwargs = {}; }
+ this.duration = kwargs.duration ? kwargs.duration : DEFAULT_DURATION;
+ this.easing = kwargs.easing ? kwargs.easing : DEFAULT_EASING;
+ },
+
+ connect: function(){
+ // summary:
+ // Connect this action to the given plot.
+ this.handle = this.chart.connectToPlot(this.plot, this, "process");
+ },
+
+ disconnect: function(){
+ // summary:
+ // Disconnect this action from the given plot, if connected.
+ if(this.handle){
+ dojo.disconnect(this.handle);
+ this.handle = null;
+ }
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the action.
+ },
+
+ destroy: function(){
+ // summary:
+ // Do any cleanup needed when destroying parent elements.
+ this.disconnect();
+ df.forIn(this.anim, function(o){
+ df.forIn(o, function(anim){
+ anim.action.stop(true);
+ });
+ });
+ this.anim = {};
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.Highlight"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Highlight"] = true;
+dojo.provide("dojox.charting.action2d.Highlight");
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.action2d.__HighlightCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // highlight: String|dojo.Color|Function?
+ // Either a color or a function that creates a color when highlighting happens.
+ highlight: null
+});
+=====*/
+(function(){
+ var DEFAULT_SATURATION = 100, // %
+ DEFAULT_LUMINOSITY1 = 75, // %
+ DEFAULT_LUMINOSITY2 = 50, // %
+
+ c = dojox.color,
+
+ cc = function(color){
+ return function(){ return color; };
+ },
+
+ hl = function(color){
+ var a = new c.Color(color),
+ x = a.toHsl();
+ if(x.s == 0){
+ x.l = x.l < 50 ? 100 : 0;
+ }else{
+ x.s = DEFAULT_SATURATION;
+ if(x.l < DEFAULT_LUMINOSITY2){
+ x.l = DEFAULT_LUMINOSITY1;
+ }else if(x.l > DEFAULT_LUMINOSITY1){
+ x.l = DEFAULT_LUMINOSITY2;
+ }else{
+ x.l = x.l - DEFAULT_LUMINOSITY2 > DEFAULT_LUMINOSITY1 - x.l ?
+ DEFAULT_LUMINOSITY2 : DEFAULT_LUMINOSITY1;
+ }
+ }
+ return c.fromHsl(x);
+ };
+
+ dojo.declare("dojox.charting.action2d.Highlight", dojox.charting.action2d.Base, {
+ // summary:
+ // Creates a highlighting action on a plot, where an element on that plot
+ // has a highlight on it.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut // easing for the action
+ },
+ optionalParams: {
+ highlight: "red" // name for the highlight color
+ // programmatic instantiation can use functions and color objects
+ },
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the highlighting action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__HighlightCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ var a = kwArgs && kwArgs.highlight;
+ this.colorFun = a ? (dojo.isFunction(a) ? a : cc(a)) : hl;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, anim, startFill, endFill;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ var color = o.shape.getFill();
+ if(!color || !(color instanceof dojo.Color)){
+ return;
+ }
+ this.anim[runName][index] = anim = {
+ start: color,
+ end: this.colorFun(color)
+ };
+ }
+
+ var start = anim.start, end = anim.end;
+ if(o.type == "onmouseout"){
+ // swap colors
+ var t = start;
+ start = end;
+ end = t;
+ }
+
+ anim.action = dojox.gfx.fx.animateFill({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ color: {start: start, end: end}
+ });
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.Magnify"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Magnify"] = true;
+dojo.provide("dojox.charting.action2d.Magnify");
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MagnifyCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to magnify the given object to. Default is 2.
+ scale: 2
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 2,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Magnify", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action that magnifies the object the action is applied to.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE // scale of magnification
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the magnifying action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot to apply the action to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MagnifyCtorArgs?
+ // Optional keyword arguments for this action.
+
+ // process optional named parameters
+ this.scale = kwArgs && typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the magnifying action.
+ if(!o.shape || !(o.type in this.overOutEvents) ||
+ !("cx" in o) || !("cy" in o)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim, init, scale;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ init = m.identity;
+ scale = this.scale;
+ }else{
+ init = m.scaleAt(this.scale, o.cx, o.cy);
+ scale = 1 / this.scale;
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "scaleAt", start: [1, o.cx, o.cy], end: [scale, o.cx, o.cy]},
+ init
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.scan"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.scan"] = true;
+dojo.provide("dojox.lang.functional.scan");
+
+
+
+// This module adds high-level functions and related constructs:
+// - "scan" family of functions
+
+// Notes:
+// - missing high-level functions are provided with the compatible API:
+// scanl, scanl1, scanr, scanr1
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+// - operate on dense arrays
+// - take a string as the array argument
+// - take an iterator objects as the array argument (only scanl, and scanl1)
+
+(function(){
+ var d = dojo, df = dojox.lang.functional, empty = {};
+
+ d.mixin(df, {
+ // classic reduce-class functions
+ scanl: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right using a seed value as a starting point; returns an array
+ // of values produced by foldl() at that point.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var t, n, i;
+ if(d.isArray(a)){
+ // array
+ t = new Array((n = a.length) + 1);
+ t[0] = z;
+ for(i = 0; i < n; z = f.call(o, z, a[i], i, a), t[++i] = z);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ t = [z];
+ for(i = 0; a.hasNext(); t.push(z = f.call(o, z, a.next(), i++, a)));
+ }else{
+ // object/dictionary
+ t = [z];
+ for(i in a){
+ if(!(i in empty)){
+ t.push(z = f.call(o, z, a[i], i, a));
+ }
+ }
+ }
+ return t; // Array
+ },
+ scanl1: function(/*Array|String|Object*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns an array of values produced by foldl1() at that
+ // point.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var t, n, z, first = true;
+ if(d.isArray(a)){
+ // array
+ t = new Array(n = a.length);
+ t[0] = z = a[0];
+ for(var i = 1; i < n; t[i] = z = f.call(o, z, a[i], i, a), ++i);
+ }else if(typeof a.hasNext == "function" && typeof a.next == "function"){
+ // iterator
+ if(a.hasNext()){
+ t = [z = a.next()];
+ for(var i = 1; a.hasNext(); t.push(z = f.call(o, z, a.next(), i++, a)));
+ }
+ }else{
+ // object/dictionary
+ for(var i in a){
+ if(!(i in empty)){
+ if(first){
+ t = [z = a[i]];
+ first = false;
+ }else{
+ t.push(z = f.call(o, z, a[i], i, a));
+ }
+ }
+ }
+ }
+ return t; // Array
+ },
+ scanr: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from right
+ // to left using a seed value as a starting point; returns an array
+ // of values produced by foldr() at that point.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var n = a.length, t = new Array(n + 1), i = n;
+ t[n] = z;
+ for(; i > 0; --i, z = f.call(o, z, a[i], i, a), t[i] = z);
+ return t; // Array
+ },
+ scanr1: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from right
+ // to left; returns an array of values produced by foldr1() at that
+ // point.
+ if(typeof a == "string"){ a = a.split(""); }
+ o = o || d.global; f = df.lambda(f);
+ var n = a.length, t = new Array(n), z = a[n - 1], i = n - 1;
+ t[i] = z;
+ for(; i > 0; --i, z = f.call(o, z, a[i], i, a), t[i] = z);
+ return t; // Array
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.MoveSlice"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.MoveSlice"] = true;
+dojo.provide("dojox.charting.action2d.MoveSlice");
+
+
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MoveSliceCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to scale the pie slice. Default is 1.05.
+ scale: 1.05,
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 7.
+ shift: 7
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 1.05,
+ DEFAULT_SHIFT = 7, // px
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.MoveSlice", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action for a pie chart that moves and scales a pie slice.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE, // scale of magnification
+ shift: DEFAULT_SHIFT // shift of the slice
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the slice moving action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MoveSliceCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.scale = typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+ this.shift = typeof kwArgs.shift == "number" ? kwArgs.shift : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || o.element != "slice" || !(o.type in this.overOutEvents)){ return; }
+
+ if(!this.angles){
+ // calculate the running total of slice angles
+ var startAngle = m._degToRad(o.plot.opt.startAngle);
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+
+ var index = o.index, anim, startScale, endScale, startOffset, endOffset,
+ angle = (this.angles[index] + this.angles[index + 1]) / 2,
+ rotateTo0 = m.rotateAt(-angle, o.cx, o.cy),
+ rotateBack = m.rotateAt( angle, o.cx, o.cy);
+
+ anim = this.anim[index];
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ startOffset = 0;
+ endOffset = this.shift;
+ startScale = 1;
+ endScale = this.scale;
+ }else{
+ startOffset = this.shift;
+ endOffset = 0;
+ startScale = this.scale;
+ endScale = 1;
+ }
+
+ anim.action = dojox.gfx.fx.animateTransform({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ rotateBack,
+ {name: "translate", start: [startOffset, 0], end: [endOffset, 0]},
+ {name: "scaleAt", start: [startScale, o.cx, o.cy], end: [endScale, o.cx, o.cy]},
+ rotateTo0
+ ]
+ });
+
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ delete this.anim[index];
+ });
+ }
+ anim.action.play();
+ },
+
+ reset: function(){
+ delete this.angles;
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.Shake"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Shake"] = true;
+dojo.provide("dojox.charting.action2d.Shake");
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.action2d.__ShakeCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 3.
+ shift: 3
+});
+=====*/
+(function(){
+ var DEFAULT_SHIFT = 3,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Shake", dojox.charting.action2d.Base, {
+ // summary:
+ // Create a shaking action for use on an element in a chart.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ shiftX: DEFAULT_SHIFT, // shift of the element along the X axis
+ shiftY: DEFAULT_SHIFT // shift of the element along the Y axis
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the shaking action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__ShakeCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.shiftX = typeof kwArgs.shiftX == "number" ? kwArgs.shiftX : DEFAULT_SHIFT;
+ this.shiftY = typeof kwArgs.shiftY == "number" ? kwArgs.shiftY : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim,
+ shiftX = o.type == "onmouseover" ? this.shiftX : -this.shiftX,
+ shiftY = o.type == "onmouseover" ? this.shiftY : -this.shiftY;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "translate", start: [this.shiftX, this.shiftY], end: [0, 0]},
+ m.identity
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojo.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.string"] = true;
+dojo.provide("dojo.string");
+
+
+dojo.getObject("string", true, dojo);
+
+/*=====
+dojo.string = {
+ // summary: String utilities for Dojo
+};
+=====*/
+
+dojo.string.rep = function(/*String*/str, /*Integer*/num){
+ // summary:
+ // Efficiently replicate a string `n` times.
+ // str:
+ // the string to replicate
+ // num:
+ // number of times to replicate the string
+
+ if(num <= 0 || !str){ return ""; }
+
+ var buf = [];
+ for(;;){
+ if(num & 1){
+ buf.push(str);
+ }
+ if(!(num >>= 1)){ break; }
+ str += str;
+ }
+ return buf.join(""); // String
+};
+
+dojo.string.pad = function(/*String*/text, /*Integer*/size, /*String?*/ch, /*Boolean?*/end){
+ // summary:
+ // Pad a string to guarantee that it is at least `size` length by
+ // filling with the character `ch` at either the start or end of the
+ // string. Pads at the start, by default.
+ // text:
+ // the string to pad
+ // size:
+ // length to provide padding
+ // ch:
+ // character to pad, defaults to '0'
+ // end:
+ // adds padding at the end if true, otherwise pads at start
+ // example:
+ // | // Fill the string to length 10 with "+" characters on the right. Yields "Dojo++++++".
+ // | dojo.string.pad("Dojo", 10, "+", true);
+
+ if(!ch){
+ ch = '0';
+ }
+ var out = String(text),
+ pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length));
+ return end ? out + pad : pad + out; // String
+};
+
+dojo.string.substitute = function( /*String*/ template,
+ /*Object|Array*/map,
+ /*Function?*/ transform,
+ /*Object?*/ thisObject){
+ // summary:
+ // Performs parameterized substitutions on a string. Throws an
+ // exception if any parameter is unmatched.
+ // template:
+ // a string with expressions in the form `${key}` to be replaced or
+ // `${key:format}` which specifies a format function. keys are case-sensitive.
+ // map:
+ // hash to search for substitutions
+ // transform:
+ // a function to process all parameters before substitution takes
+ // place, e.g. mylib.encodeXML
+ // thisObject:
+ // where to look for optional format function; default to the global
+ // namespace
+ // example:
+ // Substitutes two expressions in a string from an Array or Object
+ // | // returns "File 'foo.html' is not found in directory '/temp'."
+ // | // by providing substitution data in an Array
+ // | dojo.string.substitute(
+ // | "File '${0}' is not found in directory '${1}'.",
+ // | ["foo.html","/temp"]
+ // | );
+ // |
+ // | // also returns "File 'foo.html' is not found in directory '/temp'."
+ // | // but provides substitution data in an Object structure. Dotted
+ // | // notation may be used to traverse the structure.
+ // | dojo.string.substitute(
+ // | "File '${name}' is not found in directory '${info.dir}'.",
+ // | { name: "foo.html", info: { dir: "/temp" } }
+ // | );
+ // example:
+ // Use a transform function to modify the values:
+ // | // returns "file 'foo.html' is not found in directory '/temp'."
+ // | dojo.string.substitute(
+ // | "${0} is not found in ${1}.",
+ // | ["foo.html","/temp"],
+ // | function(str){
+ // | // try to figure out the type
+ // | var prefix = (str.charAt(0) == "/") ? "directory": "file";
+ // | return prefix + " '" + str + "'";
+ // | }
+ // | );
+ // example:
+ // Use a formatter
+ // | // returns "thinger -- howdy"
+ // | dojo.string.substitute(
+ // | "${0:postfix}", ["thinger"], null, {
+ // | postfix: function(value, key){
+ // | return value + " -- howdy";
+ // | }
+ // | }
+ // | );
+
+ thisObject = thisObject || dojo.global;
+ transform = transform ?
+ dojo.hitch(thisObject, transform) : function(v){ return v; };
+
+ return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
+ function(match, key, format){
+ var value = dojo.getObject(key, false, map);
+ if(format){
+ value = dojo.getObject(format, false, thisObject).call(thisObject, value, key);
+ }
+ return transform(value, key).toString();
+ }); // String
+};
+
+/*=====
+dojo.string.trim = function(str){
+ // summary:
+ // Trims whitespace from both sides of the string
+ // str: String
+ // String to be trimmed
+ // returns: String
+ // Returns the trimmed string
+ // description:
+ // This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
+ // The short yet performant version of this function is dojo.trim(),
+ // which is part of Dojo base. Uses String.prototype.trim instead, if available.
+ return ""; // String
+}
+=====*/
+
+dojo.string.trim = String.prototype.trim ?
+ dojo.trim : // aliasing to the native function
+ function(str){
+ str = str.replace(/^\s+/, '');
+ for(var i = str.length - 1; i >= 0; i--){
+ if(/\S/.test(str.charAt(i))){
+ str = str.substring(0, i + 1);
+ break;
+ }
+ }
+ return str;
+ };
+
+}
+
+if(!dojo._hasResource["dojo.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.date.stamp"] = true;
+dojo.provide("dojo.date.stamp");
+
+
+dojo.getObject("date.stamp", true, dojo);
+
+// Methods to convert dates to or from a wire (string) format using well-known conventions
+
+dojo.date.stamp.fromISOString = function(/*String*/formattedString, /*Number?*/defaultTime){
+ // summary:
+ // Returns a Date object given a string formatted according to a subset of the ISO-8601 standard.
+ //
+ // description:
+ // Accepts a string formatted according to a profile of ISO8601 as defined by
+ // [RFC3339](http://www.ietf.org/rfc/rfc3339.txt), except that partial input is allowed.
+ // Can also process dates as specified [by the W3C](http://www.w3.org/TR/NOTE-datetime)
+ // The following combinations are valid:
+ //
+ // * dates only
+ // | * yyyy
+ // | * yyyy-MM
+ // | * yyyy-MM-dd
+ // * times only, with an optional time zone appended
+ // | * THH:mm
+ // | * THH:mm:ss
+ // | * THH:mm:ss.SSS
+ // * and "datetimes" which could be any combination of the above
+ //
+ // timezones may be specified as Z (for UTC) or +/- followed by a time expression HH:mm
+ // Assumes the local time zone if not specified. Does not validate. Improperly formatted
+ // input may return null. Arguments which are out of bounds will be handled
+ // by the Date constructor (e.g. January 32nd typically gets resolved to February 1st)
+ // Only years between 100 and 9999 are supported.
+ //
+ // formattedString:
+ // A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00
+ //
+ // defaultTime:
+ // Used for defaults for fields omitted in the formattedString.
+ // Uses 1970-01-01T00:00:00.0Z by default.
+
+ if(!dojo.date.stamp._isoRegExp){
+ dojo.date.stamp._isoRegExp =
+//TODO: could be more restrictive and check for 00-59, etc.
+ /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
+ }
+
+ var match = dojo.date.stamp._isoRegExp.exec(formattedString),
+ result = null;
+
+ if(match){
+ match.shift();
+ if(match[1]){match[1]--;} // Javascript Date months are 0-based
+ if(match[6]){match[6] *= 1000;} // Javascript Date expects fractional seconds as milliseconds
+
+ if(defaultTime){
+ // mix in defaultTime. Relatively expensive, so use || operators for the fast path of defaultTime === 0
+ defaultTime = new Date(defaultTime);
+ dojo.forEach(dojo.map(["FullYear", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"], function(prop){
+ return defaultTime["get" + prop]();
+ }), function(value, index){
+ match[index] = match[index] || value;
+ });
+ }
+ result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0); //TODO: UTC defaults
+ if(match[0] < 100){
+ result.setFullYear(match[0] || 1970);
+ }
+
+ var offset = 0,
+ zoneSign = match[7] && match[7].charAt(0);
+ if(zoneSign != 'Z'){
+ offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0);
+ if(zoneSign != '-'){ offset *= -1; }
+ }
+ if(zoneSign){
+ offset -= result.getTimezoneOffset();
+ }
+ if(offset){
+ result.setTime(result.getTime() + offset * 60000);
+ }
+ }
+
+ return result; // Date or null
+};
+
+/*=====
+ dojo.date.stamp.__Options = function(){
+ // selector: String
+ // "date" or "time" for partial formatting of the Date object.
+ // Both date and time will be formatted by default.
+ // zulu: Boolean
+ // if true, UTC/GMT is used for a timezone
+ // milliseconds: Boolean
+ // if true, output milliseconds
+ this.selector = selector;
+ this.zulu = zulu;
+ this.milliseconds = milliseconds;
+ }
+=====*/
+
+dojo.date.stamp.toISOString = function(/*Date*/dateObject, /*dojo.date.stamp.__Options?*/options){
+ // summary:
+ // Format a Date object as a string according a subset of the ISO-8601 standard
+ //
+ // description:
+ // When options.selector is omitted, output follows [RFC3339](http://www.ietf.org/rfc/rfc3339.txt)
+ // The local time zone is included as an offset from GMT, except when selector=='time' (time without a date)
+ // Does not check bounds. Only years between 100 and 9999 are supported.
+ //
+ // dateObject:
+ // A Date object
+
+ var _ = function(n){ return (n < 10) ? "0" + n : n; };
+ options = options || {};
+ var formattedDate = [],
+ getter = options.zulu ? "getUTC" : "get",
+ date = "";
+ if(options.selector != "time"){
+ var year = dateObject[getter+"FullYear"]();
+ date = ["0000".substr((year+"").length)+year, _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-');
+ }
+ formattedDate.push(date);
+ if(options.selector != "date"){
+ var time = [_(dateObject[getter+"Hours"]()), _(dateObject[getter+"Minutes"]()), _(dateObject[getter+"Seconds"]())].join(':');
+ var millis = dateObject[getter+"Milliseconds"]();
+ if(options.milliseconds){
+ time += "."+ (millis < 100 ? "0" : "") + _(millis);
+ }
+ if(options.zulu){
+ time += "Z";
+ }else if(options.selector != "time"){
+ var timezoneOffset = dateObject.getTimezoneOffset();
+ var absOffset = Math.abs(timezoneOffset);
+ time += (timezoneOffset > 0 ? "-" : "+") +
+ _(Math.floor(absOffset/60)) + ":" + _(absOffset%60);
+ }
+ formattedDate.push(time);
+ }
+ return formattedDate.join('T'); // String
+};
+
+}
+
+if(!dojo._hasResource["dojo.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.parser"] = true;
+dojo.provide("dojo.parser");
+
+
+
+
+new Date("X"); // workaround for #11279, new Date("") == NaN
+
+dojo.parser = new function(){
+ // summary:
+ // The Dom/Widget parsing package
+
+ var d = dojo;
+
+ function val2type(/*Object*/ value){
+ // summary:
+ // Returns name of type of given value.
+
+ if(d.isString(value)){ return "string"; }
+ if(typeof value == "number"){ return "number"; }
+ if(typeof value == "boolean"){ return "boolean"; }
+ if(d.isFunction(value)){ return "function"; }
+ if(d.isArray(value)){ return "array"; } // typeof [] == "object"
+ if(value instanceof Date) { return "date"; } // assume timestamp
+ if(value instanceof d._Url){ return "url"; }
+ return "object";
+ }
+
+ function str2obj(/*String*/ value, /*String*/ type){
+ // summary:
+ // Convert given string value to given type
+ switch(type){
+ case "string":
+ return value;
+ case "number":
+ return value.length ? Number(value) : NaN;
+ case "boolean":
+ // for checked/disabled value might be "" or "checked". interpret as true.
+ return typeof value == "boolean" ? value : !(value.toLowerCase()=="false");
+ case "function":
+ if(d.isFunction(value)){
+ // IE gives us a function, even when we say something like onClick="foo"
+ // (in which case it gives us an invalid function "function(){ foo }").
+ // Therefore, convert to string
+ value=value.toString();
+ value=d.trim(value.substring(value.indexOf('{')+1, value.length-1));
+ }
+ try{
+ if(value === "" || value.search(/[^\w\.]+/i) != -1){
+ // The user has specified some text for a function like "return x+5"
+ return new Function(value);
+ }else{
+ // The user has specified the name of a function like "myOnClick"
+ // or a single word function "return"
+ return d.getObject(value, false) || new Function(value);
+ }
+ }catch(e){ return new Function(); }
+ case "array":
+ return value ? value.split(/\s*,\s*/) : [];
+ case "date":
+ switch(value){
+ case "": return new Date(""); // the NaN of dates
+ case "now": return new Date(); // current date
+ default: return d.date.stamp.fromISOString(value);
+ }
+ case "url":
+ return d.baseUrl + value;
+ default:
+ return d.fromJson(value);
+ }
+ }
+
+ var dummyClass = {}, instanceClasses = {
+ // map from fully qualified name (like "dijit.Button") to structure like
+ // { cls: dijit.Button, params: {label: "string", disabled: "boolean"} }
+ };
+
+ // Widgets like BorderContainer add properties to _Widget via dojo.extend().
+ // If BorderContainer is loaded after _Widget's parameter list has been cached,
+ // we need to refresh that parameter list (for _Widget and all widgets that extend _Widget).
+ // TODO: remove this in 2.0, when we stop caching parameters.
+ d.connect(d, "extend", function(){
+ instanceClasses = {};
+ });
+
+ function getProtoInfo(cls, params){
+ // cls: A prototype
+ // The prototype of the class to check props on
+ // params: Object
+ // The parameters object to mix found parameters onto.
+ for(var name in cls){
+ if(name.charAt(0)=="_"){ continue; } // skip internal properties
+ if(name in dummyClass){ continue; } // skip "constructor" and "toString"
+ params[name] = val2type(cls[name]);
+ }
+ return params;
+ }
+
+ function getClassInfo(/*String*/ className, /*Boolean*/ skipParamsLookup){
+ // summary:
+ // Maps a widget name string like "dijit.form.Button" to the widget constructor itself,
+ // and a list of that widget's parameters and their types
+ // className:
+ // fully qualified name (like "dijit.form.Button")
+ // returns:
+ // structure like
+ // {
+ // cls: dijit.Button,
+ // params: { label: "string", disabled: "boolean"}
+ // }
+
+ var c = instanceClasses[className];
+ if(!c){
+ // get pointer to widget class
+ var cls = d.getObject(className), params = null;
+ if(!cls){ return null; } // class not defined [yet]
+ if(!skipParamsLookup){ // from fastpath, we don't need to lookup the attrs on the proto because they are explicit
+ params = getProtoInfo(cls.prototype, {})
+ }
+ c = { cls: cls, params: params };
+
+ }else if(!skipParamsLookup && !c.params){
+ // if we're calling getClassInfo and have a cls proto, but no params info, scan that cls for params now
+ // and update the pointer in instanceClasses[className]. This happens when a widget appears in another
+ // widget's template which still uses dojoType, but an instance of the widget appears prior with a data-dojo-type,
+ // skipping this lookup the first time.
+ c.params = getProtoInfo(c.cls.prototype, {});
+ }
+
+ return c;
+ }
+
+ this._functionFromScript = function(script, attrData){
+ // summary:
+ // Convert a <script type="dojo/method" args="a, b, c"> ... </script>
+ // into a function
+ // script: DOMNode
+ // The <script> DOMNode
+ // attrData: String
+ // For HTML5 compliance, searches for attrData + "args" (typically
+ // "data-dojo-args") instead of "args"
+ var preamble = "";
+ var suffix = "";
+ var argsStr = (script.getAttribute(attrData + "args") || script.getAttribute("args"));
+ if(argsStr){
+ d.forEach(argsStr.split(/\s*,\s*/), function(part, idx){
+ preamble += "var "+part+" = arguments["+idx+"]; ";
+ });
+ }
+ var withStr = script.getAttribute("with");
+ if(withStr && withStr.length){
+ d.forEach(withStr.split(/\s*,\s*/), function(part){
+ preamble += "with("+part+"){";
+ suffix += "}";
+ });
+ }
+ return new Function(preamble+script.innerHTML+suffix);
+ };
+
+ this.instantiate = function(/* Array */nodes, /* Object? */mixin, /* Object? */args){
+ // summary:
+ // Takes array of nodes, and turns them into class instances and
+ // potentially calls a startup method to allow them to connect with
+ // any children.
+ // nodes: Array
+ // Array of nodes or objects like
+ // | {
+ // | type: "dijit.form.Button",
+ // | node: DOMNode,
+ // | scripts: [ ... ], // array of <script type="dojo/..."> children of node
+ // | inherited: { ... } // settings inherited from ancestors like dir, theme, etc.
+ // | }
+ // mixin: Object?
+ // An object that will be mixed in with each node in the array.
+ // Values in the mixin will override values in the node, if they
+ // exist.
+ // args: Object?
+ // An object used to hold kwArgs for instantiation.
+ // See parse.args argument for details.
+
+ var thelist = [],
+ mixin = mixin||{};
+ args = args||{};
+
+ // TODO: for 2.0 default to data-dojo- regardless of scopeName (or maybe scopeName won't exist in 2.0)
+ var attrName = (args.scope || d._scopeName) + "Type", // typically "dojoType"
+ attrData = "data-" + (args.scope || d._scopeName) + "-"; // typically "data-dojo-"
+
+ d.forEach(nodes, function(obj){
+ if(!obj){ return; }
+
+ // Get pointers to DOMNode, dojoType string, and clsInfo (metadata about the dojoType), etc.
+ var node, type, clsInfo, clazz, scripts, fastpath;
+ if(obj.node){
+ // new format of nodes[] array, object w/lots of properties pre-computed for me
+ node = obj.node;
+ type = obj.type;
+ fastpath = obj.fastpath;
+ clsInfo = obj.clsInfo || (type && getClassInfo(type, fastpath));
+ clazz = clsInfo && clsInfo.cls;
+ scripts = obj.scripts;
+ }else{
+ // old (backwards compatible) format of nodes[] array, simple array of DOMNodes. no fastpath/data-dojo-type support here.
+ node = obj;
+ type = attrName in mixin ? mixin[attrName] : node.getAttribute(attrName);
+ clsInfo = type && getClassInfo(type);
+ clazz = clsInfo && clsInfo.cls;
+ scripts = (clazz && (clazz._noScript || clazz.prototype._noScript) ? [] :
+ d.query("> script[type^='dojo/']", node));
+ }
+ if(!clsInfo){
+ throw new Error("Could not load class '" + type);
+ }
+
+ // Setup hash to hold parameter settings for this widget. Start with the parameter
+ // settings inherited from ancestors ("dir" and "lang").
+ // Inherited setting may later be overridden by explicit settings on node itself.
+ var params = {};
+
+ if(args.defaults){
+ // settings for the document itself (or whatever subtree is being parsed)
+ d._mixin(params, args.defaults);
+ }
+ if(obj.inherited){
+ // settings from dir=rtl or lang=... on a node above this node
+ d._mixin(params, obj.inherited);
+ }
+
+ // mix things found in data-dojo-props into the params
+ if(fastpath){
+ var extra = node.getAttribute(attrData + "props");
+ if(extra && extra.length){
+ try{
+ extra = d.fromJson.call(args.propsThis, "{" + extra + "}");
+ d._mixin(params, extra);
+ }catch(e){
+ // give the user a pointer to their invalid parameters. FIXME: can we kill this in production?
+ throw new Error(e.toString() + " in data-dojo-props='" + extra + "'");
+ }
+ }
+
+ // For the benefit of _Templated, check if node has data-dojo-attach-point/data-dojo-attach-event
+ // and mix those in as though they were parameters
+ var attachPoint = node.getAttribute(attrData + "attach-point");
+ if(attachPoint){
+ params.dojoAttachPoint = attachPoint;
+ }
+ var attachEvent = node.getAttribute(attrData + "attach-event");
+ if(attachEvent){
+ params.dojoAttachEvent = attachEvent;
+ }
+ dojo.mixin(params, mixin);
+ }else{
+ // FIXME: we need something like "deprecateOnce()" to throw dojo.deprecation for something.
+ // remove this logic in 2.0
+ // read parameters (ie, attributes) specified on DOMNode
+
+ var attributes = node.attributes;
+
+ // clsInfo.params lists expected params like {"checked": "boolean", "n": "number"}
+ for(var name in clsInfo.params){
+ var item = name in mixin ? { value:mixin[name], specified:true } : attributes.getNamedItem(name);
+ if(!item || (!item.specified && (!dojo.isIE || name.toLowerCase()!="value"))){ continue; }
+ var value = item.value;
+ // Deal with IE quirks for 'class' and 'style'
+ switch(name){
+ case "class":
+ value = "className" in mixin ? mixin.className : node.className;
+ break;
+ case "style":
+ value = "style" in mixin ? mixin.style : (node.style && node.style.cssText); // FIXME: Opera?
+ }
+ var _type = clsInfo.params[name];
+ if(typeof value == "string"){
+ params[name] = str2obj(value, _type);
+ }else{
+ params[name] = value;
+ }
+ }
+ }
+
+ // Process <script type="dojo/*"> script tags
+ // <script type="dojo/method" event="foo"> tags are added to params, and passed to
+ // the widget on instantiation.
+ // <script type="dojo/method"> tags (with no event) are executed after instantiation
+ // <script type="dojo/connect" event="foo"> tags are dojo.connected after instantiation
+ // note: dojo/* script tags cannot exist in self closing widgets, like <input />
+ var connects = [], // functions to connect after instantiation
+ calls = []; // functions to call after instantiation
+
+ d.forEach(scripts, function(script){
+ node.removeChild(script);
+ // FIXME: drop event="" support in 2.0. use data-dojo-event="" instead
+ var event = (script.getAttribute(attrData + "event") || script.getAttribute("event")),
+ type = script.getAttribute("type"),
+ nf = d.parser._functionFromScript(script, attrData);
+ if(event){
+ if(type == "dojo/connect"){
+ connects.push({event: event, func: nf});
+ }else{
+ params[event] = nf;
+ }
+ }else{
+ calls.push(nf);
+ }
+ });
+
+ var markupFactory = clazz.markupFactory || clazz.prototype && clazz.prototype.markupFactory;
+ // create the instance
+ var instance = markupFactory ? markupFactory(params, node, clazz) : new clazz(params, node);
+ thelist.push(instance);
+
+ // map it to the JS namespace if that makes sense
+ // FIXME: in 2.0, drop jsId support. use data-dojo-id instead
+ var jsname = (node.getAttribute(attrData + "id") || node.getAttribute("jsId"));
+ if(jsname){
+ d.setObject(jsname, instance);
+ }
+
+ // process connections and startup functions
+ d.forEach(connects, function(connect){
+ d.connect(instance, connect.event, null, connect.func);
+ });
+ d.forEach(calls, function(func){
+ func.call(instance);
+ });
+ });
+
+ // Call startup on each top level instance if it makes sense (as for
+ // widgets). Parent widgets will recursively call startup on their
+ // (non-top level) children
+ if(!mixin._started){
+ // TODO: for 2.0, when old instantiate() API is desupported, store parent-child
+ // relationships in the nodes[] array so that no getParent() call is needed.
+ // Note that will require a parse() call from ContentPane setting a param that the
+ // ContentPane is the parent widget (so that the parse doesn't call startup() on the
+ // ContentPane's children)
+ d.forEach(thelist, function(instance){
+ if( !args.noStart && instance &&
+ dojo.isFunction(instance.startup) &&
+ !instance._started &&
+ (!instance.getParent || !instance.getParent())
+ ){
+ instance.startup();
+ }
+ });
+ }
+ return thelist;
+ };
+
+ this.parse = function(rootNode, args){
+ // summary:
+ // Scan the DOM for class instances, and instantiate them.
+ //
+ // description:
+ // Search specified node (or root node) recursively for class instances,
+ // and instantiate them. Searches for either data-dojo-type="Class" or
+ // dojoType="Class" where "Class" is a a fully qualified class name,
+ // like `dijit.form.Button`
+ //
+ // Using `data-dojo-type`:
+ // Attributes using can be mixed into the parameters used to instantitate the
+ // Class by using a `data-dojo-props` attribute on the node being converted.
+ // `data-dojo-props` should be a string attribute to be converted from JSON.
+ //
+ // Using `dojoType`:
+ // Attributes are read from the original domNode and converted to appropriate
+ // types by looking up the Class prototype values. This is the default behavior
+ // from Dojo 1.0 to Dojo 1.5. `dojoType` support is deprecated, and will
+ // go away in Dojo 2.0.
+ //
+ // rootNode: DomNode?
+ // A default starting root node from which to start the parsing. Can be
+ // omitted, defaulting to the entire document. If omitted, the `args`
+ // object can be passed in this place. If the `args` object has a
+ // `rootNode` member, that is used.
+ //
+ // args: Object
+ // a kwArgs object passed along to instantiate()
+ //
+ // * noStart: Boolean?
+ // when set will prevent the parser from calling .startup()
+ // when locating the nodes.
+ // * rootNode: DomNode?
+ // identical to the function's `rootNode` argument, though
+ // allowed to be passed in via this `args object.
+ // * template: Boolean
+ // If true, ignores ContentPane's stopParser flag and parses contents inside of
+ // a ContentPane inside of a template. This allows dojoAttachPoint on widgets/nodes
+ // nested inside the ContentPane to work.
+ // * inherited: Object
+ // Hash possibly containing dir and lang settings to be applied to
+ // parsed widgets, unless there's another setting on a sub-node that overrides
+ // * scope: String
+ // Root for attribute names to search for. If scopeName is dojo,
+ // will search for data-dojo-type (or dojoType). For backwards compatibility
+ // reasons defaults to dojo._scopeName (which is "dojo" except when
+ // multi-version support is used, when it will be something like dojo16, dojo20, etc.)
+ // * propsThis: Object
+ // If specified, "this" referenced from data-dojo-props will refer to propsThis.
+ // Intended for use from the widgets-in-template feature of `dijit._Templated`
+ //
+ // example:
+ // Parse all widgets on a page:
+ // | dojo.parser.parse();
+ //
+ // example:
+ // Parse all classes within the node with id="foo"
+ // | dojo.parser.parse(dojo.byId('foo'));
+ //
+ // example:
+ // Parse all classes in a page, but do not call .startup() on any
+ // child
+ // | dojo.parser.parse({ noStart: true })
+ //
+ // example:
+ // Parse all classes in a node, but do not call .startup()
+ // | dojo.parser.parse(someNode, { noStart:true });
+ // | // or
+ // | dojo.parser.parse({ noStart:true, rootNode: someNode });
+
+ // determine the root node based on the passed arguments.
+ var root;
+ if(!args && rootNode && rootNode.rootNode){
+ args = rootNode;
+ root = args.rootNode;
+ }else{
+ root = rootNode;
+ }
+ args = args || {};
+
+ var attrName = (args.scope || d._scopeName) + "Type", // typically "dojoType"
+ attrData = "data-" + (args.scope || d._scopeName) + "-"; // typically "data-dojo-"
+
+ function scan(parent, list){
+ // summary:
+ // Parent is an Object representing a DOMNode, with or without a dojoType specified.
+ // Scan parent's children looking for nodes with dojoType specified, storing in list[].
+ // If parent has a dojoType, also collects <script type=dojo/*> children and stores in parent.scripts[].
+ // parent: Object
+ // Object representing the parent node, like
+ // | {
+ // | node: DomNode, // scan children of this node
+ // | inherited: {dir: "rtl"}, // dir/lang setting inherited from above node
+ // |
+ // | // attributes only set if node has dojoType specified
+ // | scripts: [], // empty array, put <script type=dojo/*> in here
+ // | clsInfo: { cls: dijit.form.Button, ...}
+ // | }
+ // list: DomNode[]
+ // Output array of objects (same format as parent) representing nodes to be turned into widgets
+
+ // Effective dir and lang settings on parent node, either set directly or inherited from grandparent
+ var inherited = dojo.clone(parent.inherited);
+ dojo.forEach(["dir", "lang"], function(name){
+ // TODO: what if this is a widget and dir/lang are declared in data-dojo-props?
+ var val = parent.node.getAttribute(name);
+ if(val){
+ inherited[name] = val;
+ }
+ });
+
+ // if parent is a widget, then search for <script type=dojo/*> tags and put them in scripts[].
+ var scripts = parent.clsInfo && !parent.clsInfo.cls.prototype._noScript ? parent.scripts : null;
+
+ // unless parent is a widget with the stopParser flag set, continue search for dojoType, recursively
+ var recurse = (!parent.clsInfo || !parent.clsInfo.cls.prototype.stopParser) || (args && args.template);
+
+ // scan parent's children looking for dojoType and <script type=dojo/*>
+ for(var child = parent.node.firstChild; child; child = child.nextSibling){
+ if(child.nodeType == 1){
+ // FIXME: desupport dojoType in 2.0. use data-dojo-type instead
+ var type, html5 = recurse && child.getAttribute(attrData + "type");
+ if(html5){
+ type = html5;
+ }else{
+ // fallback to backward compatible mode, using dojoType. remove in 2.0
+ type = recurse && child.getAttribute(attrName);
+ }
+
+ var fastpath = html5 == type;
+
+ if(type){
+ // if dojoType/data-dojo-type specified, add to output array of nodes to instantiate
+ var params = {
+ "type": type,
+ fastpath: fastpath,
+ clsInfo: getClassInfo(type, fastpath), // note: won't find classes declared via dojo.Declaration
+ node: child,
+ scripts: [], // <script> nodes that are parent's children
+ inherited: inherited // dir & lang attributes inherited from parent
+ };
+ list.push(params);
+
+ // Recurse, collecting <script type="dojo/..."> children, and also looking for
+ // descendant nodes with dojoType specified (unless the widget has the stopParser flag),
+ scan(params, list);
+ }else if(scripts && child.nodeName.toLowerCase() == "script"){
+ // if <script type="dojo/...">, save in scripts[]
+ type = child.getAttribute("type");
+ if (type && /^dojo\/\w/i.test(type)) {
+ scripts.push(child);
+ }
+ }else if(recurse){
+ // Recurse, looking for grandchild nodes with dojoType specified
+ scan({
+ node: child,
+ inherited: inherited
+ }, list);
+ }
+ }
+ }
+ }
+
+ // Make list of all nodes on page w/dojoType specified
+ var list = [];
+ scan({
+ node: root ? dojo.byId(root) : dojo.body(),
+ inherited: (args && args.inherited) || {
+ dir: dojo._isBodyLtr() ? "ltr" : "rtl"
+ }
+ }, list);
+
+ // go build the object instances
+ var mixin = args && args.template ? {template: true} : null;
+ return this.instantiate(list, mixin, args); // Array
+ };
+}();
+
+//Register the parser callback. It should be the first callback
+//after the a11y test.
+
+(function(){
+ var parseRunner = function(){
+ if(dojo.config.parseOnLoad){
+ dojo.parser.parse();
+ }
+ };
+
+ // FIXME: need to clobber cross-dependency!!
+ if(dojo.getObject("dijit.wai.onload") === dojo._loaders[0]){
+ dojo._loaders.splice(1, 0, parseRunner);
+ }else{
+ dojo._loaders.unshift(parseRunner);
+ }
+})();
+
+}
+
+if(!dojo._hasResource["dojo.cache"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.cache"] = true;
+dojo.provide("dojo.cache");
+
+
+
+/*=====
+dojo.cache = {
+ // summary:
+ // A way to cache string content that is fetchable via `dojo.moduleUrl`.
+};
+=====*/
+
+ var cache = {};
+ dojo.cache = function(/*String||Object*/module, /*String*/url, /*String||Object?*/value){
+ // summary:
+ // A getter and setter for storing the string content associated with the
+ // module and url arguments.
+ // description:
+ // module and url are used to call `dojo.moduleUrl()` to generate a module URL.
+ // If value is specified, the cache value for the moduleUrl will be set to
+ // that value. Otherwise, dojo.cache will fetch the moduleUrl and store it
+ // in its internal cache and return that cached value for the URL. To clear
+ // a cache value pass null for value. Since XMLHttpRequest (XHR) is used to fetch the
+ // the URL contents, only modules on the same domain of the page can use this capability.
+ // The build system can inline the cache values though, to allow for xdomain hosting.
+ // module: String||Object
+ // If a String, the module name to use for the base part of the URL, similar to module argument
+ // to `dojo.moduleUrl`. If an Object, something that has a .toString() method that
+ // generates a valid path for the cache item. For example, a dojo._Url object.
+ // url: String
+ // The rest of the path to append to the path derived from the module argument. If
+ // module is an object, then this second argument should be the "value" argument instead.
+ // value: String||Object?
+ // If a String, the value to use in the cache for the module/url combination.
+ // If an Object, it can have two properties: value and sanitize. The value property
+ // should be the value to use in the cache, and sanitize can be set to true or false,
+ // to indicate if XML declarations should be removed from the value and if the HTML
+ // inside a body tag in the value should be extracted as the real value. The value argument
+ // or the value property on the value argument are usually only used by the build system
+ // as it inlines cache content.
+ // example:
+ // To ask dojo.cache to fetch content and store it in the cache (the dojo["cache"] style
+ // of call is used to avoid an issue with the build system erroneously trying to intern
+ // this example. To get the build system to intern your dojo.cache calls, use the
+ // "dojo.cache" style of call):
+ // | //If template.html contains "<h1>Hello</h1>" that will be
+ // | //the value for the text variable.
+ // | var text = dojo["cache"]("my.module", "template.html");
+ // example:
+ // To ask dojo.cache to fetch content and store it in the cache, and sanitize the input
+ // (the dojo["cache"] style of call is used to avoid an issue with the build system
+ // erroneously trying to intern this example. To get the build system to intern your
+ // dojo.cache calls, use the "dojo.cache" style of call):
+ // | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
+ // | //text variable will contain just "<h1>Hello</h1>".
+ // | var text = dojo["cache"]("my.module", "template.html", {sanitize: true});
+ // example:
+ // Same example as previous, but demostrates how an object can be passed in as
+ // the first argument, then the value argument can then be the second argument.
+ // | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
+ // | //text variable will contain just "<h1>Hello</h1>".
+ // | var text = dojo["cache"](new dojo._Url("my/module/template.html"), {sanitize: true});
+
+ //Module could be a string, or an object that has a toString() method
+ //that will return a useful path. If it is an object, then the "url" argument
+ //will actually be the value argument.
+ if(typeof module == "string"){
+ var pathObj = dojo.moduleUrl(module, url);
+ }else{
+ pathObj = module;
+ value = url;
+ }
+ var key = pathObj.toString();
+
+ var val = value;
+ if(value != undefined && !dojo.isString(value)){
+ val = ("value" in value ? value.value : undefined);
+ }
+
+ var sanitize = value && value.sanitize ? true : false;
+
+ if(typeof val == "string"){
+ //We have a string, set cache value
+ val = cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
+ }else if(val === null){
+ //Remove cached value
+ delete cache[key];
+ }else{
+ //Allow cache values to be empty strings. If key property does
+ //not exist, fetch it.
+ if(!(key in cache)){
+ val = dojo._getText(key);
+ cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
+ }
+ val = cache[key];
+ }
+ return val; //String
+ };
+
+ dojo.cache._sanitize = function(/*String*/val){
+ // summary:
+ // Strips <?xml ...?> declarations so that external SVG and XML
+ // documents can be added to a document without worry. Also, if the string
+ // is an HTML document, only the part inside the body tag is returned.
+ // description:
+ // Copied from dijit._Templated._sanitizeTemplateString.
+ if(val){
+ val = val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
+ var matches = val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
+ if(matches){
+ val = matches[1];
+ }
+ }else{
+ val = "";
+ }
+ return val; //String
+ };
+
+}
+
+if(!dojo._hasResource["dijit._Templated"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Templated"] = true;
+dojo.provide("dijit._Templated");
+
+
+
+
+
+
+
+dojo.declare("dijit._Templated",
+ null,
+ {
+ // summary:
+ // Mixin for widgets that are instantiated from a template
+
+ // templateString: [protected] String
+ // A string that represents the widget template. Pre-empts the
+ // templatePath. In builds that have their strings "interned", the
+ // templatePath is converted to an inline templateString, thereby
+ // preventing a synchronous network call.
+ //
+ // Use in conjunction with dojo.cache() to load from a file.
+ templateString: null,
+
+ // templatePath: [protected deprecated] String
+ // Path to template (HTML file) for this widget relative to dojo.baseUrl.
+ // Deprecated: use templateString with dojo.cache() instead.
+ templatePath: null,
+
+ // widgetsInTemplate: [protected] Boolean
+ // Should we parse the template to find widgets that might be
+ // declared in markup inside it? False by default.
+ widgetsInTemplate: false,
+
+ // skipNodeCache: [protected] Boolean
+ // If using a cached widget template node poses issues for a
+ // particular widget class, it can set this property to ensure
+ // that its template is always re-built from a string
+ _skipNodeCache: false,
+
+ // _earlyTemplatedStartup: Boolean
+ // A fallback to preserve the 1.0 - 1.3 behavior of children in
+ // templates having their startup called before the parent widget
+ // fires postCreate. Defaults to 'false', causing child widgets to
+ // have their .startup() called immediately before a parent widget
+ // .startup(), but always after the parent .postCreate(). Set to
+ // 'true' to re-enable to previous, arguably broken, behavior.
+ _earlyTemplatedStartup: false,
+
+/*=====
+ // _attachPoints: [private] String[]
+ // List of widget attribute names associated with dojoAttachPoint=... in the
+ // template, ex: ["containerNode", "labelNode"]
+ _attachPoints: [],
+ =====*/
+
+/*=====
+ // _attachEvents: [private] Handle[]
+ // List of connections associated with dojoAttachEvent=... in the
+ // template
+ _attachEvents: [],
+ =====*/
+
+ constructor: function(){
+ this._attachPoints = [];
+ this._attachEvents = [];
+ },
+
+ _stringRepl: function(tmpl){
+ // summary:
+ // Does substitution of ${foo} type properties in template string
+ // tags:
+ // private
+ var className = this.declaredClass, _this = this;
+ // Cache contains a string because we need to do property replacement
+ // do the property replacement
+ return dojo.string.substitute(tmpl, this, function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+ }, this);
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget from a template, setting this.domNode.
+ // tags:
+ // protected
+
+ // Lookup cached version of template, and download to cache if it
+ // isn't there already. Returns either a DomNode or a string, depending on
+ // whether or not the template contains ${foo} replacement parameters.
+ var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
+
+ var node;
+ if(dojo.isString(cached)){
+ node = dojo._toDom(this._stringRepl(cached));
+ if(node.nodeType != 1){
+ // Flag common problems such as templates with multiple top level nodes (nodeType == 11)
+ throw new Error("Invalid template: " + cached);
+ }
+ }else{
+ // if it's a node, all we have to do is clone it
+ node = cached.cloneNode(true);
+ }
+
+ this.domNode = node;
+
+ // Call down to _Widget.buildRendering() to get base classes assigned
+ // TODO: change the baseClass assignment to attributeMap
+ this.inherited(arguments);
+
+ // recurse through the node, looking for, and attaching to, our
+ // attachment points and events, which should be defined on the template node.
+ this._attachTemplateNodes(node);
+
+ if(this.widgetsInTemplate){
+ // Store widgets that we need to start at a later point in time
+ var cw = (this._startupWidgets = dojo.parser.parse(node, {
+ noStart: !this._earlyTemplatedStartup,
+ template: true,
+ inherited: {dir: this.dir, lang: this.lang},
+ propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me
+ scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type
+ }));
+
+ this._supportingWidgets = dijit.findWidgets(node);
+
+ this._attachTemplateNodes(cw, function(n,p){
+ return n[p];
+ });
+ }
+
+ this._fillContent(this.srcNodeRef);
+ },
+
+ _fillContent: function(/*DomNode*/ source){
+ // summary:
+ // Relocate source contents to templated container node.
+ // this.containerNode must be able to receive children, or exceptions will be thrown.
+ // tags:
+ // protected
+ var dest = this.containerNode;
+ if(source && dest){
+ while(source.hasChildNodes()){
+ dest.appendChild(source.firstChild);
+ }
+ }
+ },
+
+ _attachTemplateNodes: function(rootNode, getAttrFunc){
+ // summary:
+ // Iterate through the template and attach functions and nodes accordingly.
+ // Alternately, if rootNode is an array of widgets, then will process dojoAttachPoint
+ // etc. for those widgets.
+ // description:
+ // Map widget properties and functions to the handlers specified in
+ // the dom node and it's descendants. This function iterates over all
+ // nodes and looks for these properties:
+ // * dojoAttachPoint
+ // * dojoAttachEvent
+ // * waiRole
+ // * waiState
+ // rootNode: DomNode|Array[Widgets]
+ // the node to search for properties. All children will be searched.
+ // getAttrFunc: Function?
+ // a function which will be used to obtain property for a given
+ // DomNode/Widget
+ // tags:
+ // private
+
+ getAttrFunc = getAttrFunc || function(n,p){ return n.getAttribute(p); };
+
+ var nodes = dojo.isArray(rootNode) ? rootNode : (rootNode.all || rootNode.getElementsByTagName("*"));
+ var x = dojo.isArray(rootNode) ? 0 : -1;
+ for(; x<nodes.length; x++){
+ var baseNode = (x == -1) ? rootNode : nodes[x];
+ if(this.widgetsInTemplate && (getAttrFunc(baseNode, "dojoType") || getAttrFunc(baseNode, "data-dojo-type"))){
+ continue;
+ }
+ // Process dojoAttachPoint
+ var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
+ if(attachPoint){
+ var point, points = attachPoint.split(/\s*,\s*/);
+ while((point = points.shift())){
+ if(dojo.isArray(this[point])){
+ this[point].push(baseNode);
+ }else{
+ this[point]=baseNode;
+ }
+ this._attachPoints.push(point);
+ }
+ }
+
+ // Process dojoAttachEvent
+ var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");;
+ if(attachEvent){
+ // NOTE: we want to support attributes that have the form
+ // "domEvent: nativeEvent; ..."
+ var event, events = attachEvent.split(/\s*,\s*/);
+ var trim = dojo.trim;
+ while((event = events.shift())){
+ if(event){
+ var thisFunc = null;
+ if(event.indexOf(":") != -1){
+ // oh, if only JS had tuple assignment
+ var funcNameArr = event.split(":");
+ event = trim(funcNameArr[0]);
+ thisFunc = trim(funcNameArr[1]);
+ }else{
+ event = trim(event);
+ }
+ if(!thisFunc){
+ thisFunc = event;
+ }
+ this._attachEvents.push(this.connect(baseNode, event, thisFunc));
+ }
+ }
+ }
+
+ // waiRole, waiState
+ // TODO: remove this in 2.0, templates are now using role=... and aria-XXX=... attributes directicly
+ var role = getAttrFunc(baseNode, "waiRole");
+ if(role){
+ dijit.setWaiRole(baseNode, role);
+ }
+ var values = getAttrFunc(baseNode, "waiState");
+ if(values){
+ dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
+ if(stateValue.indexOf('-') != -1){
+ var pair = stateValue.split('-');
+ dijit.setWaiState(baseNode, pair[0], pair[1]);
+ }
+ });
+ }
+ }
+ },
+
+ startup: function(){
+ dojo.forEach(this._startupWidgets, function(w){
+ if(w && !w._started && w.startup){
+ w.startup();
+ }
+ });
+ this.inherited(arguments);
+ },
+
+ destroyRendering: function(){
+ // Delete all attach points to prevent IE6 memory leaks.
+ dojo.forEach(this._attachPoints, function(point){
+ delete this[point];
+ }, this);
+ this._attachPoints = [];
+
+ // And same for event handlers
+ dojo.forEach(this._attachEvents, this.disconnect, this);
+ this._attachEvents = [];
+
+ this.inherited(arguments);
+ }
+ }
+);
+
+// key is either templatePath or templateString; object is either string or DOM tree
+dijit._Templated._templateCache = {};
+
+dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
+ // summary:
+ // Static method to get a template based on the templatePath or
+ // templateString key
+ // templatePath: String||dojo.uri.Uri
+ // The URL to get the template from.
+ // templateString: String?
+ // a string to use in lieu of fetching the template from a URL. Takes precedence
+ // over templatePath
+ // returns: Mixed
+ // Either string (if there are ${} variables that need to be replaced) or just
+ // a DOM tree (if the node can be cloned directly)
+
+ // is it already cached?
+ var tmplts = dijit._Templated._templateCache;
+ var key = templateString || templatePath;
+ var cached = tmplts[key];
+ if(cached){
+ try{
+ // if the cached value is an innerHTML string (no ownerDocument) or a DOM tree created within the current document, then use the current cached value
+ if(!cached.ownerDocument || cached.ownerDocument == dojo.doc){
+ // string or node of the same document
+ return cached;
+ }
+ }catch(e){ /* squelch */ } // IE can throw an exception if cached.ownerDocument was reloaded
+ dojo.destroy(cached);
+ }
+
+ // If necessary, load template string from template path
+ if(!templateString){
+ templateString = dojo.cache(templatePath, {sanitize: true});
+ }
+ templateString = dojo.string.trim(templateString);
+
+ if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
+ // there are variables in the template so all we can do is cache the string
+ return (tmplts[key] = templateString); //String
+ }else{
+ // there are no variables in the template so we can cache the DOM tree
+ var node = dojo._toDom(templateString);
+ if(node.nodeType != 1){
+ throw new Error("Invalid template: " + templateString);
+ }
+ return (tmplts[key] = node); //Node
+ }
+};
+
+if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ var cache = dijit._Templated._templateCache;
+ for(var key in cache){
+ var value = cache[key];
+ if(typeof value == "object"){ // value is either a string or a DOM node template
+ dojo.destroy(value);
+ }
+ delete cache[key];
+ }
+ });
+}
+
+// These arguments can be specified for widgets which are used in templates.
+// Since any widget can be specified as sub widgets in template, mix it
+// into the base widget class. (This is a hack, but it's effective.)
+dojo.extend(dijit._Widget,{
+ dojoAttachEvent: "",
+ dojoAttachPoint: "",
+ waiRole: "",
+ waiState:""
+});
+
+}
+
+if(!dojo._hasResource["dijit.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit.Tooltip"] = true;
+dojo.provide("dijit.Tooltip");
+
+
+
+
+
+dojo.declare(
+ "dijit._MasterTooltip",
+ [dijit._Widget, dijit._Templated],
+ {
+ // summary:
+ // Internal widget that holds the actual tooltip markup,
+ // which occurs once per page.
+ // Called by Tooltip widgets which are just containers to hold
+ // the markup
+ // tags:
+ // protected
+
+ // duration: Integer
+ // Milliseconds to fade in/fade out
+ duration: dijit.defaultDuration,
+
+ templateString: dojo.cache("dijit", "templates/Tooltip.html", "<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\r\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\r\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\r\n></div>\r\n"),
+
+ postCreate: function(){
+ dojo.body().appendChild(this.domNode);
+
+ this.bgIframe = new dijit.BackgroundIframe(this.domNode);
+
+ // Setup fade-in and fade-out functions.
+ this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
+ this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
+ },
+
+ show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
+ // summary:
+ // Display tooltip w/specified contents to right of specified node
+ // (To left if there's no space on the right, or if rtl == true)
+
+ if(this.aroundNode && this.aroundNode === aroundNode){
+ return;
+ }
+
+ // reset width; it may have been set by orient() on a previous tooltip show()
+ this.domNode.width = "auto";
+
+ if(this.fadeOut.status() == "playing"){
+ // previous tooltip is being hidden; wait until the hide completes then show new one
+ this._onDeck=arguments;
+ return;
+ }
+ this.containerNode.innerHTML=innerHTML;
+
+ var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));
+
+ // show it
+ dojo.style(this.domNode, "opacity", 0);
+ this.fadeIn.play();
+ this.isShowingNow = true;
+ this.aroundNode = aroundNode;
+ },
+
+ orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
+ // summary:
+ // Private function to set CSS for tooltip node based on which position it's in.
+ // This is called by the dijit popup code. It will also reduce the tooltip's
+ // width to whatever width is available
+ // tags:
+ // protected
+ this.connectorNode.style.top = ""; //reset to default
+
+ //Adjust the spaceAvailable width, without changing the spaceAvailable object
+ var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;
+
+ node.className = "dijitTooltip " +
+ {
+ "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
+ "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
+ "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
+ "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
+ "BR-BL": "dijitTooltipRight",
+ "BL-BR": "dijitTooltipLeft"
+ }[aroundCorner + "-" + tooltipCorner];
+
+ // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
+ this.domNode.style.width = "auto";
+ var size = dojo.contentBox(this.domNode);
+
+ var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
+ var widthWasReduced = width < size.w;
+
+ this.domNode.style.width = width+"px";
+
+ //Adjust width for tooltips that have a really long word or a nowrap setting
+ if(widthWasReduced){
+ this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
+ var scrollWidth = this.containerNode.scrollWidth;
+ this.containerNode.style.overflow = "visible"; //change it back
+ if(scrollWidth > width){
+ scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
+ this.domNode.style.width = scrollWidth + "px";
+ }
+ }
+
+ // Reposition the tooltip connector.
+ if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
+ var mb = dojo.marginBox(node);
+ var tooltipConnectorHeight = this.connectorNode.offsetHeight;
+ if(mb.h > spaceAvailable.h){
+ // The tooltip starts at the top of the page and will extend past the aroundNode
+ var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
+ this.connectorNode.style.top = aroundNodePlacement + "px";
+ this.connectorNode.style.bottom = "";
+ }else{
+ // Align center of connector with center of aroundNode, except don't let bottom
+ // of connector extend below bottom of tooltip content, or top of connector
+ // extend past top of tooltip content
+ this.connectorNode.style.bottom = Math.min(
+ Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
+ mb.h - tooltipConnectorHeight) + "px";
+ this.connectorNode.style.top = "";
+ }
+ }else{
+ // reset the tooltip back to the defaults
+ this.connectorNode.style.top = "";
+ this.connectorNode.style.bottom = "";
+ }
+
+ return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
+ },
+
+ _onShow: function(){
+ // summary:
+ // Called at end of fade-in operation
+ // tags:
+ // protected
+ if(dojo.isIE){
+ // the arrow won't show up on a node w/an opacity filter
+ this.domNode.style.filter="";
+ }
+ },
+
+ hide: function(aroundNode){
+ // summary:
+ // Hide the tooltip
+
+ if(this._onDeck && this._onDeck[1] == aroundNode){
+ // this hide request is for a show() that hasn't even started yet;
+ // just cancel the pending show()
+ this._onDeck=null;
+ }else if(this.aroundNode === aroundNode){
+ // this hide request is for the currently displayed tooltip
+ this.fadeIn.stop();
+ this.isShowingNow = false;
+ this.aroundNode = null;
+ this.fadeOut.play();
+ }else{
+ // just ignore the call, it's for a tooltip that has already been erased
+ }
+ },
+
+ _onHide: function(){
+ // summary:
+ // Called at end of fade-out operation
+ // tags:
+ // protected
+
+ this.domNode.style.cssText=""; // to position offscreen again
+ this.containerNode.innerHTML="";
+ if(this._onDeck){
+ // a show request has been queued up; do it now
+ this.show.apply(this, this._onDeck);
+ this._onDeck=null;
+ }
+ }
+
+ }
+);
+
+dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
+ // summary:
+ // Display tooltip w/specified contents in specified position.
+ // See description of dijit.Tooltip.defaultPosition for details on position parameter.
+ // If position is not specified then dijit.Tooltip.defaultPosition is used.
+ if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
+ return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
+};
+
+dijit.hideTooltip = function(aroundNode){
+ // summary:
+ // Hide the tooltip
+ if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
+ return dijit._masterTT.hide(aroundNode);
+};
+
+dojo.declare(
+ "dijit.Tooltip",
+ dijit._Widget,
+ {
+ // summary:
+ // Pops up a tooltip (a help message) when you hover over a node.
+
+ // label: String
+ // Text to display in the tooltip.
+ // Specified as innerHTML when creating the widget from markup.
+ label: "",
+
+ // showDelay: Integer
+ // Number of milliseconds to wait after hovering over/focusing on the object, before
+ // the tooltip is displayed.
+ showDelay: 400,
+
+ // connectId: String|String[]
+ // Id of domNode(s) to attach the tooltip to.
+ // When user hovers over specified dom node, the tooltip will appear.
+ connectId: [],
+
+ // position: String[]
+ // See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
+ position: [],
+
+ _setConnectIdAttr: function(/*String*/ newId){
+ // summary:
+ // Connect to node(s) (specified by id)
+
+ // Remove connections to old nodes (if there are any)
+ dojo.forEach(this._connections || [], function(nested){
+ dojo.forEach(nested, dojo.hitch(this, "disconnect"));
+ }, this);
+
+ // Make connections to nodes in newIds.
+ var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
+ this._connections = dojo.map(ary, function(id){
+ var node = dojo.byId(id);
+ return node ? [
+ this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
+ this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
+ this.connect(node, "onfocus", "_onTargetFocus"),
+ this.connect(node, "onblur", "_onTargetBlur")
+ ] : [];
+ }, this);
+
+ this._set("connectId", newId);
+
+ this._connectIds = ary; // save as array
+ },
+
+ addTarget: function(/*DOMNODE || String*/ node){
+ // summary:
+ // Attach tooltip to specified node if it's not already connected
+
+ // TODO: remove in 2.0 and just use set("connectId", ...) interface
+
+ var id = node.id || node;
+ if(dojo.indexOf(this._connectIds, id) == -1){
+ this.set("connectId", this._connectIds.concat(id));
+ }
+ },
+
+ removeTarget: function(/*DOMNODE || String*/ node){
+ // summary:
+ // Detach tooltip from specified node
+
+ // TODO: remove in 2.0 and just use set("connectId", ...) interface
+
+ var id = node.id || node, // map from DOMNode back to plain id string
+ idx = dojo.indexOf(this._connectIds, id);
+ if(idx >= 0){
+ // remove id (modifies original this._connectIds but that's OK in this case)
+ this._connectIds.splice(idx, 1);
+ this.set("connectId", this._connectIds);
+ }
+ },
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode,"dijitTooltipData");
+ },
+
+ startup: function(){
+ this.inherited(arguments);
+
+ // If this tooltip was created in a template, or for some other reason the specified connectId[s]
+ // didn't exist during the widget's initialization, then connect now.
+ var ids = this.connectId;
+ dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
+ },
+
+ _onTargetMouseEnter: function(/*Event*/ e){
+ // summary:
+ // Handler for mouseenter event on the target node
+ // tags:
+ // private
+ this._onHover(e);
+ },
+
+ _onTargetMouseLeave: function(/*Event*/ e){
+ // summary:
+ // Handler for mouseleave event on the target node
+ // tags:
+ // private
+ this._onUnHover(e);
+ },
+
+ _onTargetFocus: function(/*Event*/ e){
+ // summary:
+ // Handler for focus event on the target node
+ // tags:
+ // private
+
+ this._focus = true;
+ this._onHover(e);
+ },
+
+ _onTargetBlur: function(/*Event*/ e){
+ // summary:
+ // Handler for blur event on the target node
+ // tags:
+ // private
+
+ this._focus = false;
+ this._onUnHover(e);
+ },
+
+ _onHover: function(/*Event*/ e){
+ // summary:
+ // Despite the name of this method, it actually handles both hover and focus
+ // events on the target node, setting a timer to show the tooltip.
+ // tags:
+ // private
+ if(!this._showTimer){
+ var target = e.target;
+ this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
+ }
+ },
+
+ _onUnHover: function(/*Event*/ e){
+ // summary:
+ // Despite the name of this method, it actually handles both mouseleave and blur
+ // events on the target node, hiding the tooltip.
+ // tags:
+ // private
+
+ // keep a tooltip open if the associated element still has focus (even though the
+ // mouse moved away)
+ if(this._focus){ return; }
+
+ if(this._showTimer){
+ clearTimeout(this._showTimer);
+ delete this._showTimer;
+ }
+ this.close();
+ },
+
+ open: function(/*DomNode*/ target){
+ // summary:
+ // Display the tooltip; usually not called directly.
+ // tags:
+ // private
+
+ if(this._showTimer){
+ clearTimeout(this._showTimer);
+ delete this._showTimer;
+ }
+ dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position, !this.isLeftToRight());
+
+ this._connectNode = target;
+ this.onShow(target, this.position);
+ },
+
+ close: function(){
+ // summary:
+ // Hide the tooltip or cancel timer for show of tooltip
+ // tags:
+ // private
+
+ if(this._connectNode){
+ // if tooltip is currently shown
+ dijit.hideTooltip(this._connectNode);
+ delete this._connectNode;
+ this.onHide();
+ }
+ if(this._showTimer){
+ // if tooltip is scheduled to be shown (after a brief delay)
+ clearTimeout(this._showTimer);
+ delete this._showTimer;
+ }
+ },
+
+ onShow: function(target, position){
+ // summary:
+ // Called when the tooltip is shown
+ // tags:
+ // callback
+ },
+
+ onHide: function(){
+ // summary:
+ // Called when the tooltip is hidden
+ // tags:
+ // callback
+ },
+
+ uninitialize: function(){
+ this.close();
+ this.inherited(arguments);
+ }
+ }
+);
+
+// dijit.Tooltip.defaultPosition: String[]
+// This variable controls the position of tooltips, if the position is not specified to
+// the Tooltip widget or *TextBox widget itself. It's an array of strings with the following values:
+//
+// * before: places tooltip to the left of the target node/widget, or to the right in
+// the case of RTL scripts like Hebrew and Arabic
+// * after: places tooltip to the right of the target node/widget, or to the left in
+// the case of RTL scripts like Hebrew and Arabic
+// * above: tooltip goes above target node
+// * below: tooltip goes below target node
+//
+// The list is positions is tried, in order, until a position is found where the tooltip fits
+// within the viewport.
+//
+// Be careful setting this parameter. A value of "above" may work fine until the user scrolls
+// the screen so that there's no room above the target node. Nodes with drop downs, like
+// DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
+// that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
+// is only room below (or above) the target node, but not both.
+dijit.Tooltip.defaultPosition = ["after", "before"];
+
+}
+
+if(!dojo._hasResource["dojox.charting.action2d.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Tooltip"] = true;
+dojo.provide("dojox.charting.action2d.Tooltip");
+
+
+
+
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.action2d.__TooltipCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for tooltip actions.
+
+ // text: Function?
+ // The function that produces the text to be shown within a tooltip. By default this will be
+ // set by the plot in question, by returning the value of the element.
+ text: null
+});
+=====*/
+(function(){
+ var DEFAULT_TEXT = function(o){
+ var t = o.run && o.run.data && o.run.data[o.index];
+ if(t && typeof t != "number" && (t.tooltip || t.text)){
+ return t.tooltip || t.text;
+ }
+ if(o.element == "candlestick"){
+ return '<table cellpadding="1" cellspacing="0" border="0" style="font-size:0.9em;">'
+ + '<tr><td>Open:</td><td align="right"><strong>' + o.data.open + '</strong></td></tr>'
+ + '<tr><td>High:</td><td align="right"><strong>' + o.data.high + '</strong></td></tr>'
+ + '<tr><td>Low:</td><td align="right"><strong>' + o.data.low + '</strong></td></tr>'
+ + '<tr><td>Close:</td><td align="right"><strong>' + o.data.close + '</strong></td></tr>'
+ + (o.data.mid !== undefined ? '<tr><td>Mid:</td><td align="right"><strong>' + o.data.mid + '</strong></td></tr>' : '')
+ + '</table>';
+ }
+ return o.element == "bar" ? o.x : o.y;
+ };
+
+ var df = dojox.lang.functional, m = dojox.gfx.matrix, pi4 = Math.PI / 4, pi2 = Math.PI / 2;
+
+ dojo.declare("dojox.charting.action2d.Tooltip", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action on a plot where a tooltip is shown when hovering over an element.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ text: DEFAULT_TEXT // the function to produce a tooltip from the object
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the tooltip action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__TooltipCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ this.text = kwArgs && kwArgs.text ? kwArgs.text : DEFAULT_TEXT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(o.type === "onplotreset" || o.type === "onmouseout"){
+ dijit.hideTooltip(this.aroundRect);
+ this.aroundRect = null;
+ if(o.type === "onplotreset"){
+ delete this.angles;
+ }
+ return;
+ }
+
+ if(!o.shape || o.type !== "onmouseover"){ return; }
+
+ // calculate relative coordinates and the position
+ var aroundRect = {type: "rect"}, position = ["after", "before"];
+ switch(o.element){
+ case "marker":
+ aroundRect.x = o.cx;
+ aroundRect.y = o.cy;
+ aroundRect.width = aroundRect.height = 1;
+ break;
+ case "circle":
+ aroundRect.x = o.cx - o.cr;
+ aroundRect.y = o.cy - o.cr;
+ aroundRect.width = aroundRect.height = 2 * o.cr;
+ break;
+ case "column":
+ position = ["above", "below"];
+ // intentional fall down
+ case "bar":
+ aroundRect = dojo.clone(o.shape.getShape());
+ break;
+ case "candlestick":
+ aroundRect.x = o.x;
+ aroundRect.y = o.y;
+ aroundRect.width = o.width;
+ aroundRect.height = o.height;
+ break;
+ default:
+ //case "slice":
+ if(!this.angles){
+ // calculate the running total of slice angles
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+ var startAngle = m._degToRad(o.plot.opt.startAngle),
+ angle = (this.angles[o.index] + this.angles[o.index + 1]) / 2 + startAngle;
+ aroundRect.x = o.cx + o.cr * Math.cos(angle);
+ aroundRect.y = o.cy + o.cr * Math.sin(angle);
+ aroundRect.width = aroundRect.height = 1;
+ // calculate the position
+ if(angle < pi4){
+ // do nothing: the position is right
+ }else if(angle < pi2 + pi4){
+ position = ["below", "above"];
+ }else if(angle < Math.PI + pi4){
+ position = ["before", "after"];
+ }else if(angle < 2 * Math.PI - pi4){
+ position = ["above", "below"];
+ }
+ /*
+ else{
+ // do nothing: the position is right
+ }
+ */
+ break;
+ }
+
+ // adjust relative coordinates to absolute, and remove fractions
+ var lt = dojo.coords(this.chart.node, true);
+ aroundRect.x += lt.x;
+ aroundRect.y += lt.y;
+ aroundRect.x = Math.round(aroundRect.x);
+ aroundRect.y = Math.round(aroundRect.y);
+ aroundRect.width = Math.ceil(aroundRect.width);
+ aroundRect.height = Math.ceil(aroundRect.height);
+ this.aroundRect = aroundRect;
+
+ var tooltip = this.text(o);
+ if(tooltip){
+ dijit.showTooltip(tooltip, this.aroundRect, position);
+ }
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.scaler.common"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.scaler.common"] = true;
+dojo.provide("dojox.charting.scaler.common");
+
+(function(){
+ var eq = function(/*Number*/ a, /*Number*/ b){
+ // summary: compare two FP numbers for equality
+ return Math.abs(a - b) <= 1e-6 * (Math.abs(a) + Math.abs(b)); // Boolean
+ };
+
+ dojo.mixin(dojox.charting.scaler.common, {
+ findString: function(/*String*/ val, /*Array*/ text){
+ val = val.toLowerCase();
+ for(var i = 0; i < text.length; ++i){
+ if(val == text[i]){ return true; }
+ }
+ return false;
+ },
+ getNumericLabel: function(/*Number*/ number, /*Number*/ precision, /*Object*/ kwArgs){
+ var def = "";
+ if(dojo.number){
+ def = (kwArgs.fixed ? dojo.number.format(number, {places : precision < 0 ? -precision : 0}) :
+ dojo.number.format(number)) || "";
+ }else{
+ def = kwArgs.fixed ? number.toFixed(precision < 0 ? -precision : 0) : number.toString();
+ }
+ if(kwArgs.labelFunc){
+ var r = kwArgs.labelFunc(def, number, precision);
+ if(r){ return r; }
+ // else fall through to the regular labels search
+ }
+ if(kwArgs.labels){
+ // classic binary search
+ var l = kwArgs.labels, lo = 0, hi = l.length;
+ while(lo < hi){
+ var mid = Math.floor((lo + hi) / 2), val = l[mid].value;
+ if(val < number){
+ lo = mid + 1;
+ }else{
+ hi = mid;
+ }
+ }
+ // lets take into account FP errors
+ if(lo < l.length && eq(l[lo].value, number)){
+ return l[lo].text;
+ }
+ --lo;
+ if(lo >= 0 && lo < l.length && eq(l[lo].value, number)){
+ return l[lo].text;
+ }
+ lo += 2;
+ if(lo < l.length && eq(l[lo].value, number)){
+ return l[lo].text;
+ }
+ // otherwise we will produce a number
+ }
+ return def;
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.scaler.linear"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.scaler.linear"] = true;
+dojo.provide("dojox.charting.scaler.linear");
+
+
+(function(){
+ var deltaLimit = 3, // pixels
+ dc = dojox.charting, dcs = dc.scaler, dcsc = dcs.common,
+ findString = dcsc.findString,
+ getLabel = dcsc.getNumericLabel;
+
+ var calcTicks = function(min, max, kwArgs, majorTick, minorTick, microTick, span){
+ kwArgs = dojo.delegate(kwArgs);
+ if(!majorTick){
+ if(kwArgs.fixUpper == "major"){ kwArgs.fixUpper = "minor"; }
+ if(kwArgs.fixLower == "major"){ kwArgs.fixLower = "minor"; }
+ }
+ if(!minorTick){
+ if(kwArgs.fixUpper == "minor"){ kwArgs.fixUpper = "micro"; }
+ if(kwArgs.fixLower == "minor"){ kwArgs.fixLower = "micro"; }
+ }
+ if(!microTick){
+ if(kwArgs.fixUpper == "micro"){ kwArgs.fixUpper = "none"; }
+ if(kwArgs.fixLower == "micro"){ kwArgs.fixLower = "none"; }
+ }
+ var lowerBound = findString(kwArgs.fixLower, ["major"]) ?
+ Math.floor(kwArgs.min / majorTick) * majorTick :
+ findString(kwArgs.fixLower, ["minor"]) ?
+ Math.floor(kwArgs.min / minorTick) * minorTick :
+ findString(kwArgs.fixLower, ["micro"]) ?
+ Math.floor(kwArgs.min / microTick) * microTick : kwArgs.min,
+ upperBound = findString(kwArgs.fixUpper, ["major"]) ?
+ Math.ceil(kwArgs.max / majorTick) * majorTick :
+ findString(kwArgs.fixUpper, ["minor"]) ?
+ Math.ceil(kwArgs.max / minorTick) * minorTick :
+ findString(kwArgs.fixUpper, ["micro"]) ?
+ Math.ceil(kwArgs.max / microTick) * microTick : kwArgs.max;
+
+ if(kwArgs.useMin){ min = lowerBound; }
+ if(kwArgs.useMax){ max = upperBound; }
+
+ var majorStart = (!majorTick || kwArgs.useMin && findString(kwArgs.fixLower, ["major"])) ?
+ min : Math.ceil(min / majorTick) * majorTick,
+ minorStart = (!minorTick || kwArgs.useMin && findString(kwArgs.fixLower, ["major", "minor"])) ?
+ min : Math.ceil(min / minorTick) * minorTick,
+ microStart = (! microTick || kwArgs.useMin && findString(kwArgs.fixLower, ["major", "minor", "micro"])) ?
+ min : Math.ceil(min / microTick) * microTick,
+ majorCount = !majorTick ? 0 : (kwArgs.useMax && findString(kwArgs.fixUpper, ["major"]) ?
+ Math.round((max - majorStart) / majorTick) :
+ Math.floor((max - majorStart) / majorTick)) + 1,
+ minorCount = !minorTick ? 0 : (kwArgs.useMax && findString(kwArgs.fixUpper, ["major", "minor"]) ?
+ Math.round((max - minorStart) / minorTick) :
+ Math.floor((max - minorStart) / minorTick)) + 1,
+ microCount = !microTick ? 0 : (kwArgs.useMax && findString(kwArgs.fixUpper, ["major", "minor", "micro"]) ?
+ Math.round((max - microStart) / microTick) :
+ Math.floor((max - microStart) / microTick)) + 1,
+ minorPerMajor = minorTick ? Math.round(majorTick / minorTick) : 0,
+ microPerMinor = microTick ? Math.round(minorTick / microTick) : 0,
+ majorPrecision = majorTick ? Math.floor(Math.log(majorTick) / Math.LN10) : 0,
+ minorPrecision = minorTick ? Math.floor(Math.log(minorTick) / Math.LN10) : 0,
+ scale = span / (max - min);
+ if(!isFinite(scale)){ scale = 1; }
+
+ return {
+ bounds: {
+ lower: lowerBound,
+ upper: upperBound,
+ from: min,
+ to: max,
+ scale: scale,
+ span: span
+ },
+ major: {
+ tick: majorTick,
+ start: majorStart,
+ count: majorCount,
+ prec: majorPrecision
+ },
+ minor: {
+ tick: minorTick,
+ start: minorStart,
+ count: minorCount,
+ prec: minorPrecision
+ },
+ micro: {
+ tick: microTick,
+ start: microStart,
+ count: microCount,
+ prec: 0
+ },
+ minorPerMajor: minorPerMajor,
+ microPerMinor: microPerMinor,
+ scaler: dcs.linear
+ };
+ };
+
+ dojo.mixin(dojox.charting.scaler.linear, {
+ buildScaler: function(/*Number*/ min, /*Number*/ max, /*Number*/ span, /*Object*/ kwArgs){
+ var h = {fixUpper: "none", fixLower: "none", natural: false};
+ if(kwArgs){
+ if("fixUpper" in kwArgs){ h.fixUpper = String(kwArgs.fixUpper); }
+ if("fixLower" in kwArgs){ h.fixLower = String(kwArgs.fixLower); }
+ if("natural" in kwArgs){ h.natural = Boolean(kwArgs.natural); }
+ }
+
+ // update bounds
+ if("min" in kwArgs){ min = kwArgs.min; }
+ if("max" in kwArgs){ max = kwArgs.max; }
+ if(kwArgs.includeZero){
+ if(min > 0){ min = 0; }
+ if(max < 0){ max = 0; }
+ }
+ h.min = min;
+ h.useMin = true;
+ h.max = max;
+ h.useMax = true;
+
+ if("from" in kwArgs){
+ min = kwArgs.from;
+ h.useMin = false;
+ }
+ if("to" in kwArgs){
+ max = kwArgs.to;
+ h.useMax = false;
+ }
+
+ // check for erroneous condition
+ if(max <= min){
+ return calcTicks(min, max, h, 0, 0, 0, span); // Object
+ }
+
+ var mag = Math.floor(Math.log(max - min) / Math.LN10),
+ major = kwArgs && ("majorTickStep" in kwArgs) ? kwArgs.majorTickStep : Math.pow(10, mag),
+ minor = 0, micro = 0, ticks;
+
+ // calculate minor ticks
+ if(kwArgs && ("minorTickStep" in kwArgs)){
+ minor = kwArgs.minorTickStep;
+ }else{
+ do{
+ minor = major / 10;
+ if(!h.natural || minor > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, 0, span);
+ if(ticks.bounds.scale * ticks.minor.tick > deltaLimit){ break; }
+ }
+ minor = major / 5;
+ if(!h.natural || minor > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, 0, span);
+ if(ticks.bounds.scale * ticks.minor.tick > deltaLimit){ break; }
+ }
+ minor = major / 2;
+ if(!h.natural || minor > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, 0, span);
+ if(ticks.bounds.scale * ticks.minor.tick > deltaLimit){ break; }
+ }
+ return calcTicks(min, max, h, major, 0, 0, span); // Object
+ }while(false);
+ }
+
+ // calculate micro ticks
+ if(kwArgs && ("microTickStep" in kwArgs)){
+ micro = kwArgs.microTickStep;
+ ticks = calcTicks(min, max, h, major, minor, micro, span);
+ }else{
+ do{
+ micro = minor / 10;
+ if(!h.natural || micro > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, micro, span);
+ if(ticks.bounds.scale * ticks.micro.tick > deltaLimit){ break; }
+ }
+ micro = minor / 5;
+ if(!h.natural || micro > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, micro, span);
+ if(ticks.bounds.scale * ticks.micro.tick > deltaLimit){ break; }
+ }
+ micro = minor / 2;
+ if(!h.natural || micro > 0.9){
+ ticks = calcTicks(min, max, h, major, minor, micro, span);
+ if(ticks.bounds.scale * ticks.micro.tick > deltaLimit){ break; }
+ }
+ micro = 0;
+ }while(false);
+ }
+
+ return micro ? ticks : calcTicks(min, max, h, major, minor, 0, span); // Object
+ },
+ buildTicks: function(/*Object*/ scaler, /*Object*/ kwArgs){
+ var step, next, tick,
+ nextMajor = scaler.major.start,
+ nextMinor = scaler.minor.start,
+ nextMicro = scaler.micro.start;
+ if(kwArgs.microTicks && scaler.micro.tick){
+ step = scaler.micro.tick, next = nextMicro;
+ }else if(kwArgs.minorTicks && scaler.minor.tick){
+ step = scaler.minor.tick, next = nextMinor;
+ }else if(scaler.major.tick){
+ step = scaler.major.tick, next = nextMajor;
+ }else{
+ // no ticks
+ return null;
+ }
+ // make sure that we have finite bounds
+ var revScale = 1 / scaler.bounds.scale;
+ if(scaler.bounds.to <= scaler.bounds.from || isNaN(revScale) || !isFinite(revScale) ||
+ step <= 0 || isNaN(step) || !isFinite(step)){
+ // no ticks
+ return null;
+ }
+ // loop over all ticks
+ var majorTicks = [], minorTicks = [], microTicks = [];
+ while(next <= scaler.bounds.to + revScale){
+ if(Math.abs(nextMajor - next) < step / 2){
+ // major tick
+ tick = {value: nextMajor};
+ if(kwArgs.majorLabels){
+ tick.label = getLabel(nextMajor, scaler.major.prec, kwArgs);
+ }
+ majorTicks.push(tick);
+ nextMajor += scaler.major.tick;
+ nextMinor += scaler.minor.tick;
+ nextMicro += scaler.micro.tick;
+ }else if(Math.abs(nextMinor - next) < step / 2){
+ // minor tick
+ if(kwArgs.minorTicks){
+ tick = {value: nextMinor};
+ if(kwArgs.minorLabels && (scaler.minMinorStep <= scaler.minor.tick * scaler.bounds.scale)){
+ tick.label = getLabel(nextMinor, scaler.minor.prec, kwArgs);
+ }
+ minorTicks.push(tick);
+ }
+ nextMinor += scaler.minor.tick;
+ nextMicro += scaler.micro.tick;
+ }else{
+ // micro tick
+ if(kwArgs.microTicks){
+ microTicks.push({value: nextMicro});
+ }
+ nextMicro += scaler.micro.tick;
+ }
+ next += step;
+ }
+ return {major: majorTicks, minor: minorTicks, micro: microTicks}; // Object
+ },
+ getTransformerFromModel: function(/*Object*/ scaler){
+ var offset = scaler.bounds.from, scale = scaler.bounds.scale;
+ return function(x){ return (x - offset) * scale; }; // Function
+ },
+ getTransformerFromPlot: function(/*Object*/ scaler){
+ var offset = scaler.bounds.from, scale = scaler.bounds.scale;
+ return function(x){ return x / scale + offset; }; // Function
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.axis2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.axis2d.Base"] = true;
+dojo.provide("dojox.charting.axis2d.Base");
+
+
+
+dojo.declare("dojox.charting.axis2d.Base", dojox.charting.Element, {
+ // summary:
+ // The base class for any axis. This is more of an interface/API
+ // definition than anything else; see dojox.charting.axis2d.Default
+ // for more details.
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Return a new base axis.
+ // chart: dojox.charting.Chart2D
+ // The chart this axis belongs to.
+ // kwArgs: dojox.charting.axis2d.__AxisCtorArgs?
+ // An optional arguments object to define the axis parameters.
+ this.vertical = kwArgs && kwArgs.vertical;
+ },
+ clear: function(){
+ // summary:
+ // Stub function for clearing the axis.
+ // returns: dojox.charting.axis2d.Base
+ // A reference to the axis for functional chaining.
+ return this; // dojox.charting.axis2d.Base
+ },
+ initialized: function(){
+ // summary:
+ // Return a flag as to whether or not this axis has been initialized.
+ // returns: Boolean
+ // If the axis is initialized or not.
+ return false; // Boolean
+ },
+ calculate: function(min, max, span){
+ // summary:
+ // Stub function to run the calcuations needed for drawing this axis.
+ // returns: dojox.charting.axis2d.Base
+ // A reference to the axis for functional chaining.
+ return this; // dojox.charting.axis2d.Base
+ },
+ getScaler: function(){
+ // summary:
+ // A stub function to return the scaler object created during calculate.
+ // returns: Object
+ // The scaler object (see dojox.charting.scaler.linear for more information)
+ return null; // Object
+ },
+ getTicks: function(){
+ // summary:
+ // A stub function to return the object that helps define how ticks are rendered.
+ // returns: Object
+ // The ticks object.
+ return null; // Object
+ },
+ getOffsets: function(){
+ // summary:
+ // A stub function to return any offsets needed for axis and series rendering.
+ // returns: Object
+ // An object of the form { l, r, t, b }.
+ return {l: 0, r: 0, t: 0, b: 0}; // Object
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Stub function to render this axis.
+ // returns: dojox.charting.axis2d.Base
+ // A reference to the axis for functional chaining.
+ this.dirty = false;
+ return this; // dojox.charting.axis2d.Base
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.axis2d.Invisible"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.axis2d.Invisible"] = true;
+dojo.provide("dojox.charting.axis2d.Invisible");
+
+
+
+
+
+
+
+
+
+
+(function(){
+ var dc = dojox.charting,
+ df = dojox.lang.functional,
+ du = dojox.lang.utils,
+ g = dojox.gfx,
+ lin = dc.scaler.linear,
+ merge = du.merge,
+ labelGap = 4, // in pixels
+ centerAnchorLimit = 45; // in degrees
+
+ dojo.declare("dojox.charting.axis2d.Invisible", dojox.charting.axis2d.Base, {
+ // summary:
+ // The default axis object used in dojox.charting. See dojox.charting.Chart2D.addAxis for details.
+ //
+ // defaultParams: Object
+ // The default parameters used to define any axis.
+ // optionalParams: Object
+ // Any optional parameters needed to define an axis.
+
+ /*
+ // TODO: the documentation tools need these to be pre-defined in order to pick them up
+ // correctly, but the code here is partially predicated on whether or not the properties
+ // actually exist. For now, we will leave these undocumented but in the code for later. -- TRT
+
+ // opt: Object
+ // The actual options used to define this axis, created at initialization.
+ // scalar: Object
+ // The calculated helper object to tell charts how to draw an axis and any data.
+ // ticks: Object
+ // The calculated tick object that helps a chart draw the scaling on an axis.
+ // dirty: Boolean
+ // The state of the axis (whether it needs to be redrawn or not)
+ // scale: Number
+ // The current scale of the axis.
+ // offset: Number
+ // The current offset of the axis.
+
+ opt: null,
+ scalar: null,
+ ticks: null,
+ dirty: true,
+ scale: 1,
+ offset: 0,
+ */
+ defaultParams: {
+ vertical: false, // true for vertical axis
+ fixUpper: "none", // align the upper on ticks: "major", "minor", "micro", "none"
+ fixLower: "none", // align the lower on ticks: "major", "minor", "micro", "none"
+ natural: false, // all tick marks should be made on natural numbers
+ leftBottom: true, // position of the axis, used with "vertical"
+ includeZero: false, // 0 should be included
+ fixed: true, // all labels are fixed numbers
+ majorLabels: true, // draw major labels
+ minorTicks: true, // draw minor ticks
+ minorLabels: true, // draw minor labels
+ microTicks: false, // draw micro ticks
+ rotation: 0 // label rotation angle in degrees
+ },
+ optionalParams: {
+ min: 0, // minimal value on this axis
+ max: 1, // maximal value on this axis
+ from: 0, // visible from this value
+ to: 1, // visible to this value
+ majorTickStep: 4, // major tick step
+ minorTickStep: 2, // minor tick step
+ microTickStep: 1, // micro tick step
+ labels: [], // array of labels for major ticks
+ // with corresponding numeric values
+ // ordered by values
+ labelFunc: null, // function to compute label values
+ maxLabelSize: 0, // size in px. For use with labelFunc
+ maxLabelCharCount: 0, // size in word count.
+ trailingSymbol: null
+
+ // TODO: add support for minRange!
+ // minRange: 1, // smallest distance from min allowed on the axis
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for an axis.
+ // chart: dojox.charting.Chart2D
+ // The chart the axis belongs to.
+ // kwArgs: dojox.charting.axis2d.__AxisCtorArgs?
+ // Any optional keyword arguments to be used to define this axis.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ },
+ dependOnData: function(){
+ // summary:
+ // Find out whether or not the axis options depend on the data in the axis.
+ return !("min" in this.opt) || !("max" in this.opt); // Boolean
+ },
+ clear: function(){
+ // summary:
+ // Clear out all calculated properties on this axis;
+ // returns: dojox.charting.axis2d.Default
+ // The reference to the axis for functional chaining.
+ delete this.scaler;
+ delete this.ticks;
+ this.dirty = true;
+ return this; // dojox.charting.axis2d.Default
+ },
+ initialized: function(){
+ // summary:
+ // Finds out if this axis has been initialized or not.
+ // returns: Boolean
+ // Whether a scaler has been calculated and if the axis is not dirty.
+ return "scaler" in this && !(this.dirty && this.dependOnData());
+ },
+ setWindow: function(scale, offset){
+ // summary:
+ // Set the drawing "window" for the axis.
+ // scale: Number
+ // The new scale for the axis.
+ // offset: Number
+ // The new offset for the axis.
+ // returns: dojox.charting.axis2d.Default
+ // The reference to the axis for functional chaining.
+ this.scale = scale;
+ this.offset = offset;
+ return this.clear(); // dojox.charting.axis2d.Default
+ },
+ getWindowScale: function(){
+ // summary:
+ // Get the current windowing scale of the axis.
+ return "scale" in this ? this.scale : 1; // Number
+ },
+ getWindowOffset: function(){
+ // summary:
+ // Get the current windowing offset for the axis.
+ return "offset" in this ? this.offset : 0; // Number
+ },
+ _groupLabelWidth: function(labels, font, wcLimit){
+ if(!labels.length){
+ return 0;
+ }
+ if(dojo.isObject(labels[0])){
+ labels = df.map(labels, function(label){ return label.text; });
+ }
+ if (wcLimit) {
+ labels = df.map(labels, function(label){
+ return dojo.trim(label).length == 0 ? "" : label.substring(0, wcLimit) + this.trailingSymbol;
+ }, this);
+ }
+ var s = labels.join("<br>");
+ return dojox.gfx._base._getTextBox(s, {font: font}).w || 0;
+ },
+ calculate: function(min, max, span, labels){
+ // summary:
+ // Perform all calculations needed to render this axis.
+ // min: Number
+ // The smallest value represented on this axis.
+ // max: Number
+ // The largest value represented on this axis.
+ // span: Number
+ // The span in pixels over which axis calculations are made.
+ // labels: String[]
+ // Optional list of labels.
+ // returns: dojox.charting.axis2d.Default
+ // The reference to the axis for functional chaining.
+ if(this.initialized()){
+ return this;
+ }
+ var o = this.opt;
+ this.labels = "labels" in o ? o.labels : labels;
+ this.scaler = lin.buildScaler(min, max, span, o);
+ var tsb = this.scaler.bounds;
+ if("scale" in this){
+ // calculate new range
+ o.from = tsb.lower + this.offset;
+ o.to = (tsb.upper - tsb.lower) / this.scale + o.from;
+ // make sure that bounds are correct
+ if( !isFinite(o.from) ||
+ isNaN(o.from) ||
+ !isFinite(o.to) ||
+ isNaN(o.to) ||
+ o.to - o.from >= tsb.upper - tsb.lower
+ ){
+ // any error --- remove from/to bounds
+ delete o.from;
+ delete o.to;
+ delete this.scale;
+ delete this.offset;
+ }else{
+ // shift the window, if we are out of bounds
+ if(o.from < tsb.lower){
+ o.to += tsb.lower - o.from;
+ o.from = tsb.lower;
+ }else if(o.to > tsb.upper){
+ o.from += tsb.upper - o.to;
+ o.to = tsb.upper;
+ }
+ // update the offset
+ this.offset = o.from - tsb.lower;
+ }
+ // re-calculate the scaler
+ this.scaler = lin.buildScaler(min, max, span, o);
+ tsb = this.scaler.bounds;
+ // cleanup
+ if(this.scale == 1 && this.offset == 0){
+ delete this.scale;
+ delete this.offset;
+ }
+ }
+
+ var ta = this.chart.theme.axis, labelWidth = 0, rotation = o.rotation % 360,
+ // TODO: we use one font --- of major tick, we need to use major and minor fonts
+ taFont = o.font || (ta.majorTick && ta.majorTick.font) || (ta.tick && ta.tick.font),
+ size = taFont ? g.normalizedLength(g.splitFontString(taFont).size) : 0,
+ cosr = Math.abs(Math.cos(rotation * Math.PI / 180)),
+ sinr = Math.abs(Math.sin(rotation * Math.PI / 180));
+
+ if(rotation < 0){
+ rotation += 360;
+ }
+
+ if(size){
+ if(this.vertical ? rotation != 0 && rotation != 180 : rotation != 90 && rotation != 270){
+ // we need width of all labels
+ if(this.labels){
+ labelWidth = this._groupLabelWidth(this.labels, taFont, o.maxLabelCharCount);
+ }else{
+ var labelLength = Math.ceil(
+ Math.log(
+ Math.max(
+ Math.abs(tsb.from),
+ Math.abs(tsb.to)
+ )
+ ) / Math.LN10
+ ),
+ t = [];
+ if(tsb.from < 0 || tsb.to < 0){
+ t.push("-");
+ }
+ t.push(dojo.string.rep("9", labelLength));
+ var precision = Math.floor(
+ Math.log( tsb.to - tsb.from ) / Math.LN10
+ );
+ if(precision > 0){
+ t.push(".");
+ t.push(dojo.string.rep("9", precision));
+ }
+ labelWidth = dojox.gfx._base._getTextBox(
+ t.join(""),
+ { font: taFont }
+ ).w;
+ }
+ labelWidth = o.maxLabelSize ? Math.min(o.maxLabelSize, labelWidth) : labelWidth;
+ }else{
+ labelWidth = size;
+ }
+ switch(rotation){
+ case 0:
+ case 90:
+ case 180:
+ case 270:
+ // trivial cases: use labelWidth
+ break;
+ default:
+ // rotated labels
+ var gap1 = Math.sqrt(labelWidth * labelWidth + size * size), // short labels
+ gap2 = this.vertical ? size * cosr + labelWidth * sinr : labelWidth * cosr + size * sinr; // slanted labels
+ labelWidth = Math.min(gap1, gap2);
+ break;
+ }
+ }
+
+ this.scaler.minMinorStep = labelWidth + labelGap;
+ this.ticks = lin.buildTicks(this.scaler, o);
+ return this; // dojox.charting.axis2d.Default
+ },
+ getScaler: function(){
+ // summary:
+ // Get the pre-calculated scaler object.
+ return this.scaler; // Object
+ },
+ getTicks: function(){
+ // summary:
+ // Get the pre-calculated ticks object.
+ return this.ticks; // Object
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.axis2d.Default"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.axis2d.Default"] = true;
+dojo.provide("dojox.charting.axis2d.Default");
+
+
+
+
+
+
+
+
+
+
+
+
+/*=====
+ dojox.charting.axis2d.__AxisCtorArgs = function(
+ vertical, fixUpper, fixLower, natural, leftBottom,
+ includeZero, fixed, majorLabels, minorTicks, minorLabels, microTicks, htmlLabels,
+ min, max, from, to, majorTickStep, minorTickStep, microTickStep,
+ labels, labelFunc, maxLabelSize,
+ stroke, majorTick, minorTick, microTick, tick,
+ font, fontColor
+ ){
+ // summary:
+ // Optional arguments used in the definition of an axis.
+ //
+ // vertical: Boolean?
+ // A flag that says whether an axis is vertical (i.e. y axis) or horizontal. Default is false (horizontal).
+ // fixUpper: String?
+ // Align the greatest value on the axis with the specified tick level. Options are "major", "minor", "micro", or "none". Defaults to "none".
+ // fixLower: String?
+ // Align the smallest value on the axis with the specified tick level. Options are "major", "minor", "micro", or "none". Defaults to "none".
+ // natural: Boolean?
+ // Ensure tick marks are made on "natural" numbers. Defaults to false.
+ // leftBottom: Boolean?
+ // The position of a vertical axis; if true, will be placed against the left-bottom corner of the chart. Defaults to true.
+ // includeZero: Boolean?
+ // Include 0 on the axis rendering. Default is false.
+ // fixed: Boolean?
+ // Force all axis labels to be fixed numbers. Default is true.
+ // majorLabels: Boolean?
+ // Flag to draw all labels at major ticks. Default is true.
+ // minorTicks: Boolean?
+ // Flag to draw minor ticks on an axis. Default is true.
+ // minorLabels: Boolean?
+ // Flag to draw labels on minor ticks. Default is true.
+ // microTicks: Boolean?
+ // Flag to draw micro ticks on an axis. Default is false.
+ // htmlLabels: Boolean?
+ // Flag to use HTML (as opposed to the native vector graphics engine) to draw labels. Default is true.
+ // min: Number?
+ // The smallest value on an axis. Default is 0.
+ // max: Number?
+ // The largest value on an axis. Default is 1.
+ // from: Number?
+ // Force the chart to render data visible from this value. Default is 0.
+ // to: Number?
+ // Force the chart to render data visible to this value. Default is 1.
+ // majorTickStep: Number?
+ // The amount to skip before a major tick is drawn. Default is 4.
+ // minorTickStep: Number?
+ // The amount to skip before a minor tick is drawn. Default is 2.
+ // microTickStep: Number?
+ // The amount to skip before a micro tick is drawn. Default is 1.
+ // labels: Object[]?
+ // An array of labels for major ticks, with corresponding numeric values, ordered by value.
+ // labelFunc: Function?
+ // An optional function used to compute label values.
+ // maxLabelSize: Number?
+ // The maximum size, in pixels, for a label. To be used with the optional label function.
+ // stroke: dojox.gfx.Stroke?
+ // An optional stroke to be used for drawing an axis.
+ // majorTick: Object?
+ // An object containing a dojox.gfx.Stroke, and a length (number) for a major tick.
+ // minorTick: Object?
+ // An object containing a dojox.gfx.Stroke, and a length (number) for a minor tick.
+ // microTick: Object?
+ // An object containing a dojox.gfx.Stroke, and a length (number) for a micro tick.
+ // tick: Object?
+ // An object containing a dojox.gfx.Stroke, and a length (number) for a tick.
+ // font: String?
+ // An optional font definition (as used in the CSS font property) for labels.
+ // fontColor: String|dojo.Color?
+ // An optional color to be used in drawing labels.
+
+ this.vertical = vertical;
+ this.fixUpper = fixUpper;
+ this.fixLower = fixLower;
+ this.natural = natural;
+ this.leftBottom = leftBottom;
+ this.includeZero = includeZero;
+ this.fixed = fixed;
+ this.majorLabels = majorLabels;
+ this.minorTicks = minorTicks;
+ this.minorLabels = minorLabels;
+ this.microTicks = microTicks;
+ this.htmlLabels = htmlLabels;
+ this.min = min;
+ this.max = max;
+ this.from = from;
+ this.to = to;
+ this.majorTickStep = majorTickStep;
+ this.minorTickStep = minorTickStep;
+ this.microTickStep = microTickStep;
+ this.labels = labels;
+ this.labelFunc = labelFunc;
+ this.maxLabelSize = maxLabelSize;
+ this.stroke = stroke;
+ this.majorTick = majorTick;
+ this.minorTick = minorTick;
+ this.microTick = microTick;
+ this.tick = tick;
+ this.font = font;
+ this.fontColor = fontColor;
+}
+=====*/
+(function(){
+ var dc = dojox.charting,
+ du = dojox.lang.utils,
+ g = dojox.gfx,
+ lin = dc.scaler.linear,
+ labelGap = 4, // in pixels
+ centerAnchorLimit = 45; // in degrees
+
+ dojo.declare("dojox.charting.axis2d.Default", dojox.charting.axis2d.Invisible, {
+ // summary:
+ // The default axis object used in dojox.charting. See dojox.charting.Chart.addAxis for details.
+ //
+ // defaultParams: Object
+ // The default parameters used to define any axis.
+ // optionalParams: Object
+ // Any optional parameters needed to define an axis.
+
+ /*
+ // TODO: the documentation tools need these to be pre-defined in order to pick them up
+ // correctly, but the code here is partially predicated on whether or not the properties
+ // actually exist. For now, we will leave these undocumented but in the code for later. -- TRT
+
+ // opt: Object
+ // The actual options used to define this axis, created at initialization.
+ // scalar: Object
+ // The calculated helper object to tell charts how to draw an axis and any data.
+ // ticks: Object
+ // The calculated tick object that helps a chart draw the scaling on an axis.
+ // dirty: Boolean
+ // The state of the axis (whether it needs to be redrawn or not)
+ // scale: Number
+ // The current scale of the axis.
+ // offset: Number
+ // The current offset of the axis.
+
+ opt: null,
+ scalar: null,
+ ticks: null,
+ dirty: true,
+ scale: 1,
+ offset: 0,
+ */
+ defaultParams: {
+ vertical: false, // true for vertical axis
+ fixUpper: "none", // align the upper on ticks: "major", "minor", "micro", "none"
+ fixLower: "none", // align the lower on ticks: "major", "minor", "micro", "none"
+ natural: false, // all tick marks should be made on natural numbers
+ leftBottom: true, // position of the axis, used with "vertical"
+ includeZero: false, // 0 should be included
+ fixed: true, // all labels are fixed numbers
+ majorLabels: true, // draw major labels
+ minorTicks: true, // draw minor ticks
+ minorLabels: true, // draw minor labels
+ microTicks: false, // draw micro ticks
+ rotation: 0, // label rotation angle in degrees
+ htmlLabels: true // use HTML to draw labels
+ },
+ optionalParams: {
+ min: 0, // minimal value on this axis
+ max: 1, // maximal value on this axis
+ from: 0, // visible from this value
+ to: 1, // visible to this value
+ majorTickStep: 4, // major tick step
+ minorTickStep: 2, // minor tick step
+ microTickStep: 1, // micro tick step
+ labels: [], // array of labels for major ticks
+ // with corresponding numeric values
+ // ordered by values
+ labelFunc: null, // function to compute label values
+ maxLabelSize: 0, // size in px. For use with labelFunc
+ maxLabelCharCount: 0, // size in word count.
+ trailingSymbol: null,
+
+ // TODO: add support for minRange!
+ // minRange: 1, // smallest distance from min allowed on the axis
+
+ // theme components
+ stroke: {}, // stroke for an axis
+ majorTick: {}, // stroke + length for a tick
+ minorTick: {}, // stroke + length for a tick
+ microTick: {}, // stroke + length for a tick
+ tick: {}, // stroke + length for a tick
+ font: "", // font for labels
+ fontColor: "", // color for labels as a string
+ title: "", // axis title
+ titleGap: 0, // gap between axis title and axis label
+ titleFont: "", // axis title font
+ titleFontColor: "", // axis title font color
+ titleOrientation: "" // "axis" means the title facing the axis, "away" means facing away
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for an axis.
+ // chart: dojox.charting.Chart2D
+ // The chart the axis belongs to.
+ // kwArgs: dojox.charting.axis2d.__AxisCtorArgs?
+ // Any optional keyword arguments to be used to define this axis.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ },
+ getOffsets: function(){
+ // summary:
+ // Get the physical offset values for this axis (used in drawing data series).
+ // returns: Object
+ // The calculated offsets in the form of { l, r, t, b } (left, right, top, bottom).
+ var s = this.scaler, offsets = { l: 0, r: 0, t: 0, b: 0 };
+ if(!s){
+ return offsets;
+ }
+ var o = this.opt, labelWidth = 0, a, b, c, d,
+ gl = dc.scaler.common.getNumericLabel,
+ offset = 0, ma = s.major, mi = s.minor,
+ ta = this.chart.theme.axis,
+ // TODO: we use one font --- of major tick, we need to use major and minor fonts
+ taFont = o.font || (ta.majorTick && ta.majorTick.font) || (ta.tick && ta.tick.font),
+ taTitleFont = o.titleFont || (ta.tick && ta.tick.titleFont),
+ taTitleGap = (o.titleGap==0) ? 0 : o.titleGap || (ta.tick && ta.tick.titleGap) || 15,
+ taMajorTick = this.chart.theme.getTick("major", o),
+ taMinorTick = this.chart.theme.getTick("minor", o),
+ size = taFont ? g.normalizedLength(g.splitFontString(taFont).size) : 0,
+ tsize = taTitleFont ? g.normalizedLength(g.splitFontString(taTitleFont).size) : 0,
+ rotation = o.rotation % 360, leftBottom = o.leftBottom,
+ cosr = Math.abs(Math.cos(rotation * Math.PI / 180)),
+ sinr = Math.abs(Math.sin(rotation * Math.PI / 180));
+ this.trailingSymbol = (o.trailingSymbol === undefined || o.trailingSymbol === null) ? this.trailingSymbol : o.trailingSymbol;
+ if(rotation < 0){
+ rotation += 360;
+ }
+
+ if(size){
+ // we need width of all labels
+ if(this.labels){
+ labelWidth = this._groupLabelWidth(this.labels, taFont, o.maxLabelCharCount);
+ }else{
+ labelWidth = this._groupLabelWidth([
+ gl(ma.start, ma.prec, o),
+ gl(ma.start + ma.count * ma.tick, ma.prec, o),
+ gl(mi.start, mi.prec, o),
+ gl(mi.start + mi.count * mi.tick, mi.prec, o)
+ ], taFont, o.maxLabelCharCount);
+ }
+ labelWidth = o.maxLabelSize ? Math.min(o.maxLabelSize, labelWidth) : labelWidth;
+ if(this.vertical){
+ var side = leftBottom ? "l" : "r";
+ switch(rotation){
+ case 0:
+ case 180:
+ offsets[side] = labelWidth;
+ offsets.t = offsets.b = size / 2;
+ break;
+ case 90:
+ case 270:
+ offsets[side] = size;
+ offsets.t = offsets.b = labelWidth / 2;
+ break;
+ default:
+ if(rotation <= centerAnchorLimit || (180 < rotation && rotation <= (180 + centerAnchorLimit))){
+ offsets[side] = size * sinr / 2 + labelWidth * cosr;
+ offsets[leftBottom ? "t" : "b"] = size * cosr / 2 + labelWidth * sinr;
+ offsets[leftBottom ? "b" : "t"] = size * cosr / 2;
+ }else if(rotation > (360 - centerAnchorLimit) || (180 > rotation && rotation > (180 - centerAnchorLimit))){
+ offsets[side] = size * sinr / 2 + labelWidth * cosr;
+ offsets[leftBottom ? "b" : "t"] = size * cosr / 2 + labelWidth * sinr;
+ offsets[leftBottom ? "t" : "b"] = size * cosr / 2;
+ }else if(rotation < 90 || (180 < rotation && rotation < 270)){
+ offsets[side] = size * sinr + labelWidth * cosr;
+ offsets[leftBottom ? "t" : "b"] = size * cosr + labelWidth * sinr;
+ }else{
+ offsets[side] = size * sinr + labelWidth * cosr;
+ offsets[leftBottom ? "b" : "t"] = size * cosr + labelWidth * sinr;
+ }
+ break;
+ }
+ offsets[side] += labelGap + Math.max(taMajorTick.length, taMinorTick.length) + (o.title ? (tsize + taTitleGap) : 0);
+ }else{
+ var side = leftBottom ? "b" : "t";
+ switch(rotation){
+ case 0:
+ case 180:
+ offsets[side] = size;
+ offsets.l = offsets.r = labelWidth / 2;
+ break;
+ case 90:
+ case 270:
+ offsets[side] = labelWidth;
+ offsets.l = offsets.r = size / 2;
+ break;
+ default:
+ if((90 - centerAnchorLimit) <= rotation && rotation <= 90 || (270 - centerAnchorLimit) <= rotation && rotation <= 270){
+ offsets[side] = size * sinr / 2 + labelWidth * cosr;
+ offsets[leftBottom ? "r" : "l"] = size * cosr / 2 + labelWidth * sinr;
+ offsets[leftBottom ? "l" : "r"] = size * cosr / 2;
+ }else if(90 <= rotation && rotation <= (90 + centerAnchorLimit) || 270 <= rotation && rotation <= (270 + centerAnchorLimit)){
+ offsets[side] = size * sinr / 2 + labelWidth * cosr;
+ offsets[leftBottom ? "l" : "r"] = size * cosr / 2 + labelWidth * sinr;
+ offsets[leftBottom ? "r" : "l"] = size * cosr / 2;
+ }else if(rotation < centerAnchorLimit || (180 < rotation && rotation < (180 - centerAnchorLimit))){
+ offsets[side] = size * sinr + labelWidth * cosr;
+ offsets[leftBottom ? "r" : "l"] = size * cosr + labelWidth * sinr;
+ }else{
+ offsets[side] = size * sinr + labelWidth * cosr;
+ offsets[leftBottom ? "l" : "r"] = size * cosr + labelWidth * sinr;
+ }
+ break;
+ }
+ offsets[side] += labelGap + Math.max(taMajorTick.length, taMinorTick.length) + (o.title ? (tsize + taTitleGap) : 0);
+ }
+ }
+ if(labelWidth){
+ this._cachedLabelWidth = labelWidth;
+ }
+ return offsets; // Object
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Render/draw the axis.
+ // dim: Object
+ // An object of the form { width, height}.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.axis2d.Default
+ // The reference to the axis for functional chaining.
+ if(!this.dirty){
+ return this; // dojox.charting.axis2d.Default
+ }
+ // prepare variable
+ var o = this.opt, ta = this.chart.theme.axis, leftBottom = o.leftBottom, rotation = o.rotation % 360,
+ start, stop, titlePos, titleRotation=0, titleOffset, axisVector, tickVector, anchorOffset, labelOffset, labelAlign,
+
+ // TODO: we use one font --- of major tick, we need to use major and minor fonts
+ taFont = o.font || (ta.majorTick && ta.majorTick.font) || (ta.tick && ta.tick.font),
+ taTitleFont = o.titleFont || (ta.tick && ta.tick.titleFont),
+ // TODO: we use one font color --- we need to use different colors
+ taFontColor = o.fontColor || (ta.majorTick && ta.majorTick.fontColor) || (ta.tick && ta.tick.fontColor) || "black",
+ taTitleFontColor = o.titleFontColor || (ta.tick && ta.tick.titleFontColor) || "black",
+ taTitleGap = (o.titleGap==0) ? 0 : o.titleGap || (ta.tick && ta.tick.titleGap) || 15,
+ taTitleOrientation = o.titleOrientation || (ta.tick && ta.tick.titleOrientation) || "axis",
+ taMajorTick = this.chart.theme.getTick("major", o),
+ taMinorTick = this.chart.theme.getTick("minor", o),
+ taMicroTick = this.chart.theme.getTick("micro", o),
+
+ tickSize = Math.max(taMajorTick.length, taMinorTick.length, taMicroTick.length),
+ taStroke = "stroke" in o ? o.stroke : ta.stroke,
+ size = taFont ? g.normalizedLength(g.splitFontString(taFont).size) : 0,
+ cosr = Math.abs(Math.cos(rotation * Math.PI / 180)),
+ sinr = Math.abs(Math.sin(rotation * Math.PI / 180)),
+ tsize = taTitleFont ? g.normalizedLength(g.splitFontString(taTitleFont).size) : 0;
+ if(rotation < 0){
+ rotation += 360;
+ }
+ if(this.vertical){
+ start = {y: dim.height - offsets.b};
+ stop = {y: offsets.t};
+ titlePos = {y: (dim.height - offsets.b + offsets.t)/2};
+ titleOffset = size * sinr + (this._cachedLabelWidth || 0) * cosr + labelGap + Math.max(taMajorTick.length, taMinorTick.length) + tsize + taTitleGap;
+ axisVector = {x: 0, y: -1};
+ labelOffset = {x: 0, y: 0};
+ tickVector = {x: 1, y: 0};
+ anchorOffset = {x: labelGap, y: 0};
+ switch(rotation){
+ case 0:
+ labelAlign = "end";
+ labelOffset.y = size * 0.4;
+ break;
+ case 90:
+ labelAlign = "middle";
+ labelOffset.x = -size;
+ break;
+ case 180:
+ labelAlign = "start";
+ labelOffset.y = -size * 0.4;
+ break;
+ case 270:
+ labelAlign = "middle";
+ break;
+ default:
+ if(rotation < centerAnchorLimit){
+ labelAlign = "end";
+ labelOffset.y = size * 0.4;
+ }else if(rotation < 90){
+ labelAlign = "end";
+ labelOffset.y = size * 0.4;
+ }else if(rotation < (180 - centerAnchorLimit)){
+ labelAlign = "start";
+ }else if(rotation < (180 + centerAnchorLimit)){
+ labelAlign = "start";
+ labelOffset.y = -size * 0.4;
+ }else if(rotation < 270){
+ labelAlign = "start";
+ labelOffset.x = leftBottom ? 0 : size * 0.4;
+ }else if(rotation < (360 - centerAnchorLimit)){
+ labelAlign = "end";
+ labelOffset.x = leftBottom ? 0 : size * 0.4;
+ }else{
+ labelAlign = "end";
+ labelOffset.y = size * 0.4;
+ }
+ }
+ if(leftBottom){
+ start.x = stop.x = offsets.l;
+ titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 90 : 270;
+ titlePos.x = offsets.l - titleOffset + (titleRotation == 270 ? tsize : 0);
+ tickVector.x = -1;
+ anchorOffset.x = -anchorOffset.x;
+ }else{
+ start.x = stop.x = dim.width - offsets.r;
+ titleRotation = (taTitleOrientation && taTitleOrientation == "axis") ? 90 : 270;
+ titlePos.x = dim.width - offsets.r + titleOffset - (titleRotation == 270 ? 0 : tsize);
+ switch(labelAlign){
+ case "start":
+ labelAlign = "end";
+ break;
+ case "end":
+ labelAlign = "start";
+ break;
+ case "middle":
+ labelOffset.x += size;
+ break;
+ }
+ }
+ }else{
+ start = {x: offsets.l};
+ stop = {x: dim.width - offsets.r};
+ titlePos = {x: (dim.width - offsets.r + offsets.l)/2};
+ titleOffset = size * cosr + (this._cachedLabelWidth || 0) * sinr + labelGap + Math.max(taMajorTick.length, taMinorTick.length) + tsize + taTitleGap;
+ axisVector = {x: 1, y: 0};
+ labelOffset = {x: 0, y: 0};
+ tickVector = {x: 0, y: 1};
+ anchorOffset = {x: 0, y: labelGap};
+ switch(rotation){
+ case 0:
+ labelAlign = "middle";
+ labelOffset.y = size;
+ break;
+ case 90:
+ labelAlign = "start";
+ labelOffset.x = -size * 0.4;
+ break;
+ case 180:
+ labelAlign = "middle";
+ break;
+ case 270:
+ labelAlign = "end";
+ labelOffset.x = size * 0.4;
+ break;
+ default:
+ if(rotation < (90 - centerAnchorLimit)){
+ labelAlign = "start";
+ labelOffset.y = leftBottom ? size : 0;
+ }else if(rotation < (90 + centerAnchorLimit)){
+ labelAlign = "start";
+ labelOffset.x = -size * 0.4;
+ }else if(rotation < 180){
+ labelAlign = "start";
+ labelOffset.y = leftBottom ? 0 : -size;
+ }else if(rotation < (270 - centerAnchorLimit)){
+ labelAlign = "end";
+ labelOffset.y = leftBottom ? 0 : -size;
+ }else if(rotation < (270 + centerAnchorLimit)){
+ labelAlign = "end";
+ labelOffset.y = leftBottom ? size * 0.4 : 0;
+ }else{
+ labelAlign = "end";
+ labelOffset.y = leftBottom ? size : 0;
+ }
+ }
+ if(leftBottom){
+ start.y = stop.y = dim.height - offsets.b;
+ titleRotation = (taTitleOrientation && taTitleOrientation == "axis") ? 180 : 0;
+ titlePos.y = dim.height - offsets.b + titleOffset - (titleRotation ? tsize : 0);
+ }else{
+ start.y = stop.y = offsets.t;
+ titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0;
+ titlePos.y = offsets.t - titleOffset + (titleRotation ? 0 : tsize);
+ tickVector.y = -1;
+ anchorOffset.y = -anchorOffset.y;
+ switch(labelAlign){
+ case "start":
+ labelAlign = "end";
+ break;
+ case "end":
+ labelAlign = "start";
+ break;
+ case "middle":
+ labelOffset.y -= size;
+ break;
+ }
+ }
+ }
+
+ // render shapes
+
+ this.cleanGroup();
+
+ try{
+ var s = this.group,
+ c = this.scaler,
+ t = this.ticks,
+ canLabel,
+ f = lin.getTransformerFromModel(this.scaler),
+ // GFX Canvas now supports labels, so let's _not_ fallback to HTML anymore on canvas, just use
+ // HTML labels if explicitly asked + no rotation + no IE + no Opera
+ labelType = !titleRotation && !rotation && this.opt.htmlLabels && !dojo.isIE && !dojo.isOpera ? "html" : "gfx",
+ dx = tickVector.x * taMajorTick.length,
+ dy = tickVector.y * taMajorTick.length;
+
+ s.createLine({
+ x1: start.x,
+ y1: start.y,
+ x2: stop.x,
+ y2: stop.y
+ }).setStroke(taStroke);
+
+ //create axis title
+ if(o.title){
+ var axisTitle = dc.axis2d.common.createText[labelType](
+ this.chart,
+ s,
+ titlePos.x,
+ titlePos.y,
+ "middle",
+ o.title,
+ taTitleFont,
+ taTitleFontColor
+ );
+ if(labelType == "html"){
+ this.htmlElements.push(axisTitle);
+ }else{
+ //as soon as rotation is provided, labelType won't be "html"
+ //rotate gfx labels
+ axisTitle.setTransform(g.matrix.rotategAt(titleRotation, titlePos.x, titlePos.y));
+ }
+ }
+
+ dojo.forEach(t.major, function(tick){
+ var offset = f(tick.value), elem,
+ x = start.x + axisVector.x * offset,
+ y = start.y + axisVector.y * offset;
+ s.createLine({
+ x1: x, y1: y,
+ x2: x + dx,
+ y2: y + dy
+ }).setStroke(taMajorTick);
+ if(tick.label){
+ var label = o.maxLabelCharCount ? this.getTextWithLimitCharCount(tick.label, taFont, o.maxLabelCharCount) : {
+ text: tick.label,
+ truncated: false
+ };
+ label = o.maxLabelSize ? this.getTextWithLimitLength(label.text, taFont, o.maxLabelSize, label.truncated) : label;
+ elem = dc.axis2d.common.createText[labelType](
+ this.chart,
+ s,
+ x + dx + anchorOffset.x + (rotation ? 0 : labelOffset.x),
+ y + dy + anchorOffset.y + (rotation ? 0 : labelOffset.y),
+ labelAlign,
+ label.text,
+ taFont,
+ taFontColor
+ //this._cachedLabelWidth
+ );
+ label.truncated && this.labelTooltip(elem, this.chart, tick.label, label.text, taFont, labelType);
+ if(labelType == "html"){
+ this.htmlElements.push(elem);
+ }else if(rotation){
+ elem.setTransform([
+ {dx: labelOffset.x, dy: labelOffset.y},
+ g.matrix.rotategAt(
+ rotation,
+ x + dx + anchorOffset.x,
+ y + dy + anchorOffset.y
+ )
+ ]);
+ }
+ }
+ }, this);
+
+ dx = tickVector.x * taMinorTick.length;
+ dy = tickVector.y * taMinorTick.length;
+ canLabel = c.minMinorStep <= c.minor.tick * c.bounds.scale;
+ dojo.forEach(t.minor, function(tick){
+ var offset = f(tick.value), elem,
+ x = start.x + axisVector.x * offset,
+ y = start.y + axisVector.y * offset;
+ s.createLine({
+ x1: x, y1: y,
+ x2: x + dx,
+ y2: y + dy
+ }).setStroke(taMinorTick);
+ if(canLabel && tick.label){
+ var label = o.maxLabelCharCount ? this.getTextWithLimitCharCount(tick.label, taFont, o.maxLabelCharCount) : {
+ text: tick.label,
+ truncated: false
+ };
+ label = o.maxLabelSize ? this.getTextWithLimitLength(label.text, taFont, o.maxLabelSize, label.truncated) : label;
+ elem = dc.axis2d.common.createText[labelType](
+ this.chart,
+ s,
+ x + dx + anchorOffset.x + (rotation ? 0 : labelOffset.x),
+ y + dy + anchorOffset.y + (rotation ? 0 : labelOffset.y),
+ labelAlign,
+ label.text,
+ taFont,
+ taFontColor
+ //this._cachedLabelWidth
+ );
+ label.truncated && this.labelTooltip(elem, this.chart, tick.label, label.text, taFont, labelType);
+ if(labelType == "html"){
+ this.htmlElements.push(elem);
+ }else if(rotation){
+ elem.setTransform([
+ {dx: labelOffset.x, dy: labelOffset.y},
+ g.matrix.rotategAt(
+ rotation,
+ x + dx + anchorOffset.x,
+ y + dy + anchorOffset.y
+ )
+ ]);
+ }
+ }
+ }, this);
+
+ dx = tickVector.x * taMicroTick.length;
+ dy = tickVector.y * taMicroTick.length;
+ dojo.forEach(t.micro, function(tick){
+ var offset = f(tick.value), elem,
+ x = start.x + axisVector.x * offset,
+ y = start.y + axisVector.y * offset;
+ s.createLine({
+ x1: x, y1: y,
+ x2: x + dx,
+ y2: y + dy
+ }).setStroke(taMicroTick);
+ }, this);
+ }catch(e){
+ // squelch
+ }
+
+ this.dirty = false;
+ return this; // dojox.charting.axis2d.Default
+ },
+ labelTooltip: function(elem, chart, label, truncatedLabel, font, elemType){
+ // to avoid requiring dijit module for that feature, let's test that
+ // dynamically and return if we can't do it
+ if(!dijit || !dijit.Tooltip){
+ return;
+ }
+ var aroundRect = {type: "rect"}, position = ["above", "below"],
+ fontWidth = dojox.gfx._base._getTextBox(truncatedLabel, {font: font}).w || 0;
+ fontHeight = font ? g.normalizedLength(g.splitFontString(font).size) : 0;
+ if(elemType == "html"){
+ dojo.mixin(aroundRect, dojo.coords(elem.firstChild, true));
+ aroundRect.width = Math.ceil(fontWidth);
+ aroundRect.height = Math.ceil(fontHeight);
+ this._events.push({
+ shape: dojo,
+ handle: dojo.connect(elem.firstChild, "onmouseover", this, function(e){
+ dijit.showTooltip(label, aroundRect, position);
+ })
+ });
+ this._events.push({
+ shape: dojo,
+ handle: dojo.connect(elem.firstChild, "onmouseout", this, function(e){
+ dijit.hideTooltip(aroundRect);
+ })
+ });
+ }else{
+ var shp = elem.getShape(),
+ lt = dojo.coords(chart.node, true);
+ aroundRect = dojo.mixin(aroundRect, {
+ x: shp.x - fontWidth / 2,
+ y: shp.y
+ });
+ aroundRect.x += lt.x;
+ aroundRect.y += lt.y;
+ aroundRect.x = Math.round(aroundRect.x);
+ aroundRect.y = Math.round(aroundRect.y);
+ aroundRect.width = Math.ceil(fontWidth);
+ aroundRect.height = Math.ceil(fontHeight);
+ this._events.push({
+ shape: elem,
+ handle: elem.connect("onmouseenter", this, function(e){
+ dijit.showTooltip(label, aroundRect, position);
+ })
+ });
+ this._events.push({
+ shape: elem,
+ handle: elem.connect("onmouseleave", this, function(e){
+ dijit.hideTooltip(aroundRect);
+ })
+ });
+ }
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.common"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.common"] = true;
+dojo.provide("dojox.charting.plot2d.common");
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common;
+
+ dojo.mixin(dojox.charting.plot2d.common, {
+ makeStroke: function(stroke){
+ if(!stroke){ return stroke; }
+ if(typeof stroke == "string" || stroke instanceof dojo.Color){
+ stroke = {color: stroke};
+ }
+ return dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke);
+ },
+ augmentColor: function(target, color){
+ var t = new dojo.Color(target),
+ c = new dojo.Color(color);
+ c.a = t.a;
+ return c;
+ },
+ augmentStroke: function(stroke, color){
+ var s = dc.makeStroke(stroke);
+ if(s){
+ s.color = dc.augmentColor(s.color, color);
+ }
+ return s;
+ },
+ augmentFill: function(fill, color){
+ var fc, c = new dojo.Color(color);
+ if(typeof fill == "string" || fill instanceof dojo.Color){
+ return dc.augmentColor(fill, color);
+ }
+ return fill;
+ },
+
+ defaultStats: {
+ vmin: Number.POSITIVE_INFINITY, vmax: Number.NEGATIVE_INFINITY,
+ hmin: Number.POSITIVE_INFINITY, hmax: Number.NEGATIVE_INFINITY
+ },
+
+ collectSimpleStats: function(series){
+ var stats = dojo.delegate(dc.defaultStats);
+ for(var i = 0; i < series.length; ++i){
+ var run = series[i];
+ for(var j = 0; j < run.data.length; j++){
+ if(run.data[j] !== null){
+ if(typeof run.data[j] == "number"){
+ // 1D case
+ var old_vmin = stats.vmin, old_vmax = stats.vmax;
+ if(!("ymin" in run) || !("ymax" in run)){
+ dojo.forEach(run.data, function(val, i){
+ if(val !== null){
+ var x = i + 1, y = val;
+ if(isNaN(y)){ y = 0; }
+ stats.hmin = Math.min(stats.hmin, x);
+ stats.hmax = Math.max(stats.hmax, x);
+ stats.vmin = Math.min(stats.vmin, y);
+ stats.vmax = Math.max(stats.vmax, y);
+ }
+ });
+ }
+ if("ymin" in run){ stats.vmin = Math.min(old_vmin, run.ymin); }
+ if("ymax" in run){ stats.vmax = Math.max(old_vmax, run.ymax); }
+ }else{
+ // 2D case
+ var old_hmin = stats.hmin, old_hmax = stats.hmax,
+ old_vmin = stats.vmin, old_vmax = stats.vmax;
+ if(!("xmin" in run) || !("xmax" in run) || !("ymin" in run) || !("ymax" in run)){
+ dojo.forEach(run.data, function(val, i){
+ if(val !== null){
+ var x = "x" in val ? val.x : i + 1, y = val.y;
+ if(isNaN(x)){ x = 0; }
+ if(isNaN(y)){ y = 0; }
+ stats.hmin = Math.min(stats.hmin, x);
+ stats.hmax = Math.max(stats.hmax, x);
+ stats.vmin = Math.min(stats.vmin, y);
+ stats.vmax = Math.max(stats.vmax, y);
+ }
+ });
+ }
+ if("xmin" in run){ stats.hmin = Math.min(old_hmin, run.xmin); }
+ if("xmax" in run){ stats.hmax = Math.max(old_hmax, run.xmax); }
+ if("ymin" in run){ stats.vmin = Math.min(old_vmin, run.ymin); }
+ if("ymax" in run){ stats.vmax = Math.max(old_vmax, run.ymax); }
+ }
+
+ break;
+ }
+ }
+ }
+ return stats;
+ },
+
+ calculateBarSize: function(/* Number */ availableSize, /* Object */ opt, /* Number? */ clusterSize){
+ if(!clusterSize){
+ clusterSize = 1;
+ }
+ var gap = opt.gap, size = (availableSize - 2 * gap) / clusterSize;
+ if("minBarSize" in opt){
+ size = Math.max(size, opt.minBarSize);
+ }
+ if("maxBarSize" in opt){
+ size = Math.min(size, opt.maxBarSize);
+ }
+ size = Math.max(size, 1);
+ gap = (availableSize - size * clusterSize) / 2;
+ return {size: size, gap: gap}; // Object
+ },
+
+ collectStackedStats: function(series){
+ // collect statistics
+ var stats = dojo.clone(dc.defaultStats);
+ if(series.length){
+ // 1st pass: find the maximal length of runs
+ stats.hmin = Math.min(stats.hmin, 1);
+ stats.hmax = df.foldl(series, "seed, run -> Math.max(seed, run.data.length)", stats.hmax);
+ // 2nd pass: stack values
+ for(var i = 0; i < stats.hmax; ++i){
+ var v = series[0].data[i];
+ v = v && (typeof v == "number" ? v : v.y);
+ if(isNaN(v)){ v = 0; }
+ stats.vmin = Math.min(stats.vmin, v);
+ for(var j = 1; j < series.length; ++j){
+ var t = series[j].data[i];
+ t = t && (typeof t == "number" ? t : t.y);
+ if(isNaN(t)){ t = 0; }
+ v += t;
+ }
+ stats.vmax = Math.max(stats.vmax, v);
+ }
+ }
+ return stats;
+ },
+
+ curve: function(/* Number[] */a, /* Number|String */tension){
+ // FIX for #7235, submitted by Enzo Michelangeli.
+ // Emulates the smoothing algorithms used in a famous, unnamed spreadsheet
+ // program ;)
+ var arr = a.slice(0);
+ if(tension == "x") {
+ arr[arr.length] = arr[0]; // add a last element equal to the first, closing the loop
+ }
+ var p=dojo.map(arr, function(item, i){
+ if(i==0){ return "M" + item.x + "," + item.y; }
+ if(!isNaN(tension)) { // use standard Dojo smoothing in tension is numeric
+ var dx=item.x-arr[i-1].x, dy=arr[i-1].y;
+ return "C"+(item.x-(tension-1)*(dx/tension))+","+dy+" "+(item.x-(dx/tension))+","+item.y+" "+item.x+","+item.y;
+ } else if(tension == "X" || tension == "x" || tension == "S") {
+ // use Excel "line smoothing" algorithm (http://xlrotor.com/resources/files.shtml)
+ var p0, p1 = arr[i-1], p2 = arr[i], p3;
+ var bz1x, bz1y, bz2x, bz2y;
+ var f = 1/6;
+ if(i==1) {
+ if(tension == "x") {
+ p0 = arr[arr.length-2];
+ } else { // "tension == X || tension == "S"
+ p0 = p1;
+ }
+ f = 1/3;
+ } else {
+ p0 = arr[i-2];
+ }
+ if(i==(arr.length-1)) {
+ if(tension == "x") {
+ p3 = arr[1];
+ } else { // "tension == X || tension == "S"
+ p3 = p2;
+ }
+ f = 1/3;
+ } else {
+ p3 = arr[i+1];
+ }
+ var p1p2 = Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));
+ var p0p2 = Math.sqrt((p2.x-p0.x)*(p2.x-p0.x)+(p2.y-p0.y)*(p2.y-p0.y));
+ var p1p3 = Math.sqrt((p3.x-p1.x)*(p3.x-p1.x)+(p3.y-p1.y)*(p3.y-p1.y));
+
+ var p0p2f = p0p2 * f;
+ var p1p3f = p1p3 * f;
+
+ if(p0p2f > p1p2/2 && p1p3f > p1p2/2) {
+ p0p2f = p1p2/2;
+ p1p3f = p1p2/2;
+ } else if(p0p2f > p1p2/2) {
+ p0p2f = p1p2/2;
+ p1p3f = p1p2/2 * p1p3/p0p2;
+ } else if(p1p3f > p1p2/2) {
+ p1p3f = p1p2/2;
+ p0p2f = p1p2/2 * p0p2/p1p3;
+ }
+
+ if(tension == "S") {
+ if(p0 == p1) { p0p2f = 0; }
+ if(p2 == p3) { p1p3f = 0; }
+ }
+
+ bz1x = p1.x + p0p2f*(p2.x - p0.x)/p0p2;
+ bz1y = p1.y + p0p2f*(p2.y - p0.y)/p0p2;
+ bz2x = p2.x - p1p3f*(p3.x - p1.x)/p1p3;
+ bz2y = p2.y - p1p3f*(p3.y - p1.y)/p1p3;
+ }
+ return "C"+(bz1x+","+bz1y+" "+bz2x+","+bz2y+" "+p2.x+","+p2.y);
+ });
+ return p.join(" ");
+ },
+
+ getLabel: function(/*Number*/number, /*Boolean*/fixed, /*Number*/precision){
+ if(dojo.number){
+ return (fixed ? dojo.number.format(number, {places : precision}) :
+ dojo.number.format(number)) || "";
+ }
+ return fixed ? number.toFixed(precision) : number.toString();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.scaler.primitive"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.scaler.primitive"] = true;
+dojo.provide("dojox.charting.scaler.primitive");
+
+dojox.charting.scaler.primitive = {
+ buildScaler: function(/*Number*/ min, /*Number*/ max, /*Number*/ span, /*Object*/ kwArgs){
+ if(min == max){
+ // artificially extend bounds
+ min -= 0.5;
+ max += 0.5;
+ // now the line will be centered
+ }
+ return {
+ bounds: {
+ lower: min,
+ upper: max,
+ from: min,
+ to: max,
+ scale: span / (max - min),
+ span: span
+ },
+ scaler: dojox.charting.scaler.primitive
+ };
+ },
+ buildTicks: function(/*Object*/ scaler, /*Object*/ kwArgs){
+ return {major: [], minor: [], micro: []}; // Object
+ },
+ getTransformerFromModel: function(/*Object*/ scaler){
+ var offset = scaler.bounds.from, scale = scaler.bounds.scale;
+ return function(x){ return (x - offset) * scale; }; // Function
+ },
+ getTransformerFromPlot: function(/*Object*/ scaler){
+ var offset = scaler.bounds.from, scale = scaler.bounds.scale;
+ return function(x){ return x / scale + offset; }; // Function
+ }
+};
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d._PlotEvents"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d._PlotEvents"] = true;
+dojo.provide("dojox.charting.plot2d._PlotEvents");
+
+dojo.declare("dojox.charting.plot2d._PlotEvents", null, {
+ constructor: function(){
+ this._shapeEvents = [];
+ this._eventSeries = {};
+ },
+ destroy: function(){
+ // summary:
+ // Destroy any internal elements and event handlers.
+ this.resetEvents();
+ this.inherited(arguments);
+ },
+ plotEvent: function(o){
+ // summary:
+ // Stub function for use by specific plots.
+ // o: Object
+ // An object intended to represent event parameters.
+ },
+ raiseEvent: function(o){
+ // summary:
+ // Raises events in predefined order
+ // o: Object
+ // An object intended to represent event parameters.
+ this.plotEvent(o);
+ var t = dojo.delegate(o);
+ t.originalEvent = o.type;
+ t.originalPlot = o.plot;
+ t.type = "onindirect";
+ dojo.forEach(this.chart.stack, function(plot){
+ if(plot !== this && plot.plotEvent){
+ t.plot = plot;
+ plot.plotEvent(t);
+ }
+ }, this);
+ },
+ connect: function(object, method){
+ // summary:
+ // Helper function to connect any object's method to our plotEvent.
+ // object: Object
+ // The object to connect to.
+ // method: String|Function
+ // The method to fire when our plotEvent is fired.
+ // returns: Array
+ // The handle as returned from dojo.connect (see dojo.connect).
+ this.dirty = true;
+ return dojo.connect(this, "plotEvent", object, method); // Array
+ },
+ events: function(){
+ // summary:
+ // Find out if any event handlers have been connected to our plotEvent.
+ // returns: Boolean
+ // A flag indicating that there are handlers attached.
+ var ls = this.plotEvent._listeners;
+ if(!ls || !ls.length){ return false; }
+ for(var i in ls){
+ if(!(i in Array.prototype)){
+ return true;
+ }
+ }
+ return false;
+ },
+ resetEvents: function(){
+ // summary:
+ // Reset all events attached to our plotEvent (i.e. disconnect).
+ if(this._shapeEvents.length){
+ dojo.forEach(this._shapeEvents, function(item){
+ item.shape.disconnect(item.handle);
+ });
+ this._shapeEvents = [];
+ }
+ this.raiseEvent({type: "onplotreset", plot: this});
+ },
+ _connectSingleEvent: function(o, eventName){
+ this._shapeEvents.push({
+ shape: o.eventMask,
+ handle: o.eventMask.connect(eventName, this, function(e){
+ o.type = eventName;
+ o.event = e;
+ this.raiseEvent(o);
+ o.event = null;
+ })
+ });
+ },
+ _connectEvents: function(o){
+ if(o){
+ o.chart = this.chart;
+ o.plot = this;
+ o.hAxis = this.hAxis || null;
+ o.vAxis = this.vAxis || null;
+ o.eventMask = o.eventMask || o.shape;
+ this._connectSingleEvent(o, "onmouseover");
+ this._connectSingleEvent(o, "onmouseout");
+ this._connectSingleEvent(o, "onclick");
+ }
+ },
+ _reconnectEvents: function(seriesName){
+ var a = this._eventSeries[seriesName];
+ if(a){
+ dojo.forEach(a, this._connectEvents, this);
+ }
+ },
+ fireEvent: function(seriesName, eventName, index, eventObject){
+ // summary:
+ // Emulates firing an event for a given data value (specified by
+ // an index) of a given series.
+ // seriesName: String:
+ // Series name.
+ // eventName: String:
+ // Event name to emulate.
+ // index: Number:
+ // Valid data value index used to raise an event.
+ // eventObject: Object?:
+ // Optional event object. Especially useful for synthetic events.
+ // Default: null.
+ var s = this._eventSeries[seriesName];
+ if(s && s.length && index < s.length){
+ var o = s[index];
+ o.type = eventName;
+ o.event = eventObject || null;
+ this.raiseEvent(o);
+ o.event = null;
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Base"] = true;
+dojo.provide("dojox.charting.plot2d.Base");
+
+
+
+
+
+
+/*=====
+dojox.charting.plot2d.__PlotCtorArgs = function(){
+ // summary:
+ // The base keyword arguments object for plot constructors.
+ // Note that the parameters for this may change based on the
+ // specific plot type (see the corresponding plot type for
+ // details).
+}
+=====*/
+dojo.declare("dojox.charting.plot2d.Base", [dojox.charting.Element, dojox.charting.plot2d._PlotEvents], {
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create a base plot for charting.
+ // chart: dojox.chart.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__PlotCtorArgs?
+ // An optional arguments object to help define the plot.
+ this.zoom = null,
+ this.zoomQueue = []; // zooming action task queue
+ this.lastWindow = {vscale: 1, hscale: 1, xoffset: 0, yoffset: 0};
+ },
+ clear: function(){
+ // summary:
+ // Clear out all of the information tied to this plot.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ this.series = [];
+ this._hAxis = null;
+ this._vAxis = null;
+ this.dirty = true;
+ return this; // dojox.charting.plot2d.Base
+ },
+ setAxis: function(axis){
+ // summary:
+ // Set an axis for this plot.
+ // axis: dojox.charting.axis2d.Base
+ // The axis to set.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ if(axis){
+ this[axis.vertical ? "_vAxis" : "_hAxis"] = axis;
+ }
+ return this; // dojox.charting.plot2d.Base
+ },
+ addSeries: function(run){
+ // summary:
+ // Add a data series to this plot.
+ // run: dojox.charting.Series
+ // The series to be added.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ this.series.push(run);
+ return this; // dojox.charting.plot2d.Base
+ },
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ return dojox.charting.plot2d.common.collectSimpleStats(this.series);
+ },
+ calculateAxes: function(dim){
+ // summary:
+ // Stub function for running the axis calculations (depricated).
+ // dim: Object
+ // An object of the form { width, height }
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ this.initializeScalers(dim, this.getSeriesStats());
+ return this; // dojox.charting.plot2d.Base
+ },
+ isDirty: function(){
+ // summary:
+ // Returns whether or not this plot needs to be rendered.
+ // returns: Boolean
+ // The state of the plot.
+ return this.dirty || this._hAxis && this._hAxis.dirty || this._vAxis && this._vAxis.dirty; // Boolean
+ },
+ isDataDirty: function(){
+ // summary:
+ // Returns whether or not any of this plot's data series need to be rendered.
+ // returns: Boolean
+ // Flag indicating if any of this plot's series are invalid and need rendering.
+ return dojo.some(this.series, function(item){ return item.dirty; }); // Boolean
+ },
+ performZoom: function(dim, offsets){
+ // summary:
+ // Create/alter any zooming windows on this plot.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+
+ // get current zooming various
+ var vs = this._vAxis.scale || 1,
+ hs = this._hAxis.scale || 1,
+ vOffset = dim.height - offsets.b,
+ hBounds = this._hScaler.bounds,
+ xOffset = (hBounds.from - hBounds.lower) * hBounds.scale,
+ vBounds = this._vScaler.bounds,
+ yOffset = (vBounds.from - vBounds.lower) * vBounds.scale;
+ // get incremental zooming various
+ rVScale = vs / this.lastWindow.vscale,
+ rHScale = hs / this.lastWindow.hscale,
+ rXOffset = (this.lastWindow.xoffset - xOffset)/
+ ((this.lastWindow.hscale == 1)? hs : this.lastWindow.hscale),
+ rYOffset = (yOffset - this.lastWindow.yoffset)/
+ ((this.lastWindow.vscale == 1)? vs : this.lastWindow.vscale),
+
+ shape = this.group,
+ anim = dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform:[
+ {name:"translate", start:[0, 0], end: [offsets.l * (1 - rHScale), vOffset * (1 - rVScale)]},
+ {name:"scale", start:[1, 1], end: [rHScale, rVScale]},
+ {name:"original"},
+ {name:"translate", start: [0, 0], end: [rXOffset, rYOffset]}
+ ]}, this.zoom));
+
+ dojo.mixin(this.lastWindow, {vscale: vs, hscale: hs, xoffset: xOffset, yoffset: yOffset});
+ //add anim to zooming action queue,
+ //in order to avoid several zooming action happened at the same time
+ this.zoomQueue.push(anim);
+ //perform each anim one by one in zoomQueue
+ dojo.connect(anim, "onEnd", this, function(){
+ this.zoom = null;
+ this.zoomQueue.shift();
+ if(this.zoomQueue.length > 0){
+ this.zoomQueue[0].play();
+ }
+ });
+ if(this.zoomQueue.length == 1){
+ this.zoomQueue[0].play();
+ }
+ return this; // dojox.charting.plot2d.Base
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Render the plot on the chart.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ return this; // dojox.charting.plot2d.Base
+ },
+ getRequiredColors: function(){
+ // summary:
+ // Get how many data series we have, so we know how many colors to use.
+ // returns: Number
+ // The number of colors needed.
+ return this.series.length; // Number
+ },
+ initializeScalers: function(dim, stats){
+ // summary:
+ // Initializes scalers using attached axes.
+ // dim: Object:
+ // Size of a plot area in pixels as {width, height}.
+ // stats: Object:
+ // Min/max of data in both directions as {hmin, hmax, vmin, vmax}.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ if(this._hAxis){
+ if(!this._hAxis.initialized()){
+ this._hAxis.calculate(stats.hmin, stats.hmax, dim.width);
+ }
+ this._hScaler = this._hAxis.getScaler();
+ }else{
+ this._hScaler = dojox.charting.scaler.primitive.buildScaler(stats.hmin, stats.hmax, dim.width);
+ }
+ if(this._vAxis){
+ if(!this._vAxis.initialized()){
+ this._vAxis.calculate(stats.vmin, stats.vmax, dim.height);
+ }
+ this._vScaler = this._vAxis.getScaler();
+ }else{
+ this._vScaler = dojox.charting.scaler.primitive.buildScaler(stats.vmin, stats.vmax, dim.height);
+ }
+ return this; // dojox.charting.plot2d.Base
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Default"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Default"] = true;
+dojo.provide("dojox.charting.plot2d.Default");
+
+
+
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.plot2d.__DefaultCtorArgs", dojox.charting.plot2d.__PlotCtorArgs, {
+ // summary:
+ // The arguments used for any/most plots.
+
+ // hAxis: String?
+ // The horizontal axis name.
+ hAxis: "x",
+
+ // vAxis: String?
+ // The vertical axis name
+ vAxis: "y",
+
+ // lines: Boolean?
+ // Whether or not to draw lines on this plot. Defaults to true.
+ lines: true,
+
+ // areas: Boolean?
+ // Whether or not to draw areas on this plot. Defaults to false.
+ areas: false,
+
+ // markers: Boolean?
+ // Whether or not to draw markers at data points on this plot. Default is false.
+ markers: false,
+
+ // tension: Number|String?
+ // Whether or not to apply 'tensioning' to the lines on this chart.
+ // Options include a number, "X", "x", or "S"; if a number is used, the
+ // simpler bezier curve calculations are used to draw the lines. If X, x or S
+ // is used, the more accurate smoothing algorithm is used.
+ tension: "",
+
+ // animate: Boolean?
+ // Whether or not to animate the chart to place.
+ animate: false,
+
+ // stroke: dojox.gfx.Stroke?
+ // An optional stroke to use for any series on the plot.
+ stroke: {},
+
+ // outline: dojox.gfx.Stroke?
+ // An optional stroke used to outline any series on the plot.
+ outline: {},
+
+ // shadow: dojox.gfx.Stroke?
+ // An optional stroke to use to draw any shadows for a series on a plot.
+ shadow: {},
+
+ // fill: dojox.gfx.Fill?
+ // Any fill to be used for elements on the plot (such as areas).
+ fill: {},
+
+ // font: String?
+ // A font definition to be used for labels and other text-based elements on the plot.
+ font: "",
+
+ // fontColor: String|dojo.Color?
+ // The color to be used for any text-based elements on the plot.
+ fontColor: "",
+
+ // markerStroke: dojo.gfx.Stroke?
+ // An optional stroke to use for any markers on the plot.
+ markerStroke: {},
+
+ // markerOutline: dojo.gfx.Stroke?
+ // An optional outline to use for any markers on the plot.
+ markerOutline: {},
+
+ // markerShadow: dojo.gfx.Stroke?
+ // An optional shadow to use for any markers on the plot.
+ markerShadow: {},
+
+ // markerFill: dojo.gfx.Fill?
+ // An optional fill to use for any markers on the plot.
+ markerFill: {},
+
+ // markerFont: String?
+ // An optional font definition to use for any markers on the plot.
+ markerFont: "",
+
+ // markerFontColor: String|dojo.Color?
+ // An optional color to use for any marker text on the plot.
+ markerFontColor: ""
+});
+=====*/
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ var DEFAULT_ANIMATION_LENGTH = 1200; // in ms
+
+ dojo.declare("dojox.charting.plot2d.Default", dojox.charting.plot2d.Base, {
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ lines: true, // draw lines
+ areas: false, // draw areas
+ markers: false, // draw markers
+ tension: "", // draw curved lines (tension is "X", "x", or "S")
+ animate: false // animate chart to place
+ },
+ optionalParams: {
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: "",
+ markerStroke: {},
+ markerOutline: {},
+ markerShadow: {},
+ markerFill: {},
+ markerFont: "",
+ markerFontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Return a new plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__DefaultCtorArgs?
+ // An optional arguments object to help define this plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+
+ // animation properties
+ this.animate = this.opt.animate;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Render/draw everything on this plot.
+ // dim: Object
+ // An object of the form { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b }
+ // returns: dojox.charting.plot2d.Default
+ // A reference to this plot for functional chaining.
+
+ // make sure all the series is not modified
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ this.group.setTransform(null);
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, stroke, outline, marker, events = this.events();
+
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ if(!run.data.length){
+ run.dirty = false;
+ t.skip();
+ continue;
+ }
+
+ var theme = t.next(this.opt.areas ? "area" : "line", [this.opt, run], true),
+ s = run.group, rsegments = [], startindexes = [], rseg = null, lpoly,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ eventSeries = this._eventSeries[run.name] = new Array(run.data.length);
+
+ // split the run data into dense segments (each containing no nulls)
+ for(var j = 0; j < run.data.length; j++){
+ if(run.data[j] != null){
+ if(!rseg){
+ rseg = [];
+ startindexes.push(j);
+ rsegments.push(rseg)
+ }
+ rseg.push(run.data[j]);
+ }else{
+ rseg = null;
+ }
+ }
+
+ for(var seg = 0; seg < rsegments.length; seg++){
+ if(typeof rsegments[seg][0] == "number"){
+ lpoly = dojo.map(rsegments[seg], function(v, i){
+ return {
+ x: ht(i + startindexes[seg] + 1) + offsets.l,
+ y: dim.height - offsets.b - vt(v)
+ };
+ }, this);
+ }else{
+ lpoly = dojo.map(rsegments[seg], function(v, i){
+ return {
+ x: ht(v.x) + offsets.l,
+ y: dim.height - offsets.b - vt(v.y)
+ };
+ }, this);
+ }
+
+ var lpath = this.opt.tension ? dc.curve(lpoly, this.opt.tension) : "";
+
+ if(this.opt.areas && lpoly.length > 1){
+ var fill = theme.series.fill;
+ var apoly = dojo.clone(lpoly);
+ if(this.opt.tension){
+ var apath = "L" + apoly[apoly.length-1].x + "," + (dim.height - offsets.b) +
+ " L" + apoly[0].x + "," + (dim.height - offsets.b) +
+ " L" + apoly[0].x + "," + apoly[0].y;
+ run.dyn.fill = s.createPath(lpath + " " + apath).setFill(fill).getFill();
+ } else {
+ apoly.push({x: lpoly[lpoly.length - 1].x, y: dim.height - offsets.b});
+ apoly.push({x: lpoly[0].x, y: dim.height - offsets.b});
+ apoly.push(lpoly[0]);
+ run.dyn.fill = s.createPolyline(apoly).setFill(fill).getFill();
+ }
+ }
+ if(this.opt.lines || this.opt.markers){
+ // need a stroke
+ stroke = theme.series.stroke;
+ if(theme.series.outline){
+ outline = run.dyn.outline = dc.makeStroke(theme.series.outline);
+ outline.width = 2 * outline.width + stroke.width;
+ }
+ }
+ if(this.opt.markers){
+ run.dyn.marker = theme.symbol;
+ }
+ var frontMarkers = null, outlineMarkers = null, shadowMarkers = null;
+ if(stroke && theme.series.shadow && lpoly.length > 1){
+ var shadow = theme.series.shadow,
+ spoly = dojo.map(lpoly, function(c){
+ return {x: c.x + shadow.dx, y: c.y + shadow.dy};
+ });
+ if(this.opt.lines){
+ if(this.opt.tension){
+ run.dyn.shadow = s.createPath(dc.curve(spoly, this.opt.tension)).setStroke(shadow).getStroke();
+ } else {
+ run.dyn.shadow = s.createPolyline(spoly).setStroke(shadow).getStroke();
+ }
+ }
+ if(this.opt.markers && theme.marker.shadow){
+ shadow = theme.marker.shadow;
+ shadowMarkers = dojo.map(spoly, function(c){
+ return s.createPath("M" + c.x + " " + c.y + " " + theme.symbol).
+ setStroke(shadow).setFill(shadow.color);
+ }, this);
+ }
+ }
+ if(this.opt.lines && lpoly.length > 1){
+ if(outline){
+ if(this.opt.tension){
+ run.dyn.outline = s.createPath(lpath).setStroke(outline).getStroke();
+ } else {
+ run.dyn.outline = s.createPolyline(lpoly).setStroke(outline).getStroke();
+ }
+ }
+ if(this.opt.tension){
+ run.dyn.stroke = s.createPath(lpath).setStroke(stroke).getStroke();
+ } else {
+ run.dyn.stroke = s.createPolyline(lpoly).setStroke(stroke).getStroke();
+ }
+ }
+ if(this.opt.markers){
+ frontMarkers = new Array(lpoly.length);
+ outlineMarkers = new Array(lpoly.length);
+ outline = null;
+ if(theme.marker.outline){
+ outline = dc.makeStroke(theme.marker.outline);
+ outline.width = 2 * outline.width + (theme.marker.stroke ? theme.marker.stroke.width : 0);
+ }
+ dojo.forEach(lpoly, function(c, i){
+ var path = "M" + c.x + " " + c.y + " " + theme.symbol;
+ if(outline){
+ outlineMarkers[i] = s.createPath(path).setStroke(outline);
+ }
+ frontMarkers[i] = s.createPath(path).setStroke(theme.marker.stroke).setFill(theme.marker.fill);
+ }, this);
+ run.dyn.markerFill = theme.marker.fill;
+ run.dyn.markerStroke = theme.marker.stroke;
+ if(events){
+ dojo.forEach(frontMarkers, function(s, i){
+ var o = {
+ element: "marker",
+ index: i + startindexes[seg],
+ run: run,
+ shape: s,
+ outline: outlineMarkers[i] || null,
+ shadow: shadowMarkers && shadowMarkers[i] || null,
+ cx: lpoly[i].x,
+ cy: lpoly[i].y
+ };
+ if(typeof rsegments[seg][0] == "number"){
+ o.x = i + startindexes[seg] + 1;
+ o.y = rsegments[seg][i];
+ }else{
+ o.x = rsegments[seg][i].x;
+ o.y = rsegments[seg][i].y;
+ }
+ this._connectEvents(o);
+ eventSeries[i + startindexes[seg]] = o;
+ }, this);
+ }else{
+ delete this._eventSeries[run.name];
+ }
+ }
+ }
+ run.dirty = false;
+ }
+ if(this.animate){
+ // grow from the bottom
+ var plotGroup = this.group;
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: plotGroup,
+ duration: DEFAULT_ANIMATION_LENGTH,
+ transform:[
+ {name:"translate", start: [0, dim.height - offsets.b], end: [0, 0]},
+ {name:"scale", start: [1, 0], end:[1, 1]},
+ {name:"original"}
+ ]
+ }, this.animate)).play();
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Default
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Lines"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Lines"] = true;
+dojo.provide("dojox.charting.plot2d.Lines");
+
+
+
+dojo.declare("dojox.charting.plot2d.Lines", dojox.charting.plot2d.Default, {
+ // summary:
+ // A convenience constructor to create a typical line chart.
+ constructor: function(){
+ // summary:
+ // Preset our default plot to be line-based.
+ this.opt.lines = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Areas"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Areas"] = true;
+dojo.provide("dojox.charting.plot2d.Areas");
+
+
+
+dojo.declare("dojox.charting.plot2d.Areas", dojox.charting.plot2d.Default, {
+ // summary:
+ // Represents an area chart. See dojox.charting.plot2d.Default for details.
+ constructor: function(){
+ this.opt.lines = true;
+ this.opt.areas = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Markers"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Markers"] = true;
+dojo.provide("dojox.charting.plot2d.Markers");
+
+
+
+dojo.declare("dojox.charting.plot2d.Markers", dojox.charting.plot2d.Default, {
+ // summary:
+ // A convenience plot to draw a line chart with markers.
+ constructor: function(){
+ // summary:
+ // Set up the plot for lines and markers.
+ this.opt.markers = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.MarkersOnly"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.MarkersOnly"] = true;
+dojo.provide("dojox.charting.plot2d.MarkersOnly");
+
+
+
+dojo.declare("dojox.charting.plot2d.MarkersOnly", dojox.charting.plot2d.Default, {
+ // summary:
+ // A convenience object to draw only markers (like a scatter but not quite).
+ constructor: function(){
+ // summary:
+ // Set up our default plot to only have markers and no lines.
+ this.opt.lines = false;
+ this.opt.markers = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Scatter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Scatter"] = true;
+dojo.provide("dojox.charting.plot2d.Scatter");
+
+
+
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.Scatter", dojox.charting.plot2d.Base, {
+ // summary:
+ // A plot object representing a typical scatter chart.
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ shadows: null, // draw shadows
+ animate: null // animate chart to place
+ },
+ optionalParams: {
+ // theme component
+ markerStroke: {},
+ markerOutline: {},
+ markerShadow: {},
+ markerFill: {},
+ markerFont: "",
+ markerFontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create the scatter plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__DefaultCtorArgs?
+ // An optional keyword arguments object to help define this plot's parameters.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Scatter
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, events = this.events();
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ if(!run.data.length){
+ run.dirty = false;
+ t.skip();
+ continue;
+ }
+
+ var theme = t.next("marker", [this.opt, run]), s = run.group, lpoly,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler);
+ if(typeof run.data[0] == "number"){
+ lpoly = dojo.map(run.data, function(v, i){
+ return {
+ x: ht(i + 1) + offsets.l,
+ y: dim.height - offsets.b - vt(v)
+ };
+ }, this);
+ }else{
+ lpoly = dojo.map(run.data, function(v, i){
+ return {
+ x: ht(v.x) + offsets.l,
+ y: dim.height - offsets.b - vt(v.y)
+ };
+ }, this);
+ }
+
+ var shadowMarkers = new Array(lpoly.length),
+ frontMarkers = new Array(lpoly.length),
+ outlineMarkers = new Array(lpoly.length);
+
+ dojo.forEach(lpoly, function(c, i){
+ var finalTheme = typeof run.data[i] == "number" ?
+ t.post(theme, "marker") :
+ t.addMixin(theme, "marker", run.data[i], true),
+ path = "M" + c.x + " " + c.y + " " + finalTheme.symbol;
+ if(finalTheme.marker.shadow){
+ shadowMarkers[i] = s.createPath("M" + (c.x + finalTheme.marker.shadow.dx) + " " +
+ (c.y + finalTheme.marker.shadow.dy) + " " + finalTheme.symbol).
+ setStroke(finalTheme.marker.shadow).setFill(finalTheme.marker.shadow.color);
+ if(this.animate){
+ this._animateScatter(shadowMarkers[i], dim.height - offsets.b);
+ }
+ }
+ if(finalTheme.marker.outline){
+ var outline = dc.makeStroke(finalTheme.marker.outline);
+ outline.width = 2 * outline.width + finalTheme.marker.stroke.width;
+ outlineMarkers[i] = s.createPath(path).setStroke(outline);
+ if(this.animate){
+ this._animateScatter(outlineMarkers[i], dim.height - offsets.b);
+ }
+ }
+ var stroke = dc.makeStroke(finalTheme.marker.stroke),
+ fill = this._plotFill(finalTheme.marker.fill, dim, offsets);
+ if(fill && (fill.type === "linear" || fill.type == "radial")){
+ var color = dojox.gfx.gradutils.getColor(fill, {x: c.x, y: c.y});
+ if(stroke){
+ stroke.color = color;
+ }
+ frontMarkers[i] = s.createPath(path).setStroke(stroke).setFill(color);
+ }else{
+ frontMarkers[i] = s.createPath(path).setStroke(stroke).setFill(fill);
+ }
+ if(this.animate){
+ this._animateScatter(frontMarkers[i], dim.height - offsets.b);
+ }
+ }, this);
+ if(frontMarkers.length){
+ run.dyn.stroke = frontMarkers[frontMarkers.length - 1].getStroke();
+ run.dyn.fill = frontMarkers[frontMarkers.length - 1].getFill();
+ }
+
+ if(events){
+ var eventSeries = new Array(frontMarkers.length);
+ dojo.forEach(frontMarkers, function(s, i){
+ var o = {
+ element: "marker",
+ index: i,
+ run: run,
+ shape: s,
+ outline: outlineMarkers && outlineMarkers[i] || null,
+ shadow: shadowMarkers && shadowMarkers[i] || null,
+ cx: lpoly[i].x,
+ cy: lpoly[i].y
+ };
+ if(typeof run.data[0] == "number"){
+ o.x = i + 1;
+ o.y = run.data[i];
+ }else{
+ o.x = run.data[i].x;
+ o.y = run.data[i].y;
+ }
+ this._connectEvents(o);
+ eventSeries[i] = o;
+ }, this);
+ this._eventSeries[run.name] = eventSeries;
+ }else{
+ delete this._eventSeries[run.name];
+ }
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Scatter
+ },
+ _animateScatter: function(shape, offset){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [0, offset], end: [0, 0]},
+ {name: "scale", start: [0, 0], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.lang.functional.sequence"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.functional.sequence"] = true;
+dojo.provide("dojox.lang.functional.sequence");
+
+
+
+// This module adds high-level functions and related constructs:
+// - sequence generators
+
+// If you want more general sequence builders check out listcomp.js and
+// unfold() (in fold.js).
+
+// Defined methods:
+// - take any valid lambda argument as the functional argument
+
+(function(){
+ var d = dojo, df = dojox.lang.functional;
+
+ d.mixin(df, {
+ // sequence generators
+ repeat: function(/*Number*/ n, /*Function|String|Array*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: builds an array by repeatedly applying a unary function N times
+ // with a seed value Z. N should be greater than 0.
+ o = o || d.global; f = df.lambda(f);
+ var t = new Array(n), i = 1;
+ t[0] = z;
+ for(; i < n; t[i] = z = f.call(o, z), ++i);
+ return t; // Array
+ },
+ until: function(/*Function|String|Array*/ pr, /*Function|String|Array*/ f, /*Object*/ z, /*Object?*/ o){
+ // summary: builds an array by repeatedly applying a unary function with
+ // a seed value Z until the predicate is satisfied.
+ o = o || d.global; f = df.lambda(f); pr = df.lambda(pr);
+ var t = [];
+ for(; !pr.call(o, z); t.push(z), z = f.call(o, z));
+ return t; // Array
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Stacked"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Stacked"] = true;
+dojo.provide("dojox.charting.plot2d.Stacked");
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.Stacked", dojox.charting.plot2d.Default, {
+ // summary:
+ // Like the default plot, Stacked sets up lines, areas and markers
+ // in a stacked fashion (values on the y axis added to each other)
+ // as opposed to a direct one.
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = dc.collectStackedStats(this.series);
+ this._maxRunLength = stats.hmax;
+ return stats;
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Stacked
+ // A reference to this plot for functional chaining.
+ if(this._maxRunLength <= 0){
+ return this;
+ }
+
+ // stack all values
+ var acc = df.repeat(this._maxRunLength, "-> 0", 0);
+ for(var i = 0; i < this.series.length; ++i){
+ var run = this.series[i];
+ for(var j = 0; j < run.data.length; ++j){
+ var v = run.data[j];
+ if(v !== null){
+ if(isNaN(v)){ v = 0; }
+ acc[j] += v;
+ }
+ }
+ }
+ // draw runs in backwards
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+
+ var t = this.chart.theme, events = this.events(),
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler);
+
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next(this.opt.areas ? "area" : "line", [this.opt, run], true),
+ s = run.group, outline,
+ lpoly = dojo.map(acc, function(v, i){
+ return {
+ x: ht(i + 1) + offsets.l,
+ y: dim.height - offsets.b - vt(v)
+ };
+ }, this);
+
+ var lpath = this.opt.tension ? dc.curve(lpoly, this.opt.tension) : "";
+
+ if(this.opt.areas){
+ var apoly = dojo.clone(lpoly);
+ if(this.opt.tension){
+ var p=dc.curve(apoly, this.opt.tension);
+ p += " L" + lpoly[lpoly.length - 1].x + "," + (dim.height - offsets.b) +
+ " L" + lpoly[0].x + "," + (dim.height - offsets.b) +
+ " L" + lpoly[0].x + "," + lpoly[0].y;
+ run.dyn.fill = s.createPath(p).setFill(theme.series.fill).getFill();
+ } else {
+ apoly.push({x: lpoly[lpoly.length - 1].x, y: dim.height - offsets.b});
+ apoly.push({x: lpoly[0].x, y: dim.height - offsets.b});
+ apoly.push(lpoly[0]);
+ run.dyn.fill = s.createPolyline(apoly).setFill(theme.series.fill).getFill();
+ }
+ }
+ if(this.opt.lines || this.opt.markers){
+ if(theme.series.outline){
+ outline = dc.makeStroke(theme.series.outline);
+ outline.width = 2 * outline.width + theme.series.stroke.width;
+ }
+ }
+ if(this.opt.markers){
+ run.dyn.marker = theme.symbol;
+ }
+ var frontMarkers, outlineMarkers, shadowMarkers;
+ if(theme.series.shadow && theme.series.stroke){
+ var shadow = theme.series.shadow,
+ spoly = dojo.map(lpoly, function(c){
+ return {x: c.x + shadow.dx, y: c.y + shadow.dy};
+ });
+ if(this.opt.lines){
+ if(this.opt.tension){
+ run.dyn.shadow = s.createPath(dc.curve(spoly, this.opt.tension)).setStroke(shadow).getStroke();
+ } else {
+ run.dyn.shadow = s.createPolyline(spoly).setStroke(shadow).getStroke();
+ }
+ }
+ if(this.opt.markers){
+ shadow = theme.marker.shadow;
+ shadowMarkers = dojo.map(spoly, function(c){
+ return s.createPath("M" + c.x + " " + c.y + " " + theme.symbol).
+ setStroke(shadow).setFill(shadow.color);
+ }, this);
+ }
+ }
+ if(this.opt.lines){
+ if(outline){
+ if(this.opt.tension){
+ run.dyn.outline = s.createPath(lpath).setStroke(outline).getStroke();
+ } else {
+ run.dyn.outline = s.createPolyline(lpoly).setStroke(outline).getStroke();
+ }
+ }
+ if(this.opt.tension){
+ run.dyn.stroke = s.createPath(lpath).setStroke(theme.series.stroke).getStroke();
+ } else {
+ run.dyn.stroke = s.createPolyline(lpoly).setStroke(theme.series.stroke).getStroke();
+ }
+ }
+ if(this.opt.markers){
+ frontMarkers = new Array(lpoly.length);
+ outlineMarkers = new Array(lpoly.length);
+ outline = null;
+ if(theme.marker.outline){
+ outline = dc.makeStroke(theme.marker.outline);
+ outline.width = 2 * outline.width + (theme.marker.stroke ? theme.marker.stroke.width : 0);
+ }
+ dojo.forEach(lpoly, function(c, i){
+ var path = "M" + c.x + " " + c.y + " " + theme.symbol;
+ if(outline){
+ outlineMarkers[i] = s.createPath(path).setStroke(outline);
+ }
+ frontMarkers[i] = s.createPath(path).setStroke(theme.marker.stroke).setFill(theme.marker.fill);
+ }, this);
+ if(events){
+ var eventSeries = new Array(frontMarkers.length);
+ dojo.forEach(frontMarkers, function(s, i){
+ var o = {
+ element: "marker",
+ index: i,
+ run: run,
+ shape: s,
+ outline: outlineMarkers[i] || null,
+ shadow: shadowMarkers && shadowMarkers[i] || null,
+ cx: lpoly[i].x,
+ cy: lpoly[i].y,
+ x: i + 1,
+ y: run.data[i]
+ };
+ this._connectEvents(o);
+ eventSeries[i] = o;
+ }, this);
+ this._eventSeries[run.name] = eventSeries;
+ }else{
+ delete this._eventSeries[run.name];
+ }
+ }
+ run.dirty = false;
+ // update the accumulator
+ for(var j = 0; j < run.data.length; ++j){
+ var v = run.data[j];
+ if(v !== null){
+ if(isNaN(v)){ v = 0; }
+ acc[j] -= v;
+ }
+ }
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Stacked
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.StackedLines"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.StackedLines"] = true;
+dojo.provide("dojox.charting.plot2d.StackedLines");
+
+
+
+dojo.declare("dojox.charting.plot2d.StackedLines", dojox.charting.plot2d.Stacked, {
+ // summary:
+ // A convenience object to create a stacked line chart.
+ constructor: function(){
+ // summary:
+ // Force our Stacked base to be lines only.
+ this.opt.lines = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.StackedAreas"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.StackedAreas"] = true;
+dojo.provide("dojox.charting.plot2d.StackedAreas");
+
+
+
+dojo.declare("dojox.charting.plot2d.StackedAreas", dojox.charting.plot2d.Stacked, {
+ // summary:
+ // A convenience object to set up a stacked area plot.
+ constructor: function(){
+ // summary:
+ // Force our Stacked plotter to include both lines and areas.
+ this.opt.lines = true;
+ this.opt.areas = true;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Columns"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Columns"] = true;
+dojo.provide("dojox.charting.plot2d.Columns");
+
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.Columns", dojox.charting.plot2d.Base, {
+ // summary:
+ // The plot object representing a column chart (vertical bars).
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ gap: 0, // gap between columns in pixels
+ animate: null // animate bars into place
+ },
+ optionalParams: {
+ minBarSize: 1, // minimal column width in pixels
+ maxBarSize: 1, // maximal column width in pixels
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for a columns chart.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__BarCtorArgs?
+ // An optional keyword arguments object to help define the plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = dc.collectSimpleStats(this.series);
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ return stats;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Columns
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, width,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._vScaler.bounds.lower),
+ baselineHeight = vt(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ width = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("column", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y,
+ vv = vt(v),
+ height = vv - baselineHeight,
+ h = Math.abs(height),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "column", value, true) :
+ t.post(theme, "column");
+ if(width >= 1 && h >= 1){
+ var rect = {
+ x: offsets.l + ht(j + 0.5) + gap,
+ y: dim.height - offsets.b - (v > baseline ? vv : baselineHeight),
+ width: width, height: h
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "column",
+ index: j,
+ run: run,
+ shape: shape,
+ x: j + 0.5,
+ y: v
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateColumn(shape, dim.height - offsets.b - baselineHeight, h);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Columns
+ },
+ _animateColumn: function(shape, voffset, vsize){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [0, voffset - (voffset/vsize)], end: [0, 0]},
+ {name: "scale", start: [1, 1/vsize], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.StackedColumns"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.StackedColumns"] = true;
+dojo.provide("dojox.charting.plot2d.StackedColumns");
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.StackedColumns", dojox.charting.plot2d.Columns, {
+ // summary:
+ // The plot object representing a stacked column chart (vertical bars).
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = dc.collectStackedStats(this.series);
+ this._maxRunLength = stats.hmax;
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ return stats;
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.StackedColumns
+ // A reference to this plot for functional chaining.
+ if(this._maxRunLength <= 0){
+ return this;
+ }
+
+ // stack all values
+ var acc = df.repeat(this._maxRunLength, "-> 0", 0);
+ for(var i = 0; i < this.series.length; ++i){
+ var run = this.series[i];
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y;
+ if(isNaN(v)){ v = 0; }
+ acc[j] += v;
+ }
+ }
+ }
+ // draw runs in backwards
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, width,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ events = this.events();
+ f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ width = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("column", [this.opt, run]), s = run.group,
+ eventSeries = new Array(acc.length);
+ for(var j = 0; j < acc.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = acc[j],
+ height = vt(v),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "column", value, true) :
+ t.post(theme, "column");
+ if(width >= 1 && height >= 1){
+ var rect = {
+ x: offsets.l + ht(j + 0.5) + gap,
+ y: dim.height - offsets.b - vt(v),
+ width: width, height: height
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "column",
+ index: j,
+ run: run,
+ shape: shape,
+ x: j + 0.5,
+ y: v
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateColumn(shape, dim.height - offsets.b, height);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ // update the accumulator
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y;
+ if(isNaN(v)){ v = 0; }
+ acc[j] -= v;
+ }
+ }
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.StackedColumns
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.ClusteredColumns"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.ClusteredColumns"] = true;
+dojo.provide("dojox.charting.plot2d.ClusteredColumns");
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.ClusteredColumns", dojox.charting.plot2d.Columns, {
+ // summary:
+ // A plot representing grouped or clustered columns (vertical bars).
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.ClusteredColumns
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, width, thickness,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._vScaler.bounds.lower),
+ baselineHeight = vt(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt, this.series.length);
+ gap = f.gap;
+ width = thickness = f.size;
+ for(var i = 0; i < this.series.length; ++i){
+ var run = this.series[i], shift = thickness * i;
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("column", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y,
+ vv = vt(v),
+ height = vv - baselineHeight,
+ h = Math.abs(height),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "column", value, true) :
+ t.post(theme, "column");
+ if(width >= 1 && h >= 1){
+ var rect = {
+ x: offsets.l + ht(j + 0.5) + gap + shift,
+ y: dim.height - offsets.b - (v > baseline ? vv : baselineHeight),
+ width: width, height: h
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "column",
+ index: j,
+ run: run,
+ shape: shape,
+ x: j + 0.5,
+ y: v
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateColumn(shape, dim.height - offsets.b - baselineHeight, h);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.ClusteredColumns
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Bars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Bars"] = true;
+dojo.provide("dojox.charting.plot2d.Bars");
+
+
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.plot2d.__BarCtorArgs", dojox.charting.plot2d.__DefaultCtorArgs, {
+ // summary:
+ // Additional keyword arguments for bar charts.
+
+ // minBarSize: Number?
+ // The minimum size for a bar in pixels. Default is 1.
+ minBarSize: 1,
+
+ // maxBarSize: Number?
+ // The maximum size for a bar in pixels. Default is 1.
+ maxBarSize: 1
+});
+=====*/
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.Bars", dojox.charting.plot2d.Base, {
+ // summary:
+ // The plot object representing a bar chart (horizontal bars).
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ gap: 0, // gap between columns in pixels
+ animate: null // animate bars into place
+ },
+ optionalParams: {
+ minBarSize: 1, // minimal bar width in pixels
+ maxBarSize: 1, // maximal bar width in pixels
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for a bar chart.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__BarCtorArgs?
+ // An optional keyword arguments object to help define the plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = dc.collectSimpleStats(this.series), t;
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ t = stats.hmin, stats.hmin = stats.vmin, stats.vmin = t;
+ t = stats.hmax, stats.hmax = stats.vmax, stats.vmax = t;
+ return stats;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Bars
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.dirty = this.isDirty();
+ this.resetEvents();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, height,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._hScaler.bounds.lower),
+ baselineWidth = ht(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._vScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ height = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("bar", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y,
+ hv = ht(v),
+ width = hv - baselineWidth,
+ w = Math.abs(width),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "bar", value, true) :
+ t.post(theme, "bar");
+ if(w >= 1 && height >= 1){
+ var rect = {
+ x: offsets.l + (v < baseline ? hv : baselineWidth),
+ y: dim.height - offsets.b - vt(j + 1.5) + gap,
+ width: w, height: height
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "bar",
+ index: j,
+ run: run,
+ shape: shape,
+ x: v,
+ y: j + 1.5
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateBar(shape, offsets.l + baselineWidth, -w);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Bars
+ },
+ _animateBar: function(shape, hoffset, hsize){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [hoffset - (hoffset/hsize), 0], end: [0, 0]},
+ {name: "scale", start: [1/hsize, 1], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.StackedBars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.StackedBars"] = true;
+dojo.provide("dojox.charting.plot2d.StackedBars");
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.StackedBars", dojox.charting.plot2d.Bars, {
+ // summary:
+ // The plot object representing a stacked bar chart (horizontal bars).
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = dc.collectStackedStats(this.series), t;
+ this._maxRunLength = stats.hmax;
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ t = stats.hmin, stats.hmin = stats.vmin, stats.vmin = t;
+ t = stats.hmax, stats.hmax = stats.vmax, stats.vmax = t;
+ return stats;
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.StackedBars
+ // A reference to this plot for functional chaining.
+ if(this._maxRunLength <= 0){
+ return this;
+ }
+
+ // stack all values
+ var acc = df.repeat(this._maxRunLength, "-> 0", 0);
+ for(var i = 0; i < this.series.length; ++i){
+ var run = this.series[i];
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y;
+ if(isNaN(v)){ v = 0; }
+ acc[j] += v;
+ }
+ }
+ }
+ // draw runs in backwards
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, height,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ events = this.events();
+ f = dc.calculateBarSize(this._vScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ height = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("bar", [this.opt, run]), s = run.group,
+ eventSeries = new Array(acc.length);
+ for(var j = 0; j < acc.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = acc[j],
+ width = ht(v),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "bar", value, true) :
+ t.post(theme, "bar");
+ if(width >= 1 && height >= 1){
+ var rect = {
+ x: offsets.l,
+ y: dim.height - offsets.b - vt(j + 1.5) + gap,
+ width: width, height: height
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "bar",
+ index: j,
+ run: run,
+ shape: shape,
+ x: v,
+ y: j + 1.5
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateBar(shape, offsets.l, -width);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ // update the accumulator
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y;
+ if(isNaN(v)){ v = 0; }
+ acc[j] -= v;
+ }
+ }
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.StackedBars
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.ClusteredBars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.ClusteredBars"] = true;
+dojo.provide("dojox.charting.plot2d.ClusteredBars");
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.ClusteredBars", dojox.charting.plot2d.Bars, {
+ // summary:
+ // A plot representing grouped or clustered bars (horizontal bars)
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.ClusteredBars
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, height, thickness,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._hScaler.bounds.lower),
+ baselineWidth = ht(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._vScaler.bounds.scale, this.opt, this.series.length);
+ gap = f.gap;
+ height = thickness = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i], shift = thickness * (this.series.length - i - 1);
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("bar", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var value = run.data[j];
+ if(value !== null){
+ var v = typeof value == "number" ? value : value.y,
+ hv = ht(v),
+ width = hv - baselineWidth,
+ w = Math.abs(width),
+ finalTheme = typeof value != "number" ?
+ t.addMixin(theme, "bar", value, true) :
+ t.post(theme, "bar");
+ if(w >= 1 && height >= 1){
+ var rect = {
+ x: offsets.l + (v < baseline ? hv : baselineWidth),
+ y: dim.height - offsets.b - vt(j + 1.5) + gap + shift,
+ width: w, height: height
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ run.dyn.fill = shape.getFill();
+ run.dyn.stroke = shape.getStroke();
+ if(events){
+ var o = {
+ element: "bar",
+ index: j,
+ run: run,
+ shape: shape,
+ x: v,
+ y: j + 1.5
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ if(this.animate){
+ this._animateBar(shape, offsets.l + baselineWidth, -width);
+ }
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.ClusteredBars
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Grid"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Grid"] = true;
+dojo.provide("dojox.charting.plot2d.Grid");
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.plot2d.__GridCtorArgs", dojox.charting.plot2d.__DefaultCtorArgs, {
+ // summary:
+ // A special keyword arguments object that is specific to a grid "plot".
+
+ // hMajorLines: Boolean?
+ // Whether to show lines at the major ticks along the horizontal axis. Default is true.
+ hMajorLines: true,
+
+ // hMinorLines: Boolean?
+ // Whether to show lines at the minor ticks along the horizontal axis. Default is false.
+ hMinorLines: false,
+
+ // vMajorLines: Boolean?
+ // Whether to show lines at the major ticks along the vertical axis. Default is true.
+ vMajorLines: true,
+
+ // vMinorLines: Boolean?
+ // Whether to show lines at the major ticks along the vertical axis. Default is false.
+ vMinorLines: false,
+
+ // hStripes: String?
+ // Whether or not to show stripes (alternating fills) along the horizontal axis. Default is "none".
+ hStripes: "none",
+
+ // vStripes: String?
+ // Whether or not to show stripes (alternating fills) along the vertical axis. Default is "none".
+ vStripes: "none"
+});
+=====*/
+(function(){
+ var du = dojox.lang.utils, dc = dojox.charting.plot2d.common;
+
+ dojo.declare("dojox.charting.plot2d.Grid", dojox.charting.Element, {
+ // summary:
+ // A "faux" plot that can be placed behind other plots to represent
+ // a grid against which other plots can be easily measured.
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ hMajorLines: true, // draw horizontal major lines
+ hMinorLines: false, // draw horizontal minor lines
+ vMajorLines: true, // draw vertical major lines
+ vMinorLines: false, // draw vertical minor lines
+ hStripes: "none", // TBD
+ vStripes: "none", // TBD
+ animate: null // animate bars into place
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create the faux Grid plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__GridCtorArgs?
+ // An optional keyword arguments object to help define the parameters of the underlying grid.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.dirty = true;
+ this.animate = this.opt.animate;
+ this.zoom = null,
+ this.zoomQueue = []; // zooming action task queue
+ this.lastWindow = {vscale: 1, hscale: 1, xoffset: 0, yoffset: 0};
+ },
+ clear: function(){
+ // summary:
+ // Clear out any parameters set on this plot.
+ // returns: dojox.charting.plot2d.Grid
+ // The reference to this plot for functional chaining.
+ this._hAxis = null;
+ this._vAxis = null;
+ this.dirty = true;
+ return this; // dojox.charting.plot2d.Grid
+ },
+ setAxis: function(axis){
+ // summary:
+ // Set an axis for this plot.
+ // returns: dojox.charting.plot2d.Grid
+ // The reference to this plot for functional chaining.
+ if(axis){
+ this[axis.vertical ? "_vAxis" : "_hAxis"] = axis;
+ }
+ return this; // dojox.charting.plot2d.Grid
+ },
+ addSeries: function(run){
+ // summary:
+ // Ignored but included as a dummy method.
+ // returns: dojox.charting.plot2d.Grid
+ // The reference to this plot for functional chaining.
+ return this; // dojox.charting.plot2d.Grid
+ },
+ getSeriesStats: function(){
+ // summary:
+ // Returns default stats (irrelevant for this type of plot).
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ return dojo.delegate(dc.defaultStats);
+ },
+ initializeScalers: function(){
+ // summary:
+ // Does nothing (irrelevant for this type of plot).
+ return this;
+ },
+ isDirty: function(){
+ // summary:
+ // Return whether or not this plot needs to be redrawn.
+ // returns: Boolean
+ // If this plot needs to be rendered, this will return true.
+ return this.dirty || this._hAxis && this._hAxis.dirty || this._vAxis && this._vAxis.dirty; // Boolean
+ },
+ performZoom: function(dim, offsets){
+ // summary:
+ // Create/alter any zooming windows on this plot.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Grid
+ // A reference to this plot for functional chaining.
+
+ // get current zooming various
+ var vs = this._vAxis.scale || 1,
+ hs = this._hAxis.scale || 1,
+ vOffset = dim.height - offsets.b,
+ hBounds = this._hAxis.getScaler().bounds,
+ xOffset = (hBounds.from - hBounds.lower) * hBounds.scale,
+ vBounds = this._vAxis.getScaler().bounds,
+ yOffset = (vBounds.from - vBounds.lower) * vBounds.scale;
+ // get incremental zooming various
+ rVScale = vs / this.lastWindow.vscale,
+ rHScale = hs / this.lastWindow.hscale,
+ rXOffset = (this.lastWindow.xoffset - xOffset)/
+ ((this.lastWindow.hscale == 1)? hs : this.lastWindow.hscale),
+ rYOffset = (yOffset - this.lastWindow.yoffset)/
+ ((this.lastWindow.vscale == 1)? vs : this.lastWindow.vscale),
+
+ shape = this.group,
+ anim = dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform:[
+ {name:"translate", start:[0, 0], end: [offsets.l * (1 - rHScale), vOffset * (1 - rVScale)]},
+ {name:"scale", start:[1, 1], end: [rHScale, rVScale]},
+ {name:"original"},
+ {name:"translate", start: [0, 0], end: [rXOffset, rYOffset]}
+ ]}, this.zoom));
+
+ dojo.mixin(this.lastWindow, {vscale: vs, hscale: hs, xoffset: xOffset, yoffset: yOffset});
+ //add anim to zooming action queue,
+ //in order to avoid several zooming action happened at the same time
+ this.zoomQueue.push(anim);
+ //perform each anim one by one in zoomQueue
+ dojo.connect(anim, "onEnd", this, function(){
+ this.zoom = null;
+ this.zoomQueue.shift();
+ if(this.zoomQueue.length > 0){
+ this.zoomQueue[0].play();
+ }
+ });
+ if(this.zoomQueue.length == 1){
+ this.zoomQueue[0].play();
+ }
+ return this; // dojox.charting.plot2d.Grid
+ },
+ getRequiredColors: function(){
+ // summary:
+ // Ignored but included as a dummy method.
+ // returns: Number
+ // Returns 0, since there are no series associated with this plot type.
+ return 0; // Number
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Render the plot on the chart.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Grid
+ // A reference to this plot for functional chaining.
+ if(this.zoom){
+ return this.performZoom(dim, offsets);
+ }
+ this.dirty = this.isDirty();
+ if(!this.dirty){ return this; }
+ this.cleanGroup();
+ var s = this.group, ta = this.chart.theme.axis;
+ // draw horizontal stripes and lines
+ try{
+ var vScaler = this._vAxis.getScaler(),
+ vt = vScaler.scaler.getTransformerFromModel(vScaler),
+ ticks = this._vAxis.getTicks();
+ if(this.opt.hMinorLines){
+ dojo.forEach(ticks.minor, function(tick){
+ var y = dim.height - offsets.b - vt(tick.value);
+ var hMinorLine = s.createLine({
+ x1: offsets.l,
+ y1: y,
+ x2: dim.width - offsets.r,
+ y2: y
+ }).setStroke(ta.minorTick);
+ if(this.animate){
+ this._animateGrid(hMinorLine, "h", offsets.l, offsets.r + offsets.l - dim.width);
+ }
+ }, this);
+ }
+ if(this.opt.hMajorLines){
+ dojo.forEach(ticks.major, function(tick){
+ var y = dim.height - offsets.b - vt(tick.value);
+ var hMajorLine = s.createLine({
+ x1: offsets.l,
+ y1: y,
+ x2: dim.width - offsets.r,
+ y2: y
+ }).setStroke(ta.majorTick);
+ if(this.animate){
+ this._animateGrid(hMajorLine, "h", offsets.l, offsets.r + offsets.l - dim.width);
+ }
+ }, this);
+ }
+ }catch(e){
+ // squelch
+ }
+ // draw vertical stripes and lines
+ try{
+ var hScaler = this._hAxis.getScaler(),
+ ht = hScaler.scaler.getTransformerFromModel(hScaler),
+ ticks = this._hAxis.getTicks();
+ if(ticks && this.opt.vMinorLines){
+ dojo.forEach(ticks.minor, function(tick){
+ var x = offsets.l + ht(tick.value);
+ var vMinorLine = s.createLine({
+ x1: x,
+ y1: offsets.t,
+ x2: x,
+ y2: dim.height - offsets.b
+ }).setStroke(ta.minorTick);
+ if(this.animate){
+ this._animateGrid(vMinorLine, "v", dim.height - offsets.b, dim.height - offsets.b - offsets.t);
+ }
+ }, this);
+ }
+ if(ticks && this.opt.vMajorLines){
+ dojo.forEach(ticks.major, function(tick){
+ var x = offsets.l + ht(tick.value);
+ var vMajorLine = s.createLine({
+ x1: x,
+ y1: offsets.t,
+ x2: x,
+ y2: dim.height - offsets.b
+ }).setStroke(ta.majorTick);
+ if(this.animate){
+ this._animateGrid(vMajorLine, "v", dim.height - offsets.b, dim.height - offsets.b - offsets.t);
+ }
+ }, this);
+ }
+ }catch(e){
+ // squelch
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Grid
+ },
+ _animateGrid: function(shape, type, offset, size){
+ var transStart = type == "h" ? [offset, 0] : [0, offset];
+ var scaleStart = type == "h" ? [1/size, 1] : [1, 1/size];
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: transStart, end: [0, 0]},
+ {name: "scale", start: scaleStart, end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Pie"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Pie"] = true;
+dojo.provide("dojox.charting.plot2d.Pie");
+
+
+
+
+
+
+
+
+
+
+/*=====
+dojo.declare("dojox.charting.plot2d.__PieCtorArgs", dojox.charting.plot2d.__DefaultCtorArgs, {
+ // summary:
+ // Specialized keyword arguments object for use in defining parameters on a Pie chart.
+
+ // labels: Boolean?
+ // Whether or not to draw labels within each pie slice. Default is true.
+ labels: true,
+
+ // ticks: Boolean?
+ // Whether or not to draw ticks to labels within each slice. Default is false.
+ ticks: false,
+
+ // fixed: Boolean?
+ // TODO
+ fixed: true,
+
+ // precision: Number?
+ // The precision at which to sum/add data values. Default is 1.
+ precision: 1,
+
+ // labelOffset: Number?
+ // The amount in pixels by which to offset labels. Default is 20.
+ labelOffset: 20,
+
+ // labelStyle: String?
+ // Options as to where to draw labels. Values include "default", "rows", and "auto". Default is "default".
+ labelStyle: "default", // default/rows/auto
+
+ // htmlLabels: Boolean?
+ // Whether or not to use HTML to render slice labels. Default is true.
+ htmlLabels: true,
+
+ // radGrad: String?
+ // The type of radial gradient to use in rendering. Default is "native".
+ radGrad: "native",
+
+ // fanSize: Number?
+ // The amount for a radial gradient. Default is 5.
+ fanSize: 5,
+
+ // startAngle: Number?
+ // Where to being rendering gradients in slices, in degrees. Default is 0.
+ startAngle: 0,
+
+ // radius: Number?
+ // The size of the radial gradient. Default is 0.
+ radius: 0
+});
+=====*/
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ da = dojox.charting.axis2d.common,
+ g = dojox.gfx, m = g.matrix,
+ FUDGE_FACTOR = 0.2; // use to overlap fans
+
+ dojo.declare("dojox.charting.plot2d.Pie", [dojox.charting.Element, dojox.charting.plot2d._PlotEvents], {
+ // summary:
+ // The plot that represents a typical pie chart.
+ defaultParams: {
+ labels: true,
+ ticks: false,
+ fixed: true,
+ precision: 1,
+ labelOffset: 20,
+ labelStyle: "default", // default/rows/auto/columns
+ htmlLabels: true, // use HTML to draw labels
+ radGrad: "native", // or "linear", or "fan"
+ fanSize: 5, // maximum fan size in degrees
+ startAngle: 0 // start angle for slices in degrees
+ },
+ optionalParams: {
+ radius: 0,
+ // theme components
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: "",
+ labelWiring: {}
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create a pie plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.run = null;
+ this.dyn = [];
+ },
+ clear: function(){
+ // summary:
+ // Clear out all of the information tied to this plot.
+ // returns: dojox.charting.plot2d.Pie
+ // A reference to this plot for functional chaining.
+ this.dirty = true;
+ this.dyn = [];
+ this.run = null;
+ return this; // dojox.charting.plot2d.Pie
+ },
+ setAxis: function(axis){
+ // summary:
+ // Dummy method, since axes are irrelevant with a Pie chart.
+ // returns: dojox.charting.plot2d.Pie
+ // The reference to this plot for functional chaining.
+ return this; // dojox.charting.plot2d.Pie
+ },
+ addSeries: function(run){
+ // summary:
+ // Add a series of data to this plot.
+ // returns: dojox.charting.plot2d.Pie
+ // The reference to this plot for functional chaining.
+ this.run = run;
+ return this; // dojox.charting.plot2d.Pie
+ },
+ getSeriesStats: function(){
+ // summary:
+ // Returns default stats (irrelevant for this type of plot).
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ return dojo.delegate(dc.defaultStats);
+ },
+ initializeScalers: function(){
+ // summary:
+ // Does nothing (irrelevant for this type of plot).
+ return this;
+ },
+ getRequiredColors: function(){
+ // summary:
+ // Return the number of colors needed to draw this plot.
+ return this.run ? this.run.data.length : 0;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Render the plot on the chart.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Pie
+ // A reference to this plot for functional chaining.
+ if(!this.dirty){ return this; }
+ this.resetEvents();
+ this.dirty = false;
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group, t = this.chart.theme;
+
+ if(!this.run || !this.run.data.length){
+ return this;
+ }
+
+ // calculate the geometry
+ var rx = (dim.width - offsets.l - offsets.r) / 2,
+ ry = (dim.height - offsets.t - offsets.b) / 2,
+ r = Math.min(rx, ry),
+ taFont = "font" in this.opt ? this.opt.font : t.axis.font,
+ size = taFont ? g.normalizedLength(g.splitFontString(taFont).size) : 0,
+ taFontColor = "fontColor" in this.opt ? this.opt.fontColor : t.axis.fontColor,
+ startAngle = m._degToRad(this.opt.startAngle),
+ start = startAngle, step, filteredRun, slices, labels, shift, labelR,
+ run = this.run.data,
+ events = this.events();
+ if(typeof run[0] == "number"){
+ filteredRun = df.map(run, "x ? Math.max(x, 0) : 0");
+ if(df.every(filteredRun, "<= 0")){
+ return this;
+ }
+ slices = df.map(filteredRun, "/this", df.foldl(filteredRun, "+", 0));
+ if(this.opt.labels){
+ labels = dojo.map(slices, function(x){
+ return x > 0 ? this._getLabel(x * 100) + "%" : "";
+ }, this);
+ }
+ }else{
+ filteredRun = df.map(run, "x ? Math.max(x.y, 0) : 0");
+ if(df.every(filteredRun, "<= 0")){
+ return this;
+ }
+ slices = df.map(filteredRun, "/this", df.foldl(filteredRun, "+", 0));
+ if(this.opt.labels){
+ labels = dojo.map(slices, function(x, i){
+ if(x <= 0){ return ""; }
+ var v = run[i];
+ return "text" in v ? v.text : this._getLabel(x * 100) + "%";
+ }, this);
+ }
+ }
+ var themes = df.map(run, function(v, i){
+ if(v === null || typeof v == "number"){
+ return t.next("slice", [this.opt, this.run], true);
+ }
+ return t.next("slice", [this.opt, this.run, v], true);
+ }, this);
+ if(this.opt.labels){
+ shift = df.foldl1(df.map(labels, function(label, i){
+ var font = themes[i].series.font;
+ return dojox.gfx._base._getTextBox(label, {font: font}).w;
+ }, this), "Math.max(a, b)") / 2;
+ if(this.opt.labelOffset < 0){
+ r = Math.min(rx - 2 * shift, ry - size) + this.opt.labelOffset;
+ }
+ labelR = r - this.opt.labelOffset;
+ }
+ if("radius" in this.opt){
+ r = this.opt.radius;
+ labelR = r - this.opt.labelOffset;
+ }
+ var circle = {
+ cx: offsets.l + rx,
+ cy: offsets.t + ry,
+ r: r
+ };
+
+ this.dyn = [];
+ // draw slices
+ var eventSeries = new Array(slices.length);
+ dojo.some(slices, function(slice, i){
+ if(slice <= 0){
+ // degenerated slice
+ return false; // continue
+ }
+ var v = run[i], theme = themes[i], specialFill;
+ if(slice >= 1){
+ // whole pie
+ specialFill = this._plotFill(theme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill,
+ {
+ x: circle.cx - circle.r, y: circle.cy - circle.r,
+ width: 2 * circle.r, height: 2 * circle.r
+ });
+ specialFill = this._pseudoRadialFill(specialFill, {x: circle.cx, y: circle.cy}, circle.r);
+ var shape = s.createCircle(circle).setFill(specialFill).setStroke(theme.series.stroke);
+ this.dyn.push({fill: specialFill, stroke: theme.series.stroke});
+
+ if(events){
+ var o = {
+ element: "slice",
+ index: i,
+ run: this.run,
+ shape: shape,
+ x: i,
+ y: typeof v == "number" ? v : v.y,
+ cx: circle.cx,
+ cy: circle.cy,
+ cr: r
+ };
+ this._connectEvents(o);
+ eventSeries[i] = o;
+ }
+
+ return true; // stop iteration
+ }
+ // calculate the geometry of the slice
+ var end = start + slice * 2 * Math.PI;
+ if(i + 1 == slices.length){
+ end = startAngle + 2 * Math.PI;
+ }
+ var step = end - start,
+ x1 = circle.cx + r * Math.cos(start),
+ y1 = circle.cy + r * Math.sin(start),
+ x2 = circle.cx + r * Math.cos(end),
+ y2 = circle.cy + r * Math.sin(end);
+ // draw the slice
+ var fanSize = m._degToRad(this.opt.fanSize);
+ if(theme.series.fill && theme.series.fill.type === "radial" && this.opt.radGrad === "fan" && step > fanSize){
+ var group = s.createGroup(), nfans = Math.ceil(step / fanSize), delta = step / nfans;
+ specialFill = this._shapeFill(theme.series.fill,
+ {x: circle.cx - circle.r, y: circle.cy - circle.r, width: 2 * circle.r, height: 2 * circle.r});
+ for(var j = 0; j < nfans; ++j){
+ var fansx = j == 0 ? x1 : circle.cx + r * Math.cos(start + (j - FUDGE_FACTOR) * delta),
+ fansy = j == 0 ? y1 : circle.cy + r * Math.sin(start + (j - FUDGE_FACTOR) * delta),
+ fanex = j == nfans - 1 ? x2 : circle.cx + r * Math.cos(start + (j + 1 + FUDGE_FACTOR) * delta),
+ faney = j == nfans - 1 ? y2 : circle.cy + r * Math.sin(start + (j + 1 + FUDGE_FACTOR) * delta),
+ fan = group.createPath({}).
+ moveTo(circle.cx, circle.cy).
+ lineTo(fansx, fansy).
+ arcTo(r, r, 0, delta > Math.PI, true, fanex, faney).
+ lineTo(circle.cx, circle.cy).
+ closePath().
+ setFill(this._pseudoRadialFill(specialFill, {x: circle.cx, y: circle.cy}, r, start + (j + 0.5) * delta, start + (j + 0.5) * delta));
+ }
+ group.createPath({}).
+ moveTo(circle.cx, circle.cy).
+ lineTo(x1, y1).
+ arcTo(r, r, 0, step > Math.PI, true, x2, y2).
+ lineTo(circle.cx, circle.cy).
+ closePath().
+ setStroke(theme.series.stroke);
+ shape = group;
+ }else{
+ shape = s.createPath({}).
+ moveTo(circle.cx, circle.cy).
+ lineTo(x1, y1).
+ arcTo(r, r, 0, step > Math.PI, true, x2, y2).
+ lineTo(circle.cx, circle.cy).
+ closePath().
+ setStroke(theme.series.stroke);
+ var specialFill = theme.series.fill;
+ if(specialFill && specialFill.type === "radial"){
+ specialFill = this._shapeFill(specialFill, {x: circle.cx - circle.r, y: circle.cy - circle.r, width: 2 * circle.r, height: 2 * circle.r});
+ if(this.opt.radGrad === "linear"){
+ specialFill = this._pseudoRadialFill(specialFill, {x: circle.cx, y: circle.cy}, r, start, end);
+ }
+ }else if(specialFill && specialFill.type === "linear"){
+ specialFill = this._plotFill(specialFill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, shape.getBoundingBox());
+ }
+ shape.setFill(specialFill);
+ }
+ this.dyn.push({fill: specialFill, stroke: theme.series.stroke});
+
+ if(events){
+ var o = {
+ element: "slice",
+ index: i,
+ run: this.run,
+ shape: shape,
+ x: i,
+ y: typeof v == "number" ? v : v.y,
+ cx: circle.cx,
+ cy: circle.cy,
+ cr: r
+ };
+ this._connectEvents(o);
+ eventSeries[i] = o;
+ }
+
+ start = end;
+
+ return false; // continue
+ }, this);
+ // draw labels
+ if(this.opt.labels){
+ if(this.opt.labelStyle == "default"){
+ start = startAngle;
+ dojo.some(slices, function(slice, i){
+ if(slice <= 0){
+ // degenerated slice
+ return false; // continue
+ }
+ var theme = themes[i];
+ if(slice >= 1){
+ // whole pie
+ var v = run[i], elem = da.createText[this.opt.htmlLabels && dojox.gfx.renderer != "vml" ? "html" : "gfx"](
+ this.chart, s, circle.cx, circle.cy + size / 2, "middle", labels[i],
+ theme.series.font, theme.series.fontColor);
+ if(this.opt.htmlLabels){
+ this.htmlElements.push(elem);
+ }
+ return true; // stop iteration
+ }
+ // calculate the geometry of the slice
+ var end = start + slice * 2 * Math.PI, v = run[i];
+ if(i + 1 == slices.length){
+ end = startAngle + 2 * Math.PI;
+ }
+ var labelAngle = (start + end) / 2,
+ x = circle.cx + labelR * Math.cos(labelAngle),
+ y = circle.cy + labelR * Math.sin(labelAngle) + size / 2;
+ // draw the label
+ var elem = da.createText[this.opt.htmlLabels && dojox.gfx.renderer != "vml" ? "html" : "gfx"]
+ (this.chart, s, x, y, "middle", labels[i], theme.series.font, theme.series.fontColor);
+ if(this.opt.htmlLabels){
+ this.htmlElements.push(elem);
+ }
+ start = end;
+ return false; // continue
+ }, this);
+ }else if(this.opt.labelStyle == "columns"){
+ start = startAngle;
+ //calculate label angles
+ var labeledSlices = [];
+ dojo.forEach(slices, function(slice, i){
+ var end = start + slice * 2 * Math.PI;
+ if(i + 1 == slices.length){
+ end = startAngle + 2 * Math.PI;
+ }
+ var labelAngle = (start + end) / 2;
+ labeledSlices.push({
+ angle: labelAngle,
+ left: Math.cos(labelAngle) < 0,
+ theme: themes[i],
+ index: i,
+ omit: end - start < 0.001
+ });
+ start = end;
+ });
+ //calculate label radius to each slice
+ var labelHeight = dojox.gfx._base._getTextBox("a",{font:taFont}).h;
+ this._getProperLabelRadius(labeledSlices, labelHeight, circle.r * 1.1);
+ //draw label and wiring
+ dojo.forEach(labeledSlices, function(slice, i){
+ if (!slice.omit) {
+ var leftColumn = circle.cx - circle.r * 2,
+ rightColumn = circle.cx + circle.r * 2,
+ labelWidth = dojox.gfx._base._getTextBox(labels[i], {font: taFont}).w,
+ x = circle.cx + slice.labelR * Math.cos(slice.angle),
+ y = circle.cy + slice.labelR * Math.sin(slice.angle),
+ jointX = (slice.left) ? (leftColumn + labelWidth) : (rightColumn - labelWidth),
+ labelX = (slice.left) ? leftColumn : jointX;
+ var wiring = s.createPath().moveTo(circle.cx + circle.r * Math.cos(slice.angle), circle.cy + circle.r * Math.sin(slice.angle))
+ if (Math.abs(slice.labelR * Math.cos(slice.angle)) < circle.r * 2 - labelWidth) {
+ wiring.lineTo(x, y);
+ }
+ wiring.lineTo(jointX, y).setStroke(slice.theme.series.labelWiring);
+ var elem = da.createText[this.opt.htmlLabels && dojox.gfx.renderer != "vml" ? "html" : "gfx"](
+ this.chart, s, labelX, y, "left", labels[i], slice.theme.series.font, slice.theme.series.fontColor);
+ if (this.opt.htmlLabels) {
+ this.htmlElements.push(elem);
+ }
+ }
+ },this);
+ }
+ }
+ // post-process events to restore the original indexing
+ var esi = 0;
+ this._eventSeries[this.run.name] = df.map(run, function(v){
+ return v <= 0 ? null : eventSeries[esi++];
+ });
+ return this; // dojox.charting.plot2d.Pie
+ },
+
+ _getProperLabelRadius: function(slices, labelHeight, minRidius){
+ var leftCenterSlice = {},rightCenterSlice = {},leftMinSIN = 1, rightMinSIN = 1;
+ if (slices.length == 1) {
+ slices[0].labelR = minRidius;
+ return;
+ }
+ for(var i = 0;i<slices.length;i++){
+ var tempSIN = Math.abs(Math.sin(slices[i].angle));
+ if(slices[i].left){
+ if(leftMinSIN > tempSIN){
+ leftMinSIN = tempSIN;
+ leftCenterSlice = slices[i];
+ }
+ }else{
+ if(rightMinSIN > tempSIN){
+ rightMinSIN = tempSIN;
+ rightCenterSlice = slices[i];
+ }
+ }
+ }
+ leftCenterSlice.labelR = rightCenterSlice.labelR = minRidius;
+ this._caculateLabelR(leftCenterSlice,slices,labelHeight);
+ this._caculateLabelR(rightCenterSlice,slices,labelHeight);
+ },
+ _caculateLabelR: function(firstSlice,slices,labelHeight){
+ var i = firstSlice.index,length = slices.length,
+ currentLabelR = firstSlice.labelR;
+ while(!(slices[i%length].left ^ slices[(i+1)%length].left)){
+ if (!slices[(i + 1) % length].omit) {
+ var nextLabelR = (Math.sin(slices[i % length].angle) * currentLabelR + ((slices[i % length].left) ? (-labelHeight) : labelHeight)) /
+ Math.sin(slices[(i + 1) % length].angle);
+ currentLabelR = (nextLabelR < firstSlice.labelR) ? firstSlice.labelR : nextLabelR;
+ slices[(i + 1) % length].labelR = currentLabelR;
+ }
+ i++;
+ }
+ i = firstSlice.index,j = (i == 0)?length-1 : i - 1;
+ while(!(slices[i].left ^ slices[j].left)){
+ if (!slices[j].omit) {
+ var nextLabelR = (Math.sin(slices[i].angle) * currentLabelR + ((slices[i].left) ? labelHeight : (-labelHeight))) /
+ Math.sin(slices[j].angle);
+ currentLabelR = (nextLabelR < firstSlice.labelR) ? firstSlice.labelR : nextLabelR;
+ slices[j].labelR = currentLabelR;
+ }
+ i--;j--;
+ i = (i < 0)?i+slices.length:i;
+ j = (j < 0)?j+slices.length:j;
+ }
+ },
+ // utilities
+ _getLabel: function(number){
+ return dc.getLabel(number, this.opt.fixed, this.opt.precision);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Bubble"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Bubble"] = true;
+dojo.provide("dojox.charting.plot2d.Bubble");
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ dojo.declare("dojox.charting.plot2d.Bubble", dojox.charting.plot2d.Base, {
+ // summary:
+ // A plot representing bubbles. Note that data for Bubbles requires 3 parameters,
+ // in the form of: { x, y, size }, where size determines the size of the bubble.
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ animate: null // animate bars into place
+ },
+ optionalParams: {
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create a plot of bubbles.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__DefaultCtorArgs?
+ // Optional keyword arguments object to help define plot parameters.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ // override the render so that we are plotting only circles.
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Bubble
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+
+ var t = this.chart.theme,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ events = this.events();
+
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ if(!run.data.length){
+ run.dirty = false;
+ t.skip();
+ continue;
+ }
+
+ if(typeof run.data[0] == "number"){
+ console.warn("dojox.charting.plot2d.Bubble: the data in the following series cannot be rendered as a bubble chart; ", run);
+ continue;
+ }
+
+ var theme = t.next("circle", [this.opt, run]), s = run.group,
+ points = dojo.map(run.data, function(v, i){
+ return v ? {
+ x: ht(v.x) + offsets.l,
+ y: dim.height - offsets.b - vt(v.y),
+ radius: this._vScaler.bounds.scale * (v.size / 2)
+ } : null;
+ }, this);
+
+ var frontCircles = null, outlineCircles = null, shadowCircles = null;
+
+ // make shadows if needed
+ if(theme.series.shadow){
+ shadowCircles = dojo.map(points, function(item){
+ if(item !== null){
+ var finalTheme = t.addMixin(theme, "circle", item, true),
+ shadow = finalTheme.series.shadow;
+ var shape = s.createCircle({
+ cx: item.x + shadow.dx, cy: item.y + shadow.dy, r: item.radius
+ }).setStroke(shadow).setFill(shadow.color);
+ if(this.animate){
+ this._animateBubble(shape, dim.height - offsets.b, item.radius);
+ }
+ return shape;
+ }
+ return null;
+ }, this);
+ if(shadowCircles.length){
+ run.dyn.shadow = shadowCircles[shadowCircles.length - 1].getStroke();
+ }
+ }
+
+ // make outlines if needed
+ if(theme.series.outline){
+ outlineCircles = dojo.map(points, function(item){
+ if(item !== null){
+ var finalTheme = t.addMixin(theme, "circle", item, true),
+ outline = dc.makeStroke(finalTheme.series.outline);
+ outline.width = 2 * outline.width + theme.series.stroke.width;
+ var shape = s.createCircle({
+ cx: item.x, cy: item.y, r: item.radius
+ }).setStroke(outline);
+ if(this.animate){
+ this._animateBubble(shape, dim.height - offsets.b, item.radius);
+ }
+ return shape;
+ }
+ return null;
+ }, this);
+ if(outlineCircles.length){
+ run.dyn.outline = outlineCircles[outlineCircles.length - 1].getStroke();
+ }
+ }
+
+ // run through the data and add the circles.
+ frontCircles = dojo.map(points, function(item){
+ if(item !== null){
+ var finalTheme = t.addMixin(theme, "circle", item, true),
+ rect = {
+ x: item.x - item.radius,
+ y: item.y - item.radius,
+ width: 2 * item.radius,
+ height: 2 * item.radius
+ };
+ var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
+ specialFill = this._shapeFill(specialFill, rect);
+ var shape = s.createCircle({
+ cx: item.x, cy: item.y, r: item.radius
+ }).setFill(specialFill).setStroke(finalTheme.series.stroke);
+ if(this.animate){
+ this._animateBubble(shape, dim.height - offsets.b, item.radius);
+ }
+ return shape;
+ }
+ return null;
+ }, this);
+ if(frontCircles.length){
+ run.dyn.fill = frontCircles[frontCircles.length - 1].getFill();
+ run.dyn.stroke = frontCircles[frontCircles.length - 1].getStroke();
+ }
+
+ if(events){
+ var eventSeries = new Array(frontCircles.length);
+ dojo.forEach(frontCircles, function(s, i){
+ if(s !== null){
+ var o = {
+ element: "circle",
+ index: i,
+ run: run,
+ shape: s,
+ outline: outlineCircles && outlineCircles[i] || null,
+ shadow: shadowCircles && shadowCircles[i] || null,
+ x: run.data[i].x,
+ y: run.data[i].y,
+ r: run.data[i].size / 2,
+ cx: points[i].x,
+ cy: points[i].y,
+ cr: points[i].radius
+ };
+ this._connectEvents(o);
+ eventSeries[i] = o;
+ }
+ }, this);
+ this._eventSeries[run.name] = eventSeries;
+ }else{
+ delete this._eventSeries[run.name];
+ }
+
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Bubble
+ },
+ _animateBubble: function(shape, offset, size){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [0, offset], end: [0, 0]},
+ {name: "scale", start: [0, 1/size], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Candlesticks"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Candlesticks"] = true;
+dojo.provide("dojox.charting.plot2d.Candlesticks");
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ // Candlesticks are based on the Bars plot type; we expect the following passed
+ // as values in a series:
+ // { x?, open, close, high, low, mid? }
+ // if x is not provided, the array index is used.
+ // failing to provide the OHLC values will throw an error.
+ dojo.declare("dojox.charting.plot2d.Candlesticks", dojox.charting.plot2d.Base, {
+ // summary:
+ // A plot that represents typical candlesticks (financial reporting, primarily).
+ // Unlike most charts, the Candlestick expects data points to be represented by
+ // an object of the form { x?, open, close, high, low, mid? }, where both
+ // x and mid are optional parameters. If x is not provided, the index of the
+ // data array is used.
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ gap: 2, // gap between columns in pixels
+ animate: null // animate bars into place
+ },
+ optionalParams: {
+ minBarSize: 1, // minimal candle width in pixels
+ maxBarSize: 1, // maximal candle width in pixels
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for a candlestick chart.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__BarCtorArgs?
+ // An optional keyword arguments object to help define the plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ collectStats: function(series){
+ // summary:
+ // Collect all statistics for drawing this chart. Since the common
+ // functionality only assumes x and y, Candlesticks must create it's own
+ // stats (since data has no y value, but open/close/high/low instead).
+ // series: dojox.charting.Series[]
+ // The data series array to be drawn on this plot.
+ // returns: Object
+ // Returns an object in the form of { hmin, hmax, vmin, vmax }.
+
+ // we have to roll our own, since we need to use all four passed
+ // values to figure out our stats, and common only assumes x and y.
+ var stats = dojo.delegate(dc.defaultStats);
+ for(var i=0; i<series.length; i++){
+ var run = series[i];
+ if(!run.data.length){ continue; }
+ var old_vmin = stats.vmin, old_vmax = stats.vmax;
+ if(!("ymin" in run) || !("ymax" in run)){
+ dojo.forEach(run.data, function(val, idx){
+ if(val !== null){
+ var x = val.x || idx + 1;
+ stats.hmin = Math.min(stats.hmin, x);
+ stats.hmax = Math.max(stats.hmax, x);
+ stats.vmin = Math.min(stats.vmin, val.open, val.close, val.high, val.low);
+ stats.vmax = Math.max(stats.vmax, val.open, val.close, val.high, val.low);
+ }
+ });
+ }
+ if("ymin" in run){ stats.vmin = Math.min(old_vmin, run.ymin); }
+ if("ymax" in run){ stats.vmax = Math.max(old_vmax, run.ymax); }
+ }
+ return stats; // Object
+ },
+
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = this.collectStats(this.series);
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ return stats;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.Candlesticks
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, width,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._vScaler.bounds.lower),
+ baselineHeight = vt(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ width = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("candlestick", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var v = run.data[j];
+ if(v !== null){
+ var finalTheme = t.addMixin(theme, "candlestick", v, true);
+
+ // calculate the points we need for OHLC
+ var x = ht(v.x || (j+0.5)) + offsets.l + gap,
+ y = dim.height - offsets.b,
+ open = vt(v.open),
+ close = vt(v.close),
+ high = vt(v.high),
+ low = vt(v.low);
+ if("mid" in v){
+ var mid = vt(v.mid);
+ }
+ if(low > high){
+ var tmp = high;
+ high = low;
+ low = tmp;
+ }
+
+ if(width >= 1){
+ // draw the line and rect, set up as a group and pass that to the events.
+ var doFill = open > close;
+ var line = { x1: width/2, x2: width/2, y1: y - high, y2: y - low },
+ rect = {
+ x: 0, y: y-Math.max(open, close),
+ width: width, height: Math.max(doFill ? open-close : close-open, 1)
+ };
+ shape = s.createGroup();
+ shape.setTransform({dx: x, dy: 0 });
+ var inner = shape.createGroup();
+ inner.createLine(line).setStroke(finalTheme.series.stroke);
+ inner.createRect(rect).setStroke(finalTheme.series.stroke).
+ setFill(doFill ? finalTheme.series.fill : "white");
+ if("mid" in v){
+ // add the mid line.
+ inner.createLine({
+ x1: (finalTheme.series.stroke.width||1), x2: width - (finalTheme.series.stroke.width || 1),
+ y1: y - mid, y2: y - mid
+ }).setStroke(doFill ? "white" : finalTheme.series.stroke);
+ }
+
+ // TODO: double check this.
+ run.dyn.fill = finalTheme.series.fill;
+ run.dyn.stroke = finalTheme.series.stroke;
+ if(events){
+ var o = {
+ element: "candlestick",
+ index: j,
+ run: run,
+ shape: inner,
+ x: x,
+ y: y-Math.max(open, close),
+ cx: width/2,
+ cy: (y-Math.max(open, close)) + (Math.max(doFill ? open-close : close-open, 1)/2),
+ width: width,
+ height: Math.max(doFill ? open-close : close-open, 1),
+ data: v
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ }
+ if(this.animate){
+ this._animateCandlesticks(shape, y - low, high - low);
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.Candlesticks
+ },
+ _animateCandlesticks: function(shape, voffset, vsize){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [0, voffset - (voffset/vsize)], end: [0, 0]},
+ {name: "scale", start: [1, 1/vsize], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.OHLC"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.OHLC"] = true;
+dojo.provide("dojox.charting.plot2d.OHLC");
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ purgeGroup = df.lambda("item.purgeGroup()");
+
+ // Candlesticks are based on the Bars plot type; we expect the following passed
+ // as values in a series:
+ // { x?, open, close, high, low }
+ // if x is not provided, the array index is used.
+ // failing to provide the OHLC values will throw an error.
+ dojo.declare("dojox.charting.plot2d.OHLC", dojox.charting.plot2d.Base, {
+ // summary:
+ // A plot that represents typical open/high/low/close (financial reporting, primarily).
+ // Unlike most charts, the Candlestick expects data points to be represented by
+ // an object of the form { x?, open, close, high, low, mid? }, where both
+ // x and mid are optional parameters. If x is not provided, the index of the
+ // data array is used.
+ defaultParams: {
+ hAxis: "x", // use a horizontal axis named "x"
+ vAxis: "y", // use a vertical axis named "y"
+ gap: 2, // gap between columns in pixels
+ animate: null // animate chart to place
+ },
+ optionalParams: {
+ minBarSize: 1, // minimal bar size in pixels
+ maxBarSize: 1, // maximal bar size in pixels
+ // theme component
+ stroke: {},
+ outline: {},
+ shadow: {},
+ fill: {},
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // The constructor for a candlestick chart.
+ // chart: dojox.charting.Chart2D
+ // The chart this plot belongs to.
+ // kwArgs: dojox.charting.plot2d.__BarCtorArgs?
+ // An optional keyword arguments object to help define the plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.hAxis = this.opt.hAxis;
+ this.vAxis = this.opt.vAxis;
+ this.animate = this.opt.animate;
+ },
+
+ collectStats: function(series){
+ // summary:
+ // Collect all statistics for drawing this chart. Since the common
+ // functionality only assumes x and y, OHLC must create it's own
+ // stats (since data has no y value, but open/close/high/low instead).
+ // series: dojox.charting.Series[]
+ // The data series array to be drawn on this plot.
+ // returns: Object
+ // Returns an object in the form of { hmin, hmax, vmin, vmax }.
+
+ // we have to roll our own, since we need to use all four passed
+ // values to figure out our stats, and common only assumes x and y.
+ var stats = dojo.delegate(dc.defaultStats);
+ for(var i=0; i<series.length; i++){
+ var run = series[i];
+ if(!run.data.length){ continue; }
+ var old_vmin = stats.vmin, old_vmax = stats.vmax;
+ if(!("ymin" in run) || !("ymax" in run)){
+ dojo.forEach(run.data, function(val, idx){
+ if(val !== null){
+ var x = val.x || idx + 1;
+ stats.hmin = Math.min(stats.hmin, x);
+ stats.hmax = Math.max(stats.hmax, x);
+ stats.vmin = Math.min(stats.vmin, val.open, val.close, val.high, val.low);
+ stats.vmax = Math.max(stats.vmax, val.open, val.close, val.high, val.low);
+ }
+ });
+ }
+ if("ymin" in run){ stats.vmin = Math.min(old_vmin, run.ymin); }
+ if("ymax" in run){ stats.vmax = Math.max(old_vmax, run.ymax); }
+ }
+ return stats;
+ },
+
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ var stats = this.collectStats(this.series);
+ stats.hmin -= 0.5;
+ stats.hmax += 0.5;
+ return stats;
+ },
+
+ render: function(dim, offsets){
+ // summary:
+ // Run the calculations for any axes for this plot.
+ // dim: Object
+ // An object in the form of { width, height }
+ // offsets: Object
+ // An object of the form { l, r, t, b}.
+ // returns: dojox.charting.plot2d.OHLC
+ // A reference to this plot for functional chaining.
+ if(this.zoom && !this.isDataDirty()){
+ return this.performZoom(dim, offsets);
+ }
+ this.resetEvents();
+ this.dirty = this.isDirty();
+ if(this.dirty){
+ dojo.forEach(this.series, purgeGroup);
+ this._eventSeries = {};
+ this.cleanGroup();
+ var s = this.group;
+ df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
+ }
+ var t = this.chart.theme, f, gap, width,
+ ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
+ vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
+ baseline = Math.max(0, this._vScaler.bounds.lower),
+ baselineHeight = vt(baseline),
+ events = this.events();
+ f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt);
+ gap = f.gap;
+ width = f.size;
+ for(var i = this.series.length - 1; i >= 0; --i){
+ var run = this.series[i];
+ if(!this.dirty && !run.dirty){
+ t.skip();
+ this._reconnectEvents(run.name);
+ continue;
+ }
+ run.cleanGroup();
+ var theme = t.next("candlestick", [this.opt, run]), s = run.group,
+ eventSeries = new Array(run.data.length);
+ for(var j = 0; j < run.data.length; ++j){
+ var v = run.data[j];
+ if(v !== null){
+ var finalTheme = t.addMixin(theme, "candlestick", v, true);
+
+ // calculate the points we need for OHLC
+ var x = ht(v.x || (j+0.5)) + offsets.l + gap,
+ y = dim.height - offsets.b,
+ open = vt(v.open),
+ close = vt(v.close),
+ high = vt(v.high),
+ low = vt(v.low);
+ if(low > high){
+ var tmp = high;
+ high = low;
+ low = tmp;
+ }
+
+ if(width >= 1){
+ var hl = {x1: width/2, x2: width/2, y1: y - high, y2: y - low},
+ op = {x1: 0, x2: ((width/2) + ((finalTheme.series.stroke.width||1)/2)), y1: y-open, y2: y-open},
+ cl = {x1: ((width/2) - ((finalTheme.series.stroke.width||1)/2)), x2: width, y1: y-close, y2: y-close};
+ shape = s.createGroup();
+ shape.setTransform({dx: x, dy: 0});
+ var inner = shape.createGroup();
+ inner.createLine(hl).setStroke(finalTheme.series.stroke);
+ inner.createLine(op).setStroke(finalTheme.series.stroke);
+ inner.createLine(cl).setStroke(finalTheme.series.stroke);
+
+ // TODO: double check this.
+ run.dyn.stroke = finalTheme.series.stroke;
+ if(events){
+ var o = {
+ element: "candlestick",
+ index: j,
+ run: run,
+ shape: inner,
+ x: x,
+ y: y-Math.max(open, close),
+ cx: width/2,
+ cy: (y-Math.max(open, close)) + (Math.max(open > close ? open-close : close-open, 1)/2),
+ width: width,
+ height: Math.max(open > close ? open-close : close-open, 1),
+ data: v
+ };
+ this._connectEvents(o);
+ eventSeries[j] = o;
+ }
+ }
+ if(this.animate){
+ this._animateOHLC(shape, y - low, high - low);
+ }
+ }
+ }
+ this._eventSeries[run.name] = eventSeries;
+ run.dirty = false;
+ }
+ this.dirty = false;
+ return this; // dojox.charting.plot2d.OHLC
+ },
+ _animateOHLC: function(shape, voffset, vsize){
+ dojox.gfx.fx.animateTransform(dojo.delegate({
+ shape: shape,
+ duration: 1200,
+ transform: [
+ {name: "translate", start: [0, voffset - (voffset/vsize)], end: [0, 0]},
+ {name: "scale", start: [1, 1/vsize], end: [1, 1]},
+ {name: "original"}
+ ]
+ }, this.animate)).play();
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.plot2d.Spider"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot2d.Spider"] = true;
+dojo.provide("dojox.charting.plot2d.Spider");
+
+dojo.experimental("dojox.charting.plot2d.Spider");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(function(){
+ var df = dojox.lang.functional, du = dojox.lang.utils,
+ dc = dojox.charting.plot2d.common,
+ da = dojox.charting.axis2d.common,
+ g = dojox.gfx, m = g.matrix,
+ FUDGE_FACTOR = 0.2; // use to overlap fans
+
+ dojo.declare("dojox.charting.plot2d.Spider", [dojox.charting.Element, dojox.charting.plot2d._PlotEvents], {
+ // summary:
+ // The plot that represents a typical Spider chart.
+ defaultParams: {
+ labels: true,
+ ticks: false,
+ fixed: true,
+ precision: 1,
+ labelOffset: -10,
+ labelStyle: "default", // default/rows/auto
+ htmlLabels: true, // use HTML to draw labels
+ startAngle: -90, // start angle for slices in degrees
+ divisions: 3, // radius tick count
+ axisColor: "", // spider axis color
+ axisWidth: 0, // spider axis stroke width
+ spiderColor: "", // spider web color
+ spiderWidth: 0, // spider web stroke width
+ seriesWidth: 0, // plot border with
+ seriesFillAlpha: 0.2, // plot fill alpha
+ spiderOrigin: 0.16,
+ markerSize: 3, // radius of plot vertex (px)
+ spiderType: "polygon", //"circle"
+ animationType: dojo.fx.easing.backOut,
+ axisTickFont: "",
+ axisTickFontColor: "",
+ axisFont: "",
+ axisFontColor: ""
+ },
+ optionalParams: {
+ radius: 0,
+ font: "",
+ fontColor: ""
+ },
+
+ constructor: function(chart, kwArgs){
+ // summary:
+ // Create a Spider plot.
+ this.opt = dojo.clone(this.defaultParams);
+ du.updateWithObject(this.opt, kwArgs);
+ du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
+ this.series = [];
+ this.dyn = [];
+ this.datas = {};
+ this.labelKey = [];
+ this.oldSeriePoints = {};
+ this.animations = {};
+ },
+ clear: function(){
+ // summary:
+ // Clear out all of the information tied to this plot.
+ // returns: dojox.charting.plot2d.Spider
+ // A reference to this plot for functional chaining.
+ this.dirty = true;
+ this.dyn = [];
+ this.series = [];
+ this.datas = {};
+ this.labelKey = [];
+ this.oldSeriePoints = {};
+ this.animations = {};
+ return this; // dojox.charting.plot2d.Spider
+ },
+ setAxis: function(axis){
+ // summary:
+ // Dummy method, since axes are irrelevant with a Spider chart.
+ // returns: dojox.charting.plot2d.Spider
+ // The reference to this plot for functional chaining.
+ return this; // dojox.charting.plot2d.Spider
+ },
+ addSeries: function(run){
+ // summary:
+ // Add a data series to this plot.
+ // run: dojox.charting.Series
+ // The series to be added.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ var matched = false;
+ this.series.push(run);
+ for(var key in run.data){
+ var val = run.data[key],
+ data = this.datas[key];
+ if(data){
+ data.vlist.push(val);
+ data.min = Math.min(data.min, val);
+ data.max = Math.max(data.max, val);
+ }else{
+ this.datas[key] = {min: val, max: val, vlist: [val]};
+ }
+ }
+ if (this.labelKey.length <= 0) {
+ for (var key in run.data) {
+ this.labelKey.push(key);
+ }
+ }
+ return this; // dojox.charting.plot2d.Base
+ },
+ getSeriesStats: function(){
+ // summary:
+ // Calculate the min/max on all attached series in both directions.
+ // returns: Object
+ // {hmin, hmax, vmin, vmax} min/max in both directions.
+ return dojox.charting.plot2d.common.collectSimpleStats(this.series);
+ },
+ calculateAxes: function(dim){
+ // summary:
+ // Stub function for running the axis calculations (depricated).
+ // dim: Object
+ // An object of the form { width, height }
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ this.initializeScalers(dim, this.getSeriesStats());
+ return this; // dojox.charting.plot2d.Base
+ },
+ getRequiredColors: function(){
+ // summary:
+ // Get how many data series we have, so we know how many colors to use.
+ // returns: Number
+ // The number of colors needed.
+ return this.series.length; // Number
+ },
+ initializeScalers: function(dim, stats){
+ // summary:
+ // Initializes scalers using attached axes.
+ // dim: Object:
+ // Size of a plot area in pixels as {width, height}.
+ // stats: Object:
+ // Min/max of data in both directions as {hmin, hmax, vmin, vmax}.
+ // returns: dojox.charting.plot2d.Base
+ // A reference to this plot for functional chaining.
+ if(this._hAxis){
+ if(!this._hAxis.initialized()){
+ this._hAxis.calculate(stats.hmin, stats.hmax, dim.width);
+ }
+ this._hScaler = this._hAxis.getScaler();
+ }else{
+ this._hScaler = dojox.charting.scaler.primitive.buildScaler(stats.hmin, stats.hmax, dim.width);
+ }
+ if(this._vAxis){
+ if(!this._vAxis.initialized()){
+ this._vAxis.calculate(stats.vmin, stats.vmax, dim.height);
+ }
+ this._vScaler = this._vAxis.getScaler();
+ }else{
+ this._vScaler = dojox.charting.scaler.primitive.buildScaler(stats.vmin, stats.vmax, dim.height);
+ }
+ return this; // dojox.charting.plot2d.Base
+ },
+ render: function(dim, offsets){
+ // summary:
+ // Render the plot on the chart.
+ // dim: Object
+ // An object of the form { width, height }.
+ // offsets: Object
+ // An object of the form { l, r, t, b }.
+ // returns: dojox.charting.plot2d.Spider
+ // A reference to this plot for functional chaining.
+ if(!this.dirty){ return this; }
+ this.dirty = false;
+ this.cleanGroup();
+ var s = this.group, t = this.chart.theme;
+ this.resetEvents();
+
+ if(!this.series || !this.series.length){
+ return this;
+ }
+
+ // calculate the geometry
+ var o = this.opt, ta = t.axis,
+ rx = (dim.width - offsets.l - offsets.r) / 2,
+ ry = (dim.height - offsets.t - offsets.b) / 2,
+ r = Math.min(rx, ry),
+ axisTickFont = o.font || (ta.majorTick && ta.majorTick.font) || (ta.tick && ta.tick.font) || "normal normal normal 7pt Tahoma",
+ axisFont = o.axisFont || (ta.tick && ta.tick.titleFont) || "normal normal normal 11pt Tahoma",
+ axisTickFontColor = o.axisTickFontColor || (ta.majorTick && ta.majorTick.fontColor) || (ta.tick && ta.tick.fontColor) || "silver",
+ axisFontColor = o.axisFontColor || (ta.tick && ta.tick.titleFontColor) || "black",
+ axisColor = o.axisColor || (ta.tick && ta.tick.axisColor) || "silver",
+ spiderColor = o.spiderColor || (ta.tick && ta.tick.spiderColor) || "silver",
+ axisWidth = o.axisWidth || (ta.stroke && ta.stroke.width) || 2,
+ spiderWidth = o.spiderWidth || (ta.stroke && ta.stroke.width) || 2,
+ seriesWidth = o.seriesWidth || (ta.stroke && ta.stroke.width) || 2,
+ asize = g.normalizedLength(g.splitFontString(axisFont).size),
+ startAngle = m._degToRad(o.startAngle),
+ start = startAngle, step, filteredRun, slices, labels, shift, labelR,
+ outerPoints, innerPoints, divisionPoints, divisionRadius, labelPoints,
+ ro = o.spiderOrigin, dv = o.divisions >= 3 ? o.divisions : 3, ms = o.markerSize,
+ spt = o.spiderType, at = o.animationType, lboffset = o.labelOffset < -10 ? o.labelOffset : -10,
+ axisExtra = 0.2;
+
+ if(o.labels){
+ labels = dojo.map(this.series, function(s){
+ return s.name;
+ }, this);
+ shift = df.foldl1(df.map(labels, function(label, i){
+ var font = t.series.font;
+ return dojox.gfx._base._getTextBox(label, {
+ font: font
+ }).w;
+ }, this), "Math.max(a, b)") / 2;
+ r = Math.min(rx - 2 * shift, ry - asize) + lboffset;
+ labelR = r - lboffset;
+ }
+ if ("radius" in o) {
+ r = o.radius;
+ labelR = r - lboffset;
+ }
+ r /= (1+axisExtra);
+ var circle = {
+ cx: offsets.l + rx,
+ cy: offsets.t + ry,
+ r: r
+ };
+
+ for (var i = this.series.length - 1; i >= 0; i--) {
+ var serieEntry = this.series[i];
+ if (!this.dirty && !serieEntry.dirty) {
+ t.skip();
+ continue;
+ }
+ serieEntry.cleanGroup();
+ var run = serieEntry.data;
+ if (run !== null) {
+ var len = this._getObjectLength(run);
+ //construct connect points
+ if (!outerPoints || outerPoints.length <= 0) {
+ outerPoints = [], innerPoints = [], labelPoints = [];
+ this._buildPoints(outerPoints, len, circle, r, start, true);
+ this._buildPoints(innerPoints, len, circle, r*ro, start, true);
+ this._buildPoints(labelPoints, len, circle, labelR, start);
+ if(dv > 2){
+ divisionPoints = [], divisionRadius = [];
+ for (var j = 0; j < dv - 2; j++) {
+ divisionPoints[j] = [];
+ this._buildPoints(divisionPoints[j], len, circle, r*(ro + (1-ro)*(j+1)/(dv-1)), start, true);
+ divisionRadius[j] = r*(ro + (1-ro)*(j+1)/(dv-1));
+ }
+ }
+ }
+ }
+ }
+
+ //draw Spider
+ //axis
+ var axisGroup = s.createGroup(), axisStroke = {color: axisColor, width: axisWidth},
+ spiderStroke = {color: spiderColor, width: spiderWidth};
+ for (var j = outerPoints.length - 1; j >= 0; --j) {
+ var point = outerPoints[j],
+ st = {
+ x: point.x + (point.x - circle.cx) * axisExtra,
+ y: point.y + (point.y - circle.cy) * axisExtra
+ },
+ nd = {
+ x: point.x + (point.x - circle.cx) * axisExtra / 2,
+ y: point.y + (point.y - circle.cy) * axisExtra / 2
+ };
+ axisGroup.createLine({
+ x1: circle.cx,
+ y1: circle.cy,
+ x2: st.x,
+ y2: st.y
+ }).setStroke(axisStroke);
+ //arrow
+ this._drawArrow(axisGroup, st, nd, axisStroke);
+ }
+
+ // draw the label
+ var labelGroup = s.createGroup();
+ for (var j = labelPoints.length - 1; j >= 0; --j) {
+ var point = labelPoints[j],
+ fontWidth = dojox.gfx._base._getTextBox(this.labelKey[j], {font: axisFont}).w || 0,
+ render = this.opt.htmlLabels && dojox.gfx.renderer != "vml" ? "html" : "gfx";
+ elem = da.createText[render](this.chart, labelGroup, (!dojo._isBodyLtr() && render == "html") ? (point.x + fontWidth - dim.width) : point.x, point.y,
+ "middle", this.labelKey[j], axisFont, axisFontColor);
+ if (this.opt.htmlLabels) {
+ this.htmlElements.push(elem);
+ }
+ }
+
+ //spider web: polygon or circle
+ var spiderGroup = s.createGroup();
+ if(spt == "polygon"){
+ spiderGroup.createPolyline(outerPoints).setStroke(spiderStroke);
+ spiderGroup.createPolyline(innerPoints).setStroke(spiderStroke);
+ if (divisionPoints.length > 0) {
+ for (var j = divisionPoints.length - 1; j >= 0; --j) {
+ spiderGroup.createPolyline(divisionPoints[j]).setStroke(spiderStroke);
+ }
+ }
+ }else{//circle
+ var ccount = this._getObjectLength(this.datas);
+ spiderGroup.createCircle({cx: circle.cx, cy: circle.cy, r: r}).setStroke(spiderStroke);
+ spiderGroup.createCircle({cx: circle.cx, cy: circle.cy, r: r*ro}).setStroke(spiderStroke);
+ if (divisionRadius.length > 0) {
+ for (var j = divisionRadius.length - 1; j >= 0; --j) {
+ spiderGroup.createCircle({cx: circle.cx, cy: circle.cy, r: divisionRadius[j]}).setStroke(spiderStroke);
+ }
+ }
+ }
+ //text
+ var textGroup = s.createGroup(), len = this._getObjectLength(this.datas), k = 0;
+ for(var key in this.datas){
+ var data = this.datas[key], min = data.min, max = data.max, distance = max - min,
+ end = start + 2 * Math.PI * k / len;
+ for (var i = 0; i < dv; i++) {
+ var text = min + distance*i/(dv-1), point = this._getCoordinate(circle, r*(ro + (1-ro)*i/(dv-1)), end);
+ text = this._getLabel(text);
+ var fontWidth = dojox.gfx._base._getTextBox(text, {font: axisTickFont}).w || 0,
+ render = this.opt.htmlLabels && dojox.gfx.renderer != "vml" ? "html" : "gfx";
+ if (this.opt.htmlLabels) {
+ this.htmlElements.push(da.createText[render]
+ (this.chart, textGroup, (!dojo._isBodyLtr() && render == "html") ? (point.x + fontWidth - dim.width) : point.x, point.y,
+ "start", text, axisTickFont, axisTickFontColor));
+ }
+ }
+ k++;
+ }
+
+ //draw series (animation)
+ this.chart.seriesShapes = {};
+ var animationConnections = [];
+ for (var i = this.series.length - 1; i >= 0; i--) {
+ var serieEntry = this.series[i], run = serieEntry.data;
+ if (run !== null) {
+ //series polygon
+ var seriePoints = [], k = 0, tipData = [];
+ for(var key in run){
+ var data = this.datas[key], min = data.min, max = data.max, distance = max - min,
+ entry = run[key], end = start + 2 * Math.PI * k / len,
+ point = this._getCoordinate(circle, r*(ro + (1-ro)*(entry-min)/distance), end);
+ seriePoints.push(point);
+ tipData.push({sname: serieEntry.name, key: key, data: entry});
+ k++;
+ }
+ seriePoints[seriePoints.length] = seriePoints[0];
+ tipData[tipData.length] = tipData[0];
+ var polygonBoundRect = this._getBoundary(seriePoints),
+ theme = t.next("spider", [o, serieEntry]), ts = serieEntry.group,
+ f = g.normalizeColor(theme.series.fill), sk = {color: theme.series.fill, width: seriesWidth};
+ f.a = o.seriesFillAlpha;
+ serieEntry.dyn = {fill: f, stroke: sk};
+
+ var osps = this.oldSeriePoints[serieEntry.name];
+ var cs = this._createSeriesEntry(ts, (osps || innerPoints), seriePoints, f, sk, r, ro, ms, at);
+ this.chart.seriesShapes[serieEntry.name] = cs;
+ this.oldSeriePoints[serieEntry.name] = seriePoints;
+
+ var po = {
+ element: "spider_poly",
+ index: i,
+ id: "spider_poly_"+serieEntry.name,
+ run: serieEntry,
+ plot: this,
+ shape: cs.poly,
+ parent: ts,
+ brect: polygonBoundRect,
+ cx: circle.cx,
+ cy: circle.cy,
+ cr: r,
+ f: f,
+ s: s
+ };
+ this._connectEvents(po);
+
+ var so = {
+ element: "spider_plot",
+ index: i,
+ id: "spider_plot_"+serieEntry.name,
+ run: serieEntry,
+ plot: this,
+ shape: serieEntry.group
+ };
+ this._connectEvents(so);
+
+ dojo.forEach(cs.circles, function(c, i){
+ var shape = c.getShape(),
+ co = {
+ element: "spider_circle",
+ index: i,
+ id: "spider_circle_"+serieEntry.name+i,
+ run: serieEntry,
+ plot: this,
+ shape: c,
+ parent: ts,
+ tdata: tipData[i],
+ cx: seriePoints[i].x,
+ cy: seriePoints[i].y,
+ f: f,
+ s: s
+ };
+ this._connectEvents(co);
+ }, this);
+ }
+ }
+ return this; // dojox.charting.plot2d.Spider
+ },
+ _createSeriesEntry: function(ts, osps, sps, f, sk, r, ro, ms, at){
+ //polygon
+ var spoly = ts.createPolyline(osps).setFill(f).setStroke(sk), scircle = [];
+ for (var j = 0; j < osps.length; j++) {
+ var point = osps[j], cr = ms;
+ var circle = ts.createCircle({cx: point.x, cy: point.y, r: cr}).setFill(f).setStroke(sk);
+ scircle.push(circle);
+ }
+
+ var anims = dojo.map(sps, function(np, j){
+ // create animation
+ var sp = osps[j],
+ anim = new dojo._Animation({
+ duration: 1000,
+ easing: at,
+ curve: [sp.y, np.y]
+ });
+ var spl = spoly, sc = scircle[j];
+ dojo.connect(anim, "onAnimate", function(y){
+ //apply poly
+ var pshape = spl.getShape();
+ pshape.points[j].y = y;
+ spl.setShape(pshape);
+ //apply circle
+ var cshape = sc.getShape();
+ cshape.cy = y;
+ sc.setShape(cshape);
+ });
+ return anim;
+ });
+
+ var anims1 = dojo.map(sps, function(np, j){
+ // create animation
+ var sp = osps[j],
+ anim = new dojo._Animation({
+ duration: 1000,
+ easing: at,
+ curve: [sp.x, np.x]
+ });
+ var spl = spoly, sc = scircle[j];
+ dojo.connect(anim, "onAnimate", function(x){
+ //apply poly
+ var pshape = spl.getShape();
+ pshape.points[j].x = x;
+ spl.setShape(pshape);
+ //apply circle
+ var cshape = sc.getShape();
+ cshape.cx = x;
+ sc.setShape(cshape);
+ });
+ return anim;
+ });
+ var masterAnimation = dojo.fx.combine(anims.concat(anims1)); //dojo.fx.chain(anims);
+ masterAnimation.play();
+ return {group :ts, poly: spoly, circles: scircle};
+ },
+ plotEvent: function(o){
+ // summary:
+ // Stub function for use by specific plots.
+ // o: Object
+ // An object intended to represent event parameters.
+ var runName = o.id ? o.id : "default", a;
+ if (runName in this.animations) {
+ a = this.animations[runName];
+ a.anim && a.anim.stop(true);
+ } else {
+ a = this.animations[runName] = {};
+ }
+ if(o.element == "spider_poly"){
+ if(!a.color){
+ var color = o.shape.getFill();
+ if(!color || !(color instanceof dojo.Color)){
+ return;
+ }
+ a.color = {
+ start: color,
+ end: transColor(color)
+ };
+ }
+ var start = a.color.start, end = a.color.end;
+ if(o.type == "onmouseout"){
+ // swap colors
+ var t = start; start = end; end = t;
+ }
+ a.anim = dojox.gfx.fx.animateFill({
+ shape: o.shape,
+ duration: 800,
+ easing: dojo.fx.easing.backOut,
+ color: {start: start, end: end}
+ });
+ a.anim.play();
+ }else if(o.element == "spider_circle"){
+ var init, scale, defaultScale = 1.5;
+ if(o.type == "onmouseover"){
+ init = dojox.gfx.matrix.identity;
+ scale = defaultScale;
+ //show tooltip
+ var aroundRect = {type: "rect"};
+ aroundRect.x = o.cx;
+ aroundRect.y = o.cy;
+ aroundRect.width = aroundRect.height = 1;
+ var lt = dojo.coords(this.chart.node, true);
+ aroundRect.x += lt.x;
+ aroundRect.y += lt.y;
+ aroundRect.x = Math.round(aroundRect.x);
+ aroundRect.y = Math.round(aroundRect.y);
+ aroundRect.width = Math.ceil(aroundRect.width);
+ aroundRect.height = Math.ceil(aroundRect.height);
+ this.aroundRect = aroundRect;
+ var position = ["after", "before"];
+ if(dijit && dijit.Tooltip){
+ dijit.showTooltip(o.tdata.sname + "<br/>" + o.tdata.key + "<br/>" + o.tdata.data, this.aroundRect, position);
+ }
+ }else{
+ init = dojox.gfx.matrix.scaleAt(defaultScale, o.cx, o.cy);
+ scale = 1/defaultScale;
+ if(dijit && dijit.Tooltip){
+ this.aroundRect && dijit.hideTooltip(this.aroundRect);
+ }
+ }
+ var cs = o.shape.getShape(),
+ init = m.scaleAt(defaultScale, cs.cx, cs.cy),
+ kwArgs = {
+ shape: o.shape,
+ duration: 200,
+ easing: dojo.fx.easing.backOut,
+ transform: [
+ {name: "scaleAt", start: [1, cs.cx, cs.cy], end: [scale, cs.cx, cs.cy]},
+ init
+ ]
+ };
+ a.anim = dojox.gfx.fx.animateTransform(kwArgs);
+ a.anim.play();
+ }else if(o.element == "spider_plot"){
+ //dojo gfx function "moveToFront" not work in IE
+ if (o.type == "onmouseover" && !dojo.isIE) {
+ o.shape.moveToFront();
+ }
+ }
+ },
+ _getBoundary: function(points){
+ var xmax = points[0].x,
+ xmin = points[0].x,
+ ymax = points[0].y,
+ ymin = points[0].y;
+ for(var i = 0; i < points.length; i++){
+ var point = points[i];
+ xmax = Math.max(point.x, xmax);
+ ymax = Math.max(point.y, ymax);
+ xmin = Math.min(point.x, xmin);
+ ymin = Math.min(point.y, ymin);
+ }
+ return {
+ x: xmin,
+ y: ymin,
+ width: xmax - xmin,
+ height: ymax - ymin
+ };
+ },
+
+ _drawArrow: function(s, start, end, stroke){
+ var len = Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2)),
+ sin = (end.y - start.y)/len, cos = (end.x - start.x)/len,
+ point2 = {x: end.x + (len/3)*(-sin), y: end.y + (len/3)*cos},
+ point3 = {x: end.x + (len/3)*sin, y: end.y + (len/3)*(-cos)};
+ s.createPolyline([start, point2, point3]).setFill(stroke.color).setStroke(stroke);
+ },
+
+ _buildPoints: function(points, count, circle, radius, angle, recursive){
+ for (var i = 0; i < count; i++) {
+ var end = angle + 2 * Math.PI * i / count;
+ points.push(this._getCoordinate(circle, radius, end));
+ }
+ if(recursive){
+ points.push(this._getCoordinate(circle, radius, angle + 2 * Math.PI));
+ }
+ },
+
+ _getCoordinate: function(circle, radius, angle){
+ return {
+ x: circle.cx + radius * Math.cos(angle),
+ y: circle.cy + radius * Math.sin(angle)
+ }
+ },
+
+ _getObjectLength: function(obj){
+ var count = 0;
+ if(dojo.isObject(obj)){
+ for(var key in obj){
+ count++;
+ }
+ }
+ return count;
+ },
+
+ // utilities
+ _getLabel: function(number){
+ return dc.getLabel(number, this.opt.fixed, this.opt.precision);
+ }
+ });
+
+ function transColor(color){
+ var a = new dojox.color.Color(color),
+ x = a.toHsl();
+ if(x.s == 0){
+ x.l = x.l < 50 ? 100 : 0;
+ }else{
+ x.s = 100;
+ if(x.l < 50){
+ x.l = 75;
+ }else if(x.l > 75){
+ x.l = 50;
+ }else{
+ x.l = x.l - 50 > 75 - x.l ?
+ 50 : 75;
+ }
+ }
+ var color = dojox.color.fromHsl(x);
+ color.a = 0.7;
+ return color;
+ }
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.Chart2D"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.Chart2D"] = true;
+dojo.provide("dojox.charting.Chart2D");
+
+dojo.deprecated("dojox.charting.Chart2D", "Use dojo.charting.Chart instead and require all other components explicitly", "2.0");
+
+// require all axes to support references by name
+
+
+
+// require all plots to support references by name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// require the main file
+
+
+dojox.charting.Chart2D = dojox.charting.Chart;
+
+}
+
+if(!dojo._hasResource["dojox.charting.widget.Chart2D"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.widget.Chart2D"] = true;
+dojo.provide("dojox.charting.widget.Chart2D");
+
+dojo.deprecated("dojox.charting.widget.Chart2D", "Use dojo.charting.widget.Chart instead and require all other components explicitly", "2.0");
+
+
+
+// require all actions to support references by name
+
+
+
+
+
+
+// require Chart2D to get compatibility on chart type reference by name
+
+
+dojox.charting.widget.Chart2D = dojox.charting.widget.Chart;
+
+}
+
+if(!dojo._hasResource["dojox.charting.themes.GreySkies"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.themes.GreySkies"] = true;
+dojo.provide("dojox.charting.themes.GreySkies");
+
+
+(function(){
+ var dxc=dojox.charting;
+ dxc.themes.GreySkies=new dxc.Theme(dxc.Theme._def);
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.widget.Sparkline"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.widget.Sparkline"] = true;
+dojo.provide("dojox.charting.widget.Sparkline");
+
+
+
+
+
+
+(function(){
+
+ var d = dojo;
+
+ dojo.declare("dojox.charting.widget.Sparkline",
+ dojox.charting.widget.Chart2D,
+ {
+ theme: dojox.charting.themes.GreySkies,
+ margins: { l: 0, r: 0, t: 0, b: 0 },
+ type: "Lines",
+ valueFn: "Number(x)",
+ store: "",
+ field: "",
+ query: "",
+ queryOptions: "",
+ start: "0",
+ count: "Infinity",
+ sort: "",
+ data: "",
+ name: "default",
+ buildRendering: function(){
+ var n = this.srcNodeRef;
+ if( !n.childNodes.length || // shortcut the query
+ !d.query("> .axis, > .plot, > .action, > .series", n).length){
+ var plot = document.createElement("div");
+ d.attr(plot, {
+ "class": "plot",
+ "name": "default",
+ "type": this.type
+ });
+ n.appendChild(plot);
+
+ var series = document.createElement("div");
+ d.attr(series, {
+ "class": "series",
+ plot: "default",
+ name: this.name,
+ start: this.start,
+ count: this.count,
+ valueFn: this.valueFn
+ });
+ d.forEach(
+ ["store", "field", "query", "queryOptions", "sort", "data"],
+ function(i){
+ if(this[i].length){
+ d.attr(series, i, this[i]);
+ }
+ },
+ this
+ );
+ n.appendChild(series);
+ }
+ this.inherited(arguments);
+ }
+ }
+ );
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.charting.widget.Legend"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.widget.Legend"] = true;
+dojo.provide("dojox.charting.widget.Legend");
+
+
+
+
+
+
+
+dojo.declare("dojox.charting.widget.Legend", [dijit._Widget, dijit._Templated], {
+ // summary: A legend for a chart. A legend contains summary labels for
+ // each series of data contained in the chart.
+ //
+ // Set the horizontal attribute to boolean false to layout legend labels vertically.
+ // Set the horizontal attribute to a number to layout legend labels in horizontal
+ // rows each containing that number of labels (except possibly the last row).
+ //
+ // (Line or Scatter charts (colored lines with shape symbols) )
+ // -o- Series1 -X- Series2 -v- Series3
+ //
+ // (Area/Bar/Pie charts (letters represent colors))
+ // [a] Series1 [b] Series2 [c] Series3
+
+ chartRef: "",
+ horizontal: true,
+ swatchSize: 18,
+
+ templateString: "<table dojoAttachPoint='legendNode' class='dojoxLegendNode' role='group' aria-label='chart legend'><tbody dojoAttachPoint='legendBody'></tbody></table>",
+
+ legendNode: null,
+ legendBody: null,
+
+ postCreate: function(){
+ if(!this.chart){
+ if(!this.chartRef){ return; }
+ this.chart = dijit.byId(this.chartRef);
+ if(!this.chart){
+ var node = dojo.byId(this.chartRef);
+ if(node){
+ this.chart = dijit.byNode(node);
+ }else{
+ console.log("Could not find chart instance with id: " + this.chartRef);
+ return;
+ }
+ }
+ this.series = this.chart.chart.series;
+ }else{
+ this.series = this.chart.series;
+ }
+
+ this.refresh();
+ },
+ refresh: function(){
+ // summary: regenerates the legend to reflect changes to the chart
+
+ var df = dojox.lang.functional;
+
+ // cleanup
+ if(this._surfaces){
+ dojo.forEach(this._surfaces, function(surface){
+ surface.destroy();
+ });
+ }
+ this._surfaces = [];
+ while(this.legendBody.lastChild){
+ dojo.destroy(this.legendBody.lastChild);
+ }
+
+ if(this.horizontal){
+ dojo.addClass(this.legendNode, "dojoxLegendHorizontal");
+ // make a container <tr>
+ this._tr = dojo.create("tr", null, this.legendBody);
+ this._inrow = 0;
+ }
+
+ var s = this.series;
+ if(s.length == 0){
+ return;
+ }
+ if(s[0].chart.stack[0].declaredClass == "dojox.charting.plot2d.Pie"){
+ var t = s[0].chart.stack[0];
+ if(typeof t.run.data[0] == "number"){
+ var filteredRun = df.map(t.run.data, "Math.max(x, 0)");
+ if(df.every(filteredRun, "<= 0")){
+ return;
+ }
+ var slices = df.map(filteredRun, "/this", df.foldl(filteredRun, "+", 0));
+ dojo.forEach(slices, function(x, i){
+ this._addLabel(t.dyn[i], t._getLabel(x * 100) + "%");
+ }, this);
+ }else{
+ dojo.forEach(t.run.data, function(x, i){
+ this._addLabel(t.dyn[i], x.legend || x.text || x.y);
+ }, this);
+ }
+ }else{
+ dojo.forEach(s, function(x){
+ this._addLabel(x.dyn, x.legend || x.name);
+ }, this);
+ }
+ },
+ _addLabel: function(dyn, label){
+ // create necessary elements
+ var wrapper = dojo.create("td"),
+ icon = dojo.create("div", null, wrapper),
+ text = dojo.create("label", null, wrapper),
+ div = dojo.create("div", {
+ style: {
+ "width": this.swatchSize + "px",
+ "height":this.swatchSize + "px",
+ "float": "left"
+ }
+ }, icon);
+ dojo.addClass(icon, "dojoxLegendIcon dijitInline");
+ dojo.addClass(text, "dojoxLegendText");
+ // create a skeleton
+ if(this._tr){
+ // horizontal
+ this._tr.appendChild(wrapper);
+ if(++this._inrow === this.horizontal){
+ // make a fresh container <tr>
+ this._tr = dojo.create("tr", null, this.legendBody);
+ this._inrow = 0;
+ }
+ }else{
+ // vertical
+ var tr = dojo.create("tr", null, this.legendBody);
+ tr.appendChild(wrapper);
+ }
+
+ // populate the skeleton
+ this._makeIcon(div, dyn);
+ text.innerHTML = String(label);
+ },
+ _makeIcon: function(div, dyn){
+ var mb = { h: this.swatchSize, w: this.swatchSize };
+ var surface = dojox.gfx.createSurface(div, mb.w, mb.h);
+ this._surfaces.push(surface);
+ if(dyn.fill){
+ // regions
+ surface.createRect({x: 2, y: 2, width: mb.w - 4, height: mb.h - 4}).
+ setFill(dyn.fill).setStroke(dyn.stroke);
+ }else if(dyn.stroke || dyn.marker){
+ // draw line
+ var line = {x1: 0, y1: mb.h / 2, x2: mb.w, y2: mb.h / 2};
+ if(dyn.stroke){
+ surface.createLine(line).setStroke(dyn.stroke);
+ }
+ if(dyn.marker){
+ // draw marker on top
+ var c = {x: mb.w / 2, y: mb.h / 2};
+ if(dyn.stroke){
+ surface.createPath({path: "M" + c.x + " " + c.y + " " + dyn.marker}).
+ setFill(dyn.stroke.color).setStroke(dyn.stroke);
+ }else{
+ surface.createPath({path: "M" + c.x + " " + c.y + " " + dyn.marker}).
+ setFill(dyn.color).setStroke(dyn.color);
+ }
+ }
+ }else{
+ // nothing
+ surface.createRect({x: 2, y: 2, width: mb.w - 4, height: mb.h - 4}).
+ setStroke("black");
+ surface.createLine({x1: 2, y1: 2, x2: mb.w - 2, y2: mb.h - 2}).setStroke("black");
+ surface.createLine({x1: 2, y1: mb.h - 2, x2: mb.w - 2, y2: 2}).setStroke("black");
+ }
+ }
+});
+
+}
+
+
+}};});