react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

PathFindingLink aka SmartRoute doesn't create when user adds new links between nodes

Open DanieLazarLDAPPS opened this issue 7 years ago • 2 comments

Smart routing demo creates a default new link, not PathFinding. I am not sure how the new interface should look like but I think there should be again class "PathFingindPortModel" inherit from DefaultPortModel and overrides createLinkModel should return new PathFindingLinkModel() ?? Or is it designed in a different way ?? It is a little bit confusing for people who want to be inspired by this demo.

DanieLazarLDAPPS avatar Aug 12 '19 10:08 DanieLazarLDAPPS

Ah I see, there is a new way how to put link instance to link function of DefaultPortModel. But anyway when a new link is created using port DefaultLinkModel is used. @dylanvorster So we have to create a class as I mentioned in the issue description. Maybe DefaultPortModel should have link type in the constructor to override the link type.

DanieLazarLDAPPS avatar Aug 12 '19 10:08 DanieLazarLDAPPS

the constructor could be a good way to do that, but your explanation of creating your own port widget is the correct approach I would use :)

dylanvorster avatar Aug 12 '19 22:08 dylanvorster