How to Prevent Node Moving Outside the Lane in Vue Diagram?
This article explains how to prevent nodes from moving outside the lane in Vue Diagram. In the Syncfusion® Vue Diagram, you can manage the movement of nodes using Node Constraints, particularly to prevent nodes from moving outside designated lanes.
To restrict a node’s movement to only within its assigned lane, you can use the AllowMovingOutsideLane option in the node constraints. When this option is enabled, it ensures that the node can only be moved within the confines of the lane, preventing any unwanted positioning outside of it.
// Set constraints as AllowMovingOutsideLane for node
constraints: NodeConstraints.Default |NodeConstraints.AllowMovingOutsideLane
Set the constraints for the following child node.
children: [
{
id: 'node1',
annotations: [ {content: 'Nodee 1'} ],
margin: { left: 60, top: 30 },
height: 40, width: 100, ports: port,
constraints: NodeConstraints.Default |NodeConstraints.AllowMovingOutsideLane
},
]
Refer to the working sample for additional details and implementation: Click here for the sample
Conclusion
We hope you enjoyed learning how to prevent nodes from moving outside the lane in Vue Diagram.
You can refer to our Vue Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our Vue Diagram example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!