X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-interaction-model.js;h=9654f2826f78778615bebc393e455066ed38091c;hb=204161754f01aaf091f9fc7d5598ec5127a00f4f;hp=d335f15a3e7b7986184009dac6edbca30f31da41;hpb=242a8bc8c3282bf2334aa3e9254d6e99e3e2f2c2;p=dygraphs.git diff --git a/dygraph-interaction-model.js b/dygraph-interaction-model.js index d335f15..9654f28 100644 --- a/dygraph-interaction-model.js +++ b/dygraph-interaction-model.js @@ -84,7 +84,8 @@ Dygraph.Interaction.startPan = function(event, g, context) { var yRange = g.yAxisRange(i); // TODO(konigsberg): These values should be in |context|. // In log scale, initialTopValue, dragValueRange and unitsPerPixel are log scale. - if (axis.logscale) { + var logscale = g.attributes_.getForAxis("logscale", i); + if (logscale) { axis_data.initialTopValue = Dygraph.log10(yRange[1]); axis_data.dragValueRange = Dygraph.log10(yRange[1]) - Dygraph.log10(yRange[0]); } else { @@ -158,7 +159,8 @@ Dygraph.Interaction.movePan = function(event, g, context) { minValue = maxValue - axis_data.dragValueRange; } } - if (axis.logscale) { + var logscale = g.attributes_.getForAxis("logscale", i); + if (logscale) { axis.valueWindow = [ Math.pow(Dygraph.LOG_SCALE, minValue), Math.pow(Dygraph.LOG_SCALE, maxValue) ]; } else { @@ -479,7 +481,8 @@ Dygraph.Interaction.moveTouch = function(event, g, context) { if (context.touchDirections.y) { for (i = 0; i < 1 /*g.axes_.length*/; i++) { var axis = g.axes_[i]; - if (axis.logscale) { + var logscale = g.attributes_.getForAxis("logscale", i); + if (logscale) { // TODO(danvk): implement } else { axis.valueWindow = [ @@ -571,9 +574,7 @@ Dygraph.Interaction.defaultModel = { if (event.altKey || event.shiftKey) { return; } - // TODO(konigsberg): replace g.doUnzoom()_ with something that is - // friendlier to public use. - g.doUnzoom_(); + g.resetZoom(); } };