Combining Circular Layouts

I am trying to evaluate if GoJS can satisfy our diagramming needs. We are trying to create a circular visual consisting of primary nodes and secondary nodes. Here is a rough example of what we are trying to implement.

In this example the primary nodes are the central points of each cluster and the secondary nodes are laid out in a circular pattern around each primary node which are in turn arranged in a circular pattern around the middle of the visual.

To implement this I was thinking of either using ForcedDirectedLayout or the CircularLayout or some combination of the two. My question is using just the CircularLayout is it possible to nest the layout in a such a way that each node of the primary layout has a secondary layout of nodes around it. If so, how would I accomplish this? If this isnt possible then what would be the best method to implement the above example?

Thanks!

Edit 1: After continuing to read the documentation on the website I found Groups. Assuming I read this correctly would it be possible to embed a circular layout into a Group so that sub nodes are arranged around the primary node. Then I could simply just lay the primary nodes out as a circular layout. Am I going down the wrong track here or would this potentially work for my needs?

Yes, you could use groups. But you don’t have to – use ArrangingLayout instead: https://gojs.net/latest/extensionsJSM/Arranging.html and https://gojs.net/latest/api/symbols/ArrangingLayout.html

You probably want ArrangingLayout.primaryLayout to be a ForceDirectedLayout (or maybe a CircularLayout that also puts a node in the center, as does https://gojs.net/latest/samples/arrowheads.html ) and ArrangingLayout.arrangingLayout to be a CircularLayout.

1 Like

Thanks, that cleared up what I need to do immensely. Also, I’m guessing that if we needed the capability to collapse the subgroups of nodes that would be when we want to use groups and subgraphs?

Yes, that would make sense – it would be easy to implement that way.

But even then groups might not be necessary, depending on what you want to do. For example, if your subgraphs are actually tree-structured, you could tree-collapse the root node.

1 Like