How do I group node across the lane


#1

I use PoolLayout. ( https://gojs.net/latest/samples/swimLanesVertical.html )

I want group nodes like this.

I think this layout needs to “group layout”.


#2

The PoolLayout is reponsible for arranging the “lanes” next to each other, with the same lengths. Each “lane” is implemented by a Group.

The PoolLayout is not responsible for positioning the nodes within the lanes/groups.

In the Swim Lanes samples, each lane/group has its own Group.layout that is responsible for positioning the nodes within the lane. Those samples use LayeredDigraphLayout, but the Kanban sample uses GridLayout. https://gojs.net/latest/samples/kanban.html

I am guessing that you want to use a special layout that keeps nodes in their assigned lanes, but still positions the nodes vertically relative to each other when there is any relationship (perhaps indirect) defined by links.

I think I have an example of that. Let me look for it or develop it anew for you, please.


#3

Ah, I found it: Alignment of nodes in Swimlane

Basically, if you have seen the Beat Paths sample, https://gojs.net/latest/samples/beatPaths.html, the same model has been augmented by having each node know which lane it belongs in by assigning each node to a group.

That results in this sample: https://gojs.net/temp/SwimLaneLayout.html.

That sample actually organizes the data into two different ways – either into 8 groups/lanes, or into 2 groups/lanes.

You just need to add the groups (lanes) to your model data, and assign each node to a group (lane). Then use the SwimLaneLayout instead of a regular LayeredDigraphLayout. The complete implementation is on that sample page.