def construct_node(self, _function: Function): """ Takes a Function object and constructs a Dot Node object for it. Adds the created object to the dictionary. Finished. """ n = Node(_function.name) n.set_tooltip(construct_tooltip(_function)) self.node_dic[_function.name] = n self.graph.add_node(n)
def get_node(name): # modify to accept orm_nodes node = GNode(cleanup(name)) orm_node = Node.objects.select_related().get(name=name) node.set_URL('/node/'+name) tooltip = '/n'.join(orm_node.description.splitlines()) node.set_tooltip(tooltip) node.set_target('_parent') color = getattr(orm_node.node_type,"color","lightblue") shape = getattr(orm_node.node_type,"shape","box") node.set_color(color) node.set_shape(shape) node.set_style('filled') return node
def construct_node(self, function): n = Node(function.name) n.set_tooltip(construct_tooltip(function)) self.node_dic[function.name] = n self.graph.add_node(n)