flutter_graphite icon indicating copy to clipboard operation
flutter_graphite copied to clipboard

Alignment of Nodes (Parent and children vertically)

Open basnetjiten opened this issue 1 year ago • 1 comments

Hi thanks for this awesome package. I have little concern regarding alignment of the Nodes. I am creating a family Tree, I want to align the nodes at center so that two children nodes align accordingly to top node , I tired to show them visually here. Brackets [ ] represent the nodes, there childres nodes

IMG_20230122_114143

Please guide me through the right path, it is doable.

basnetjiten avatar Jan 22 '23 05:01 basnetjiten

Hello. This package uses grid approach for graph representation, meaning that graph's underlying coordinate space is, basically, a 2d Matrix. Drawing trees in manner above goes out of current grid algorithm capabilities. If you want to draw tree in symmetrical but non grid manner you may try other packages. For instance this: https://pub.dev/packages/graphview .

I think, in future releases feature like this would be added by creating a gap in the center of even node children.

|_|_|x|_|_|
|x|x|_|x|x|

But thats is also not 100% perfect solution.

lempiy avatar Jan 23 '23 11:01 lempiy