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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Slowness issue when having large number of the connectors

Thread ID:





145977 Jul 16,2019 01:35 PM UTC Jul 22,2019 01:12 PM UTC Angular - EJ 2 3
Tags: Diagram
Siddharth Kulat
Asked On July 16, 2019 01:35 PM UTC

Hello Sir/Madam,

We are currently using the diagram feature in our web application to draw something like floor plan. We are using around 6000 node connectors to draw the floor map. The plotting process we have done successfully, but it is taking a lot of time to load the view on website. Below are the steps what we did,

1) Getting data from the service.
2) Doing basic operations on the data in the ngOnInit() of a component.
3) Drawing the nodes using *ngFor in the component.html file.

Do you have any idea/solution to get rid of this. Because we are facing slowness issue. Please help on this.

Ramya Thirugnanam [Syncfusion]
Replied On July 17, 2019 10:55 AM UTC

Hi Siddharth,  
Please enable Virtualization Diagram Constraints in your sample as shown in below code example.  Also, we have created a sample in which we have rendered 6000 nodes and connectors.  
Code example:  
  <ejs-diagram #diagram id="diagram" width="100%" height="700px" [constraints]="constraints" [nodes]="nodes" [connectors]="connectors">   
public constraints: DiagramConstraints = DiagramConstraints.Default | DiagramConstraints.Virtualization;  
Ramya T  

Siddharth Kulat
Replied On July 17, 2019 03:03 PM UTC

Hello Sir,

Thanks for the update. Actually I want to add only the e-connectors dynamically. Please look the below code snippet,

In app.component.html file,

      <e-connector *ngFor="let coordinates of finalCordinates" [sourcePoint]='{"x":coordinates.sourcePoint.sourcePointx,"y":coordinates.sourcePoint.sourcePointy}'
        [targetPoint]='{"x":coordinates.targetPoint.targetPointx,"y":coordinates.targetPoint.targetPointy}'  [style]='{  "strokeWidth": 2,"strokeColor": "#fff","fill": "transparent","strokeDashArray": "","opacity": 1,"gradient": {"type": "Straight"}}' [targetDecorator] = '{ shape: "None" }'>

Where the finalCordinates is my input array. It Contains 6000 entries and it is taking a lot of time to render.

I have tried your solution, but it is not working. It showing the error "invalid host/origin header" in the console. I am using Angular version 7, typescript version 3.2.4 respectively.

Ramya Thirugnanam [Syncfusion]
Replied On July 22, 2019 01:05 PM UTC

Hi Siddharth,  
Thanks for your patience. 
We have applied your code in our sample to render 6000 connectors. Also, we have enabled Virtualization DiagramConstraints in the sample. The sample is working fine in our end. Could you please check in the below sample?  
Ramya T  


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