-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: index-shaped layout algorithm #46
Copy link
Copy link
Open
Labels
algorithmsRelated to internal algorithmsRelated to internal algorithmsenhancementNew feature or requestNew feature or requesthacktoberfestFor tasks eligible for Hacktoberfest participationFor tasks eligible for Hacktoberfest participation
Metadata
Metadata
Assignees
Labels
algorithmsRelated to internal algorithmsRelated to internal algorithmsenhancementNew feature or requestNew feature or requesthacktoberfestFor tasks eligible for Hacktoberfest participationFor tasks eligible for Hacktoberfest participation
Introduction
Sometimes we might want to render trees as if they were indices, using "new lines" and "tabulations" to denote the nesting level of an item within the tree.
Visual example:
The main changes belong to the
@beautiful-tree/algorithmspackage.Some extra notes
API Changes
Besides introducing a new layout algorithm, we might have to modify the API of or
@beautiful-tree/reactlibrary.This is because the current layout algorithms assume that the nodes will be drawn centered around each point given by the layout algorith; but in the case of the index-shaped layout, we want the nodes to be drawn on the "right side" of the given point (to ensure that they are always left-aligned with other nodes at the same level of depth).
Connector lines
Right now, we only have straight connector lines. For the index-shaped layouts we need to have vertical+corner+horizontal connectors (as depicted in the example above).
We already defined an independent task for this: #13 .