Articles in this section

How to restrict the elements/ objects in positive side of the Angular Diagram?

This article explains how to restrict the element/objects to the positive side of the angular diagram. In Syncfusion® Angular Diagram, it is possible to restrict the diagram elements to the positive side of the diagram by using the boundaryConstraints property of pageSettings.

By default, the boundaryConstraints property is set to “Infinity,” allowing dragging anywhere in the diagram. To restrict the diagram element to the positive side, set the boundaryConstraints to “Page” in the pageSettings, and ensure to set the width and height of the pageSettings accordingly. This ensures that the diagram elements are draggable only within the specified bounds based on the defined width and height of the diagram’s pageSettings.

Boundary constraints as Page:

 public pageSettings: PageSettingsModel = {
   boundaryConstraints: 'Page',
   width: 500,
   height: 500,
   showPageBreaks: true,
 }; 

Here, the diagram nodes are only draggable within the positive side of the diagram’s page bounds, which are set to a width of 500 and a height of 500, and we cannot drag the diagram object beyond these page bounds.

Boundary constraints as Diagram:

To confine the diagram element to the positive side within the viewport area, set the boundaryConstraints to “Diagram” in the pageSettings. In this mode, the diagram elements are draggable only within the diagram bounds.

 public pageSettings: PageSettingsModel = {
   boundaryConstraints: 'Diagram',
   width: 500,
   height: 500,
   showPageBreaks: true,
 }; 

In this setup, the diagram nodes can only be dragged within the positive side of the diagram’s boundaries, regardless of the page’s width and height.

Sample:

Refer to the working sample for additional details and implementation: Click here for sample

Conclusion

We hope you enjoyed learning about how to restrict the elements/objects in the positive side of the Angular Diagram.

You can refer to our Angular Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular 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!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied