GraphAlchemist / Alchemy

Other
517 stars 234 forks source link

Clearing graph #563

Open gdulus opened 9 years ago

gdulus commented 9 years ago

Hey

I have an issue with clearing view port. I'm creating graph with:

alchemy.begin({"dataSource": {"nodes": [{"id": 1},{"id": 2}],"edges": [{"source": 1,"target": 2}]}})

then clearing out:

alchemy.remove.nodes(alchemy.get.nodes().all());

and then i try to redraw the same graph:

alchemy.begin({"dataSource": {"nodes": [{"id": 1},{"id": 2}],"edges": [{"source": 1,"target": 2}]}})

and at this moment exception is thrown:

Uncaught TypeError: Cannot read property '0' of undefined
    at Object.a.EdgeUtils.edgeStyle (http://cdn.graphalchemist.com/alchemy.min.js:12:7094)
    at SVGGElement.<anonymous> (http://cdn.graphalchemist.com/alchemy.min.js:12:2689)
    at http://cdn.graphalchemist.com/alchemy.min.js:6:28884
    at K (http://cdn.graphalchemist.com/alchemy.min.js:4:20968)
    at Array.oh.each (http://cdn.graphalchemist.com/alchemy.min.js:6:28859)
    at Object.c.styleLink (http://cdn.graphalchemist.com/alchemy.min.js:12:2442)
    at Object.d.createEdge (http://cdn.graphalchemist.com/alchemy.min.js:12:4093)
    at a.updateGraph (http://cdn.graphalchemist.com/alchemy.min.js:11:32052)
    at a.Create.a.nodes (http://cdn.graphalchemist.com/alchemy.min.js:11:3422)
    at a.startGraph (http://cdn.graphalchemist.com/alchemy.min.js:11:27055)
solvith commented 8 years ago

i have the same issues too