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