(self)
return nx.draw_networkx(
            self.graph, with_labels=True, labels=label_dict,
            pos=self.layout)
Property that returns back a drawing with the graph.
Property that returns back a drawing with the graph.
Property that returns back a drawing with the graph .
def draw(self):
        """Property that returns back a drawing with the graph."""
        if not self.graph:
            return None

        if not self.graph.size():
            return None

        data = self.data.get('elements', {})
        nodes = data.get('nodes', [])

        label_dict = {
            x.get('data', {}).get('name', ''): x.get(
                'data', {}).get('label', '') for x in nodes
        }

        edges = data.get('edges', [])
        edge_dict = {
            x.get('data', {}).get('name', ''): x.get(
                'data', {}).get('label', '') for x in edges
        }
        label_dict.update(edge_dict)

        label_keys = list(label_dict.keys())
        for key in label_keys:
            if not key:
                _ = label_dict.pop(key)

        return nx.draw_networkx(
            self.graph, with_labels=True, labels=label_dict,
            pos=self.layout)
def draw ( self ) : if not self . graph : return None if not self . graph . size ( ) : return None data = self . data . get ( 'elements' , { } ) nodes = data . get ( 'nodes' , [ ] ) label_dict = { x . get ( 'data' , { } ) . get ( 'name' , '' ) : x . get ( 'data' , { } ) . get ( 'label' , '' ) for x in nodes } edges = data . get ( 'edges' , [ ] ) edge_dict = { x . get ( 'data' , { } ) . get ( 'name' , '' ) : x . get ( 'data' , { } ) . get ( 'label' , '' ) for x in edges } label_dict . update ( edge_dict ) label_keys = list ( label_dict . keys ( ) ) for key in label_keys : if not key : _ = label_dict . pop ( key ) return nx . draw_networkx ( self . graph , with_labels = True , labels = label_dict , pos = self . layout )