You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I am using ngraph.graph version ^20.0.0 as specified in my package.json.
I am creating a graph from a file planet-route-data.json like so:
importcreateGraphfrom'ngraph.graph'functionmakeTravelGraph(){constgraph=createGraph()consttravelGraphData=JSON.parse(fs.readFileSync('./src/planet-route-data.json'))// first, we create nodestravelGraphData.forEach(sourcePlanet=>{graph.addNode(sourcePlanet.name)})// then, we link themtravelGraphData.forEach(sourcePlanet=>{sourcePlanet.destinations.forEach(destination=>{graph.addLink(sourcePlanet.name,destination.name,{fuelCost: destination.cost})})})returngraph}
My planet-route-data.json file looks like this (please ignore the values themselves, haha):
However, the nodes themselves, which contain a property named links, do not seem to be updated. If I try to print them, their links property looks like an empty object: {}. If I do:
Hello! I am using
ngraph.graph
version^20.0.0
as specified in mypackage.json
.I am creating a graph from a file
planet-route-data.json
like so:My
planet-route-data.json
file looks like this (please ignore the values themselves, haha):The nodes in the graph are being created, and links seem to be created successfully -- that is, I can list them as expected with something like:
However, the nodes themselves, which contain a property named
links
, do not seem to be updated. If I try to print them, theirlinks
property looks like an empty object:{}
. If I do:nothing is iterated upon, presumably as there are no nodes with links to be found.
Is this, by any chance, by design, or is it not intended behavior?
The text was updated successfully, but these errors were encountered: