Forums

Full Version: CricleLayout with root node in center
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good morning folks,

here comes a simple one. This demo applies the newly developed RootInCenterCircleLayout, which is a small modification of the original CircleLayout of the flare lib. This new layout places the root node of the graph at the center of the layout while the other nodes are placed in a circle as in the original layout.

[attachment=220]

cheers

ps.: Used in the current version of the Genealogy of Influence viewer


requires flare version 2008.07.29 or higher

Guest

I'm in Flex Builder 3, using prefuse.flare-alpha-20080808. I get the following error messages for this example:

1119: Access of possibly undefined property isNodeSprite through a reference with static type Class.
AnimalWebDemo/src
AnimalWebDemo.as line 90

1137: Incorrect number of arguments. Expected no more than 1.
AnimalWebDemo/src
AnimalWebDemo.as line 90


34all Wrote:Good morning folks,

here comes a simple one. This demo applies the newly developed RootInCenterCircleLayout, which is a small modification of the original CircleLayout of the flare lib. This new layout places the root node of the graph at the center of the layout while the other nodes are placed in a circle as in the original layout.



cheers

ps.: Used in the current version of the Genealogy of Influence viewer


requires flare version 2008.07.29 or higher

Guest

oops! sorry, posted to the wrong thread!
Hi Gabe

Gabe's AnimalWebDemo is not compatible with the latest flare version any more. For the error you reported you would have to remove the first argument, which is assumingly the visualization, and exchange the isNodeSprite function with the NodeSprite class. But I am not exactly sure how the AnimalWebDemo looks like. And I guess there are more things in that demo which have to be changed so that they fit to the latest flare release.


cheers

maritn

(I will move your thread later ....)
Hi Martin,
great example!
i wanted to ask: in all examples the edges going out from the middle of the node.
is there a way i can make a ports for the "edges holes". ( Like MS visio - that there are 4 ports in the rectangle)
i want the out going edge and the incoming edge won't end-up \ start-in the same hole.
i read in GraphML site about Ports attribute.
is there any implementation of this in flare?
Thanks!
Hi Xperetz,

hope you are well. I haven't heard of anyone implenting ports so I am afraid you would have to implement that yourself. But it shouldn't be that difficult. You might have a look how the flare EdgeRenderer draws ArrowEdges. It determines the intersection point of the line between node center and node center and the bounding box of the node and then uses this intersection point as the end poit of the arrow. So in your case even more easy, you could just use the port attribute and draw the edge to that point. Ther flare EdgeRenderer is actually not that complicated so it should be not too difficult to adjust it to your needs

cheers

martin
hi martin,
i did manage to set ports on the source and target nodes.
my problem is with the arrow render.
it renders to the worng location
i think im missing something here:
can u please point me in "GRCEdgeRenderer.as" to the starting point of the arrow.
i just cant find it
i attach screenshoot + the file!
thanks man,
avi
Hi Avi,

the ports look great. For the arrow heads look for

Code:
// get arrow tip point as intersection of edge with bounding box
if (t==null) {
    _p.x = x2; _p.y = y2;
} else {
    var r:Rectangle = t.getBounds(t.parent);
    if (Geometry.intersectLineRect(xL,yL,x2,y2, r, _p,_q) <= 0)
    {
        _p.x = x2; _p.y = y2;
    }
}

and just replace the else case with setting _p.x,_p.y to the respective port coordinates. I might be wrong of course but I think this should make it.

Once things work out it would be really great if you could make a complete demo and post it as a separate thread. For sure many flare users would be grateful to get this feature.

Thanks

martin
Hi martin,
great advice!
thanks.
i fixed the problem.
u gave me 60% of the solution, and manage with the rest
im now at work. i promiss later today ill upload a nice demo ( and even spider web)
thanks.
avi
Hi Everyone - Glad to stumble across this forum; Flare would be a lot more difficult without this resource to get some examples from.

I wanted to ask about the ExtendedEdgeRenderer class' reference to flare.vis.util.Arrows. Couldn't see if there was a work around for this since it does not appear to be in the latest build (the alpha release: 080808)

Am I missing something?

Again, thanks for the help!
Reference URL's