The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am generating a diagram programmatically and now getting this quite often: TypeError: undefined is not an object (evaluating 'layout.levels[intersect[0]].rBounds')
it happens on layout and also when I select the diagram.
Any idea what causes this? Really annoying it keeps doing this.. and no real indication of what it could be.
I am using the diagramInstance.addNode and diagramInstance.addConnector APIs. Is there something I should watch out for when using the APIs?
SGShyam G Syncfusion Team November 6, 2019 07:03 AM UTC
Hi Raphael,
Please use diagram add method to add a node/connector at runtime. Also, you should not change the node/connector id property at runtime. We have created a sample in which we have added node and connector at runtime. Could you please check in the below sample? Still if you face any issues, please share us more details such as modify the below sample.
Ok... after many hours of comparing and copying code.. I am able to reproduce the error in your example. Very painful to track down.
simply add constraints to the diagram . and it will throw the error I am getting. I was trying to add the virtualization constraint as in my other note
please help!!
Error occurred:
undefined is not an object (evaluating 'e.width.toString')
so I added this from the other examples you shared on enabling virtualization:
and of course add DiagramConstraints to the inport
additionally.. I enhanced your demo to draw 100 nodes on each click... not sure if that makes a difference
drawNode(){
for(let index =0; index <100; index++){
nodeId+=1;
let node ={
id:'newNode'+nodeId,
width:100,
height:100,
annotations:[{ content:'newNode'+nodeId }],
offsetX:200,
offsetY:200};
diagramInstance.add(node);
}
}
SGShyam G Syncfusion Team November 8, 2019 04:40 PM UTC
Hi Raphael,
We have logged “Exception raised while adding node at runtime by enabling virtualization” as a defect. The fix for this issue is estimated to be available on 27th November, 2019.
You can track the status of the issue from the below feedback link.