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