

def zoomOut(self):
    if (1 == self.zoomIndex):
        self.getXAxis().setAxisMin(self.initialPlotRegion.xMin)
        self.getXAxis().setAxisMax(self.initialPlotRegion.xMax)
        self.getYAxis().setAxisMin(self.initialPlotRegion.yMin)
        self.getYAxis().setAxisMax(self.initialPlotRegion.yMax)
        self.p1.x = self.initialSelectionRegion.xMin
        self.p2.x = self.initialSelectionRegion.xMax
        self.p1.y = self.initialSelectionRegion.yMin
        self.p2.y = self.initialSelectionRegion.yMax
    else:
        xMin = self.getXAxis().getAxisMin()
        xMax = self.getXAxis().getAxisMax()
        yMin = self.getYAxis().getAxisMin()
        yMax = self.getYAxis().getAxisMax()
        if (0 == self.zoomIndex):
            self.initialPlotRegion.xMin = xMin
            self.initialPlotRegion.xMax = xMax
            self.initialPlotRegion.yMin = yMin
            self.initialPlotRegion.yMax = yMax
            self.initialSelectionRegion.xMin = min(self.p1.x, self.p2.x)
            self.initialSelectionRegion.xMax = max(self.p1.x, self.p2.x)
            self.initialSelectionRegion.yMin = min(self.p1.y, self.p2.y)
            self.initialSelectionRegion.yMax = max(self.p1.y, self.p2.y)
            dx = (xMax - xMin)
            dy = (yMax - yMin)
            xCenter = ((self.p1.x + self.p2.x) / 2)
            yCenter = ((self.p1.y + self.p2.y) / 2)
            xMin = (xCenter - (dx / 2))
            xMax = (xCenter + (dx / 2))
            yMin = (yCenter - (dy / 2))
            yMax = (yCenter + (dy / 2))
        pXMin = min(self.p1.x, self.p2.x)
        pXMax = max(self.p1.x, self.p2.x)
        pYMin = min(self.p1.y, self.p2.y)
        pYMax = max(self.p1.y, self.p2.y)
        newXSize = (((xMax - xMin) * (xMax - xMin)) / (pXMax - pXMin))
        newYSize = (((yMax - yMin) * (yMax - yMin)) / (pYMax - pYMin))
        dx = (xMax - xMin)
        dy = (yMax - yMin)
        xCenter = ((self.p1.x + self.p2.x) / 2)
        yCenter = ((self.p1.y + self.p2.y) / 2)
        self.p1.x = (xCenter - (dx / 2))
        self.p2.x = (xCenter + (dx / 2))
        self.p1.y = (yCenter - (dy / 2))
        self.p2.y = (yCenter + (dy / 2))
        newXMin = (((xMin + xMax) - newXSize) / 2.0)
        newXMax = (((xMin + xMax) + newXSize) / 2.0)
        newYMin = (((yMin + yMax) - newYSize) / 2.0)
        newYMax = (((yMin + yMax) + newYSize) / 2.0)
        self.getXAxis().setAxisMin(newXMin)
        self.getXAxis().setAxisMax(newXMax)
        self.getYAxis().setAxisMin(newYMin)
        self.getYAxis().setAxisMax(newYMax)
        self.p1.x = xMin
        self.p2.x = xMax
        self.p1.y = yMin
        self.p2.y = yMax
    self.zoomIndex -= 1
    self.updateCursor()

dataset/ETHPy150Open anandology/pyjamas/examples/gcharttestapp/GChartExample24.py GChartExample24.zoomOut/original