panthernet/GraphX

Reresh the graph

jakubkrzysztofsikora opened this issue · 3 comments

Hey! First: Good work, keep it up, man. Second: I can't seem to find any method to refresh the graph after deleting a vertex or edge. Could you point me out how to do it, becasue after I call my methods to delete vertex/edge nothing happens. Relayout doesn't do the trick.

Hi! You should use GraphArea::RemoveEdge and RemoveVertex methods to delete vertices and edges because there are some additional logic associated with this procedures. With these methods you can remove visual or visual+data.

Okay, thanks, you're right. What about when I want to add a vertex to a certain place in the graph? I've managed to add the vertex and after regenereting the graph its there, but what I would need is adding the vertex to the certain place without changing the layout of the whole graph. Is that possible now or maybe you could point me how could I achieve that by overloading some method?

Again, you have to use AddVertex/AddEdge methods and then use VertexControl::SetPosition() method to set the coordinates.