From: Dan Vanderkam Date: Tue, 23 Jul 2013 01:43:15 +0000 (-0400) Subject: making progress on a usable dygraph-combined.js; the great quoting begins X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=f124528886193714986f944d2b537e1780992f32;p=dygraphs.git making progress on a usable dygraph-combined.js; the great quoting begins --- diff --git a/dygraph-combined.js b/dygraph-combined.js index e6380de..a4df9d7 100644 --- a/dygraph-combined.js +++ b/dygraph-combined.js @@ -1,7 +1,162 @@ -This is not the file you are looking for. -A reasonably up-to-date version can be found at http://dygraphs.com/dygraph-combined.js +/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */ +(function() {var k=void 0,q=!0,s=null,v=!1;function aa(){return function(a){return a}}function x(a){return function(){return this[a]}}var y,ba=this;function z(a,d){var b=a.split("."),c=ba;!(b[0]in c)&&c.execScript&&c.execScript("var "+b[0]);for(var e;b.length&&(e=b.shift());)!b.length&&d!==k?c[e]=d:c=c[e]?c[e]:c[e]={}};/* -dygraph-combined.js is a "packed" version of the larger dygraphs JS files. It is -smaller and loads more quickly, but is harder to debug. + Copyright 2012 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) -To generate this file, run "make" or generate-combined.sh. + Copyright 2011 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2011 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2006 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2006 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2011 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2011 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2011 Robert Konigsberg (konigsberg@google.com) + MIT-licensed (http://opensource.org/licenses/MIT) + + Copyright 2011 Dan Vanderkam (danvdk@gmail.com) + MIT-licensed (http://opensource.org/licenses/MIT) +*/ +function ca(a,d){if("undefined"!==typeof a.ic)throw"Must un-install old line pattern before installing a new one.";a.ic=q;var b=[0,0],c=[],e=a.beginPath,f=a.lineTo,g=a.moveTo,j=a.stroke;a.Fb=function(){this.beginPath=e;this.lineTo=f;this.moveTo=g;this.stroke=j;this.ic=this.Fb=k};a.beginPath=function(){c=[];e.call(this)};a.moveTo=function(a,b){c.push([[a,b]]);g.call(this,a,b)};a.lineTo=function(a,b){c[c.length-1].push([a,b])};a.stroke=function(){if(0===c.length)j.call(this);else{for(var a=0;al;)t=d[i],l=b[1]?l+b[1]:l+t,l>u?(b=[i,l-u],l=u):b=[(i+1)%d.length,0],0===i%2?f.call(this,l,0):g.call(this,l,0),i=(i+1)%d.length;this.restore();i=p;l=r}j.call(this);c=[]}}}CanvasRenderingContext2D.prototype.Fb=function(){throw"Must install a line pattern before uninstalling it.";}; +function B(a){this.j=a;this.o=[];this.Gb={};this.M={};this.fc=this.j.d;this.wa=this.j.Q||{};this.ea=[];this.gc=this.get("highlightSeriesOpts")||{};this.Ja()} +(function(){var a={y:0,Y:0,y1:0,Y1:0,y2:1,Y2:1};B.prototype.Ja=function(){var d=this.get("labels");if(d){this.ea=d.slice(1);this.o=[{L:[],options:{}}];this.Gb={options:{}};this.M={};if(this.wa.series)for(d=0;d=b&&this.Hc.push([b,c]);this.Kc=[];for(a=0;a=b&&this.Kc.push([a,b,c])};I.prototype.Oc=function(){var a,b={};for(a=0;au?u=0:1=Math.pow(10,c)||Math.abs(a)=h){c=ta(a/h,b)+j[i];break}f&&(g=String(a.toExponential()).split("e-"), +2===g.length&&(3<=g[1]&&24>=g[1])&&(c=0=O.ce)return""+a.getFullYear();if(d>=O.de)return kb[a.getMonth()]+" "+a.getFullYear();if(0===3600*a.getHours()+60*a.getMinutes()+a.getSeconds()+a.getMilliseconds()||d>=O.be){var b=new Date(a.getTime()+36E5);return Q(b.getDate())+kb[b.getMonth()]}return va(a.getTime())} +var mb=fa,H={highlightCircleSize:3,highlightSeriesOpts:s,highlightSeriesBackgroundAlpha:0.5,labelsDivWidth:250,labelsDivStyles:{},labelsSeparateLines:v,labelsShowZeroValues:q,labelsKMB:v,labelsKMG2:v,showLabelsOnHighlight:q,digitsAfterDecimal:2,maxNumberWidth:6,sigFigs:s,strokeWidth:1,strokeBorderWidth:0,strokeBorderColor:"white",axisTickSize:3,axisLabelFontSize:14,xAxisLabelWidth:50,yAxisLabelWidth:50,rightGap:5,showRoller:v,xValueParser:wa,delimiter:",",sigma:2,errorBars:v,fractions:v,wilsonInterval:q, +customBars:v,fillGraph:v,fillAlpha:0.15,connectSeparatedPoints:v,stackedGraph:v,stackedGraphNaNFill:"all",hideOverlayOnMouseOut:q,legend:"onmouseover",stepPlot:v,avoidMinZero:v,xRangePad:0,yRangePad:s,drawAxesAtZero:v,titleHeight:28,xLabelHeight:18,yLabelWidth:18,drawXAxis:q,drawYAxis:q,axisLineColor:"black",axisLineWidth:0.3,gridLineWidth:0.3,axisLabelColor:"black",axisLabelFont:"Arial",axisLabelWidth:50,drawYGrid:q,drawXGrid:q,gridLineColor:"rgb(128,128,128)",interactionModel:s,animatedZooms:v, +showRangeSelector:v,rangeSelectorHeight:40,rangeSelectorPlotStrokeColor:"#808FAB",rangeSelectorPlotFillColor:"#A7B1C4",plotter:[mb.hd,mb.gd,mb.td],plugins:[],axes:{x:{pixelsPerLabel:60,axisLabelFormatter:lb,valueFormatter:R,drawGrid:q,independentTicks:q,ticker:s},y:{pixelsPerLabel:30,valueFormatter:ib,axisLabelFormatter:jb,drawGrid:q,independentTicks:q,ticker:s},y2:{pixelsPerLabel:30,valueFormatter:ib,axisLabelFormatter:jb,drawGrid:v,independentTicks:v,ticker:s}}},qa=[],nb=v; +function K(a,d,b){if(d in a.Ea){var c={qa:a,cancelable:v,defaultPrevented:v,preventDefault:function(){if(!c.cancelable)throw"Cannot call preventDefault on non-cancelable event.";c.defaultPrevented=q},uc:v,stopPropagation:function(){c.uc=q}};G(c,b);if(a=a.Ea[d])for(d=a.length-1;0<=d&&!(a[d][1].call(a[d][0],c),c.uc);d--);}}y=O.prototype; +y.sd=function(a){if(a===s||a===k)return this.ma||this.Oa;if("x"===a)return this.ma;if("y"===a)return this.Oa;throw"axis parameter is ["+a+"] must be null, 'x' or 'y'.";};y.toString=function(){var a=this.fa;return"[Dygraph "+(a&&a.id?a.id:a)+"]"};y.a=function(a,d){return d?this.l.cc(a,d):this.l.get(a)};y.getOption=function(a,d){return this.a(a,d)}; +function ob(a,d){return function(b){var c=a.Q.e;return c&&c[d]&&c[d].hasOwnProperty(b)?c[d][b]:"undefined"!=typeof a.Q[b]?a.Q[b]:(c=a.d.e)&&c[d]&&c[d].hasOwnProperty(b)?c[d][b]:"y"==d&&a.b[0].hasOwnProperty(b)?a.b[0][b]:"y2"==d&&a.b[1].hasOwnProperty(b)?a.b[1][b]:a.a(b)}}y.Ab=x("Ka");y.K=function(){return this.C?this.C:this.jb()}; +y.jb=function(){var a=this.a("xRangePad")/this.n.i.f;if(0===this.pc())return[0-a,1+a];var d=this.q[0][0],b=this.q[this.q.length-1][0];if(a)var c=b-d,d=d-c*a,b=b+c*a;return[d,b]};y.xa=function(a){a=a||0;if(0>a||a>=this.b.length)return s;a=this.b[a];return[a.t[0],a.t[1]]};y.X=function(){for(var a=[],d=0;da||a>this.q.length||0>d||d>this.q[a].length?s:this.q[a][d]}; +function pa(a){var d=a.fa;a.D=document.createElement("div");a.D.style.textAlign="left";d.appendChild(a.D);a.w=xa();a.w.style.position="absolute";a.U=pb(a,a.w);qb(a);a.S=ya(a.w);a.ba=ya(a.U);a.D.appendChild(a.U);a.D.appendChild(a.w);a.Za=rb(a);a.h=new I(a);a.lc=function(b){var c=a.h.k;if(!(c===k||c===s)){var d=a.Zb(b),c=d[0],d=d[1],f=v;if(a.a("highlightSeriesOpts")&&!a.Ya){if(a.a("stackedGraph")){for(var g=sb(a,c),j,n,h=0;h=l.length)){var m=l[i]; +if(V(m)&&(f=m.m,c>m.g&&i+1d?b:10-b;if(0>=b)a.N&&Db(a,1);else{var c=++a.mb;Ea(function(){a.mb==c&&(a.N+=d,0===a.N?a.Ra():Db(a,a.N/10))},b,30,function(){})}} +function Db(a,d){K(a,"select",{Ce:a.J,Be:a.r});var b,c=a.S;if(a.a("highlightSeriesOpts")){c.clearRect(0,0,a.s,a.p);if(b=1-a.a("highlightSeriesBackgroundAlpha")){if(d===k){Cb(a,1);return}c.fillStyle="rgba(255,255,255,"+b*d+")";c.fillRect(0,0,a.s,a.p)}a.n.Nb(a.ta,c)}else if(0<=a.yb){var e=0,f=a.a("labels");for(b=1;be&&(e=g)}c.clearRect(a.yb-e-1,0,2*e+2,a.p)}a.Xa&&a.Ba&&O.prototype.Wb.apply(a,a.Ba);if(0this.r.length)return-1;for(var a=0;af&&(g=f);jc)c=j;if(b===s||gc)c=f;if(b===s||f=l[m]){l=s;break}}else 0>=l&&(l=s);l!==s?j.push([i,l]):j.push([i,n?[s,s]:g?[s,s,s]:l])}c=j;a:{g=a;e=a.Ka;e=Math.min(e,c.length);f=[];n=g.a("sigma");h=m=i=l=h=j=i=h=k;if(g.bc)for(j=m=l=0;ji?0:i,h=m,i=n*Math.sqrt(r*(1-r)/h+n*n/(4*h*h)),t=1+n*n/m,h=(r+n*n/(2*m)-i)/t,i=(r+n*n/(2*m)+i)/t;f[j]=[p,[100*r,100*(r-h),100*(i-r)]]}else f[j]=[p,[0,0,0]];else h=m?n*Math.sqrt(i*(1-i)/m):1,f[j]=[p,[100*i,100*h,100*h]];else f[j]=[p,100*i]}else if(g.a("customBars"))for(j=g=i=n=h=0;j=n))for(l=n;lb[1]&&(b[1]=m);m=r&&w===s&&(w=h),p[h][0]<=t&&(u=h);w===s&&(w=0);h=w;for(r=q;r&&0r&&(r=0));Infinity==p&&(p=0);-Infinity==r&&(r=1);e=r-p;0===e&&(e=0!== +r?Math.abs(r):r=1);i?c?(i=r+g*e,f=p):(f=Math.exp(Math.log(e)*g),i=r*f,f=p/f):(i=r+g*e,f=p-g*e,c&&!a.a("avoidMinZero")&&(0>f&&0<=p&&(f=0),0=r&&(i=0)));h.Fa=[f,i]}h.B?h.t=[h.B[0],h.B[1]]:h.A?(p=isNaN(parseFloat(h.A[0]))?h.Fa[0]:h.A[0],r=isNaN(parseFloat(h.A[1]))?h.Fa[1]:h.A[1],c||(h.ud?(f=Math.exp(Math.log(e)*g),p*=f,r/=f):(e=r-p,p-=e*g,r+=e*g)),h.t=[p,r]):h.t=h.Fa;m&&(h.independentTicks=m,c=ob(a,"y"+(n?"2":"")),g=c("ticker"),h.gb=g(h.t[0],h.t[1],a.p,c,a),j||(j=h))}if(j===k)throw'Configuration Error: At least one axis has to have the "independentTicks" option activated.'; +for(n=0;nd)&&(b=q);Jb(a,b)} +function Jb(a,d){d?(a.d.Ib=wa,a.d.e.x.ka=R,a.d.e.x.Na=Ia,a.d.e.x.za=lb):(a.d.Ib=function(a){return parseFloat(a)},a.d.e.x.ka=aa(),a.d.e.x.Na=Ja,a.d.e.x.za=a.d.e.x.ka)} +function Kb(a,d){var b=[],c=d.split(Ka(d)||"\n"),e,f,g=a.a("delimiter");-1==c[0].indexOf(g)&&0<=c[0].indexOf("\t")&&(g="\t");f=0;"labels"in a.Q||(f=1,a.d.labels=c[0].split(g),a.l.Ja());for(var j,n=v,h=a.a("labels").length,i=v,l=f;lp.length)){var r=[];n||(Ib(a,p[0]),j=a.a("xValueParser"),n=q);r[0]=j(p[0],a);if(a.bc)for(f=1;fa||a>=b.length?N("invalid series number in setVisibility: "+a):(b[a]=d,$(this))};y.size=function(){return{width:this.s,height:this.p}}; +y.bb=function(a,d){a:if(!nb){var b=document.createElement("style");b.type="text/css";document.getElementsByTagName("head")[0].appendChild(b);for(b=0;ba.pageX?0:a.pageX;var b=document.documentElement,c=document.body;return a.clientX+(b.scrollLeft||c.scrollLeft)-(b.clientLeft||0)};Ga=function(a){if(a.pageY)return!a.pageY||0>a.pageY?0:a.pageY;var b=document.documentElement,c=document.body; +return a.clientY+(b.scrollTop||c.scrollTop)-(b.clientTop||0)};S=function(a,b){return Fa(a)-b.vc};T=function(a,b){return Ga(a)-b.wc};ja=function(a){return!!a&&!isNaN(a)};V=function(a,b){return!a||a.F===s||a.x===s||a.x===k||a.y===s||a.y===k||isNaN(a.x)||!b&&isNaN(a.y)?v:q};sa=function(a,b){var c=Math.min(Math.max(1,b||2),21);return 0.0010>Math.abs(a)&&0!==a?a.toExponential(c-1):a.toPrecision(c)};Q=function(a){return 10>a?"0"+a:""+a};va=function(a){var b=Q;a=new Date(a);return a.getSeconds()?b(a.getHours())+ +":"+b(a.getMinutes())+":"+b(a.getSeconds()):b(a.getHours())+":"+b(a.getMinutes())};R=function(a){var b=Q,c=new Date(a),e=""+c.getFullYear(),f=b(c.getMonth()+1),b=b(c.getDate()),g="";3600*c.getHours()+60*c.getMinutes()+c.getSeconds()&&(g=" "+va(a));return e+"/"+f+"/"+b+g};ta=function(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c};Ta=function(a,b,c,e,f){if(e===s||e===k||f===s||f===k)e=0,f=b.length-1;if(e>f)return-1;if(c===s||c===k)c=0;var g=parseInt((e+f)/2,10),j=b[g];return j==a?g:j>a?0c&&(j=g+1,0<=j&&ja)?g:Ta(a,b,c,g+1,f):-1};wa=function(a){var b;if(-1==a.search("-")||-1!=a.search("T")||-1!=a.search("Z"))if((b=X(a))&&!isNaN(b))return b;if(-1!=a.search("-")){for(b=a.replace("-","/","g");-1!=b.search("-");)b=b.replace("-","/");b=X(b)}else 8==a.length?(b=a.substr(0,4)+"/"+a.substr(4,2)+"/"+a.substr(6,2),b=X(b)):b=X(a);(!b||isNaN(b))&&E("Couldn't parse "+a+" as a date");return b};X=function(a){return(new Date(a)).getTime()}; +G=function(a,b){if("undefined"!=typeof b&&b!==s)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};oa=function(a,b){if("undefined"!=typeof b&&b!==s)for(var c in b)if(b.hasOwnProperty(c))if(b[c]===s)a[c]=s;else if(M(b[c]))a[c]=b[c].slice();else if("object"===typeof Node?b[c]instanceof Node:"object"===typeof b[c]&&"number"===typeof b[c].nodeType&&"string"===typeof b[c].nodeName)a[c]=b[c];else if("object"==typeof b[c]){if("object"!=typeof a[c]||a[c]===s)a[c]={};oa(a[c],b[c])}else a[c]=b[c]};M=function(a){var b= +typeof a;return"object"!=b&&!("function"==b&&"function"==typeof a.item)||a===s||"number"!=typeof a.length||3===a.nodeType?v:q};La=function(a){return"object"!=typeof a||a===s||"function"!=typeof a.getTime?v:q};Ma=function(a){for(var b=[],c=0;c=b||a.call(window,function(){var a=(new Date).getTime()-j;g=f;f=Math.floor(a/c);a=f-g;f+a>n||f>=n?(d(n),e()):(0!==a&&d(f),i())})})()}};Na=function(a,b){var c={annotationClickHandler:q,annotationDblClickHandler:q,annotationMouseOutHandler:q,annotationMouseOverHandler:q,axisLabelColor:q,axisLineColor:q, +axisLineWidth:q,clickCallback:q,digitsAfterDecimal:q,drawCallback:q,drawHighlightPointCallback:q,drawPoints:q,drawPointCallback:q,drawXGrid:q,drawYGrid:q,fillAlpha:q,gridLineColor:q,gridLineWidth:q,hideOverlayOnMouseOut:q,highlightCallback:q,highlightCircleSize:q,interactionModel:q,isZoomedIgnoreProgrammaticZoom:q,labelsDiv:q,labelsDivStyles:q,labelsDivWidth:q,labelsKMB:q,labelsKMG2:q,labelsSeparateLines:q,labelsShowZeroValues:q,legend:q,maxNumberWidth:q,panEdgeFraction:q,pixelsPerYLabel:q,pointClickCallback:q, +pointSize:q,rangeSelectorPlotFillColor:q,rangeSelectorPlotStrokeColor:q,showLabelsOnHighlight:q,showRoller:q,sigFigs:q,strokeWidth:q,underlayCallback:q,unhighlightCallback:q,xAxisLabelFormatter:q,xTicker:q,xValueFormatter:q,yAxisLabelFormatter:q,yValueFormatter:q,zoomCallback:q},e=v,f={};if(a)for(var g=1;gb?1/Math.pow(a,-b):Math.pow(a,b)};Va={zd:Date.prototype.setMilliseconds,Bc:Date.prototype.setSeconds,jc:Date.prototype.setMinutes, +c:Date.prototype.setHours};Y=function(a,b){var c=a.getTimezoneOffset(),e;for(e in b)if(b.hasOwnProperty(e)){var f=Va[e];if(!f)throw"Invalid setter: "+e;f.call(a,b[e]);a.getTimezoneOffset()!=c&&a.setTime(a.getTime()+6E4*(c-a.getTimezoneOffset()))}};ia=function(a){var b=document.createElement("div");b.style.backgroundColor=a;b.style.visibility="hidden";document.body.appendChild(b);a=window.getComputedStyle(b,s).backgroundColor;document.body.removeChild(b);b=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(a); +return{xc:parseInt(b[1],10),ra:parseInt(b[2],10),Pb:parseInt(b[3],10)}};da=function(a){var b;try{b=a||document.createElement("canvas"),b.getContext("2d")}catch(c){if(a=navigator.appVersion.match(/MSIE (\d\.\d)/),b=-1!=navigator.userAgent.toLowerCase().indexOf("opera"),!a||6>a[1]||b)return v}return q};W=function(a,b,c){var e=parseFloat(a);if(!isNaN(e))return e;if(/^ *$/.test(a))return s;if(/^ *nan *$/i.test(a))return NaN;a="Unable to parse '"+a+"' as a number";c!==k&&b!==k&&(a+=" on line "+(1+(b|| +0))+" ('"+c+"') of CSV.");E(a);return s}})();"use strict"; +Z={Od:function(a,d,b){var c;b.O=q;a=d.K();b.oa=a[1]-a[0];b.pb=a[0];b.Fc=b.oa/(d.n.i.f-1);if(d.a("panEdgeFraction")){a=d.size();var e=a.width*d.getOption("panEdgeFraction");c=d.jb();var f=d.hb(c[0])-e,e=d.hb(c[1])+e,f=d.ia(f),e=d.ia(e);b.Z=[f,e];f=[];e=a.height*d.a("panEdgeFraction");for(a=0;ab.Z[1]&&(a-=c-b.Z[1],c=a+b.oa);d.C=[a,c];if(b.Wa){a=b.v-b.I;for(c=0;cMath.abs(b.u-b.H)&&(2>c&&d.J!==k&&-1!=d.J)&&Z.Eb(d,a,b);b.O=v;b.Wa=v;b.pb=s;b.oa=s;b.A=s;b.Z=s;b.Qa=s;b.e=s},Pd:function(a,d,b){b.da=q;b.Mc=v},yd:function(a,d,b){b.Mc=q;b.u=S(a,b);b.v=T(a,b);b.Ca=Math.abs(b.H-b.u)c&&(2>e&&d.J!==k&&-1!=d.J)&&Z.Eb(d,a,b);a=d.n.i;10<=c&&1==b.Ca?(c=Math.min(b.H,b.u),e=Math.max(b.H,b.u),c=Math.max(c,a.x),e=Math.min(e,a.x+a.f),ca,y:22.5c;c++)h=d.b[c],d.l.T("logscale",c)||(h.B=[a.aa-f+(b.V.y[0]-a.aa)/i,a.aa-f+(b.V.y[1]-a.aa)/i],g=q);Bb(d);g&&(1c-b.eb&&b.Ub&&50>Math.abs(b.Ub-a.screenX)&&b.Vb&&50>Math.abs(b.Vb-a.screenY)?d.zb():(b.eb=c,b.Ub=a.screenX,b.Vb=a.screenY)}},ad:{nc:function(a,d,b){a.button&&2==a.button||(b.qb(a,d,b),a.altKey||a.shiftKey?Wa(a,d,b):Xa(a,d,b))},vd:function(a,d,b){b.da?Ya(a,d,b):b.O&&Za(a,d,b)},oc:function(a,d,b){b.da?$a(a,d,b):b.O&&ab(a,d,b)},He:function(a,d,b){Z.Dc(a,d,b)},Ge:function(a,d,b){Z.xd(a,d,b)},Fe:function(a,d,b){Z.ed(a,d,b)},te:function(a,d,b){b.da&& +(b.u=s,b.v=s,vb(d))},je:function(a,d,b){b.Aa?b.Aa=v:!a.altKey&&!a.shiftKey&&d.zb()}}};H.qe=Z.ad;$a=Z.fd;Ya=Z.yd;Xa=Z.Pd;ab=Z.dd;Za=Z.wd;Wa=Z.Od;Z.ue={nc:function(a,d,b){b.qb(a,d,b)},oc:function(a,d,b){b.u=S(a,b);b.v=T(a,b);var c=Math.abs(b.v-b.I);2>Math.abs(b.u-b.H)&&(2>c&&d.J!==k&&-1!=d.J)&&Z.Eb(d,a,b)}};Z.ke={nc:function(a,d,b){b.qb(a,d,b);Wa(a,d,b)},vd:function(a,d,b){b.O&&Za(a,d,b)},oc:function(a,d,b){b.O&&ab(a,d,b)}}; +(function(){Ja=function(a,b,d,g,j,n){return bb(a,b,d,function(a){return"logscale"===a?v:g(a)},j,n)};var a=function(){for(var a=[],b=-39;39>=b;b++)for(var d=Math.pow(10,b),g=1;9>=g;g++)a.push(d*g);return a}();bb=function(b,d,f,g,j,n){var h=g("pixelsPerLabel"),i=[],l,m;if(n)for(b=0;b=m/4){for(;p>=n;p--){var r=a[p],t=Math.log(r/b)/Math.log(d/b)*f,w={W:r}; +l===s?l={Rd:r,qc:t}:Math.abs(t-l.qc)>=h?l={Rd:r,qc:t}:w.label="";i.push(w)}i.reverse()}}if(0===i.length){g("labelsKMG2")?(n=[1,2,4,8,16,32,64,128,256],l=16):(n=[1,2,5,10,20,50,100],l=10);var p=Math.floor(Math.log(Math.abs(d-b)/Math.ceil(f/h))/Math.log(l)),p=Math.pow(l,p),u,F,A;for(l=0;lh);l++);F>A&&(u*=-1);for(b=0;bj;j++)if(d/eb(a,b,j)>=g)return j;return-1};eb=function(a,e,f){if(15>f)return Math.floor(0.5+1*(e-a)/d[f]);f=b[f]; +return Math.floor(0.5+1*(1*(e-a)/31557807360)*f.ga.length/f.la)};db=function(a,e,f,g,j){var n=g("axisLabelFormatter"),h=[],i;if(15>f){var l=d[f];i=l/1E3;a=new Date(a);Y(a,{zd:0});var m;60>=i?(m=a.getSeconds(),Y(a,{Bc:m-m%i})):(Y(a,{Bc:0}),i/=60,60>=i?(m=a.getMinutes(),Y(a,{jc:m-m%i})):(Y(a,{jc:0}),i/=60,24>=i?(m=a.getHours(),a.setHours(m-m%i)):(a.setHours(0),7==i/24&&a.setDate(a.getDate()-a.getDay()))));a=a.getTime();m=(new Date(a)).getTimezoneOffset();var p=l>=d[11];for(i=a;i<=e;i+=l)a=new Date(i), +p&&a.getTimezoneOffset()!=m&&(i+=6E4*(a.getTimezoneOffset()-m),a=new Date(i),m=a.getTimezoneOffset(),(new Date(i+l)).getTimezoneOffset()!=m&&(i+=l,a=new Date(i),m=a.getTimezoneOffset())),h.push({W:i,label:n(a,f,g,j)})}else{m=1;21>f?(l=b[f].ga,m=b[f].la):N("Span of dates is too long");for(var p=(new Date(e)).getFullYear(),r=Q,t=(new Date(a)).getFullYear();t<=p;t++)if(0===t%m)for(var w=0;we||h.push({W:i,label:n(new Date(i),f,g,j)})}return h};O&&(H&& +H.axes&&H.axes.x&&H.axes.y&&H.axes.y2)&&(H.axes.x.ticker=Ia,H.axes.y.ticker=bb,H.axes.y2.ticker=bb)})();z("Dygraph",O);z("Dygraph.prototype.adjustRoll",O.prototype.Ob);z("Dygraph.prototype.annotations",O.prototype.R);z("Dygraph.prototype.clearSelection",O.prototype.Ra);z("Dygraph.prototype.destroy",O.prototype.bd);z("Dygraph.prototype.eventToDomCoords",O.prototype.Zb);z("Dygraph.prototype.getArea",O.prototype.kd);z("Dygraph.prototype.getColors",O.prototype.ld);z("Dygraph.prototype.getHighlightSeries",O.prototype.md);z("Dygraph.prototype.getLabels",O.prototype.Ua);z("Dygraph.prototype.getOption",O.prototype.getOption); +z("Dygraph.prototype.getPropertiesForSeries",O.prototype.nd);z("Dygraph.prototype.getSelection",O.prototype.getSelection);z("Dygraph.prototype.getValue",O.prototype.getValue);z("Dygraph.prototype.indexFromSetName",O.prototype.pd);z("Dygraph.prototype.isSeriesLocked",O.prototype.rd);z("Dygraph.prototype.isZoomed",O.prototype.sd);z("Dygraph.prototype.numAxes",O.prototype.Ga);z("Dygraph.prototype.numColumns",O.prototype.vb);z("Dygraph.prototype.numRows",O.prototype.pc); +z("Dygraph.prototype.resetZoom",O.prototype.zb);z("Dygraph.prototype.resize",O.prototype.yc);z("Dygraph.prototype.rollPeriod",O.prototype.Ab);z("Dygraph.prototype.setAnnotations",O.prototype.bb);z("Dygraph.prototype.setSelection",O.prototype.setSelection);z("Dygraph.prototype.setVisibility",O.prototype.Jd);z("Dygraph.prototype.toDataCoords",O.prototype.Sd);z("Dygraph.prototype.toDataXCoord",O.prototype.ia);z("Dygraph.prototype.toDataYCoord",O.prototype.ja);z("Dygraph.prototype.toDomCoords",O.prototype.Td); +z("Dygraph.prototype.toDomXCoord",O.prototype.hb);z("Dygraph.prototype.toDomYCoord",O.prototype.ib);z("Dygraph.prototype.toPercentXCoord",O.prototype.Ud);z("Dygraph.prototype.toPercentYCoord",O.prototype.Cb);z("Dygraph.prototype.toString",O.prototype.toString);z("Dygraph.prototype.updateOptions",O.prototype.Xd);z("Dygraph.prototype.visibility",O.prototype.visibility);z("Dygraph.prototype.xAxisExtremes",O.prototype.jb);z("Dygraph.prototype.xAxisRange",O.prototype.K); +z("Dygraph.prototype.yAxisRange",O.prototype.xa);z("Dygraph.prototype.yAxisRanges",O.prototype.X);z("Dygraph.Plotters",mb);})(); diff --git a/dygraph.js b/dygraph.js index 38fcb15..452143d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -394,122 +394,122 @@ Dygraph.Plotters = DygraphCanvasRenderer._Plotters; // Default attribute values. /** @type {{axes: Object}} */ Dygraph.DEFAULT_ATTRS = { - highlightCircleSize: 3, - highlightSeriesOpts: null, - highlightSeriesBackgroundAlpha: 0.5, + 'highlightCircleSize': 3, + 'highlightSeriesOpts': null, + 'highlightSeriesBackgroundAlpha': 0.5, - labelsDivWidth: 250, - labelsDivStyles: { + 'labelsDivWidth': 250, + 'labelsDivStyles': { // TODO(danvk): move defaults from createStatusMessage_ here. }, - labelsSeparateLines: false, - labelsShowZeroValues: true, - labelsKMB: false, - labelsKMG2: false, - showLabelsOnHighlight: true, - - digitsAfterDecimal: 2, - maxNumberWidth: 6, - sigFigs: null, - - strokeWidth: 1.0, - strokeBorderWidth: 0, - strokeBorderColor: "white", - - axisTickSize: 3, - axisLabelFontSize: 14, - xAxisLabelWidth: 50, - yAxisLabelWidth: 50, - rightGap: 5, - - showRoller: false, - xValueParser: Dygraph.dateParser, - - delimiter: ',', - - sigma: 2.0, - errorBars: false, - fractions: false, - wilsonInterval: true, // only relevant if fractions is true - customBars: false, - fillGraph: false, - fillAlpha: 0.15, - connectSeparatedPoints: false, - - stackedGraph: false, - stackedGraphNaNFill: 'all', - hideOverlayOnMouseOut: true, + 'labelsSeparateLines': false, + 'labelsShowZeroValues': true, + 'labelsKMB': false, + 'labelsKMG2': false, + 'showLabelsOnHighlight': true, + + 'digitsAfterDecimal': 2, + 'maxNumberWidth': 6, + 'sigFigs': null, + + 'strokeWidth': 1.0, + 'strokeBorderWidth': 0, + 'strokeBorderColor': "white", + + 'axisTickSize': 3, + 'axisLabelFontSize': 14, + 'xAxisLabelWidth': 50, + 'yAxisLabelWidth': 50, + 'rightGap': 5, + + 'showRoller': false, + 'xValueParser': Dygraph.dateParser, + + 'delimiter': ',', + + 'sigma': 2.0, + 'errorBars': false, + 'fractions': false, + 'wilsonInterval': true, // only relevant if fractions is true + 'customBars': false, + 'fillGraph': false, + 'fillAlpha': 0.15, + 'connectSeparatedPoints': false, + + 'stackedGraph': false, + 'stackedGraphNaNFill': 'all', + 'hideOverlayOnMouseOut': true, // TODO(danvk): support 'onmouseover' and 'never', and remove synonyms. - legend: 'onmouseover', // the only relevant value at the moment is 'always'. + 'legend': 'onmouseover', // the only relevant value at the moment is 'always'. - stepPlot: false, - avoidMinZero: false, - xRangePad: 0, - yRangePad: null, - drawAxesAtZero: false, + 'stepPlot': false, + 'avoidMinZero': false, + 'xRangePad': 0, + 'yRangePad': null, + 'drawAxesAtZero': false, // Sizes of the various chart labels. - titleHeight: 28, - xLabelHeight: 18, - yLabelWidth: 18, - - drawXAxis: true, - drawYAxis: true, - axisLineColor: "black", - axisLineWidth: 0.3, - gridLineWidth: 0.3, - axisLabelColor: "black", - axisLabelFont: "Arial", // TODO(danvk): is this implemented? - axisLabelWidth: 50, - drawYGrid: true, - drawXGrid: true, - gridLineColor: "rgb(128,128,128)", - - interactionModel: null, // will be set to Dygraph.Interaction.defaultModel - animatedZooms: false, // (for now) + 'titleHeight': 28, + 'xLabelHeight': 18, + 'yLabelWidth': 18, + + 'drawXAxis': true, + 'drawYAxis': true, + 'axisLineColor': "black", + 'axisLineWidth': 0.3, + 'gridLineWidth': 0.3, + 'axisLabelColor': "black", + 'axisLabelFont': "Arial", // TODO(danvk): is this implemented? + 'axisLabelWidth': 50, + 'drawYGrid': true, + 'drawXGrid': true, + 'gridLineColor': "rgb(128,128,128)", + + 'interactionModel': null, // will be set to Dygraph.Interaction.defaultModel + 'animatedZooms': false, // (for now) // Range selector options - showRangeSelector: false, - rangeSelectorHeight: 40, - rangeSelectorPlotStrokeColor: "#808FAB", - rangeSelectorPlotFillColor: "#A7B1C4", + 'showRangeSelector': false, + 'rangeSelectorHeight': 40, + 'rangeSelectorPlotStrokeColor': "#808FAB", + 'rangeSelectorPlotFillColor': "#A7B1C4", // The ordering here ensures that central lines always appear above any // fill bars/error bars. - plotter: [ + 'plotter': [ Dygraph.Plotters.fillPlotter, Dygraph.Plotters.errorPlotter, Dygraph.Plotters.linePlotter ], - plugins: [ ], + 'plugins': [ ], // per-axis options - axes: { - x: { - pixelsPerLabel: 60, - axisLabelFormatter: dateAxisFormatter_, - valueFormatter: Dygraph.dateString_, - drawGrid: true, - independentTicks: true, - ticker: null // will be set in dygraph-tickers.js + 'axes': { + 'x': { + 'pixelsPerLabel': 60, + 'axisLabelFormatter': dateAxisFormatter_, + 'valueFormatter': Dygraph.dateString_, + 'drawGrid': true, + 'independentTicks': true, + 'ticker': null // will be set in dygraph-tickers.js }, - y: { - pixelsPerLabel: 30, - valueFormatter: numberValueFormatter_, - axisLabelFormatter: numberAxisLabelFormatter_, - drawGrid: true, - independentTicks: true, - ticker: null // will be set in dygraph-tickers.js + 'y': { + 'pixelsPerLabel': 30, + 'valueFormatter': numberValueFormatter_, + 'axisLabelFormatter': numberAxisLabelFormatter_, + 'drawGrid': true, + 'independentTicks': true, + 'ticker': null // will be set in dygraph-tickers.js }, - y2: { - pixelsPerLabel: 30, - valueFormatter: numberValueFormatter_, - axisLabelFormatter: numberAxisLabelFormatter_, - drawGrid: false, - independentTicks: false, - ticker: null // will be set in dygraph-tickers.js + 'y2': { + 'pixelsPerLabel': 30, + 'valueFormatter': numberValueFormatter_, + 'axisLabelFormatter': numberAxisLabelFormatter_, + 'drawGrid': false, + 'independentTicks': false, + 'ticker': null // will be set in dygraph-tickers.js } } }; @@ -2836,7 +2836,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) { if (independentTicks) { - axis.independentTicks = independentTicks; + axis['independentTicks'] = independentTicks; var opts = this.optionsViewForAxis_('y' + (i ? '2' : '')); var ticker = opts('ticker'); axis.ticks = ticker(axis.computedValueRange[0], @@ -2857,7 +2857,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) { for (var i = 0; i < numAxes; i++) { var axis = this.axes_[i]; - if (!axis.independentTicks) { + if (!axis['independentTicks']) { var opts = this.optionsViewForAxis_('y' + (i ? '2' : '')); var ticker = opts('ticker'); var p_ticks = p_axis.ticks; diff --git a/generate-combined.sh b/generate-combined.sh index f1a7260..21ebd3c 100755 --- a/generate-combined.sh +++ b/generate-combined.sh @@ -36,7 +36,7 @@ Copyright () { CatMinified () { Copyright CatSources \ - | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();' + | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --js dygraph-exports.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();' #| uglifyjs - -c 'warnings=false' -m # | java -jar yuicompressor-2.4.2.jar --type js diff --git a/tests/demo.html b/tests/demo.html index 8fa6fde..d778d41 100644 --- a/tests/demo.html +++ b/tests/demo.html @@ -9,7 +9,7 @@ - +

Demo

diff --git a/tests/exported-symbols.html b/tests/exported-symbols.html index 27d9b7b..8b9e32d 100644 --- a/tests/exported-symbols.html +++ b/tests/exported-symbols.html @@ -27,10 +27,7 @@ - -