I am having trouble creating a subgraph for a node in a flowchart diagram that is created from XML. I am using the GoLayoutLayeredDigraph to create flow charts from XML source. It is all working pretty well but, now I am trying to create subgraphs that are attached to certain nodes. Here is what I would like to have:
and here is what I am getting:
Here is the code I have in my XMLTransformFlowChartNode.vb code:
Public Overrides Sub ConsumeChild(ByVal parent As Object, ByVal child As Object)
Dim p As FlowNode = CType(parent, FlowNode)
If p.HasSubGraph Then
Dim sg As GoSubGraph = p.FindChild(“subGraph”) 'Has subgraph been added yet?
If sg Is Nothing Then 'If not, then add it
sg = New GoSubGraph()
Dim c As FlowNode = CType(child, FlowNode)
Dim doc As GoDocument = CType(Me.Reader.RootObject, GoDocument) doc.Add(c) Else MyBase.ConsumeChild(parent, child) Dim c As FlowNode = CType(child, FlowNode) Dim doc As GoDocument = CType(Me.Reader.RootObject, GoDocument) doc.Add(c) End If End Sub
The code runs without error and it appears that the nodes representing “a” and “b” from the illustrations above are being added to the subgraph. But when the diagram is drawn, they appear as normal children of the node that contains the subgraph.
Is this a Layer issue? Or do I misunderstand the subgraph functionality all-together?
Thanks for any help you can provide.