Hello,
I have a graph where I allow the user to swap the graph layout as they choose, as well as add / remove nodes to and from the graph in an adhoc manner.
This works very well under most situations, but I am having a problem with using the CircularLayout.
When I swap to the Circular layout with more than 1 node and link in the model, the layout shows fine. I can add more nodes to the layout and the update is as expected. However, if I send 1 node only to the layout, that single node appears correctly, but any subsequent items sent to it do not show at all (the complete graph is now blank, although the model still contains all the bits I would expect - I can also swap back to a ForceDirected or Grid Layout and see all of the items). There is no obvious exception being thrown.
Using a custom circular layout so that I could get some debug statements out, I see the following behaviour in the layout (the number in brackets is the number of times the method is called in a row) :
//initial swap from a force directed graph (20 nodes, 19 links) - all looks good
Invalidate
CanLayoutPart (6)
DoLayout
MakeNetwork
CanLayoutPart (42)
LayoutNodesAndLinks
LayoutNodes
LayoutLinks (2)
//replace the items that are showing with a single node - that node appears okay
Invalidate (40)
DoLayout
MakeNetwork
CreateNetwork
CanLayoutPart (3)
// replace the single showing node with 5 other nodes - now the complete graph is blank
Invalidate (5)
DoLayout
Can anybody suggest what I should do to get the graph showing?
thanks you, Sean