/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */
//>>built
require({cache:{"url:esri/dijit/templates/Gauge.html":"<div class=\"gaugeContainer\">\r\n  <div data-dojo-attach-point=\"titleNode\" class=\"gaugeTitle\">${title}</div>\r\n  <div data-dojo-attach-point=\"dataLabelWrapperNode\">\r\n    <div data-dojo-attach-point=\"dataLabelNode\">${dataLabel}</div>\r\n  </div>\r\n  <div data-dojo-attach-point=\"gaugeNode\" style=\"margin: -10px auto 10px auto; width: 240px; height: 120px;\"></div>\r\n  <div data-dojo-attach-point=\"captionNode\" class=\"gaugeCaption\">${caption}</div>\r\n</div>\r\n"}});define("esri/dijit/Gauge",["dojo/_base/declare","dojo/_base/lang","dojo/_base/connect","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/number","dojo/has","dojo/text!esri/dijit/templates/Gauge.html","dijit/_WidgetBase","dijit/_TemplatedMixin","dojox/widget/AnalogGauge","dojox/widget/gauge/AnalogArcIndicator","esri/kernel"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e){var _f=_1([_a,_b],{declaredClass:"esri.dijit.Gauge",templateString:_9,widgetsInTemplate:false,constructor:function(_10,_11){this.caption="&nbsp;";this.color="#000";this.dataFormat="value";this.maxDataValue=100;this.title="&nbsp;";this.unitLabel="";this.fromWebmap=false;this.feature=null;this.dataLabel="&nbsp;";_2.mixin(this,_10);this._majorTicks="";this.value=0;this.numberFormat=this.numberFormat||{"places":0};if(this.fromWebmap){this.dataField=this.field;this.dataFormat=this.valueLabel;this.dataLabelField=this.displayField;this.maxDataValue=this.target;this.unitLabel="";}if(this.dataFormat=="percentage"){this.unitLabel="%";this._majorTicks={offset:90,interval:25,length:3,color:"black"};}this.watch("caption",this._updateCaption);this.watch("dataLabel",this._updateDataLabel);this.watch("title",this._updateTitle);this.watch("value",this._updateValue);this.watch("feature",this._updateFeature);},startup:function(){this.inherited(arguments);var _12=new _d({interactionMode:"indicator",noChange:true,value:this.maxDataValue,width:20,offset:65,color:[204,204,204,1],title:"value",hideValue:true,duration:100});var _13=new _d({interactionMode:"indicator",noChange:false,value:this.value,width:20,offset:65,color:this.color,title:"value",hideValue:true,onDragMove:"",duration:100});this.gaugeWidget=new _c({background:[204,204,204,0],width:parseInt(this.gaugeNode.style.width),height:parseInt(this.gaugeNode.style.height)+10,cx:parseInt(this.gaugeNode.style.width)/2,cy:parseInt(this.gaugeNode.style.height),style:"position: absolute;",radius:parseInt(this.gaugeNode.style.width)/2,useTooltip:false,ranges:[{low:0,high:this.maxDataValue,color:"rgba(255,0,0,0)"}],majorTicks:this._majorTicks,indicators:[_12,_13]},_4.create("div",null,this.gaugeNode));this.gaugeWidget.startup();this.gaugeWidget._handleMouseDownIndicator=function(){};this.valueNode=_4.create("div",{"innerHTML":"0"+this.unitLabel,"style":{"bottom":parseInt(this.gaugeNode.style.height)-(this.gaugeWidget.cy-20)+"px","color":"#000","font-family":"arial","font-size":"1em","left":"-1000px","position":"absolute"}},this.gaugeWidget.domNode);var _14=_5.getContentBox(this.valueNode);_6.set(this.valueNode,"left",this.gaugeWidget.cx+"px");_6.set(this.valueNode,"marginLeft",(-_14.w/2)+"px");if(this.gaugeWidget.cx){_6.set(this.valueNode,"marginBottom",(-_14.h/2)+"px");}if(this.layer){this._connectMouseOver();}},destroy:function(){if(this._mouseOverHandler){_3.disconnect(this._mouseOverHandler);}this.gaugeWidget.destroy();_4.empty(this.domNode);},_connectMouseOver:function(){this._mouseOverHandler=_3.connect(this.layer,"onMouseOver",_2.hitch(this,function(e){this.set("feature",e);}));},_formatValue:function(val){if(this.dataFormat=="percentage"){val=Math.round((val/this.maxDataValue)*100);}return _7.format(val,this.numberFormat);},_updateCaption:function(_15,_16,_17){this.captionNode.innerHTML=_17;},_updateTitle:function(_18,_19,_1a){this.titleNode.innerHTML=_1a;},_updateValue:function(_1b,_1c,_1d){var val=this._formatValue(_1d);this.valueNode.innerHTML=val+this.unitLabel;this.gaugeWidget.indicators[1].update(parseInt(val));},_updateDataLabel:function(_1e,_1f,_20){this.dataLabelNode.innerHTML=_20;},_updateFeature:function(_21,_22,_23){if(!_23||(_23.hasOwnPropety&&!_23.hasOwnProperty("graphic")&&!_23.declaredClass=="esri.Graphic")){console.log("Gauge Dijit:  a graphic is required to update the gauge.");return;}this.feature=_23.graphic||_23;this.set("value",this.feature.attributes[this.dataField]||0);this.set("dataLabel",this.feature.attributes[this.dataLabelField]||this.noDataLabel);}});if(_8("extend-esri")){_2.setObject("dijit.Gauge",_f,_e);}return _f;});