从 Ruby on Rails 调用 Gephi
我对构建数据可视化组件非常感兴趣并且可以 看看如何做到,但不想重新发明一些东西 这已经存在了。如果这确实是“第一次”,那么我准备放置我的初始代码 在 Github 上供其他人分享[并希望改进!!]
本质上我希望能够执行以下操作:
1)访问数据库中的一个或多个表并基于创建节点 在其中的条目上。在创建时添加节点,在删除时删除它们。
2)使用外键和/或连接表[对于多对多链接] 创建边缘。创建节点时添加边,创建节点时删除边 删除,检查并在节点更新时添加/删除边。
3)将节点和边传递给 Gephi 进行显示
我可以看到如何快速轻松地执行步骤 1 和 2 - 我还没有看到 能够找到(经过多次搜索)是如何执行步骤3的。
有人在这方面取得过成功吗? - 他们愿意分享任何示例代码吗?
谢谢
I'm very interested in building a data visualisation component and can
see how it could be done but would prefer not to reinvent something
which already exists. If this truly is a 'first' then I'm prepared to put my initial code
on Github for others to share [and hopefully improve !!]
Essentially I'd like to be able to do the following:
1) Access a table or tables within a database and create nodes based
on entries within them. Add nodes on create, remove them on delete.
2) Use the foreign keys and/or join tables [for many-many links] to
create edges. Add edge(s) when node created, remove edges when node
deleted, check and add/remove edges when node updated.
3) Pass the nodes and edges to Gephi for display
I can see how to do steps 1 and 2 quickly and easily -- what I haven't
been able to find (after much searching) is how to do step 3.
Has anyone had any success in doing this? -- any example code that they're willing to share ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们曾经尝试过类似的方法,但它可能对您没有多大帮助。我们编写了一个 Rake 任务,从数据库中获取数据,然后手动将其输入到 Gephi 中。这并不是很令人满意,最后我选择了 Rake 任务 -> CSV->用于可视化的 R 脚本(基本上是世界地图上用户的连接)。如果您不打算使用 Gephi,我可以向您展示一些 R 代码:-)
We tried something similar once, but it may not help you that much. We wrote a Rake task that got data out our DB, which we then fed into Gephi manually. That wasn't really satisfactory and in the end I went with Rake task -> CSV -> R script for visualization (basically connections of users on a world map). If you are not dead set on using Gephi I could show you some of the R code :-)