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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Connectors hard to connect to ports

Thread ID:

Created:

Updated:

Platform:

Replies:

148586 Oct 25,2019 01:58 PM UTC Mar 23,2020 06:59 AM UTC ReactJS 3
loading
Tags: ejDiagram
peter
Asked On October 25, 2019 01:58 PM UTC

Hello,


When the diagram is not zoomed enough, it is pretty hard to connect connectors. 

On the above example, each node has 16 ports. When one tries to change the connector target position to one of the 16 ports of one of the small box nodes, the connector seems to always want to connect to the top middle port of the big blue node. 

The target of the connector need to be exactly at the perfect pixel of the port to connect to it which is annoying. 

Is it possible to change the magnetism of the port so that the target of the connector connects to it if it is at say 5 pixels from it?

Thank you, 

Shyam G [Syncfusion]
Replied On October 29, 2019 05:30 AM UTC

Hi Peter, 

When we move the connector to the node for establishing connection, it will dock to the node center. If you need to connect to a port, then you should move connector exactly to the port. It is a default behavior of the diagram control. We don’t have option to establish the connection with nearest ports in nodes, while drawing the connector at runtime. 
Also, when you need only port to port connection and to disable node to node connection, please remove InConnect and OutConnect constraints from default NodeConstraints. Please refer to a code example and modified sample. 

Code example: 
const loadDiagram = () => {  
    console.log("save is", save)  
     // iterate the nodes 
    for(let i=0; i< save.nodes.length; i++) { 
      let node = save.nodes[i]; 
      // remove the connect constraints 
      node.constraints = NodeConstraints.Default &~(NodeConstraints.InConnect | NodeConstraints.OutConnect); 
    }  
    save = JSON.stringify(save) 
    diagramInstance.loadDiagram(save) 
 



Please let us know whether an above solution satisfies your requirement?  

Regards, 
Shyam G 


Amatressa
Replied On March 21, 2020 05:50 PM UTC

Hello,


When the diagram is not zoomed enough, it is pretty hard to connect connectors. 

On the above example, each node has 16 ports. When one tries to change the connector target position to one of the 16 ports of one of the small box nodes, the connector seems to always want to connect to the top middle port of the big blue node. 

The target of the connector need to be exactly at the perfect pixel of the port to connect to it which is annoying. 

Is it possible to change the magnetism of the port so that the target of the connector connects to it if it is at say 5 pixels from it?

Thank you, 

Does this solutioon worked for you 
can you help me ??








Shyam G [Syncfusion]
Replied On March 23, 2020 06:59 AM UTC

Hi Amatressa,  
 
When we move the connector to the node for establishing connection, it will dock to the node center. If you need to connect to a port, then you should move connector exactly to the port. It is a default behavior of the diagram control. We don’t have option to establish the connection with nearest ports in nodes, while drawing the connector at runtime.  
Also, when you need only port to port connection and to disable node to node connection, please remove InConnect and OutConnect constraints from defaultNodeConstraints. Please refer to a code example and modified sample.  
 
Code example:  
const loadDiagram = () => {   
    console.log("save is", save)   
     // iterate the nodes  
    for(let i=0; i< save.nodes.length; i++) {  
      let node = save.nodes[i];  
      // remove the connect constraints  
      node.constraints = NodeConstraints.Default &~(NodeConstraints.InConnect | NodeConstraints.OutConnect);  
    }   
    save = JSON.stringify(save)  
    diagramInstance.loadDiagram(save)  
   


 
 
Please let us know whether an above solution satisfies your requirement?   
 
Regards,  
Shyam G  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon