anvaka/ngraph.graph

Get link by id

fecorreiabr opened this issue · 1 comments

Hello!

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

  • using getNode and iterating over the links property
  • via getLinks and getLink
  • via nodes and links iterators

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.

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.