Connector lines are overlapping nodes in diagram

Hi team,

I am implementing a Syncfunction diagram, but the connector lines are overlapping nodes. Could you guy help me with that? I put a screenshot & code below.

Thank you in advance!

Image_3177_1742514817249

import { createRoot } from 'react-dom/client';
import * as React from 'react';
import {
  ComplexHierarchicalTree,
  DataBinding,
  LineDistribution,
  DiagramComponent,
  ConnectionPointOrigin,
  Inject,
  DiagramConstraints,
  LineRouting,
  SnapConstraints,
  ConnectorBridging
from '@syncfusion/ej2-react-diagrams';

import { registerLicense } from '@syncfusion/ej2-base';
registerLicense(
  ''
);

function diagramTemplate(props) {
  return (
    <div
      style={{
        border: '1px solid black',
        height: '100%',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
      }}
    >
      abc
    </div>
  );
}

const nodes = [
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-9c05060d-8ff5-457e-bb69-b9f81039def5',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-5fc2fd4e-d9e3-4969-92ec-af696bc95c2d',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-7861f5e5-9bc8-4ca3-9c9d-5985f15c1386',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-03319bb8-4ad1-4bc9-b71f-585f784cf721',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-aefb689a-8dca-4a65-b93e-8842e7c24d72',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-1ea3088d-af9d-4e13-8db2-61bfd237bd5c',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-641308cf-e1e0-42d0-8199-3f9d45225334',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-f8a2a41b-e992-460e-91b2-5abdcceed7a6',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-3c56a5ff-1f00-4ba6-9e45-9a3075068b59',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-32aa00e9-125f-4925-b527-aa74a1d54721',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-52932097-4c9d-459d-9fcf-7e3742973ee0',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-272b5692-982d-4d34-a0ce-a7e46ee09b92',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-97717e2b-0360-4d6b-899a-5125e266fe97',
  },
  {
    width: 170,
    height: 50,
    shape: {
      type: 'HTML',
    },
    id: 'node-51fae793-1f2b-49ee-9cac-2cb2cebf695a',
  },
];

const connectors = [
  {
    sourceID: 'node-9c05060d-8ff5-457e-bb69-b9f81039def5',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-5fc2fd4e-d9e3-4969-92ec-af696bc95c2d',
    id: 'connector_1',
  },
  {
    sourceID: 'node-9c05060d-8ff5-457e-bb69-b9f81039def5',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-7861f5e5-9bc8-4ca3-9c9d-5985f15c1386',
    id: 'connector_2',
  },
  {
    sourceID: 'node-03319bb8-4ad1-4bc9-b71f-585f784cf721',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-aefb689a-8dca-4a65-b93e-8842e7c24d72',
    id: 'connector_3',
  },
  {
    sourceID: 'node-03319bb8-4ad1-4bc9-b71f-585f784cf721',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-1ea3088d-af9d-4e13-8db2-61bfd237bd5c',
    id: 'connector_4',
  },
  {
    sourceID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-f8a2a41b-e992-460e-91b2-5abdcceed7a6',
    id: 'connector_5',
  },
  {
    sourceID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-272b5692-982d-4d34-a0ce-a7e46ee09b92',
    id: 'connector_6',
  },
  {
    sourceID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-3c56a5ff-1f00-4ba6-9e45-9a3075068b59',
    id: 'connector_7',
  },
  {
    sourceID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-9c05060d-8ff5-457e-bb69-b9f81039def5',
    id: 'connector_8',
  },
  {
    sourceID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-32aa00e9-125f-4925-b527-aa74a1d54721',
    id: 'connector_9',
  },
  {
    sourceID: 'node-52932097-4c9d-459d-9fcf-7e3742973ee0',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    id: 'connector_10',
  },
  {
    sourceID: 'node-52932097-4c9d-459d-9fcf-7e3742973ee0',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-9c05060d-8ff5-457e-bb69-b9f81039def5',
    id: 'connector_11',
  },
  {
    sourceID: 'node-272b5692-982d-4d34-a0ce-a7e46ee09b92',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-03319bb8-4ad1-4bc9-b71f-585f784cf721',
    id: 'connector_12',
  },
  {
    sourceID: 'node-97717e2b-0360-4d6b-899a-5125e266fe97',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-51fae793-1f2b-49ee-9cac-2cb2cebf695a',
    id: 'connector_13',
  },
  {
    sourceID: 'node-97717e2b-0360-4d6b-899a-5125e266fe97',
    type: 'Orthogonal',
    cornerRadius: 5,
    targetDecorator: {
      shape: 'Arrow',
      height: 7,
      width: 7,
    },
    style: {
      strokeColor: '#6d6d6d',
    },
    targetID: 'node-e7b98adf-dcbc-4576-a96d-acf4ca523964',
    id: 'connector_14',
  },
];
function ComplexHierarchicalModel() {
  const diagramInstance = React.useRef(null);
  function rendereComplete() {
    if (diagramInstance.current) {
      diagramInstance.current.fitToPage();
    }
  }
  return (
    <div className="control-pane diagram-control-pane">
      <div className="col-lg-8 control-section">
        <div className="content-wrapper" style={width: '100%' }}>
          <DiagramComponent
            id="diagram"
            ref={(diagram=> (diagramInstance.current = diagram)}
            width={'100%'}
            height={580}
            layout={{
              type: 'ComplexHierarchicalTree',
              connectionPointOrigin: ConnectionPointOrigin.DifferentPoint,
              horizontalSpacing: 40,
              verticalSpacing: 40,
              orientation: 'TopToBottom',
              margin: { left: 10right: 0top: 0bottom: 0 },
            }}
            // snapSettings={{ constraints: 0 }}
            nodeTemplate={diagramTemplate}
            nodes={nodes}
            connectors={connectors}
            created={rendereComplete}
            snapSettings={constraints: SnapConstraints.None }}
              constraints={DiagramConstraints.Default | DiagramConstraints.LineRouting | DiagramConstraints.Bridging }
          >
            <Inject
              services={[
                DataBinding,
                ComplexHierarchicalTree,
                LineDistribution,
                LineRouting,
                ConnectorBridging
              ]}
            />
          </DiagramComponent>
        </div>
      </div>
    </div>
  );
}
export default ComplexHierarchicalModel;




21 Replies 1 reply marked as answer

MJ Meriton Jamesdurai Syncfusion Team March 21, 2025 01:51 PM UTC

Hi Lia,

 

Thank you for bringing this to our attention. We have successfully replicated the issue you’re facing, where the connector lines are overlapping the nodes in your diagram.

After investigating, we found that this can be resolved by enabling the enableRouting property within the layout settings. This ensures that the connectors automatically avoid nodes and route properly around them.

Once you set enableRouting to true, the connectors will be routed correctly, and the overlapping issue will be resolved.

For your reference, please check the updated sample and UG documentation.
Sample - 36knoyes (forked) - StackBlitz

UG doc - https://ej2.syncfusion.com/react/documentation/diagram/complex-layout#enable-routing-for-layout

Please let us know if you need any further assistance!

 

Best regards,

Meriton

 



LT Lia Tran replied to Meriton Jamesdurai March 25, 2025 08:01 AM UTC

Hi Meriton,

Your suggestion solved my problem.

Thank you for your help! Wishing you a great workday!



PR Preethi Rajakandham Syncfusion Team March 26, 2025 06:58 AM UTC

Hi Lia Tran,

You are welcome. 

We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out. 

Regards,

Preethi R



LT Lia Tran April 1, 2025 09:13 AM UTC

Hi team,

Continue working with the sample you sent, I found that if there is no connectors, nodes will overlap each other (please refer to attached screenshot).

How can I fix it?

Thank you!


Image_2833_1743498721715



MJ Meriton Jamesdurai Syncfusion Team April 2, 2025 12:02 PM UTC

Hi Lia Tran,


Thank you for reporting the issue.

We were able to replicate the problem on our end where nodes overlap when there are no connectors. Our team is currently validating the issue, and we will get back to you as soon as possible.

We appreciate your patience. Please let us know if you have any further queries.


Best regards,
Meriton




LT Lia Tran April 3, 2025 02:59 AM UTC

Hi Meriton,

This is an important issue since our diagram may contain multiple independent nodes that aren't connected to others. I’d really appreciate your solution as soon as possible.

Thanks a lot!



MJ Meriton Jamesdurai Syncfusion Team April 4, 2025 02:05 PM UTC

Hi Lia Tran,


If the connector collection is empty, we recommend setting the enableRouting property in the layout settings to false. This will prevent nodes from overlapping during layout rendering.

However, we are actively working on a fix to handle this scenario even when enableRouting is set to true, ensuring proper node placement regardless of connector availability


Please let us know if you need any further assistance in the meantime.


Best regards,
Meriton




LT Lia Tran April 7, 2025 07:27 AM UTC

Hi Meriton,

Thank you for your response.

The issue causing independent nodes to overlap is due to setting enableRouting = true, which is intended to prevent connectors from overlapping nodes.

Unfortunately, we need both issues to be resolved, as they are affecting our UI.

I’d like to know if this bug is relatively simple and can be fixed soon, as we are approaching our app’s release date. If it can’t be resolved in time, we may need to look for an alternative solution.

Thank you very much, and I look forward to your response!

Kind regards,

Lia



MJ Meriton Jamesdurai Syncfusion Team April 8, 2025 02:35 PM UTC

Hi Lia Tran,

 

Reported Issue:  Independent nodes get overlapped in complex hierarchical tree layout

 

We can reproduce the issue and confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on April 29th 2025 weekly patch release.

 

Feedback link: Independent nodes get overlapped in complex hierarchical tree layout in React | Feedback Portal

 

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

 

Best Regards,

Meriton



LT Lia Tran April 10, 2025 01:25 AM UTC

Hi Meriton,

Thank you for the prompt update and for confirming the issue.
We appreciate your support and look forward to the release.

Best regards,
Lia Tran



LT Lia Tran April 10, 2025 01:25 AM UTC

Hi Meriton,

Thank you for the prompt update and for confirming the issue.
We appreciate your support and look forward to the release.

Best regards,
Lia Tran



MJ Meriton Jamesdurai Syncfusion Team April 29, 2025 10:52 AM UTC

Hi Lia Tran,


We have resolved the reported issue "Independent nodes get overlapped in complex hierarchical tree layout", but due to additional testing on related scenarios, the fix could not be included in the latest weekly release. In the meantime, we have provided a custom patch, and the fix will be included in our upcoming weekly release which is scheduled to release on May 06, 2025.

We apologize for any inconvenience this may have caused and appreciate your understanding.


Best Regards,

Meriton


Attachment: syncfusionej2diagrams29.1.40_56be43b5.zip


LT Lia Tran May 2, 2025 02:41 AM UTC

Hi Meriton,

Thank you for the update and for providing the custom patch in the meantime.

I appreciate your team’s efforts in addressing the issue and thoroughly testing related scenarios.

Looking forward to the upcoming release on May 06.

Best regards,
Lia Tran



LT Lia Tran May 2, 2025 02:41 AM UTC

Hi Meriton,

Thank you for the update and for providing the custom patch in the meantime.

I appreciate your team’s efforts in addressing the issue and thoroughly testing related scenarios.

Looking forward to the upcoming release on May 06.

Best regards,
Lia Tran



PR Preethi Rajakandham Syncfusion Team May 2, 2025 06:04 AM UTC

Hi Lia Tran,

Thank you for your valuable feedback. As promised, the fix will be included in our upcoming weekly release which is scheduled to release on May 06, 2025. 

Regards,

Preethi R



MJ Meriton Jamesdurai Syncfusion Team May 7, 2025 02:44 PM UTC

Hi Lia Tran,


We apologize for the inconvenience caused. After addressing the fix, we encountered some failures in our automation tests. We are currently addressing the issue and will include the fix in our 2025 Vol 2 Service Pack release, which is rolled out on May 14, 2025.
Thank you for your patience and understanding.

Best regards,
Meriton



MG Moulidharan Gopalakrishnan Syncfusion Team May 15, 2025 09:35 AM UTC

Hi Lia Tran,


Reported Issue:  Independent nodes get overlapped in complex hierarchical tree layout


Feedback Link: https://www.syncfusion.com/feedback/66847/independent-nodes-get-overlapped-in-complex-hierarchical-tree-layout


We are glad to announce that our Essential Studio® 2025 Volume 1 Service Pack Release v29.2.4 is rolled out and is available for download under the following link.


Essential Studio® 2025 Volume ... | Announcements Forums | Syncfusion®


We have fixed the reported issue and included In this release. We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Root cause: The independent nodes are not considered root nodes due to a condition that requires nodes to have more than zero outgoing edges.

Regards,

Moulidharan


Marked as answer

LT Lia Tran May 16, 2025 08:04 AM UTC

Hi Moulidharan,

Thank you for the update!



PR Preethi Rajakandham Syncfusion Team May 19, 2025 07:03 AM UTC

Hi Lia Tran,

You are welcome. Please let us know if you require any further assistance on this. We will be happy to assist you.

Regards,

Preethi R



LT Lia Tran June 10, 2025 07:26 AM UTC

Hi Preethi,

I’ve recently upgraded from version 28.2 to 29.2, but I’ve noticed that rendering has become extremely slow compared to v28, even though my code remains exactly the same—only the library version has changed.

With just a few dozen interconnected nodes, I sometimes have to wait up to 10 seconds for the render to complete.

I'd like to ask if this is a known issue that has already been reported, or if this might be specific to my case.

Also, do you have any suggestions or best practices to improve rendering performance in version 29.2? I'm open to refactoring or configuration tweaks if that would help reduce the loading time. Thanks again!

Thank you!



MJ Meriton Jamesdurai Syncfusion Team June 11, 2025 07:02 AM UTC

Hi,


A new forum has been created for your query. Please follow the link below to track updates and responses.

 

Forum link - Performance issue in version 29... | React - EJ 2 Forums | Syncfusion®

 

Regards

Meriton


Loader.
Up arrow icon