コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 def time_key(i):
     return timestamp(
         aggreagate_time(
             fromtimestamp(data.time_values[i],
                           tz=data.time_variable.timezone)))
コード例 #4
0
 def time_key(i):
     return timestamp(aggreagate_time(fromtimestamp(data.time_values[i])))