dagrejs/dagre

dagre layout can't fetch edges

silentmissile opened this issue · 1 comments

in layout() function in @dagrejs/dagre

inputGraph.edges().forEach(e => {

inputLabel and layoutLabel are two strings

in line 86, the code assign "points" property to string, that code can't run, the error message is:

TypeError: Cannot create property 'points' on string "my-label"

If graph.setEdge has a 3rd argument, it's used as the edgeLabel, so edge didn't always return a string and in the Dagre tests, an object was used for the label.

Regardless, I added an edgeAsObj function in Graphlib and used that in layout.js. Both libraries have been released to NPM.