projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.58k stars 1.17k forks source link

addLink, addAll occur error in DiagramModel #781

Open yangtop123 opened 3 years ago

yangtop123 commented 3 years ago

At DiagramModel, I'm added nodes and links. model.addAll( ...nodes, ...links ); But links are not created in DiagramModel. Only created nodes.

So I changed method to addLink. But It occur error.

I use javascript. So I can't use generic.

image

berabulut commented 3 years ago

I'm not sure that I understand your question completely and can't speak precisely but probably you are trying to add links before nodes are being created. You need to add nodes first then add links to model or use addAll only.

If it doesn't help you can provide some code and I can take a look.