How to make the nodes in the lane only stay in the swimlane without exceeding the swimlane width when adjusting the swimlane width ?

When I adjust the width of the swimlane, sometimes the node is separated from the swimlane, such as the situation in the gif below :

https://drive.google.com/file/d/1vbiz-2aZVToFyL0XwzqwlfiGQAnXxj6K/view?usp=sharing

It can be seen that when adjusting the length of swimlane, the node is directly excluded from the lane.




6 Replies

DT Deepa Thiruppathy Syncfusion Team June 28, 2022 11:35 AM UTC

Hi Tealer,


We are checking on your requirement. We will update the more details on June 29, 2022.


Regards,

Deepa Thiruppathy



KR Karkuvel Rajan Shanmugavel Syncfusion Team June 29, 2022 11:31 AM UTC

Hi Tealer,


Requirement: Lane children stay in the same lane while adjusting swimlane height.


In SfDiagram, if we placed a child in the lane of a swimlane, then the size of the lane in the swimlane will not go beyond the size of the child's bounds. So, your requirement is the basic behavior of the lane. But in the provided .gif, you are adjusting the height of the lane beyond its children's bounds. So, we suspect that you have implemented any sample level codes for this behavior, or the node in the lane is not added as a child for the lane. So, please validate the implemented codes or modify the already provided sample to reproduce the issue on our end. This will help us to provide a proper solution for your requirement.


Regards,

Karkuvel Rajan S



TE tealer June 30, 2022 01:23 AM UTC



DT Deepa Thiruppathy Syncfusion Team June 30, 2022 11:51 AM UTC

Hi Tealer,


We have validated the sample. You have used Custom resizing for LPR node alone. So capacitor remain same in position. Please refer below code snippet,


Code snippet:


public class CustoLaneVM : LaneViewModel

{

    double previousHeight;

    protected override void OnPropertyChanged(string name)

    {

        base.OnPropertyChanged(name);

        if (name == "UnitHeight")

        {

            //finding differnce between current lane height and previous height.

            double heightDifference = this.UnitHeight - previousHeight;

            // 修复调整的高度过低报错问题

            var skipResizing = (this.Children as LaneChildren).Any(e => (e as INode).UnitHeight + heightDifference < (e as INode).MinHeight);

            if (skipResizing)

            {

                this.UnitHeight = previousHeight;

            }

            else

            {

                foreach (NodeViewModel node in this.Children as LaneChildren)

                {

                    // 只有搜索到LPR node时候才会拉伸节点

                    if (node.Key.ToString() == "LPR" || node.Key.ToString() == "NO_Block1")

                    {

                        //updating height difference to lane's child node and updating OffsetY position according to that.

                        node.LaneOffsetY += (heightDifference * 0.5);

                        node.OffsetY += (heightDifference * 0.5);

                        node.UnitHeight += heightDifference;

                    }

                }

            }

        }

        previousHeight = this.UnitHeight;

    }

}


Regards,

Deepa T



TE tealer replied to Deepa Thiruppathy July 1, 2022 12:31 AM UTC

Thank you for solving my problem !



DT Deepa Thiruppathy Syncfusion Team July 1, 2022 05:43 AM UTC

You are welcome. Please let us know if you require any further assistance.


Loader.
Up arrow icon