(self, graph)
Iterates over the JSON objects that build up the graph using the Gephi
        graph streaming API. The objects returned from this function are Python
        objects; they must be formatted with ``json.dumps`` before sending them
        to the destination.
Iterates over the JSON objects that build up the graph using the Gephi
        graph streaming API. The objects returned from this function are Python
        objects; they must be formatted with ``json.dumps`` before sending them
        to the destination.
Iterates over the JSON objects that build up the graph using the Gephi graph streaming API . The objects returned from this function are Python objects ; they must be formatted with json . dumps before sending them to the destination .
def iterjsonobj(self, graph):
        """Iterates over the JSON objects that build up the graph using the Gephi
        graph streaming API. The objects returned from this function are Python
        objects; they must be formatted with ``json.dumps`` before sending them
        to the destination."""

        # Construct a unique ID prefix
        id_prefix = "igraph:%s" % (hex(id(graph)),)

        # Add the vertices
        add_node = self.format.get_add_node_event
        for vertex in graph.vs:
            yield add_node("%s:v:%d" % (id_prefix, vertex.index), vertex.attributes())

        # Add the edges
        add_edge = self.format.get_add_edge_event
        directed = graph.is_directed()
        for edge in graph.es:
            yield add_edge(
                "%s:e:%d:%d" % (id_prefix, edge.source, edge.target),
                "%s:v:%d" % (id_prefix, edge.source),
                "%s:v:%d" % (id_prefix, edge.target),
                directed,
                edge.attributes(),
            )
def iterjsonobj ( self , graph ) : # Construct a unique ID prefix id_prefix = "igraph:%s" % ( hex ( id ( graph ) ) , ) # Add the vertices add_node = self . format . get_add_node_event for vertex in graph . vs : yield add_node ( "%s:v:%d" % ( id_prefix , vertex . index ) , vertex . attributes ( ) ) # Add the edges add_edge = self . format . get_add_edge_event directed = graph . is_directed ( ) for edge in graph . es : yield add_edge ( "%s:e:%d:%d" % ( id_prefix , edge . source , edge . target ) , "%s:v:%d" % ( id_prefix , edge . source ) , "%s:v:%d" % ( id_prefix , edge . target ) , directed , edge . attributes ( ) , )