python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module graph :: Class GephiGraphStreamingDrawer
[hide private]

Class GephiGraphStreamingDrawer

source code

                object --+        
                         |        
baseclasses.AbstractDrawer --+    
                             |    
           AbstractGraphDrawer --+
                                 |
                                GephiGraphStreamingDrawer

Graph drawer that sends a graph to a file-like object (e.g., socket, URL connection, file) using the Gephi graph streaming format.

The Gephi graph streaming format is a simple JSON-based format that can be used to post mutations to a graph (i.e. node and edge additions, removals and updates) to a remote component. For instance, one can open up Gephi (http://www.gephi.org), install the Gephi graph streaming plugin and then send a graph from igraph straight into the Gephi window by using GephiGraphStreamingDrawer with the appropriate URL where Gephi is listening.

The connection property exposes the GephiConnection that the drawer uses. The drawer also has a property called streamer which exposes the underlying GephiGraphStreamer that is responsible for generating the JSON objects, encoding them and writing them to a file-like object. If you want to customize the encoding process, this is the object where you can tweak things to your taste.

Instance Methods [hide private]
 
__init__(self, conn=None, *args, **kwds)
Constructs a Gephi graph streaming drawer that will post graphs to the given Gephi connection.
source code
 
draw(self, graph, *args, **kwds)
Draws (i.e.
source code

Inherited from AbstractGraphDrawer: ensure_layout

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conn=None, *args, **kwds)
(Constructor)

source code 

Constructs a Gephi graph streaming drawer that will post graphs to the given Gephi connection. If conn is None, the remaining arguments of the constructor are forwarded intact to the constructor of GephiConnection in order to create a connection. This means that any of the following are valid:

  • GephiGraphStreamingDrawer() will construct a drawer that connects to workspace 0 of the local Gephi instance on port 8080.
  • GephiGraphStreamingDrawer(workspace=2) will connect to workspace 2 of the local Gephi instance on port 8080.
  • GephiGraphStreamingDrawer(port=1234) will connect to workspace 0 of the local Gephi instance on port 1234.
  • GephiGraphStreamingDrawer(host="remote", port=1234, workspace=7) will connect to workspace 7 of the Gephi instance on host remote, port 1234.
  • GephiGraphStreamingDrawer(url="http://remote:1234/workspace7) is the same as above, but with an explicit URL.
Overrides: object.__init__

draw(self, graph, *args, **kwds)

source code 

Draws (i.e. sends) the given graph to the destination of the drawer using the Gephi graph streaming API.

The following keyword arguments are allowed:

  • ``encoder`` lets one specify an instance of ``json.JSONEncoder`` that will be used to encode the JSON objects.
Overrides: baseclasses.AbstractDrawer.draw

   Home       Trees       Indices       Help