//>>built
define("dojox/charting/plot2d/Bubble","dojo/_base/lang,dojo/_base/declare,dojo/_base/array,./CartesianBase,./_PlotEvents,./common,dojox/lang/functional,dojox/lang/functional/reversed,dojox/lang/utils,dojox/gfx/fx".split(","),function(o,q,e,v,w,x,y,z,p,A){var B=z.lambda("item.purgeGroup()");return q("dojox.charting.plot2d.Bubble",[v,w],{defaultParams:{hAxis:"x",vAxis:"y",animate:null},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},styleFunc:null,font:"",fontColor:""},constructor:function(h,
f){this.opt=o.clone(this.defaultParams);p.updateWithObject(this.opt,f);p.updateWithPattern(this.opt,f,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate},render:function(h,f){if(this.zoom&&!this.isDataDirty())return this.performZoom(h,f);this.resetEvents();if(this.dirty=this.isDirty()){e.forEach(this.series,B);this._eventSeries={};this.cleanGroup();var i=this.group;y.forEachRev(this.series,function(a){a.cleanGroup(i)})}for(var m=this.chart.theme,
o=this._hScaler.scaler.getTransformerFromModel(this._hScaler),p=this._vScaler.scaler.getTransformerFromModel(this._vScaler),q=this.events(),r=this.series.length-1;0<=r;--r){var c=this.series[r];if(!this.dirty&&!c.dirty)m.skip(),this._reconnectEvents(c.name);else if(c.cleanGroup(),c.data.length){if("number"!=typeof c.data[0]){var n=m.next("circle",[this.opt,c]),i=c.group,j=e.map(c.data,function(a){return a?{x:o(a.x)+f.l,y:h.height-f.b-p(a.y),radius:this._vScaler.bounds.scale*(a.size/2)}:null},this),
g=null,k=null,l=null,t=this.opt.styleFunc,s=function(a){return t?m.addMixin(n,"circle",[a,t(a)],!0):m.addMixin(n,"circle",a,!0)};if(n.series.shadow&&(l=e.map(j,function(a,d){if(null!==a){var b=s(c.data[d]).series.shadow,b=i.createCircle({cx:a.x+b.dx,cy:a.y+b.dy,r:a.radius}).setStroke(b).setFill(b.color);this.animate&&this._animateBubble(b,h.height-f.b,a.radius);return b}return null},this),l.length))c.dyn.shadow=l[l.length-1].getStroke();if(n.series.outline&&(k=e.map(j,function(a,d){if(null!==a){var b=
s(c.data[d]),b=x.makeStroke(b.series.outline);b.width=2*b.width+n.series.stroke.width;b=i.createCircle({cx:a.x,cy:a.y,r:a.radius}).setStroke(b);this.animate&&this._animateBubble(b,h.height-f.b,a.radius);return b}return null},this),k.length))c.dyn.outline=k[k.length-1].getStroke();g=e.map(j,function(a,d){if(null!==a){var b=s(c.data[d]),g={x:a.x-a.radius,y:a.y-a.radius,width:2*a.radius,height:2*a.radius},e=this._plotFill(b.series.fill,h,f),e=this._shapeFill(e,g),b=i.createCircle({cx:a.x,cy:a.y,r:a.radius}).setFill(e).setStroke(b.series.stroke);
this.animate&&this._animateBubble(b,h.height-f.b,a.radius);return b}return null},this);if(g.length)c.dyn.fill=g[g.length-1].getFill(),c.dyn.stroke=g[g.length-1].getStroke();if(q){var u=Array(g.length);e.forEach(g,function(a,d){if(null!==a){var b={element:"circle",index:d,run:c,shape:a,outline:k&&k[d]||null,shadow:l&&l[d]||null,x:c.data[d].x,y:c.data[d].y,r:c.data[d].size/2,cx:j[d].x,cy:j[d].y,cr:j[d].radius};this._connectEvents(b);u[d]=b}},this);this._eventSeries[c.name]=u}else delete this._eventSeries[c.name];
c.dirty=!1}}else c.dirty=!1,m.skip()}this.dirty=!1;return this},_animateBubble:function(e,f,i){A.animateTransform(o.delegate({shape:e,duration:1200,transform:[{name:"translate",start:[0,f],end:[0,0]},{name:"scale",start:[0,1/i],end:[1,1]},{name:"original"}]},this.animate)).play()}})});