Hi !
The addLink function creates nodes if they do not exist. The data parameter of this function attaches ... data to the link. But what about created nodes ? They are created without data. Why not having created a function addLink with 3 data: one for the link, one for the "from" node and the last for the "to" node. I think you create Node with data before or after adding links but this is error prone in the case we forget some nodes.
Hi ! The
addLink
function creates nodes if they do not exist. The data parameter of this function attaches ... data to the link. But what about created nodes ? They are created without data. Why not having created a function addLink with 3 data: one for the link, one for the "from" node and the last for the "to" node. I think you create Node with data before or after adding links but this is error prone in the case we forget some nodes.Thx !