test_class.declarator: xyPlot
test_class.modifier: @Mock
test_class.original_string: @Mock
      XYPlot xyPlot;
test_class.type: XYPlot
test_class.var_name: xyPlot
test_class.file: androidplot-core/src/test/java/com/androidplot/xy/ZoomEstimatorTest.java
test_class.identifier: ZoomEstimatorTest
test_class.superclass: extends AndroidplotTest
test_case.body: @Test
      public void testCalculateZoom() {
          ZoomEstimator estimator = spy(new ZoomEstimator());
  
          SampledXYSeries series =
                  spy(new SampledXYSeries(TestUtils
                          .generateXYSeries("test series", 1000), 2, 100));
          series.resample();
  
          when(xyPlot.getBounds())
                  .thenReturn(new RectRegion(0, 1000, 0, 1000));
  
          // fully zoomed out so max zoom factor should be applied:
          assertEquals(series.getMaxZoomFactor(), estimator.calculateZoom(series, new RectRegion(0, 1000, 0, 1000)));
  
          // fully zoomed in so min zoom factor should be applied:
          assertEquals(1d, estimator.calculateZoom(series, new RectRegion(0, 1, 0, 1)));
  
      }
test_case.class_method_signature: ZoomEstimatorTest.testCalculateZoom()
test_case.full_signature: @Test public void testCalculateZoom()
test_case.identifier: testCalculateZoom
test_case.invocations: spy spy generateXYSeries resample thenReturn when getBounds assertEquals getMaxZoomFactor calculateZoom assertEquals calculateZoom
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCalculateZoom()
focal_class.file: androidplot-core/src/main/java/com/androidplot/xy/ZoomEstimator.java
focal_class.identifier: ZoomEstimator
focal_class.class_method_signature: ZoomEstimator.run(XYPlot plot, XYSeriesBundle sf)
focal_class.full_signature: @Override public void run(XYPlot plot, XYSeriesBundle sf)
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: (XYPlot plot, XYSeriesBundle sf)
focal_class.return: void
focal_class.signature: void run(XYPlot plot, XYSeriesBundle sf)
focal_class.class_method_signature: ZoomEstimator.calculateZoom(SampledXYSeries series, RectRegion visibleBounds)
focal_class.full_signature: protected double calculateZoom(SampledXYSeries series, RectRegion visibleBounds)
focal_class.identifier: calculateZoom
focal_class.modifiers: protected
focal_class.parameters: (SampledXYSeries series, RectRegion visibleBounds)
focal_class.return: double
focal_class.signature: double calculateZoom(SampledXYSeries series, RectRegion visibleBounds)
focal_class.superclass: extends Estimator
focal_method.body: protected double calculateZoom(SampledXYSeries series, RectRegion visibleBounds) {
          RectRegion seriesBounds = series.getBounds();
          final double ratio = seriesBounds.getxRegion().ratio(visibleBounds.getxRegion()).doubleValue();
          final double maxFactor = series.getMaxZoomFactor();
          final double factor = Math.abs(Math.round(maxFactor / ratio));
          return factor > 0 ? factor : 1;
      }
focal_method.class_method_signature: ZoomEstimator.calculateZoom(SampledXYSeries series, RectRegion visibleBounds)
focal_method.full_signature: protected double calculateZoom(SampledXYSeries series, RectRegion visibleBounds)
focal_method.identifier: calculateZoom
focal_method.invocations: getBounds doubleValue ratio getxRegion getxRegion getMaxZoomFactor abs round
focal_method.modifiers: protected
focal_method.parameters: (SampledXYSeries series, RectRegion visibleBounds)
focal_method.return: double
focal_method.signature: double calculateZoom(SampledXYSeries series, RectRegion visibleBounds)