Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.28.0] - 2025-04-19
### Added:
- Tree Export: Add export to visualisation with pyvis.
- DAGNode: Methods for .add, .extend methods, available for chaining.
### Changed:
- BaseNode: Able to have method chaining for .add, .extend, .sort method
- Type Hint: Type hint to use Optional and default argument to None instead of empty string.
### Fixed:
- Tree Plot: Reingold Tilford discovered edge case that caused subtrees to overlap, fixed the logic to account for this.

## [0.27.0] - 2025-14-13
## [0.27.0] - 2025-04-13
### Added:
- DAG/Tree Parsing: Add parsing module to get path from origin node to destination node, this was already available in
`.go_to()` function, but abstracted out to a parsing module. Tree parsing module has another method of getting common
ancestors between multiple branches of the same tree.

## [0.26.0] - 2025-14-13
## [0.26.0] - 2025-04-13
### Added:
- Tree Modify: Merge trees to merge multiple trees/branches into a single tree.

Expand Down Expand Up @@ -771,8 +775,9 @@ ignore null attribute columns.
- Utility Iterator: Tree traversal methods.
- Workflow To Do App: Tree use case with to-do list implementation.

[Unreleased]: https://github.com/kayjan/bigtree/compare/0.27.0...HEAD
[0.27.0]: https://github.com/kayjan/bigtree/compare/0.26.4...0.27.0
[Unreleased]: https://github.com/kayjan/bigtree/compare/0.28.0...HEAD
[0.28.0]: https://github.com/kayjan/bigtree/compare/0.27.0...0.28.0
[0.27.0]: https://github.com/kayjan/bigtree/compare/0.26.0...0.27.0
[0.26.0]: https://github.com/kayjan/bigtree/compare/0.25.4...0.26.0
[0.25.4]: https://github.com/kayjan/bigtree/compare/0.25.3...0.25.4
[0.25.3]: https://github.com/kayjan/bigtree/compare/0.25.2...0.25.3
Expand Down
2 changes: 1 addition & 1 deletion bigtree/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.27.0"
__version__ = "0.28.0"

from bigtree.binarytree.construct import list_to_binarytree
from bigtree.dag.construct import dataframe_to_dag, dict_to_dag, list_to_dag
Expand Down
6 changes: 2 additions & 4 deletions bigtree/tree/export/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from bigtree.node import node
from bigtree.tree.export.stdout import yield_tree
from bigtree.utils import exceptions
from bigtree.utils import exceptions, plot

try:
import pyvis
Expand Down Expand Up @@ -92,9 +92,7 @@ def tree_to_vis(
network_kwargs = network_kwargs or {}

# Get x, y, coordinates of diagram
from bigtree.utils.plot import reingold_tilford

reingold_tilford(tree, reverse=True, **plot_kwargs)
plot.reingold_tilford(tree, reverse=True, **plot_kwargs)

from pyvis.network import Network

Expand Down
7 changes: 6 additions & 1 deletion bigtree/utils/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,20 @@ def _get_subtree_shift(
new_shift = 0.0

if not initial_run:
cum_shift_temp = cum_shift * left_idx / right_idx
x_left = (
left_subtree.get_attr("x") + left_subtree.get_attr("shift") + left_cum_shift
left_subtree.get_attr("x")
+ left_subtree.get_attr("shift")
+ left_cum_shift
+ cum_shift_temp
)
x_right = (
right_subtree.get_attr("x")
+ right_subtree.get_attr("shift")
+ right_cum_shift
+ cum_shift
)
# Take into account that right_subtree shift will also cause left_subtree to shift
new_shift = max(
(x_left + subtree_separation - x_right) / (1 - left_idx / right_idx), 0
)
Expand Down
Loading