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
120 u = len(self.
rangesranges) - 1
123 if key >= self.
rangesranges[i].start
and key <= self.
rangesranges[i].end:
125 elif key < self.
rangesranges[i].start:
134 @param self this object
138 self.
rangesranges.append(range)
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.
rangesranges[0 : e + 1]
163 return self.
rangesranges[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.
rangesranges))
185 @param self this object
192 @param self this object
195 if len(self.
rangesranges) > 0:
196 lo = self.
rangesranges[0].start
210 """! Get ranges bounds
211 @param self this object
219 @param self this object
224 u = len(self.
eventsevents) - 1
227 if key == self.
eventsevents[i].at:
229 elif key < self.
eventsevents[i].at:
238 @param self this object
239 @param event event to add
242 self.
eventsevents.append(event)
246 @param self this object
247 @param start starting event
248 @param end ending event
253 return self.
eventsevents[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
278 if len(self.
eventsevents) > 0:
279 lo = self.
eventsevents[0].at
280 hi = self.
eventsevents[-1].at
298 @param self this object
308 @param self this object
312 for range
in self.
rangesranges:
313 if range.name == name:
316 self.
rangesranges.append(timeline)
320 """! Get Event String
321 @param self this object
323 @return the event string
325 for event_str
in self.
event_strevent_str:
326 if event_str.name == name:
334 @param self this object
338 for event_int
in self.
event_intevent_int:
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
371 for range
in self.
rangesranges:
380 @param self this object
385 for range
in self.
rangesranges:
386 (range_lo, range_hi) = range.get_bounds()
391 for event_str
in self.
event_strevent_str:
392 (ev_lo, ev_hi) = event_str.get_bounds()
397 for event_int
in self.
event_intevent_int:
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
541 if not self.
__colors__colors.has_key(name):
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]
597 item_height = t_height + self.
__padding__padding
598 if item_height > line_height:
599 line_height = item_height
600 if line_used + item_width > self.
__width__width:
601 line_used = self.
__padding__padding + item_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]
629 item_height = t_height + self.
__padding__padding
630 if item_height > line_height:
631 line_height = item_height
632 if line_used + item_width > self.
__width__width:
633 line_used = self.
__padding__padding + item_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__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.
timelinestimelines.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.
paddingpadding
753 right_n_lines = range_n + eventint_n + eventstr_n
754 right_height = (right_n_lines - 1) * self.
paddingpadding + 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.
paddingpadding
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.
paddingpadding / 2, width, height + self.
paddingpadding)
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.
startstart, self.
endend)
802 for event
in events.events[lo:hi]:
803 real_x = int(x + (event.at - self.
startstart) * width / (self.
endend - self.
startstart))
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.
paddingpadding / 2, width, height + self.
paddingpadding)
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.
startstart, self.
endend)
831 for data_range
in ranges.ranges[lo:hi]:
832 s =
max(data_range.start, self.
startstart)
833 e =
min(data_range.end, self.
endend)
834 x_start = int(x + (s - self.
startstart) * width / (self.
endend - self.
startstart))
835 x_end = int(x + (e - self.
startstart) * width / (self.
endend - self.
startstart))
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.
colorscolors.lookup(data_range.value)
841 ctx.set_source_rgb(color.r, color.g, color.b)
849 @param self this object
854 top_y = self.
paddingpadding / 2
855 left_x_start = self.
paddingpadding / 2
856 left_x_end = left_x_start + self.
left_widthleft_width
857 right_x_start = left_x_end + self.
paddingpadding
858 right_x_end = right_x_start + self.
right_widthright_width
859 data_x_start = right_x_end + self.
paddingpadding / 2
860 data_x_end = self.
widthwidth
861 data_width = data_x_end - data_x_start
865 for timeline
in self.
timelinestimelines.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_heightmax_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_heightmax_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_heightmax_text_height + 5
879 right_x_start - self.
paddingpadding / 2,
880 cur_y - self.
paddingpadding / 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_heightmax_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_heightmax_text_height + 5
895 right_x_start - self.
paddingpadding / 2,
896 cur_y - self.
paddingpadding / 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_heightmax_text_height - (t_height + y_bearing))
903 ctx.show_text(ranges.name)
904 self.
draw_rangesdraw_ranges(ctx, ranges, data_x_start, cur_y, data_width, 10)
908 right_x_start - self.
paddingpadding / 2,
909 cur_y - self.
paddingpadding / 2,
914 bot_y = cur_y - self.
paddingpadding / 2
915 self.
draw_linedraw_line(ctx, left_x_end + self.
paddingpadding / 2, 0, 0, bot_y)
916 self.
draw_linedraw_line(ctx, right_x_end + self.
paddingpadding / 2, 0, 0, bot_y)
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)
985 data_delta = self.
__hi__hi - self.
__lo__lo
987 while (closest * 10) < data_delta:
989 if (data_delta / closest) == 0:
991 elif (data_delta / closest) == 1:
995 start = self.
__lo__lo - (self.
__lo__lo % delta) + delta
996 end = self.
__hi__hi - (self.
__hi__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__lo - (self.
__lo__lo % delta) + delta
1024 end = self.
__hi__hi - (self.
__hi__hi % delta)
1026 if self.
__top__top == 1:
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__lo - (self.
__lo__lo % delta) + delta
1051 end = self.
__hi__hi - (self.
__hi__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__data.get_data_x_start()
1125 """! Get Data Rectangle
1126 @param self this object
1130 x_start = self.
__data__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
1173 self.
__data__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__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__data.get_data_x_start(),
1271 ctx.move_to(self.
__data__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__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__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__width, height_used)
1303 ctx.line_to(self.
__width__width, height_used + 20)
1304 ctx.line_to(select_end, height_used + 20)
1305 ctx.line_to(self.
__width__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__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__width, height_used)
1326 ctx.line_to(self.
__width__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__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)
1417 self.connect(
"expose_event", self.
exposeexpose)
1418 self.connect(
"size-allocate", self.
size_allocatesize_allocate)
1419 self.connect(
"motion-notify-event", self.
motion_notifymotion_notify)
1420 self.connect(
"button-press-event", self.
button_pressbutton_press)
1421 self.connect(
"button-release-event", self.
button_releasebutton_release)
1424 """! Set Smaller Zoom
1425 @param self this object
1428 (start, end) = self.
__data__data.get_range()
1429 self.
__data__data.set_range(start, start + (end - start) * 2)
1434 """! Set Bigger Zoom
1435 @param self this object
1438 (start, end) = self.
__data__data.get_range()
1439 self.
__data__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__data.get_width(), self.
__data__data.get_height()
1453 self.
__data__data.draw(ctx)
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__data.get_selection_rectangle()
1464 (d_x, d_y, d_width, d_height) = self.
__data__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__data.get_range()[1]
1496 self.
__data__data.set_range(left, right)
1503 left = self.
__data__data.get_range()[0]
1504 self.
__data__data.set_range(left, right)
1511 (left, right) = self.
__data__data.get_range()
1512 self.
__data__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__data.get_selection_rectangle()
1531 elif event.x >= x + width:
1535 self.queue_draw_area(0, int(y), int(self.
__width__width), int(height))
1538 if event.x >= self.
__width__width:
1544 self.queue_draw_area(0, int(y), int(self.
__width__width), int(height))
1551 elif event.x > cur_e:
1555 self.queue_draw_area(0, int(y), int(self.
__width__width), int(height))
1560 (left, right) = self.
__data__data.get_range()
1561 self.
__data__data.set_range(left + delta, right + delta)
1566 (d_x, d_y, d_width, d_height) = self.
__data__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
1590 self.
__data__data.layout(allocation.width, allocation.height)
1596 @param self this object
1597 @param widget widget
1603 cairo.FORMAT_ARGB32, self.
__data__data.get_width(), self.
__data__data.get_height()
1606 self.
__data__data.draw(ctx)
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__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
1701 self.
__render__render.set_smaller_zoom()
1704 """! Set Bigger Callback
1705 @param self this object
1706 @param widget widget
1709 self.
__render__render.set_bigger_zoom()
1712 """! Output PNG Callback
1713 @param self this object
1714 @param widget widget
1717 dialog = gtk.FileChooserDialog(
1718 "Output Png", self.
__window__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__dialog.get_filename()
1734 self.
__render__render.output_png(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)
def __init__(self, r=0.0, g=0.0, b=0.0)
Initializer.
def set(self, r, g, b)
Set color.
def __init__(self)
Initializer.
def lookup(self, name)
Lookup name.
def add(self, name, color)
Add.
list default_colors
default colors XXX add more
def __init__(self, start=0, end=0, value="")
Initializer.
def __init__(self, at=0, value=0.0)
Initializer.
def __init__(self, at=0, value=0.0)
Initializer.
def __init__(self, at=0, value="")
Initializer.
def set_top_legend(self, top_legend)
Set Top Legend.
def get_range(self)
Get Range.
def get_selection_rectangle(self)
Get Selection Rectangle.
def set_range(self, start, end)
Set Range.
def get_height(self)
Get Height.
def get_data_rectangle(self)
Get Data Rectangle.
def scale_selection(self, x)
Scale Selection.
def layout(self, width, height)
Set Layout.
def set_data(self, data)
Set Date.
def __x_pixel(self, x, width)
X Pixel.
def __init__(self, start, end)
Initializer.
def get_width(self)
Get Width.
def scale_data(self, x)
Get Data Rectangle.
GtkGraphicRenderer class.
__force_full_redraw
full redraw
__moving_top_start
moving top start
def set_smaller_zoom(self)
Set Smaller Zoom.
__moving_both_cur
moving both cur
def button_release(self, widget, event)
Button Release.
__moving_right
moving right
__moving_right_cur
moving right cur
__buffer_surface
__buffer_surface
__moving_top_cur
moving top cur
def button_press(self, widget, event)
Button Press.
def size_allocate(self, widget, allocation)
Size Allocate.
__moving_both_start
moving both start
def motion_notify(self, widget, event)
Motion Notify.
def set_bigger_zoom(self)
Set Bigger Zoom.
def expose(self, widget, event)
Expose.
__moving_left_cur
moving left cur
def output_png(self, filename)
Output PNG.
def __init__(self, data)
Initializer.
def run(self, graphic)
Run function.
def __output_png_cb(self, widget)
Output PNG Callback.
def __init__(self)
Initializer.
def __set_smaller_cb(self, widget)
Set Smaller Callback.
def __dialog_response_cb(self, widget, response)
Dialog Response Callback.
def __set_bigger_cb(self, widget)
Set Bigger Callback.
def layout(self, width)
Layout.
max_text_height
maximum text height
def get_position(self, x)
Get Position.
def set_bot(self)
Set Bottom.
def set_top(self)
Set Top.
def __init__(self)
Initializer.
def get_height(self)
Get Height.
def set_bounds(self, lo, hi)
Set Bounds.
def __init__(self, name="")
Initializer.
def get_bounds(self)
Get bounds.
def add_range(self, range)
Add range.
def __search(self, key)
Search.
def get_ranges_bounds(self, start, end)
Get ranges bounds.
def get_ranges(self, start, end)
Get selected ranges.
def sort(self)
Sort ranges.
def get_all(self)
Get all ranges.
def add_event(self, event)
Add Event.
def get_events(self, start, end)
Get Events.
def get_events_bounds(self, start, end)
Get Events Bounds.
def sort(self)
Sort function.
def get_bounds(self)
Get Bounds.
def __search(self, key)
Search function.
def __init__(self, name="")
Get ranges bounds.
def get_ranges(self)
Get Ranges.
def get_range(self, name)
Get range.
def get_event_int(self, name)
Get Event Int.
def get_events_int(self)
Get Events int.
def get_event_str(self, name)
Get Event String.
def __init__(self, name="")
Initializer.
def get_bounds(self)
Get Bounds.
def get_events_str(self)
Get Events string.
def sort(self)
Sort the ranges and events.
def get_bounds(self)
Get Bounds.
def get(self, name)
Get Timeline.
def get_all_range_values(self)
Get All Ranges.
def get_all(self)
Get All Timeline.
def sort(self)
Sort the timelines.
def set_timelines(self, timelines, colors)
Set Timelines.
grey_background
grey background
def draw_line(self, ctx, x, y, width, height)
Draw Line.
def get_data_x_start(self)
Get Data X Start.
def set_render_range(self, start, end)
Set Render Range.
def layout(self, width)
Get Data X Start.
max_text_height
maximum text height
def draw_events(self, ctx, events, x, y, width, height)
Draw Event.
def __init__(self)
Initializer.
def get_height(self)
Get Height.
def draw_ranges(self, ctx, ranges, x, y, width, height)
Draw Ranges.
def get_height(self)
Set padding.
def layout(self, width)
Set padding.
def __init__(self)
Initializer.
def draw(self, ctx)
Set padding.
def set_padding(self, padding)
Set padding.
def set_legends(self, legends, colors)
Set padding.
def read_data(filename)
read_data function
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
def set_bounds(x1, y1, x2, y2)