fkling / JSNetworkX

Build, process and analyze graphs in JavaScript (port of NetworkX)
https://felix-kling.de/jsnetworkx/
Other
757 stars 185 forks source link

dijkstraPath weight #76

Open cath222ou opened 5 years ago

cath222ou commented 5 years ago

Hello, I tried to use dijkstraPath with a weight. However, when I set an edge attribute as weight, I get an error 'Can not read property' toString 'of undefined'. How i can use an edge attribute for weight ?

var poidMan1 = parseInt(featureToUpdate.getProperties().ifmanuel); G.addNodesFrom(geometry); G.addEdge( start, end, { poidMan: poidMan1, } ); path = jsnx.dijkstraPath(G, {source:depart, target:arrivee, weight:poidMan });

Thanks for your help.