/*
	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
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.charting.plot2d.Bubble"],["require","dojox.charting.plot2d.Base"],["require","dojox.lang.functional"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.charting.plot2d.Bubble"]){_4._hasResource["dojox.charting.plot2d.Bubble"]=true;_4.provide("dojox.charting.plot2d.Bubble");_4.require("dojox.charting.plot2d.Base");_4.require("dojox.lang.functional");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_7=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Bubble",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",animate:null},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_8,_9){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_9);du.updateWithPattern(this.opt,_9,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(_a,_b){if(this.zoom&&!this.isDataDirty()){return this.performZoom(_a,_b);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_7);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(_c){_c.cleanGroup(s);});}var t=this.chart.theme,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_d=this.events();for(var i=this.series.length-1;i>=0;--i){var _e=this.series[i];if(!this.dirty&&!_e.dirty){t.skip();this._reconnectEvents(_e.name);continue;}_e.cleanGroup();if(!_e.data.length){_e.dirty=false;t.skip();continue;}if(typeof _e.data[0]=="number"){console.warn("dojox.charting.plot2d.Bubble: the data in the following series cannot be rendered as a bubble chart; ",_e);continue;}var _f=t.next("circle",[this.opt,_e]),s=_e.group,_10=_4.map(_e.data,function(v,i){return v?{x:ht(v.x)+_b.l,y:_a.height-_b.b-vt(v.y),radius:this._vScaler.bounds.scale*(v.size/2)}:null;},this);var _11=null,_12=null,_13=null;if(_f.series.shadow){_13=_4.map(_10,function(_14){if(_14!==null){var _15=t.addMixin(_f,"circle",_14,true),_16=_15.series.shadow;var _17=s.createCircle({cx:_14.x+_16.dx,cy:_14.y+_16.dy,r:_14.radius}).setStroke(_16).setFill(_16.color);if(this.animate){this._animateBubble(_17,_a.height-_b.b,_14.radius);}return _17;}return null;},this);if(_13.length){_e.dyn.shadow=_13[_13.length-1].getStroke();}}if(_f.series.outline){_12=_4.map(_10,function(_18){if(_18!==null){var _19=t.addMixin(_f,"circle",_18,true),_1a=dc.makeStroke(_19.series.outline);_1a.width=2*_1a.width+_f.series.stroke.width;var _1b=s.createCircle({cx:_18.x,cy:_18.y,r:_18.radius}).setStroke(_1a);if(this.animate){this._animateBubble(_1b,_a.height-_b.b,_18.radius);}return _1b;}return null;},this);if(_12.length){_e.dyn.outline=_12[_12.length-1].getStroke();}}_11=_4.map(_10,function(_1c){if(_1c!==null){var _1d=t.addMixin(_f,"circle",_1c,true),_1e={x:_1c.x-_1c.radius,y:_1c.y-_1c.radius,width:2*_1c.radius,height:2*_1c.radius};var _1f=this._plotFill(_1d.series.fill,_a,_b);_1f=this._shapeFill(_1f,_1e);var _20=s.createCircle({cx:_1c.x,cy:_1c.y,r:_1c.radius}).setFill(_1f).setStroke(_1d.series.stroke);if(this.animate){this._animateBubble(_20,_a.height-_b.b,_1c.radius);}return _20;}return null;},this);if(_11.length){_e.dyn.fill=_11[_11.length-1].getFill();_e.dyn.stroke=_11[_11.length-1].getStroke();}if(_d){var _21=new Array(_11.length);_4.forEach(_11,function(s,i){if(s!==null){var o={element:"circle",index:i,run:_e,shape:s,outline:_12&&_12[i]||null,shadow:_13&&_13[i]||null,x:_e.data[i].x,y:_e.data[i].y,r:_e.data[i].size/2,cx:_10[i].x,cy:_10[i].y,cr:_10[i].radius};this._connectEvents(o);_21[i]=o;}},this);this._eventSeries[_e.name]=_21;}else{delete this._eventSeries[_e.name];}_e.dirty=false;}this.dirty=false;return this;},_animateBubble:function(_22,_23,_24){_6.gfx.fx.animateTransform(_4.delegate({shape:_22,duration:1200,transform:[{name:"translate",start:[0,_23],end:[0,0]},{name:"scale",start:[0,1/_24],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}}};});