vendor/assets/javascripts/dojox/charting/Element.js in dojox-rails-0.13.0 vs vendor/assets/javascripts/dojox/charting/Element.js in dojox-rails-0.14.0

- old
+ new

@@ -11,13 +11,17 @@ this.destroyHtmlElements(); if(this.group){ this.group.removeShape(); var _8=this.group.children; for(var i=0;i<_8.length;++i){ -_6.dispose(_8[i]); +_6.dispose(_8[i],true); } +if(this.group.rawNode){ +_3.empty(this.group.rawNode); +} this.group.clear(); +_6.dispose(this.group,true); this.group=null; } this.dirty=true; if(this._events.length){ _2.forEach(this._events,function(_9){ @@ -30,15 +34,23 @@ this.destroyHtmlElements(); if(!_a){ _a=this.chart.surface; } if(this.group){ -var _b=this.group.children; -for(var i=0;i<_b.length;++i){ -_6.dispose(_b[i]); +var _b; +var _c=this.group.children; +for(var i=0;i<_c.length;++i){ +_6.dispose(_c[i],true); } +if(this.group.rawNode){ +_b=this.group.bgNode; +_3.empty(this.group.rawNode); +} this.group.clear(); +if(_b){ +this.group.rawNode.appendChild(_b); +} }else{ this.group=_a.createGroup(); } this.dirty=true; return this; @@ -47,165 +59,165 @@ _2.forEach(this.htmlElements,_3.destroy); this.htmlElements=[]; } },destroy:function(){ this.purgeGroup(); -},getTextWidth:function(s,_c){ -return _5._base._getTextBox(s,{font:_c}).w||0; -},getTextWithLimitLength:function(s,_d,_e,_f){ +},getTextWidth:function(s,_d){ +return _5._base._getTextBox(s,{font:_d}).w||0; +},getTextWithLimitLength:function(s,_e,_f,_10){ if(!s||s.length<=0){ -return {text:"",truncated:_f||false}; +return {text:"",truncated:_10||false}; } -if(!_e||_e<=0){ -return {text:s,truncated:_f||false}; +if(!_f||_f<=0){ +return {text:s,truncated:_10||false}; } -var _10=2,_11=0.618,_12=s.substring(0,1)+this.trailingSymbol,_13=this.getTextWidth(_12,_d); -if(_e<=_13){ -return {text:_12,truncated:true}; +var _11=2,_12=0.618,_13=s.substring(0,1)+this.trailingSymbol,_14=this.getTextWidth(_13,_e); +if(_f<=_14){ +return {text:_13,truncated:true}; } -var _14=this.getTextWidth(s,_d); -if(_14<=_e){ -return {text:s,truncated:_f||false}; +var _15=this.getTextWidth(s,_e); +if(_15<=_f){ +return {text:s,truncated:_10||false}; }else{ -var _15=0,end=s.length; -while(_15<end){ -if(end-_15<=_10){ -while(this.getTextWidth(s.substring(0,_15)+this.trailingSymbol,_d)>_e){ -_15-=1; +var _16=0,end=s.length; +while(_16<end){ +if(end-_16<=_11){ +while(this.getTextWidth(s.substring(0,_16)+this.trailingSymbol,_e)>_f){ +_16-=1; } -return {text:(s.substring(0,_15)+this.trailingSymbol),truncated:true}; +return {text:(s.substring(0,_16)+this.trailingSymbol),truncated:true}; } -var _16=_15+Math.round((end-_15)*_11),_17=this.getTextWidth(s.substring(0,_16),_d); -if(_17<_e){ -_15=_16; +var _17=_16+Math.round((end-_16)*_12),_18=this.getTextWidth(s.substring(0,_17),_e); +if(_18<_f){ +_16=_17; end=end; }else{ -_15=_15; -end=_16; +_16=_16; +end=_17; } } } -},getTextWithLimitCharCount:function(s,_18,_19,_1a){ +},getTextWithLimitCharCount:function(s,_19,_1a,_1b){ if(!s||s.length<=0){ -return {text:"",truncated:_1a||false}; +return {text:"",truncated:_1b||false}; } -if(!_19||_19<=0||s.length<=_19){ -return {text:s,truncated:_1a||false}; +if(!_1a||_1a<=0||s.length<=_1a){ +return {text:s,truncated:_1b||false}; } -return {text:s.substring(0,_19)+this.trailingSymbol,truncated:true}; -},_plotFill:function(_1b,dim,_1c){ -if(!_1b||!_1b.type||!_1b.space){ -return _1b; +return {text:s.substring(0,_1a)+this.trailingSymbol,truncated:true}; +},_plotFill:function(_1c,dim,_1d){ +if(!_1c||!_1c.type||!_1c.space){ +return _1c; } -var _1d=_1b.space,_1e; -switch(_1b.type){ +var _1e=_1c.space,_1f; +switch(_1c.type){ case "linear": -if(_1d==="plot"||_1d==="shapeX"||_1d==="shapeY"){ -_1b=_5.makeParameters(_5.defaultLinearGradient,_1b); -_1b.space=_1d; -if(_1d==="plot"||_1d==="shapeX"){ -_1e=dim.height-_1c.t-_1c.b; -_1b.y1=_1c.t+_1e*_1b.y1/100; -_1b.y2=_1c.t+_1e*_1b.y2/100; +if(_1e==="plot"||_1e==="shapeX"||_1e==="shapeY"){ +_1c=_5.makeParameters(_5.defaultLinearGradient,_1c); +_1c.space=_1e; +if(_1e==="plot"||_1e==="shapeX"){ +_1f=dim.height-_1d.t-_1d.b; +_1c.y1=_1d.t+_1f*_1c.y1/100; +_1c.y2=_1d.t+_1f*_1c.y2/100; } -if(_1d==="plot"||_1d==="shapeY"){ -_1e=dim.width-_1c.l-_1c.r; -_1b.x1=_1c.l+_1e*_1b.x1/100; -_1b.x2=_1c.l+_1e*_1b.x2/100; +if(_1e==="plot"||_1e==="shapeY"){ +_1f=dim.width-_1d.l-_1d.r; +_1c.x1=_1d.l+_1f*_1c.x1/100; +_1c.x2=_1d.l+_1f*_1c.x2/100; } } break; case "radial": -if(_1d==="plot"){ -_1b=_5.makeParameters(_5.defaultRadialGradient,_1b); -_1b.space=_1d; -var _1f=dim.width-_1c.l-_1c.r,_20=dim.height-_1c.t-_1c.b; -_1b.cx=_1c.l+_1f*_1b.cx/100; -_1b.cy=_1c.t+_20*_1b.cy/100; -_1b.r=_1b.r*Math.sqrt(_1f*_1f+_20*_20)/200; +if(_1e==="plot"){ +_1c=_5.makeParameters(_5.defaultRadialGradient,_1c); +_1c.space=_1e; +var _20=dim.width-_1d.l-_1d.r,_21=dim.height-_1d.t-_1d.b; +_1c.cx=_1d.l+_20*_1c.cx/100; +_1c.cy=_1d.t+_21*_1c.cy/100; +_1c.r=_1c.r*Math.sqrt(_20*_20+_21*_21)/200; } break; case "pattern": -if(_1d==="plot"||_1d==="shapeX"||_1d==="shapeY"){ -_1b=_5.makeParameters(_5.defaultPattern,_1b); -_1b.space=_1d; -if(_1d==="plot"||_1d==="shapeX"){ -_1e=dim.height-_1c.t-_1c.b; -_1b.y=_1c.t+_1e*_1b.y/100; -_1b.height=_1e*_1b.height/100; +if(_1e==="plot"||_1e==="shapeX"||_1e==="shapeY"){ +_1c=_5.makeParameters(_5.defaultPattern,_1c); +_1c.space=_1e; +if(_1e==="plot"||_1e==="shapeX"){ +_1f=dim.height-_1d.t-_1d.b; +_1c.y=_1d.t+_1f*_1c.y/100; +_1c.height=_1f*_1c.height/100; } -if(_1d==="plot"||_1d==="shapeY"){ -_1e=dim.width-_1c.l-_1c.r; -_1b.x=_1c.l+_1e*_1b.x/100; -_1b.width=_1e*_1b.width/100; +if(_1e==="plot"||_1e==="shapeY"){ +_1f=dim.width-_1d.l-_1d.r; +_1c.x=_1d.l+_1f*_1c.x/100; +_1c.width=_1f*_1c.width/100; } } break; } -return _1b; -},_shapeFill:function(_21,_22){ -if(!_21||!_21.space){ -return _21; +return _1c; +},_shapeFill:function(_22,_23){ +if(!_22||!_22.space){ +return _22; } -var _23=_21.space,_24; -switch(_21.type){ +var _24=_22.space,_25; +switch(_22.type){ case "linear": -if(_23==="shape"||_23==="shapeX"||_23==="shapeY"){ -_21=_5.makeParameters(_5.defaultLinearGradient,_21); -_21.space=_23; -if(_23==="shape"||_23==="shapeX"){ -_24=_22.width; -_21.x1=_22.x+_24*_21.x1/100; -_21.x2=_22.x+_24*_21.x2/100; +if(_24==="shape"||_24==="shapeX"||_24==="shapeY"){ +_22=_5.makeParameters(_5.defaultLinearGradient,_22); +_22.space=_24; +if(_24==="shape"||_24==="shapeX"){ +_25=_23.width; +_22.x1=_23.x+_25*_22.x1/100; +_22.x2=_23.x+_25*_22.x2/100; } -if(_23==="shape"||_23==="shapeY"){ -_24=_22.height; -_21.y1=_22.y+_24*_21.y1/100; -_21.y2=_22.y+_24*_21.y2/100; +if(_24==="shape"||_24==="shapeY"){ +_25=_23.height; +_22.y1=_23.y+_25*_22.y1/100; +_22.y2=_23.y+_25*_22.y2/100; } } break; case "radial": -if(_23==="shape"){ -_21=_5.makeParameters(_5.defaultRadialGradient,_21); -_21.space=_23; -_21.cx=_22.x+_22.width/2; -_21.cy=_22.y+_22.height/2; -_21.r=_21.r*_22.width/200; +if(_24==="shape"){ +_22=_5.makeParameters(_5.defaultRadialGradient,_22); +_22.space=_24; +_22.cx=_23.x+_23.width/2; +_22.cy=_23.y+_23.height/2; +_22.r=_22.r*_23.width/200; } break; case "pattern": -if(_23==="shape"||_23==="shapeX"||_23==="shapeY"){ -_21=_5.makeParameters(_5.defaultPattern,_21); -_21.space=_23; -if(_23==="shape"||_23==="shapeX"){ -_24=_22.width; -_21.x=_22.x+_24*_21.x/100; -_21.width=_24*_21.width/100; +if(_24==="shape"||_24==="shapeX"||_24==="shapeY"){ +_22=_5.makeParameters(_5.defaultPattern,_22); +_22.space=_24; +if(_24==="shape"||_24==="shapeX"){ +_25=_23.width; +_22.x=_23.x+_25*_22.x/100; +_22.width=_25*_22.width/100; } -if(_23==="shape"||_23==="shapeY"){ -_24=_22.height; -_21.y=_22.y+_24*_21.y/100; -_21.height=_24*_21.height/100; +if(_24==="shape"||_24==="shapeY"){ +_25=_23.height; +_22.y=_23.y+_25*_22.y/100; +_22.height=_25*_22.height/100; } } break; } -return _21; -},_pseudoRadialFill:function(_25,_26,_27,_28,end){ -if(!_25||_25.type!=="radial"||_25.space!=="shape"){ -return _25; +return _22; +},_pseudoRadialFill:function(_26,_27,_28,_29,end){ +if(!_26||_26.type!=="radial"||_26.space!=="shape"){ +return _26; } -var _29=_25.space; -_25=_5.makeParameters(_5.defaultRadialGradient,_25); -_25.space=_29; +var _2a=_26.space; +_26=_5.makeParameters(_5.defaultRadialGradient,_26); +_26.space=_2a; if(arguments.length<4){ -_25.cx=_26.x; -_25.cy=_26.y; -_25.r=_25.r*_27/100; -return _25; +_26.cx=_27.x; +_26.cy=_27.y; +_26.r=_26.r*_28/100; +return _26; } -var _2a=arguments.length<5?_28:(end+_28)/2; -return {type:"linear",x1:_26.x,y1:_26.y,x2:_26.x+_25.r*_27*Math.cos(_2a)/100,y2:_26.y+_25.r*_27*Math.sin(_2a)/100,colors:_25.colors}; -return _25; +var _2b=arguments.length<5?_29:(end+_29)/2; +return {type:"linear",x1:_27.x,y1:_27.y,x2:_27.x+_26.r*_28*Math.cos(_2b)/100,y2:_27.y+_26.r*_28*Math.sin(_2b)/100,colors:_26.colors}; +return _26; }}); });