class documentation
class GephiGraphStreamingDrawer(AbstractGraphDrawer): (source)
图形绘制器,使用Gephi图形流格式将图形发送到类似文件的对象(例如,套接字、URL连接、文件)。
Gephi 图流格式是一种简单的基于 JSON 的格式,可用于将图的变更(即节点和边的添加、删除和更新)发布到远程组件。例如,可以打开 Gephi (http://www.gephi.org),安装 Gephi 图流插件,然后使用 GephiGraphStreamingDrawer 将图直接从 igraph 发送到 Gephi 窗口,通过指定 Gephi 正在监听的适当 URL。
connection 属性暴露了绘图器使用的 GephiConnection。绘图器还有一个名为 streamer 的属性,它暴露了底层的 GephiGraphStreamer,该对象负责生成 JSON 对象、编码它们并将它们写入类似文件的对象。如果你想自定义编码过程,这是你可以根据自己的喜好进行调整的对象。
| 方法 | __init__ |
构造一个Gephi图形流绘制器,该绘制器将图形发布到给定的Gephi连接。如果conn是None,构造函数的其余参数将原封不动地传递给GephiConnection的构造函数... |
| 方法 | draw |
使用Gephi图流API将给定的图绘制(即发送)到绘图器的目标。 |
| 实例变量 | connection |
未记录 |
| 实例变量 | streamer |
未记录 |
继承自 AbstractGraphDrawer:
| 静态方法 | ensure |
确保 layout 是 Layout 实例的辅助方法。如果不是,该方法将尝试根据以下规则将其转换为 Layout: |
| 静态方法 | _determine |
返回给定图的边必须绘制的顺序,假设相关的关键字参数(edge_order 和 edge_order_by)在 kwds 中以字典形式给出。如果既没有 edge_order... |
| 静态方法 | _determine |
返回给定图的顶点必须绘制的顺序,假设相关的关键字参数(vertex_order 和 vertex_order_by)在 kwds 中以字典形式给出。如果两者都没有... |
构建一个Gephi图形流绘制器,该绘制器将图形发布到给定的Gephi连接。如果conn是None,则构造函数的其余参数将原封不动地传递给GephiConnection的构造函数以创建连接。这意味着以下任何一种都是有效的:
- 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.