Skip to content

Commit 1810633

Browse files
authored
Modify render tree (#386)
* docs: reorder import * test: fix test coverage * feat: add render tree * feat: add render tree * feat: add render tree * fix: pyvis enhancements * test: fix test coverage + omit render from being tested * feat: add render tree
1 parent 8c77b65 commit 1810633

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ For **Tree** implementation, there are 11 main components.
3939
4. From *nested dictionary*, using path-attribute key-value pairs or recursive structure
4040
5. From *pandas DataFrame*, using paths or parent-child columns
4141
6. From *polars DataFrame*, using paths or parent-child columns
42-
7. Add nodes to existing tree using path string
43-
8. Add nodes and attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using path
44-
9. Add only attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using node name
42+
7. From *interactive UI*
43+
8. Add nodes to existing tree using path string
44+
9. Add nodes and attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using path
45+
10. Add only attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using node name
4546
3. [**➰ Traversing Tree**](https://bigtree.readthedocs.io/stable/bigtree/utils/iterators/)
4647
1. Pre-Order Traversal
4748
2. Post-Order Traversal

bigtree/tree/construct/render.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def __init__(
4444

4545
# Insert nodes
4646
tree_root = tree.insert("", "end", iid=self.get_iid(), text=root_name)
47-
tree.insert(tree_root, "end", iid=self.get_iid(), text="Child 1")
4847

4948
# Add button
5049
tk.Button(root, text="Add Child", command=self.on_plus).pack()
@@ -124,7 +123,7 @@ def on_return(self, event: TkEvent) -> None:
124123
elif parent:
125124
# Add node
126125
self.validate_name(parent, name)
127-
self.tree.insert(parent, "end", text=name, iid=self.get_iid())
126+
self.tree.insert(parent, "end", iid=self.get_iid(), text=name)
128127
self.entry_place_forget()
129128

130129
def on_plus(self, event: TkEvent = None) -> None:

docs/home/tree.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For **Tree** implementation, there are 11 main components.
1717
- From *nested dictionary*, using path-attribute key-value pairs or recursive structure
1818
- From *pandas DataFrame*, using paths or parent-child columns
1919
- From *polars DataFrame*, using paths or parent-child columns
20+
- From *interactive UI*
2021
- Add nodes to existing tree using path string
2122
- Add nodes and attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using path
2223
- Add only attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using node name

0 commit comments

Comments
 (0)