def scale(self, value): quantity = round(value - self.minimum()) delta = self.__time_delta if delta is None: return timestamp(self.__scale_minimum + (self.__scale_maximum - self.__scale_minimum) * (value - self.minimum()) / (self.maximum() - self.minimum())) scaled_dt = add_time(self.__scale_minimum, delta, quantity) return timestamp(scaled_dt)
def new_value(value): if self.custom_step_size: step_amount = self.STEP_SIZES[self.step_size] time = fromtimestamp(self.slider.scale(value)) newTime = add_time(time, step_amount, -1 if backward else 1) return self.slider.unscale(timestamp(newTime)) return value + (-delta if backward else delta)
def time_key(i): return timestamp( aggreagate_time( fromtimestamp(data.time_values[i], tz=data.time_variable.timezone)))
def time_key(i): return timestamp(aggreagate_time(fromtimestamp(data.time_values[i])))