We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to cause connectors to automatically re-route around nodes dropped i their way

Hi,

In researching your release notes recently, I came across the following:

#125463, 125593, 133145, 126648, 142340, 147493, 157092, 167300, 172181, 176433, 178583 - Support to automatically re-route the line around the nodes if any nodes is found in between line is added

Does this feature address the following scenario:




In case 2 above, I moved Task 3 between the other 2 tasks - the connector did not re-route.
In case 3 I manually re-routed the connector.

Is it possible to have case 3 happen automatically?
I was hoping that is what the feature I found did.

Any suggestions?

Thanks

Jim

1 Reply

AR Aravind Ravi Syncfusion Team January 28, 2019 04:27 AM UTC

Hi Jim 
 
By using routing constraints in diagram we can able to do  Line routing for nodes. Please find the below code snippet for how to use the routing constraints.  
 
                     
              $("#diagram").ejDiagram({ 
                    nodes: nodes, 
                    width: "100%", 
                    height: "100%", 
                    enableAutoScroll: false, 
              constraints: ej.datavisualization.Diagram.DiagramConstraints.Default | ej.datavisualization.Diagram.DiagramConstraints.Routing 
                     
                }); 
                     
                 
 
 
 
We have created a simple sample for your requirement . Please find the sample in below playground link 
 
 
For more information about diagram constraints please find below UG documentation link  
 
 
If you want routing for only specified connector instead of whole diagram means then you can define routing for only specified connector through connector constraints. Please find below code snippet for how to enable routing for specified connector. 
 
            var connector = { 
                name: "connector1", 
                sourcePoint: { x: 100, y: 100 }, 
                targetPoint: { x: 200, y: 200 }, 
                constraints:                                         ej.datavisualization.Diagram.ConnectorConstraints.Default | ej.datavisualization.Diagram.ConnectorConstraints.Routing 
              }; 
 
 
 
For more information about  connector constraints please find below UG documentation link  
 
 
Note: Routing does not support for the nodes inside the swimlane 
 
Regards 
Aravind Ravi 
 
 
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon