anvaka / ngraph.graph

Graph data structure in JavaScript
BSD 3-Clause "New" or "Revised" License
520 stars 66 forks source link

Get link by id #48

Open fecorreiabr opened 2 years ago

fecorreiabr commented 2 years ago

Hello!

Currently it's possible to get a link from the graph through several ways:

However, there's no way to get a link by its id property, which would be useful if you store these ids externally (when the graph is created or changed) for later use.

fecorreiabr commented 2 years ago

I believe a good solution would be to make getLink/hasLink find a link from an id if only the first argument is passed. I created a pr with a proposal for this.