Package Gnumed :: Package timelinelib :: Package drawing :: Module utils :: Class Metrics |
[frames] | no frames]

# Class Metrics

source code

    object --+
             |
            Metrics

Convert between pixel coordinates and time coordinates.

Instance Methods
__init__(self, size, time_type, time_period, divider_line_slider) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
calc_exact_x(self, time) Return the x position in pixels as a float for the given time. | source code
calc_x(self, time) Return the x position in pixels as an integer for the given time. | source code
calc_exact_width(self, time_period) Return the with in pixels as a float for the given time_period. | source code
calc_width(self, time_period) Return the with in pixels as an integer for the given time_period. | source code
get_time(self, x) Return the time at pixel `x`. | source code
get_difftime(self, x1, x2) Return the time length between two x positions. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, size, time_type, time_period, divider_line_slider) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)