nabil6391 / graphview

Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.
MIT License
420 stars 114 forks source link

Reversing direction of arrow? (Sugiyama) #72

Open jayaxel opened 2 years ago

jayaxel commented 2 years ago

Hello! Is it possible to reverse the direction of arrows? ie. instead of the edges pointing downwards (from the top down orientation), the edges point upwards.

it's possible to hack this by reversing the orientation and source/target of nodes, but then nodes are flushed to the bottom instead, which is not I want visually.

nabil6391 commented 2 years ago

The direction of the arrows are based on the edge source and destination. If you just swap them , then you would not need to change the orientation.

jayaxel commented 2 years ago

I'm trying to get to a state where my orientation is top down, but the arrows are pointing upwards instead of down tho. Here's an illustration: This is the end state i'm looking for:

image

By placing my source and target nodes correctly, I get this

image

However, the arrows are in the wrong direction.

Flipping the source and target (orientation = ORIENTATION_TOP_BOTTOM) gives me this:

image

However, I want to position my nodes the other way around

Flipping the source and target, AND setting orientation as ORIENTATION_BOTTOM_TOP gives me this:

image

However, 2nd order nodes are now flushed to the bottom of the vis

As such, I was trying to find a way to reverse the arrows from the 2nd image above, which would give me the 1st image.

nabil6391 commented 2 years ago

I get what you mean, there is no way we can do it now, have to think of a way to do it