anvaka / ngraph.graph

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

Update data property of Node #46

Closed guplersaxanoid closed 2 years ago

guplersaxanoid commented 2 years ago

Is it possible to reassign a different value to Node.data property after initial assignment?

guplersaxanoid commented 2 years ago

I see that addNode() simply updates the node data if a node with given NodeId already exists: https://github.com/anvaka/ngraph.graph/blob/c9a891baeaa6029ee5acfd6ee7955899396a7bc6/index.js#L309

this wouldn't alter the links from/to the node would it ?

anvaka commented 2 years ago

No, links are stored separately