Example #1
0
 def render_node(self, node):
     slug = node.slug()
     label = node.label.replace(".", "\\n")
     modtime = date_to_seconds(node.data['last_modified'])
     color = self.num_colors - int(((modtime - self.min_modtime) - 1) / self.band_width)
     return "{} [label=\"{}\" colorscheme=rdylgn9 color={} style=filled]".format(slug, label, color)
Example #2
0
 def __init__(self, graph):
     modtimes = map(lambda node: node.data['last_modified'], graph)
     self.min_modtime = date_to_seconds(min(modtimes))
     self.max_modtime = date_to_seconds(max(modtimes))
     self.num_colors = 9
     self.band_width = (self.max_modtime - self.min_modtime) / self.num_colors