How do I get the start node for a GoDoc?

I am trying to create my own persistence in a database. I had two questions:

  1. How do I determine the start node for a GoDoc without having to determine which GraphNode has no pidin? After using the ProtoApp sample, I was convinced that the order in which the Store method writes the xml file is based on the order in which the Icon/text nodes are dragged & dropped. So if I dragged the first node last it is last in the iteration of the collection.
  2. From a given node how can I determine which is the next node without having to look at the link from's and to's?
Any input will be greatly appreciated!

Thank you

  1. I don’t think there’s any shortcut here–if you need the “start node”, you’ll need to figure it out for the kind of graph that your document has. Remember that some graphs might have multiple “start nodes”, and some might not have any.
  2. If you are depending on links to determine the order of nodes, then you can just iterate over the GoNode.Destinations (or GoNode.Sources, if you are going in the opposite direction). Of course, since there could well be more than one node in the Destinations enumerable (or none), you’ll need to decide which one to consider the “next” one.

Walter, thank you! I got it to work. GoDiagrams is really working out great for our project.

Thanks again!