packages/vaex-ui/vaex/ui/plot_windows.py
def _update_step2(self, layers):
        """Each layer has it's own ranges_grid computed now, unless something went wrong
        But all layers are shown with the same ranges (self.state.ranges_viewport)
        If any of the ranges is None, take the min/max of each layer
        """
        logger.info("done with ranges, now update step2 for layers: %r", layers)

        for dimension in range(self.dimensions):
            if self.state.ranges_viewport[dimension] is None:
                vmin = min([layer.state.ranges_grid[dimension][0] for layer in layers])
                vmax = max([layer.state.ranges_grid[dimension][1] for layer in layers])
                self.state.ranges_viewport[dimension] = [vmin, vmax]

        logger.debug("ranges before aspect check: %r", self.state.ranges_viewport)
        self.check_aspect(0)
        logger.debug("ranges after aspect check: %r", self.state.ranges_viewport)
        # now make sure the layers all have the same ranges_grid
        for layer in layers:
            # layer.state.ranges_grid = copy.deepcopy(self.state.ranges_viewport)
            for d in range(layer.dimensions):
                layer.set_range(self.state.ranges_viewport[d][0], self.state.ranges_viewport[d][1], d)

        # now we are ready to calculate histograms
        promises = [layer.add_tasks_histograms() for layer in layers]
        executors = list(set([layer.dataset.executor for layer in layers]))
        for executor in executors:
            executor.execute()

        promises_histograms_done = vaex.promise.listPromise(promises)
        promises_histograms_done.then(self._update_step3, self.on_error_or_cancel).end()
def _update_step2(self, layers):
        """Each layer has it's own ranges_grid computed now, unless something went wrong
        But all layers are shown with the same ranges (self.state.ranges_viewport)
        If any of the ranges is None, take the min/max of each layer
        """
        logger.info("done with ranges, now update step2 for layers: %r", layers)

        for dimension in range(self.dimensions):
            if self.state.ranges_viewport[dimension] is None:
                vmin = min([layer.state.ranges_grid[dimension][0] for layer in layers])
                vmax = max([layer.state.ranges_grid[dimension][1] for layer in layers])
                self.state.ranges_viewport[dimension] = [vmin, vmax]

        logger.debug("ranges before aspect check: %r", self.state.ranges_viewport)
        self.check_aspect(0)
        logger.debug("ranges after aspect check: %r", self.state.ranges_viewport)
        # now make sure the layers all have the same ranges_grid
        for layer in layers:
            # layer.state.ranges_grid = copy.deepcopy(self.state.ranges_viewport)
            for d in range(layer.dimensions):
                layer.set_range(self.state.ranges_viewport[d][0], self.state.ranges_viewport[d][1], d)

        # now we are ready to calculate histograms
        promises = [layer.add_tasks_histograms() for layer in layers]
        executors = list(set([layer.dataset.executor for layer in layers]))
        for executor in executors:
            executor.execute()

        promises_histograms_done = vaex.promise.listPromise(promises)
        promises_histograms_done.then(self._update_step3, self.on_error_or_cancel).end()
Each layer has it's own ranges_grid computed now, unless something went wrong
        But all layers are shown with the same ranges (self.state.ranges_viewport)
        If any of the ranges is None, take the min/max of each layer