Save/Load Subgraphs

Using the NodeLinkDemo45 got us a long way – it’s been awesome to use!

Now I’m trying to add subgraphs and I’m not sure what subgraph fields to bind AND I can see that the contained nodes aren’t saved, and I suspect the links are not being saved either.

Is there a sample project that saves/loads SubGraphs? Sadly, SubGraphApp45 does not.

From NodeLinkDemo (XmlSubGraphTextNode)

GoSubGraph sg = new GoSubGraph(); sg.Port = new GoPort(); t = new GoXmlBindingTransformer("SubGraph", sg); t.HandlesNamedPorts = true; // generate attributes for each of the named ports, specifying their IDs t.HandlesChildren = true; // generates children and consumes them by adding to the subgraph t.HandlesChildAttributes = true; // make sure reading/writing each child calls these Generate/ConsumeChildAttributes methods t.HandlesSubGraphCollapsedChildren = true; // generate SavedBounds and SavedPath info for children if subgraph is collapsed t.AddBinding("Text", "Text"); t.AddBinding("xy", "Position"); rw.AddTransformer(t);

Thanks, that helped a lot!

That saves the data out properly, but hit a little snag on reloading all nodes in or connected to a Subgraph are losing their labels (other custom properties are in tact).

So it appears I have to change:

t.AddBinding(“label”, “Text”);


t.AddBinding(“Text”, “Text”);

And then it all works, but this means all my saved graphs are needing a conversion. :-(

I can write the conversion, but it’d be nice if SubGraphs Transformer handled it.

Links (and their custom properties) all appear to be working fine.

Can you post a sample of your “saved” XML?

Sorry – the applied fix cleared the issue and it’s all working… and then I had a long Christmas break.

Don’t have any of the non-functional xml around any more.