module timelinelib.canvas.drawing.drawers.default

timelinelib.canvas.drawing.drawers.default.OUTER_PADDING = 5
timelinelib.canvas.drawing.drawers.default.INNER_PADDING = 3
timelinelib.canvas.drawing.drawers.default.PERIOD_THRESHOLD = 20
timelinelib.canvas.drawing.drawers.default.BALLOON_RADIUS = 12
timelinelib.canvas.drawing.drawers.default.ARROW_OFFSET = 37
timelinelib.canvas.drawing.drawers.default.DATA_INDICATOR_SIZE = 10
timelinelib.canvas.drawing.drawers.default.CONTRAST_RATIO_THREASHOLD = 2250
timelinelib.canvas.drawing.drawers.default.WHITE = (255, 255, 255)
timelinelib.canvas.drawing.drawers.default.BLACK = (0, 0, 0)
class timelinelib.canvas.drawing.drawers.default.DefaultDrawingAlgorithm[source]

Bases: timelinelib.canvas.drawing.interface.Drawer

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

set_event_font(new_font)[source]
set_event_box_drawer(event_box_drawer)[source]
set_background_drawer(background_drawer)[source]
increment_font_size(step=2)[source]
decrement_font_size(step=2)[source]
event_is_period(time_period)[source]

Return True if the event time_period will make the event appear below the center line, as a period event.

get_closest_overlapping_event(event_to_move, up=True)[source]
draw(dc, timeline, view_properties, appearance, fast_draw=False)[source]

Draw a representation of a timeline.

The dc is used to do the actual drawing. The timeline is used to get the events to visualize. The view properties contains information like which events are selected in the view we are drawing for and what period is currently displayed.

When the dc is temporarily stored in a class variable such as self.dc, this class variable must be deleted before the draw method ends.

snap(time, snap_region=10)[source]

Snap time to minor strip if within snap_region pixels.

snap_selection(period_selection)[source]

Return a tuple where the selection has been stretched to fit to minor strip.

period_selection: (start, end) Return: (new_start, new_end)

event_at(x, y, alt_down=False)[source]

Return the event at pixel coordinate (x, y) or None if no event there.

set_horizontal_mouse_position_factor(event, x)[source]
get_events_in_rect(rect)[source]
event_with_rect_at(x, y, view_properties=None)[source]

Return the event at pixel coordinate (x, y) and its rect in a tuple (event, rect) or None if no event there.

event_rect(evt)[source]
balloon_at(x, y)[source]
get_time(x)[source]
get_hidden_event_count()[source]
get_period_xpos(time_period)[source]
period_is_visible(time_period)[source]