简体   繁体   English

Prefuse:重新加载XML文件

[英]Prefuse: Reloading of XML files

I am a new to the prefuse visualization toolkit and have a couple of general questions. 我是prefuse可视化工具包的新手,并有几个常规问题。 For my purpose, I would like to perform an initial visualization using prefuse (graphview / graphml). 出于我的目的,我想使用预熔(graphview / graphml)进行初始可视化。 Once rendered, upon a user click of a node, I would like to completely reload a new xml file for a new visualization. 呈现后,在用户单击节点后,我想完全重新加载新的xml文件以进行新的可视化。 I want to do this in order to allow me to "pre-package" graphs for display. 我想这样做是为了让我可以“预打包”图形进行显示。

For example. 例如。 If I search for Ted. 如果我搜索Ted。 I would like to have an xml file relating to Ted load and render a display. 我想要一个与Ted加载相关的xml文件并呈现显示。 Now in the display I see that Ted has nodes associated called Bill and Joe. 现在在显示中,我看到Ted具有关联的节点,分别称为Bill和Joe。 When I click Joe, I would like to clear the display and load an xml file associated with Joe. 当我单击Joe时,我想清除显示并加载与Joe关联的xml文件。 And so on. 等等。

I have looked into loading one very large xml file containing all node and node relationship info and allowing prefuse to handle this using the hops from one level to another. 我研究了装入一个非常大的xml文件,其中包含所有节点和节点关系信息,并允许预先使用从一个级别到另一个级别的跃点来处理该文件。 However, eventually I am sure that system performance issues will arise due to the size of data. 但是,最终我确定由于数据量的原因,会出现系统性能问题。

Thanks in advance for any help, John 预先感谢您的帮助,约翰

Of course as you said, one option is loading all nodes and then set the nodes you don't need to be invisible. 当然,正如您所说,一种方法是加载所有节点,然后设置不需要隐藏的节点。 Prefuse scales fairly well, but of course it has its limits. 预熔可以很好地扩展,但是当然有其局限性。 The second option is to just create a brand new panel and replace the old panel. 第二种选择是只创建一个全新的面板并替换旧面板。 I've used the option 2 and it works quite well. 我使用了选项2,效果很好。

I'm far from an expert on Prefuse's performance issues, but I think it is definitely more resource intensive to have a huge xml file loaded at once than to do the processing to only re-load the necessary nodes. 我与Prefuse的性能问题的专家相去甚远,但是我认为一次加载一个巨大的xml文件比执行仅重新加载必要节点的处理肯定要消耗更多的资源。

I don't know what kind of graph you are using, but I would place a 'refreshGraph' that removes the graph from the Visualization object, cancels Activity, cancels Layout, refreshes the ActionList and re-starts over. 我不知道您使用的是哪种图形,但是我会放置一个“ refreshGraph”,该图形从Visualization对象中删除该图形,取消Activity,取消Layout,刷新ActionList并重新开始。 It would probably turn out something like this: 结果可能是这样的:

public void refresh(clickedNode){
    visualization.removeGroup(GRAPH);
    visualization.removeGroup(AGGR);
    activity.cancel();
    actionList.cancel();
    visualization.reset();
    // process the XML and reload your graph here
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM