networkit.gephi

Submodules

networkit.gephi.csv module

networkit.gephi.csv.exportNodeValues(values, fpath, column_name)

This method exports node values (e.g. community information, betwenness centrality values) to a CSV file. The values can then be imported to Gephi. Parameters:

  • values: python list or Partition object that contains the values to be exported.
  • fpath: the file including its path to be written to
  • column_name: name of the column as description for the data

networkit.gephi.pyclient module

Allow a Python script to communicate with Gephi using the Gephi Graph Streaming protocol and plugin.

class networkit.gephi.pyclient.GephiClient(url='http://127.0.0.1:8080/workspace0', autoflush=False)

Bases: networkit.gephi.pyclient.JSONClient

class networkit.gephi.pyclient.GephiFileHandler(out, **params)

Bases: networkit.gephi.pyclient.JSONClient

class networkit.gephi.pyclient.JSONClient(autoflush=0, enable_timestamps=False, process_event_hook=None)

Bases: object

add_edge(id, source, target, directed=True, **attributes)
add_node(id, flush=True, **attributes)
change_edge(id, source, target, directed=True, **attributes)
change_node(id, flush=True, **attributes)
clean()
delete_edge(id)
delete_node(id)
flush()
incrementUnflushedDumps()

networkit.gephi.streaming module

This module provides methods to export data from NetworKit directly to Gephi using the Gephi Streaming Plugin.

class networkit.gephi.streaming.GephiStreamingClient(url='http://localhost:8080/workspace0')

Bases: object

A python singleton providing access to a running Master instance of the Gephi Streaming plugin

clearGraph()

Cleans the first workspace in Gephi.

exportAdditionalEdge(u, v)

Adds an edge (u,v) in an already exported graph. If the edge is already present, nothing happens. If the graph is directed, the edge goes from u to v

Parameters: - u: first node - v: second node

exportCoordinates(graph, scale=1)
exportEdgeValues(graph, values, attribute_name)

This method exports an edge attribute to gephi using the Gephi Streaming Plugin. Use exportGraph(Graph) first to export graph itself.

Parameters: - values: python list contains the values to be exported. - attribute_name: name of the edge attribute in gephi

exportEventStream(stream, timeStepDelay=0)
exportGraph(graph)

Exports the given graph to gephi. No attributes or weights are exported. Please note that only graphs with indexed edges can be exported, so edges will be indexed if neccessary.

exportNodeValues(graph, values, attribute_name)

This method exports node values (e.g. community information, betwenness centrality values) to gephi using the Gephi Streaming Plugin. Use exportGraph(Graph) first to export the graph itself.

Parameters: - values: python list or Partition object that contains the values to be exported. - attribute_name: name of the node attribute in gephi

removeExportedEdge(u, v)

Removes an edge from an already exported graph.