[英]Prefuse set different color to every nodes group
I am new to prefuse and don't understand several things regarding nodes. 我是新手,不了解关于节点的几件事。
Its important to say that I build the graph in real-time and not loading it from any file. 重要的是要说我是实时构建图形,而不是从任何文件加载图形。
Thanks, Ozrad. 谢谢,奥兹拉德。
Three answers to your three questions: 您的三个问题的三个答案:
prefuse.controls.ControlAdapter
and add it to the Display
. prefuse.controls.ControlAdapter
并将其添加到Display
。 prefuse.action.assignment.DataColorAction
assigns color based on a data field. prefuse.action.assignment.DataColorAction
根据数据字段分配颜色。 For more advanced scenarios you can use ColorAction
with predicates or extend the class DataColorAction
. ColorAction
与谓词ColorAction
使用或扩展DataColorAction
类。 You can add columns to the node table to store metadata. 您可以将列添加到节点表中以存储元数据。 A column can also store objects if you need it:
如果需要,列还可以存储对象:
vg.getNodeTable().addColumn("meta", MyMetaData.class);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.