改进 JUNG 图的渲染
我正在使用 jung 来直观地显示大型数据集(数千个节点),但是当我放大或缩小或移动节点时,系统会变得非常滞后。有没有办法改善 JUNG 中图形的渲染?
i am using jung to visually display large data sets, (1000s of nodes) but the system becomes very laggy when I zoom in or out, or move a node. Is there anyway to improve the rendering of graphs in JUNG ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我用来改进图形渲染的方法是过滤图形的边缘。每次您尝试移动图形时,框架都会进行大量计算来重新定位每个顶点和边,这会导致性能不佳。
可以通过将 AbstractPopupGraphMousePlugin 后继添加到您正在使用的 DefaultModalGraphMouse 对象来完成过滤。只需重写handlePopup(MouseEvent mouseEvent)。
The way that I used to improve rendering on graphs was to filter the edges of the graph. Every time you try to move the graph the framework do enormous calculations to reposition every vertex and edge and this causes bad performance.
The filtering could be done with adding AbstractPopupGraphMousePlugin succesor to the DefaultModalGraphMouse object you are using. Simply override the handlePopup(MouseEvent mouseEvent).
我不知道具体的图表,但通常的选项是
仅处理屏幕上实际显示的内容(放大)
隐藏详细信息缩小
缩小
仅更新屏幕上实际更改内容的部分(移动节点)
I do not know specifically for graphs, but the usual options are
Only process what is actually shown on screen (zoom in)
Hide details when zooming out
Only update part of the screen that have actually changed content (move a node)