I am new to Prefuse. The demo examples are all loaded data from a file/database. Is there any way to create the data dynamically instead of loading from file. For example, I want to create a tree data structure and visualize this. Any simple working example would be really helpful for me.
相关问题
- How to determine +/- sign when calculating diagona
- Seaborn HeatMap - How to set colour grading throug
- Direction of tick marks in matplotlib
- Adjacency list with O(1) look up time using HashSe
- Broken axis in Google charts
相关文章
- Mercurial Commit Charts / Graphs [closed]
- Sankey diagrams in Python
- Java: Traveling Salesman - Found polynomial algori
- Generating a Voronoi Diagram around 2D Polygons
- How to calculate the best price [duplicate]
- How to plot CCDF graph on a logarithmic scale?
- Battery graph in android using GraphView library?
- Python/NetworkX: calculate edge weights on the fly
I've just been attacking this problem. Here's a tweaked version of
Example.java
which shows one way to make it happen.Instead of loading data from
socialnet.xml
, I'm generating it programatically (based onAggregate.java
but without the aggregation stuff) and adding one field to eachNode
and eachEdge
. TheNode
field is a simple boolean flag which controls the colour it's rendered; theEdge
field is a label - but it's not being rendered yet. I'm still working on that one! :-)The question-specific code is in
makeGraph()
. The basic approach is to create aTable
(well, one each for nodes and edges), and add columns to those tables defining the shape of the data; then when you add your nodes and edges, you can add the corresponding data. One gotcha is that for edges you must include columns for the edge's source/target nodes - see theGraph
andTable
documentation for more details. There are other ways to do this (e.g. involvingSchema
) but I haven't sussed them out yet.Hope this helps.