No nodes appears in LayeredDigraphLayout when isTreeExpanded is set as false

Hi Walter,

I have a diagram when where the i am using a LayeredDiagraphLayout as in my case a child node can have multiple parent. I am also using $(“TreeExpanderButton”) button for lazy loading of nodes.

Now with this i ran into a scenario where the initial screen is rendered with tree collapsed however if i have a root node 1 linking to childnode2 and childnode3 and again there is a link back from childnode2 to root node. In this case, the diagram doesnt appear on the screen. But with similar links when i set the sTreeExpanded as true in node template, the diagram gets generated. Any help to overcome this issue.?

Problem Statement 2:

I have a two nodes with birdirectional arrow heads as they are linked among themselves. The link also contains some text to be displayed on the arrow links. But when diagram get rendered on the screen, the arrow links are displayed one over the other, hence the label over them are also overlapped which are not readable, Is is possible that labels over the arrow heads do not overlap and some how we can make them appear towards the arrow head of arrow end of the link between two nodes?

Few more question on which if i can have sample code it will be helpful

  1. Ability to multi select entities and have a dynamic context menu.
  2. Ability to render the diagram which makes visual sense from a hierarchical perspective.
  3. Highlight/Fade out some entities in the block diagram.
  4. Managing bidirectional relationships with 2 different arrows such that the labels on the arrow do not overlap.
  5. Relationship arrows/connectors should always be connecting from the bottom edge of parent entity to the top edge of the child entity.

Thanks in advance.

In the first case, it certainly doesn’t sound like you have a tree structure. So Node.isTreeExpanded would not make sense, especially if there are cycles.

You might be able to get around this problem by setting Link.isTreeLink to false on those links that point “back” up the tree, resulting in cycles. That will cause all tree-related operations to ignore those links.

For your second issue, your description seems contradictory. Do you have one link between the two nodes or two? If you have only one link, are there two labels that you want to display? If so, there are examples such as http://gojs.net/latest/samples/entityRelationship.html.

But I highly recommend that you read the Introduction pages about Links:
http://gojs.net/latest/intro/links.html
http://gojs.net/latest/intro/linkLabels.html
http://gojs.net/latest/intro/connectionPoints.html

Regarding your other issues:

  1. Yes, Diagram.selection is a Set. And see http://gojs.net/latest/intro/contextmenus.html

  2. ???

  3. You can change the GraphObject.opacity of any GraphObject. Also see http://gojs.net/latest/intro/selection.html and http://gojs.net/latest/intro/highlighting.html.

  4. Didn’t you ask this above? Or are you asking something else?

  5. The above referenced Introduction pages about Links will cover the fromSpot and toSpot concept. Note that some Layouts (including TreeLayout and LayeredDigraphLayout) will automatically set those two properties on Links, unless you disable that, so that the default values on the Node port(s) can take effect.

In any case there are lots of examples satisfying your requirements.

Were you able to figure out how to get what you wanted?

If you provided some sketches or screenshots, we might be able to answer your questions more precisely.