Articles in this section

How to Prevent Multiple Connectors From a Port in Angular Diagram?

In this article, you can learn about how to prevent multiple connectors from a port in Angular Diagram. To prevent a connector from being drawn from a port that already has a connector connected to it in Angular Diagram, you can use the elementDraw event. This event is triggered when a connector is being drawn from a port.

By examining the arguments of the event, we can check for existing connections and cancel the drawing if the port is already connected.

Below is an example of how to implement this functionality:

public elementDraw(args: any): void {
   if (args.state == 'Start') {
     let ports = args.source.ports;
     if (ports && this.diagram.nodes !== undefined) {
       for (let j = 0; j < ports.length; j++) {
         let port = ports[j];
         if (port && (port.outEdges.length > 0 || port.inEdges.length > 0)) {
           args.cancel = true;
         }
       }
     }
   }
 } 

Sample: Multiple Connectors

Conclusion

We hope you enjoyed learning how to drag the Swimlane by selecting the lane in the Angular Diagram.

You can refer to our Angular 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 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 explore 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