Question

Many components of prefuse seem to use a String group to identify some subset of data. How do you use groups in practice? Some documentation seems to imply that a single row of data can belong to multiple groups, but I cannot work out how to make this happen.

Ideally, I could put some nodes of a graph into multiple groups, but have them each visualized once, and apply various forces and layouts to them.

Était-ce utile?

La solution

Indeed most prefuse components such as Layout, ColorAction or the RendererFactory use group names.

There are different types of groups:

  • groups created from raw data, e.g. by vis.addGraph(...)
  • focus groups that contains some items (= rows) from another group
  • decorator groups, e.g., for labels
  • aggregate groups that represent items merged to aggregated items

In order to put "some nodes of a graph into multiple groups" you can use focus groups. Then some Action may be added to run only on the focus group.

Alternatively you could pass a Predicate to the Action, so that only items (= rows) matching the Predicate are handled by the Action.

I recommend to look at the demos to see how this works: for example https://github.com/prefuse/Prefuse/blob/master/demos/prefuse/demos/ZipDecode.java

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top