//>>built
define("dojox/charting/scaler/log",["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","./linear","./common"],function(u,h,p,k,r){function q(a,c){var f=0;if(.6>a){var b=a.toString().match(/\.(\d+)/);b&&b[1]&&(f=-b[1].length)}return t(a,f,c)}var l={},t=r.getNumericLabel;return h.mixin(l,k,{base:10,setBase:function(a){this.base=Math.round(a||10)},buildScaler:function(a,c,f,b){var g=Math.log(this.base),e,d;"min"in b&&(a=b.min);"max"in b&&(c=b.max);a=Math.log(a)/g;c=Math.log(c)/g;var h=Math.floor(a),
m=Math.ceil(c);a=h<a?h:a-1;c=c<m?m:c+1;b.includeZero&&(0<a&&(a=0),0>c&&(c=0),0<e&&(e=0),0<d&&(d=0));e={min:a,max:c,fixUpper:b.fixUpper,fixLower:b.fixLower,natural:b.natural,minorTicks:!1,minorLabels:!1,majorTickStep:1};"from"in b&&(e.from=Math.log(b.from)/g);"to"in b&&(e.to=Math.log(b.to)/g);a=k.buildScaler.call(k,a,c,f,e);a.scaler=l;a.bounds.lower=Math.exp(a.bounds.lower*g);a.bounds.upper=Math.exp(a.bounds.upper*g);a.bounds.from=Math.exp(a.bounds.from*g);a.bounds.to=Math.exp(a.bounds.to*g);return a},
buildTicks:function(a,c){var f=this.base,b=Math.log(this.base),g=h.mixin({},a.bounds);a.bounds.lower=Math.log(a.bounds.lower)/b;a.bounds.upper=Math.log(a.bounds.upper)/b;a.bounds.from=Math.log(a.bounds.from)/b;a.bounds.to=Math.log(a.bounds.to)/b;var e=h.mixin({},c);e.minorTicks=e.minorLabels=!1;e.majorTickStep=1;var d=k.buildTicks.call(k,a,e);h.mixin(a.bounds,g);if(!d)return d;p.forEach(d.major,function(a){a.value=Math.exp(a.value*b);1<=a.value&&(a.value=Math.round(a.value));10===f&&(a.value=+a.value.toPrecision(1));
c.minorLabels&&(a.label=q(a.value,c))});d.minor=[];if(c.minorTicks&&10===this.base){var l=a.bounds.from,m=a.bounds.to,n=function(a){l<=a&&a<=m&&(c.minorLabels?d.minor.push({value:a,label:q(a,c)}):d.minor.push({value:a}))};d.major.length&&(n(+(d.major[0].value/5).toPrecision(1)),n(+(d.major[0].value/2).toPrecision(1)));p.forEach(d.major,function(a,b){n(+(2*a.value).toPrecision(1));n(+(5*a.value).toPrecision(1))})}d.micro=[];return d},getTransformerFromModel:function(a){var c=Math.log(this.base),f=
Math.log(a.bounds.from)/c,b=a.bounds.scale;return function(a){return(Math.log(a)/c-f)*b}},getTransformerFromPlot:function(a){var c=this.base,f=a.bounds.from,b=a.bounds.scale;return function(a){return Math.pow(c,a/b)*f}}})});