コード例 #1
0
ファイル: graph_draw.py プロジェクト: brettc/bricolage
    def __init__(self, diag, px, py, channel, channel_type):
        Shape.__init__(self, diag, px, py)
        self.channel = channel
        self.channel_type = channel_type

        if channel_type == ChannelType.INPUT:
            self.outline = cut_hexagon(px, py, self.radius * .8)
            self.color = ColorScheme.cue

        elif channel_type == ChannelType.OUTPUT:
            # self.outline = ppath.circle(px, py, self.radius * .8)
            self.outline = cut_hexagon_rotated(px, py, self.radius * .8)
            self.color = ColorScheme.act
            # self.color = pcolor.gradient.Jet.getcolor(channel * .05)
        else:
            self.outline = ppath.circle(px, py, self.radius * .8)
            # self.outline = diamond(px, py, self.radius)
            # self.color = pcolor.gradient.WhiteRed.getcolor(
            #     (channel - p.reg_range[0]) * (1.0/p.reg_channels))
            # self.color = pcolor.gradient.Gray.getcolor(annote[channel]['W'])
            self.color = pcolor.cmyk.Black
            # ColorScheme.sig

        if channel == diag.highlight:
            self.color = pcolor.cmyk.Red

        self.text = latexify(self.diagram.world.name_for_channel(channel))
コード例 #2
0
ファイル: graph_draw.py プロジェクト: brettc/bricolage
 def __init__(self, diag, px, py, gene):
     Shape.__init__(self, diag, px, py)
     self.outline = rounded_rect(px, py, self.width, self.height)
     self.gene = gene
     if gene.sequence >= diag.world.reg_channels:
         self.color = pcolor.cmyk.Green
     else:
         self.color = pcolor.cmyk.Gray
コード例 #3
0
ファイル: graph_draw.py プロジェクト: brettc/bricolage
 def __init__(self, diag, px, py, gene):
     Shape.__init__(self, diag, px, py)
     self.text = latexify(
         text_for_gene(gene) + '=>' + diag.world.name_for_channel(gene.pub))
     w, h = measure_text(self.text)
     self.outline = rounded_rect(px, py, w + .2, self.height)
     if gene.sequence >= diag.world.reg_channels:
         self.color = pcolor.cmyk.Green
     else:
         self.color = pcolor.cmyk.Black