How to cancel the link when it is not connected between two ports?

Hi,

I noticed that the sample Flow Chart Flowchart has a great feature: when the link is not connected between two ports, the link will be deleted automatically.
I tried to understand the coding of that, but I didn’t find the place correspoding to this feature.

Thanks a lot~

See GoJS Validation -- Northwoods Software.

I have read the link, but I what I want is that if the link are not meaningful(which means it starts from any port but not ends at any port), I think the link says something about setting specific from and to. But actually, I want all nodes be both from and to.

Any othe ideas?

That is discussed in that page about linking validation. Basically, just set fromLinkable and toLinkable to true on the main port of each node.

Or set those two properties on the whole Node. But then you will probably want to set them to false on some of the GraphObjects inside your nodes, so that the user can select or manipulate them rather than only starting to draw a new link from them.