//>>built
define("dojox/charting/action2d/MoveSlice",["dojo/_base/connect","dojo/_base/declare","dojo/_base/array","./PlotAction","dojo/fx/easing","dojox/gfx/matrix","dojox/gfx/fx","dojox/lang/functional","dojox/lang/functional/scan","dojox/lang/functional/fold"],function(_1,_2,_3,_4,_5,m,gf,df){
var _6=1.05,_7=7;
return _2("dojox.charting.action2d.MoveSlice",_4,{defaultParams:{duration:400,easing:_5.backOut,scale:_6,shift:_7},optionalParams:{},constructor:function(_8,_9,_a){
if(!_a){
_a={};
}
this.scale=typeof _a.scale=="number"?_a.scale:_6;
this.shift=typeof _a.shift=="number"?_a.shift:_7;
this.connect();
},process:function(o){
if(!o.shape||o.element!="slice"||!(o.type in this.overOutEvents)){
return;
}
if(!this.angles){
var _b=m._degToRad(o.plot.opt.startAngle);
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));
}
this.angles=_3.map(this.angles,function(_c){
return _c+_b;
});
}
var _d=o.index,_e,_f,_10,_11,_12,_13=(this.angles[_d]+this.angles[_d+1])/2,_14=m.rotateAt(-_13,o.cx,o.cy),_15=m.rotateAt(_13,o.cx,o.cy);
_e=this.anim[_d];
if(_e){
_e.action.stop(true);
}else{
this.anim[_d]=_e={};
}
if(o.type=="onmouseover"){
_11=0;
_12=this.shift;
_f=1;
_10=this.scale;
}else{
_11=this.shift;
_12=0;
_f=this.scale;
_10=1;
}
_e.action=gf.animateTransform({shape:o.shape,duration:this.duration,easing:this.easing,transform:[_15,{name:"translate",start:[_11,0],end:[_12,0]},{name:"scaleAt",start:[_f,o.cx,o.cy],end:[_10,o.cx,o.cy]},_14]});
if(o.type=="onmouseout"){
_1.connect(_e.action,"onEnd",this,function(){
delete this.anim[_d];
});
}
_e.action.play();
},reset:function(){
delete this.angles;
}});
});
