-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat(react): Allow Different Tree Orientations #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react): Allow Different Tree Orientations #56
Conversation
|
Hi @Rounak-stha 😄 , thank you for the PR. There are a some details that I'd like to verify, though.
|
- Preserve Siblings Order on Rotation - Preserve Text Orientation
- Update Test Tree Snapshot
…ak-stha/beautiful-tree into Different_Tree_orientations
|
Hey @castarco
Here are the results: |
|
Hi again @Rounak-stha . I checked, and what happens when we rotate the tree is not OK (it's not the same to rotate the content as to rotate the canvas), as it does not respect the width and height that we set for the canvas (it switches them).
|
|
I am working on fixing this I am still confused on the issue of ordering of child nodes. |
|
Hi @castarco I updated the orientation logic and I think it works well now
The way I am thinking is that the layout that the rotation logic rendered was correct in a way that the left and right child would retain their position (example in above comments) but when mirrored the positions would get swapped. |
- Respect the Height and Width on Different Orientation
|
@Rounak-stha merged 👍🏻 🚀 |
|
Great |






This PR adds the feature of allowing different tree orientations mentioned in #24 .
One thing to note is that since the while svg is rotated, so for Left - Right or Right -> Left orientations the width and height are flipped.
Results:
L-R:

R-L:

D-T:
