I am trying to make a diagram and split the diagram into multiple layers. I can add nodes to second a third layers but the double tree structure I am using losses all links between nodes. How do I keep the links between nodes in multiple layers?
How are you choosing to assign a link to a layer? If you have a tree-structure, would it make sense for each link to be in the same layer as the child node?
Hmm I may not fully understand how this works. How do I assign links in a layer? I looked at the examples and have done a few google searches but I see no mention of assigning links to a layer.
I have central diagram with all nodes linked. I have layers where nodes are present in that layer but no other layers except the main. In all layers except the main the nodes show up but there is no links being drawn between any of the nodes. I would be fine with the user having to move the nodes and manually assigning the links between them in each layer. I am unsure how to create any kind of visible link between nodes in any layer except the default layer.
Are you setting or binding Link.layerName at all? If not, the layerName will default to be the empty string, which names the default Layer. So all of your Links ought to be present. Unless maybe you are making the default Layer not visible?
If anyone needs an example of what walter meant when he said to bind to the link layer, here it is:
// define the Link template
Diagram.linkTemplate =
graphObjectMake(go.Link, // the whole link panel
new go.Binding(“layerName”, “layerName”),
{ selectable: false }, //link will not be selectable
graphObjectMake(go.Shape,
{
name: “LINKSHAPE”,
stroke: “black”,
strokeWidth: 1
} ));
var links = Diagram.links;
var link;
while (links.next())
{
link = links.value;
setLinkLayer(link, “theLayer”);
} }
function setLinkLayer(link, layerName)
{
link.layerName = layerName;
}