20 @param self this object
38 @param self this object
54 @param self this object
70 @param self this object
79 diff = a.start - b.start
106 @param self this object
115 @param self this object
117 @return index if found or -1 if not found
123 if key >= self.
ranges[i].start
and key <= self.
ranges[i].end:
125 elif key < self.
ranges[i].start:
134 @param self this object
142 @param self this object
148 """! Get selected ranges
149 @param self this object
150 @param start range start
152 @return the range or and empty list
156 if s == -1
and e == -1:
159 return self.
ranges[0 : e + 1]
163 return self.
ranges[s : e + 1]
166 """! Get ranges bounds
167 @param self this object
168 @param start range start
174 if s == -1
and e == -1:
179 return (s, len(self.
ranges))
185 @param self this object
192 @param self this object
210 """! Get ranges bounds
211 @param self this object
219 @param self this object
227 if key == self.
events[i].at:
229 elif key < self.
events[i].at:
238 @param self this object
239 @param event event to add
246 @param self this object
247 @param start starting event
248 @param end ending event
253 return self.
events[s : e + 1]
256 """! Get Events Bounds
257 @param self this object
258 @param start starting event
259 @param end ending event
268 @param self this object
275 @param self this object
298 @param self this object
308 @param self this object
313 if range.name == name:
316 self.
ranges.append(timeline)
320 """! Get Event String
321 @param self this object
323 @return the event string
326 if event_str.name == name:
334 @param self this object
339 if event_int.name == name:
347 @param self this object
353 """! Get Events string
354 @param self this object
361 @param self this object
367 """! Sort the ranges and events
368 @param self this object
380 @param self this object
386 (range_lo, range_hi) = range.get_bounds()
392 (ev_lo, ev_hi) = event_str.get_bounds()
398 (ev_lo, ev_hi) = event_int.get_bounds()
412 @param self: this object
418 @param self this object
420 @return the timeline for the name
423 if timeline.name == name:
430 """! Get All Timeline
431 @param self this object
432 @return all timelines
437 """! Sort the timelines
438 @param self this object
446 @param self this object
447 @return the bounds for all timelines
452 (t_lo, t_hi) = timeline.get_bounds()
461 @param self this object
462 @return the keys for all ranges
466 for ranges
in timeline.get_ranges():
467 for ran
in ranges.get_all():
468 range_values[ran.value] = 1
469 return range_values.keys()
482 @param self: this object
493 @param self: this object
522 @param self this object
526 def add(self, name, color):
528 @param self this object
529 @param name name of the color
530 @param color color value
537 @param self this object
560 @param self this object
566 @param self this object
567 @param padding padding
574 @param self this object
575 @param legends legends
584 @param self this object
589 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 1, 1)
590 ctx = cairo.Context(surface)
595 (t_width, t_height) = ctx.text_extents(legend)[2:4]
598 if item_height > line_height:
599 line_height = item_height
600 if line_used + item_width > self.
__width:
602 total_height += line_height
604 line_used += item_width
605 x = line_used - item_width
606 total_height += line_height
611 @param self this object
618 @param self this object
627 (t_width, t_height) = ctx.text_extents(legend)[2:4]
630 if item_height > line_height:
631 line_height = item_height
632 if line_used + item_width > self.
__width:
634 total_height += line_height
636 line_used += item_width
637 x = line_used - item_width
639 ctx.set_source_rgb(0, 0, 0)
640 ctx.set_line_width(2)
641 ctx.stroke_preserve()
644 ctx.move_to(x + self.
__padding * 2, total_height + t_height)
645 ctx.set_source_rgb(0, 0, 0)
646 ctx.show_text(legend)
676 @param self this object
683 @param self this object
690 @param self this object
691 @param timelines timelines
699 """! Set Render Range
700 @param self this object
709 """! Get Data X Start
710 @param self: this object
718 """! Get Data X Start
719 @param self this object
723 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 1, 1)
724 ctx = cairo.Context(surface)
725 max_text_height = ctx.text_extents(
726 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcedefghijklmnopqrstuvwxyz0123456789"
735 for timeline
in self.
timelines.get_all():
737 t_width = ctx.text_extents(timeline.name)[2]
738 left_width = max(left_width, t_width)
739 for rang
in timeline.get_ranges():
740 t_width = ctx.text_extents(rang.name)[2]
741 right_width = max(right_width, t_width)
743 for events_int
in timeline.get_events_int():
744 t_width = ctx.text_extents(events_int.name)[2]
745 right_width = max(right_width, t_width)
747 for events_str
in timeline.get_events_str():
748 t_width = ctx.text_extents(events_str.name)[2]
749 right_width = max(right_width, t_width)
752 left_height = left_n_lines * max_text_height + (left_n_lines - 1) * self.
padding
753 right_n_lines = range_n + eventint_n + eventstr_n
754 right_height = (right_n_lines - 1) * self.
padding + right_n_lines * max_text_height
755 right_data_height = (eventint_n + eventstr_n) * (max_text_height + 5) + range_n * 10
756 right_data_height += (right_n_lines - 1) * self.
padding
758 height = max(left_height, right_height)
759 height = max(height, right_data_height)
769 @param self this object
778 ctx.rel_line_to(width, height)
780 ctx.set_operator(cairo.OPERATOR_SOURCE)
781 ctx.set_line_width(1.0)
782 ctx.set_source_rgb(0, 0, 0)
787 @param self this object
797 ctx.rectangle(x, y - self.
padding / 2, width, height + self.
padding)
798 ctx.set_source_rgb(0.9, 0.9, 0.9)
800 last_x_drawn = int(x)
801 (lo, hi) = events.get_events_bounds(self.
start, self.
end)
802 for event
in events.events[lo:hi]:
803 real_x = int(x + (event.at - self.
start) * width / (self.
end - self.
start))
804 if real_x > last_x_drawn + 2:
805 ctx.rectangle(real_x, y, 1, 1)
806 ctx.set_source_rgb(1, 0, 0)
809 ctx.set_source_rgb(0, 0, 0)
810 ctx.show_text(str(event.value))
811 last_x_drawn = real_x
816 @param self this object
826 ctx.rectangle(x, y - self.
padding / 2, width, height + self.
padding)
827 ctx.set_source_rgb(0.9, 0.9, 0.9)
829 last_x_drawn = int(x - 1)
830 (lo, hi) = ranges.get_ranges_bounds(self.
start, self.
end)
831 for data_range
in ranges.ranges[lo:hi]:
832 s = max(data_range.start, self.
start)
833 e = min(data_range.end, self.
end)
834 x_start = int(x + (s - self.
start) * width / (self.
end - self.
start))
835 x_end = int(x + (e - self.
start) * width / (self.
end - self.
start))
836 if x_end > last_x_drawn:
837 ctx.rectangle(x_start, y, x_end - x_start, 10)
838 ctx.set_source_rgb(0, 0, 0)
839 ctx.stroke_preserve()
840 color = self.
colors.lookup(data_range.value)
841 ctx.set_source_rgb(color.r, color.g, color.b)
849 @param self this object
855 left_x_start = self.
padding / 2
857 right_x_start = left_x_end + self.
padding
859 data_x_start = right_x_end + self.
padding / 2
860 data_x_end = self.
width
861 data_width = data_x_end - data_x_start
865 for timeline
in self.
timelines.get_all():
866 (y_bearing, t_width, t_height) = ctx.text_extents(timeline.name)[1:4]
867 ctx.move_to(left_x_start, cur_y + self.
max_text_height - (t_height + y_bearing))
868 ctx.show_text(timeline.name)
869 for events_int
in timeline.get_events_int():
870 (y_bearing, t_width, t_height) = ctx.text_extents(events_int.name)[1:4]
871 ctx.move_to(right_x_start, cur_y + self.
max_text_height - (t_height + y_bearing))
872 ctx.show_text(events_int.name)
874 ctx, events_int, data_x_start, cur_y, data_width, self.
max_text_height + 5
879 right_x_start - self.
padding / 2,
885 for events_str
in timeline.get_events_str():
886 (y_bearing, t_width, t_height) = ctx.text_extents(events_str.name)[1:4]
887 ctx.move_to(right_x_start, cur_y + self.
max_text_height - (t_height + y_bearing))
888 ctx.show_text(events_str.name)
890 ctx, events_str, data_x_start, cur_y, data_width, self.
max_text_height + 5
895 right_x_start - self.
padding / 2,
900 for ranges
in timeline.get_ranges():
901 (y_bearing, t_width, t_height) = ctx.text_extents(ranges.name)[1:4]
902 ctx.move_to(right_x_start, cur_y + self.
max_text_height - (t_height + y_bearing))
903 ctx.show_text(ranges.name)
904 self.
draw_ranges(ctx, ranges, data_x_start, cur_y, data_width, 10)
908 right_x_start - self.
padding / 2,
914 bot_y = cur_y - self.
padding / 2
937 @param self this object
944 @param self this object
954 @param self this object
963 @param self this object
970 @param self this object
977 @param self this object
981 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 1, 1)
982 ctx = cairo.Context(surface)
987 while (closest * 10) < data_delta:
989 if (data_delta / closest) == 0:
991 elif (data_delta / closest) == 1:
995 start = self.
__lo - (self.
__lo % delta) + delta
996 end = self.
__hi - (self.
__hi % delta)
1002 max_text_height = ctx.text_extents(
1003 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcedefghijklmnopqrstuvwxyz0123456789"
1006 height = max_text_height + 10
1011 @param self: this object
1018 @param self this object
1023 start = self.
__lo - (self.
__lo % delta) + delta
1024 end = self.
__hi - (self.
__hi % delta)
1031 ctx.set_source_rgb(0, 0, 0)
1032 ctx.set_line_width(1.0)
1033 ticks = range(int(start), int(end + delta), int(delta))
1036 ctx.move_to(real_x, 0)
1037 ctx.line_to(real_x, 5 * s)
1040 (t_y_bearing, t_width, t_height) = ctx.text_extents(str(x))[1:4]
1042 text_delta = t_height + t_y_bearing
1044 text_delta = -t_y_bearing
1045 ctx.move_to(real_x - t_width / 2, (5 + 5 + text_delta) * s)
1046 ctx.show_text(str(x))
1050 start = self.
__lo - (self.
__lo % delta) + delta
1051 end = self.
__hi - (self.
__hi % delta)
1052 for x
in range(int(start), int(end + delta), int(delta)):
1054 ctx.move_to(real_x, 0)
1055 ctx.line_to(real_x, 3 * s)
1086 @param self this object
1102 @param self: this object
1109 @param self this object
1116 """! Get Data Rectangle
1117 @param self this object
1121 x_start = self.
__data.get_data_x_start()
1125 """! Get Data Rectangle
1126 @param self this object
1130 x_start = self.
__data.get_data_x_start()
1136 """! Get Selection Rectangle
1137 @param self this object
1149 return (x_start, y_start, x_end - x_start, y_height)
1152 """! Scale Selection
1153 @param self this object
1162 @param self this object
1170 end = min(self.
__end, e)
1173 self.
__data.set_render_range(start, end)
1179 @param self this object
1186 @param self this object
1194 @param self this object
1195 @param top_legend The legend
1202 @param self this object
1204 @param height height
1218 @param self this object
1228 @param self this object
1234 ctx.set_source_rgb(1, 1, 1)
1235 ctx.set_operator(cairo.OPERATOR_SOURCE)
1246 ctx.move_to(0, top_legend_height)
1247 ctx.line_to(self.
__width, top_legend_height)
1249 ctx.set_line_width(2)
1250 ctx.set_source_rgb(0, 0, 0)
1255 ctx.translate(0, top_legend_height)
1262 self.
__data.get_data_x_start(),
1271 ctx.move_to(self.
__data.get_data_x_start(), height_used)
1274 ctx.set_source_rgb(0, 0, 0)
1275 ctx.set_line_width(2)
1279 ctx.move_to(0, height_used)
1280 ctx.line_to(self.
__width, height_used)
1282 ctx.set_line_width(2)
1283 ctx.set_source_rgb(0, 0, 0)
1290 ctx.move_to(0, height_used)
1291 ctx.line_to(self.
__data.get_data_x_start(), height_used)
1292 ctx.line_to(select_start, height_used + 20)
1293 ctx.line_to(0, height_used + 20)
1294 ctx.line_to(0, height_used)
1295 ctx.set_source_rgb(0, 0, 0)
1296 ctx.set_line_width(1)
1297 ctx.stroke_preserve()
1298 ctx.set_source_rgb(0.9, 0.9, 0.9)
1302 ctx.move_to(self.
__width, height_used)
1303 ctx.line_to(self.
__width, height_used + 20)
1304 ctx.line_to(select_end, height_used + 20)
1305 ctx.line_to(self.
__width, height_used)
1306 ctx.set_source_rgb(0, 0, 0)
1307 ctx.set_line_width(1)
1308 ctx.stroke_preserve()
1309 ctx.set_source_rgb(0.9, 0.9, 0.9)
1318 ctx.rectangle(0, height_used, unused_start, unused_height)
1319 ctx.rectangle(unused_end, height_used, self.
__width - unused_end, unused_height)
1320 ctx.set_source_rgb(0.9, 0.9, 0.9)
1324 ctx.move_to(unused_end, height_used)
1325 ctx.line_to(self.
__width, height_used)
1326 ctx.line_to(self.
__width, height_used + unused_height)
1327 ctx.line_to(0, height_used + unused_height)
1328 ctx.line_to(0, height_used)
1329 ctx.line_to(unused_start, height_used)
1331 ctx.set_line_width(2)
1332 ctx.set_source_rgb(0, 0, 0)
1334 ctx.move_to(unused_start, height_used)
1335 ctx.line_to(unused_end, height_used)
1337 ctx.set_line_width(1)
1338 ctx.set_source_rgb(0.9, 0.9, 0.9)
1343 ctx.move_to(max(unused_start, 2), height_used)
1344 ctx.rel_line_to(0, unused_height)
1345 ctx.move_to(min(unused_end, self.
__width - 2), height_used)
1346 ctx.rel_line_to(0, unused_height)
1347 ctx.set_dash([5], 0)
1348 ctx.set_source_rgb(0, 0, 0)
1349 ctx.set_line_width(1)
1355 ctx.translate(0, height_used)
1404 @param self this object
1407 super(GtkGraphicRenderer, self).
__init__()
1414 self.add_events(gtk.gdk.POINTER_MOTION_MASK)
1415 self.add_events(gtk.gdk.BUTTON_PRESS_MASK)
1416 self.add_events(gtk.gdk.BUTTON_RELEASE_MASK)
1424 """! Set Smaller Zoom
1425 @param self this object
1428 (start, end) = self.
__data.get_range()
1429 self.
__data.set_range(start, start + (end - start) * 2)
1434 """! Set Bigger Zoom
1435 @param self this object
1438 (start, end) = self.
__data.get_range()
1439 self.
__data.set_range(start, start + (end - start) / 2)
1445 @param self this object
1446 @param filename file name
1449 surface = cairo.ImageSurface(
1450 cairo.FORMAT_ARGB32, self.
__data.get_width(), self.
__data.get_height()
1454 surface.write_to_png(filename)
1458 @param self this object
1459 @param widget widget
1461 @return true if button has been pressed otherwise false
1463 (x, y, width, height) = self.
__data.get_selection_rectangle()
1464 (d_x, d_y, d_width, d_height) = self.
__data.get_data_rectangle()
1465 if event.y > y
and event.y < y + height:
1466 if abs(event.x - x) < 5:
1469 if abs(event.x - (x + width)) < 5:
1472 if event.x > x
and event.x < x + width:
1477 if event.y > d_y
and event.y < (d_y + d_height):
1478 if event.x > d_x
and event.x < (d_x + d_width):
1487 @param self this object
1488 @param widget widget
1490 @return true if button was released otherwise false
1495 right = self.
__data.get_range()[1]
1496 self.
__data.set_range(left, right)
1503 left = self.
__data.get_range()[0]
1504 self.
__data.set_range(left, right)
1511 (left, right) = self.
__data.get_range()
1512 self.
__data.set_range(left + delta, right + delta)
1522 @param self this object
1523 @param widget widget
1525 @return true if moving otherwise false
1527 (x, y, width, height) = self.
__data.get_selection_rectangle()
1531 elif event.x >= x + width:
1535 self.queue_draw_area(0, int(y), int(self.
__width), int(height))
1544 self.queue_draw_area(0, int(y), int(self.
__width), int(height))
1551 elif event.x > cur_e:
1555 self.queue_draw_area(0, int(y), int(self.
__width), int(height))
1560 (left, right) = self.
__data.get_range()
1561 self.
__data.set_range(left + delta, right + delta)
1566 (d_x, d_y, d_width, d_height) = self.
__data.get_data_rectangle()
1567 if event.y > y
and event.y < y + height:
1568 if abs(event.x - x) < 5
or abs(event.x - (x + width)) < 5:
1569 widget.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.SB_H_DOUBLE_ARROW))
1571 if event.x > x
and event.x < x + width:
1572 widget.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR))
1574 if event.y > d_y
and event.y < (d_y + d_height):
1575 if event.x > d_x
and event.x < (d_x + d_width):
1576 widget.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR))
1578 widget.window.set_cursor(
None)
1583 @param self this object
1584 @param widget widget
1585 @param allocation allocation
1588 self.
__width = allocation.width
1590 self.
__data.layout(allocation.width, allocation.height)
1596 @param self this object
1597 @param widget widget
1603 cairo.FORMAT_ARGB32, self.
__data.get_width(), self.
__data.get_height()
1608 ctx = widget.window.cairo_create()
1609 ctx.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
1613 (x, y, width, height) = self.
__data.get_selection_rectangle()
1616 ctx.rel_line_to(0, height)
1618 ctx.set_line_width(1)
1619 ctx.set_source_rgb(0, 0, 0)
1623 ctx.rel_line_to(0, height)
1625 ctx.set_line_width(1)
1626 ctx.set_source_rgb(0, 0, 0)
1630 left_x = x + delta_x
1631 ctx.move_to(x + delta_x, y)
1632 ctx.rel_line_to(0, height)
1634 ctx.move_to(x + width + delta_x, y)
1635 ctx.rel_line_to(0, height)
1637 ctx.set_source_rgb(0, 0, 0)
1638 ctx.set_line_width(1)
1661 @param self this object
1667 @param self this object
1668 @param graphic graphic
1671 window = gtk.Window()
1673 window.set_default_size(200, 200)
1678 vbox.pack_end(render,
True,
True, 0)
1680 vbox.pack_start(hbox,
False,
False, 0)
1681 smaller_zoom = gtk.Button(
"Zoom Out")
1683 hbox.pack_start(smaller_zoom)
1684 bigger_zoom = gtk.Button(
"Zoom In")
1686 hbox.pack_start(bigger_zoom)
1687 output_png = gtk.Button(
"Output Png")
1689 hbox.pack_start(output_png)
1690 window.connect(
"destroy", gtk.main_quit)
1696 """! Set Smaller Callback
1697 @param self this object
1698 @param widget widget
1704 """! Set Bigger Callback
1705 @param self this object
1706 @param widget widget
1712 """! Output PNG Callback
1713 @param self this object
1714 @param widget widget
1717 dialog = gtk.FileChooserDialog(
1718 "Output Png", self.
__window, gtk.FILE_CHOOSER_ACTION_SAVE, (
"Save", 1)
1721 dialog.set_default_response(1)
1726 """! Dialog Response Callback
1727 @param self this object
1728 @param widget widget
1729 @param response response
1733 filename = self.
__dialog.get_filename()
1742 m1 = re.compile(
"range ([^ ]+) ([^ ]+) ([^ ]+) ([0-9]+) ([0-9]+)")
1743 m2 = re.compile(
"event-str ([^ ]+) ([^ ]+) ([^ ]+) ([0-9]+)")
1744 m3 = re.compile(
"event-int ([^ ]+) ([^ ]+) ([0-9]+) ([0-9]+)")
1745 m4 = re.compile(
"color ([^ ]+) #([a-fA-F0-9]{2,2})([a-fA-F0-9]{2,2})([a-fA-F0-9]{2,2})")
1747 with open(filename, encoding=
"utf-8")
as fh:
1748 for line
in fh.readlines():
1751 line_name = m.group(1)
1752 timeline = timelines.get(m.group(1))
1753 rang = timeline.get_range(m.group(2))
1755 data_range.value = m.group(3)
1756 data_range.start = int(m.group(4))
1757 data_range.end = int(m.group(5))
1758 rang.add_range(data_range)
1762 line_name = m.group(1)
1763 timeline = timelines.get(m.group(1))
1764 ev = timeline.get_event_str(m.group(2))
1766 event.value = m.group(3)
1767 event.at = int(m.group(4))
1772 line_name = m.group(1)
1773 timeline = timelines.get(m.group(1))
1774 ev = timeline.get_event_int(m.group(2))
1776 event.value = int(m.group(3))
1777 event.at = int(m.group(4))
1783 r = int(m.group(2), 16)
1784 g = int(m.group(3), 16)
1785 b = int(m.group(4), 16)
1786 color =
Color(r / 255, g / 255, b / 255)
1787 colors.add(m.group(1), color)
1790 return (colors, timelines)
1794 (colors, timelines) =
read_data(sys.argv[1])
1795 (lower_bound, upper_bound) = timelines.get_bounds()
1798 range_values = timelines.get_all_range_values()
1800 for range_value
in range_values:
1801 range_colors.append(colors.lookup(range_value))
1802 top_legend.set_legends(range_values, range_colors)
1803 graphic.set_top_legend(top_legend)
1805 data.set_timelines(timelines, colors)
1806 graphic.set_data(data)
1809 range_mid = (upper_bound - lower_bound) / 2
1810 range_width = (upper_bound - lower_bound) / 10
1811 range_lo = range_mid - range_width / 2
1812 range_hi = range_mid + range_width / 2
1813 graphic.set_range(range_lo, range_hi)
1816 main_window.run(graphic)
__init__(self, r=0.0, g=0.0, b=0.0)
Initializer.
set(self, r, g, b)
Set color.
add(self, name, color)
Add.
__init__(self)
Initializer.
lookup(self, name)
Lookup name.
list default_colors
default colors XXX add more
__init__(self, start=0, end=0, value="")
Initializer.
__init__(self, at=0, value=0.0)
Initializer.
__init__(self, at=0, value=0.0)
Initializer.
__init__(self, at=0, value="")
Initializer.
__x_pixel(self, x, width)
X Pixel.
layout(self, width, height)
Set Layout.
get_data_rectangle(self)
Get Data Rectangle.
__init__(self, start, end)
Initializer.
scale_selection(self, x)
Scale Selection.
get_range(self)
Get Range.
set_top_legend(self, top_legend)
Set Top Legend.
set_data(self, data)
Set Date.
get_selection_rectangle(self)
Get Selection Rectangle.
scale_data(self, x)
Get Data Rectangle.
get_width(self)
Get Width.
set_range(self, start, end)
Set Range.
get_height(self)
Get Height.
GtkGraphicRenderer class.
button_press
button_press function
__force_full_redraw
full redraw
__moving_top_start
moving top start
__moving_both_cur
moving both cur
motion_notify(self, widget, event)
Motion Notify.
motion_notify
motion_notify function
__moving_right
moving right
button_release(self, widget, event)
Button Release.
set_smaller_zoom(self)
Set Smaller Zoom.
__moving_right_cur
moving right cur
__buffer_surface
__buffer_surface
__moving_top_cur
moving top cur
button_press(self, widget, event)
Button Press.
set_bigger_zoom(self)
Set Bigger Zoom.
__moving_both_start
moving both start
__init__(self, data)
Initializer.
button_release
button_release function
expose(self, widget, event)
Expose.
size_allocate(self, widget, allocation)
Size Allocate.
__moving_left_cur
moving left cur
size_allocate
size_allocate function
output_png(self, filename)
Output PNG.
__output_png_cb(self, widget)
Output PNG Callback.
__set_bigger_cb
__set_bigger_cb function
run(self, graphic)
Run function.
__init__(self)
Initializer.
__dialog_response_cb
__dialog_response_cb function
__set_smaller_cb
__set_smaller_cb function
__set_bigger_cb(self, widget)
Set Bigger Callback.
__output_png_cb
__output_png_cb function
__set_smaller_cb(self, widget)
Set Smaller Callback.
__dialog_response_cb(self, widget, response)
Dialog Response Callback.
get_height(self)
Get Height.
set_bounds(self, lo, hi)
Set Bounds.
max_text_height
maximum text height
__init__(self)
Initializer.
layout(self, width)
Layout.
get_position(self, x)
Get Position.
__init__(self, name="")
Initializer.
get_all(self)
Get all ranges.
get_ranges(self, start, end)
Get selected ranges.
add_range(self, range)
Add range.
get_ranges_bounds(self, start, end)
Get ranges bounds.
__search(self, key)
Search.
get_bounds(self)
Get bounds.
__search(self, key)
Search function.
get_events(self, start, end)
Get Events.
__init__(self, name="")
Get ranges bounds.
add_event(self, event)
Add Event.
get_bounds(self)
Get Bounds.
get_events_bounds(self, start, end)
Get Events Bounds.
get_range(self, name)
Get range.
__init__(self, name="")
Initializer.
get_bounds(self)
Get Bounds.
sort(self)
Sort the ranges and events.
get_events_str(self)
Get Events string.
get_event_str(self, name)
Get Event String.
get_ranges(self)
Get Ranges.
get_events_int(self)
Get Events int.
get_event_int(self, name)
Get Event Int.
get_all(self)
Get All Timeline.
get_bounds(self)
Get Bounds.
get(self, name)
Get Timeline.
sort(self)
Sort the timelines.
get_all_range_values(self)
Get All Ranges.
layout(self, width)
Get Data X Start.
grey_background
grey background
__init__(self)
Initializer.
draw_line(self, ctx, x, y, width, height)
Draw Line.
set_render_range(self, start, end)
Set Render Range.
get_data_x_start(self)
Get Data X Start.
get_height(self)
Get Height.
max_text_height
maximum text height
draw_events(self, ctx, events, x, y, width, height)
Draw Event.
set_timelines(self, timelines, colors)
Set Timelines.
draw_ranges(self, ctx, ranges, x, y, width, height)
Draw Ranges.
__init__(self)
Initializer.
set_legends(self, legends, colors)
Set padding.
set_padding(self, padding)
Set padding.
get_height(self)
Set padding.
draw(self, ctx)
Set padding.
layout(self, width)
Set padding.
read_data(filename)
read_data function