Ejemplo n.º 1
0
 def gen_legend(self):
     if self.b_comp and not self.b_bar and (not self.b_chr or not self.b_many):
         self.graph_legend.append([gm_default_color_parent , "Whole track"])
         self.graph_legend.append([gm_default_color_selection , "Selection"])
     if self.b_many and self.b_chr:
         for track in self.tracks:
             self.graph_legend.append([common.number_to_color(track.number) , track.name])
     for l in self.graph_legend: l[1] = common.wrap_string(l[1], 25)
     self.graph_legend = [[l[0], common.wrap_string(l[1], 52)] for l in self.graph_legend]
Ejemplo n.º 2
0
 def gen_ylabels(self):
     if self.b_chr:
         for i, chr in enumerate(self.chrs):
             self.ylabels.append([i*self.major_ystep + self.minor_ystep*len(self.tracks)*0.5, chr])
     elif self.b_many:
         for i, track in enumerate(self.tracks):
             self.ylabels.append([i*self.major_ystep + self.hjump*0.5, track.name])
     else:
         self.ylabels = [[0.0, '']]
     self.ylabels = [[l[0], common.wrap_string(l[1], 30)] for l in self.ylabels]