Swimband - multiple nodes in single lane

I’m using swimband in my code. I would like to add multiple level nodes in a single lane based on runtime data.


I want to add one more node after ‘OneB’ and that should come in same lane as ‘OneB’ node. Please suggest me, how to resolve this

Just to clear some confusion – “lanes” would go left-and-right in your screenshot. That’s how the links between the nodes go. The vertical columns are “bands”. In the real world, swimmers tend to stay in their lanes as they swim, just as drivers of vehicles tend to stay in their lanes when driving.

What you are seeing is that each band corresponds to exactly one layer determined by the layout. Is your layout a TreeLayout or a LayeredDigraphLayout or something else?

Did you want to insert that extra node between “oneB” and “twoA” and have it stay in the gray band “One”? So the gray band would need to be wider. And would nodes such as “twoA” and “threeC” stay in band “Two”, the light colored band?

I may have a solution for you if you can for each node specify ahead of time exactly which band you want them to be in. Let’s say you add a “band” property to each node data object in the model, and you would have an Array of all band names in a special object named “_BANDS” in the model.

Here you go: BandedLDLayout
As usual the complete implementation is in the page itself.

Thanks for the solution Walter .

We are looking for some similar. But facing the below issue in assignLayer method of BandedLDLayout


Layer property is not there in LayoutVertex class. Currently we are using gojs 2.2 version

It will be an instance of LayeredDigraphVertex.