TreeMixin.to_dot
should produce dot-file, not an image.
node.identifier = node.identifier
no longer raises a DuplicateChildError. It has now become a no-op.
- Package is now based on AbstractTree.
The API has been revamped:
- Methods
tree.iter_nodes
and similar renamed toiter(tree.nodes)
- Methods
tree.count_nodes
and similar renamed totree.nodes.count()
- Method
Node.to_image()
now returnsbytes
. UseNode.to_pillow
to get an image. littletree.export.*
is gone. Useabstracttree.export.*
orTreeMixin.*
instead.- Methods
add_child
,add_children
andremove_child
have been added toBaseNode
. - Change transform to match abstract signature:
- Possible to change identifier when transforming
- Function takes just a node as argument.
Route
has a slightly different api.
- Methods
- Rename
NodeMixin
toTreeMixin
- Move
BaseNode.path.to
toTreeMixin.to
.
- Make better use of NodeMixin
- Make sure most exporter work directly on NodeMixin
- Move exporter functions (from Node) directly to NodeMixin.
- Remove
PathTo
class. - Add class
Route
which is a generic version of the oldPathTo
class.
- Add
NodeMixin
class, which provides something even more basic thanBaseNode
. - Add parameters
keep
anddeep
totree.copy()
. So a pruned copy can be made by doingtree.copy(keep=MaxDepth(3))
. - Calling
iter_leaves
on a node that is a leaf now correctly yields an iterable containing just that Node. - Fix
iter_siblings
to use identity instead of equality. - Methods
sort_children
,update
andclear
no longer returnself
, but None.
- Remove dataclasses (slots). Doesn't work until python3.10.
- Improve RowSerializer for pandas dataframe.
- Add newlines to output of
node.to_dot()
andnode.to_mermaid()
.
- Add
NetworkXSerializer
for conversion to and from networkx. - Faster implementation of
__eq__
for deep trees. - Two trees can now be equal (
==
) if their roots have a different identifier. - Replace argument
str_factory
byformatter
intree.show()
andtree.to_string
. If passed a string, it will be applied asformatter.format(node=node)
.
Fix bug in tree.compare
method
- Improve DotExporter
- Rename
name_factory
tonode_name
. - Derive file type from file extension if possible. Fall back on png.
- Add
graph_attributes
. - Make attribute handling more intelligent. Distinguish static and dynamic properties.
- Add parameter
directed
(default: True). - Remove whitespace around arrows for compacter file size.
- Rename
- Add MermaidExporter. Similar to DotExporter, but supported by GitHub.
- Make
tree.children
writable for more compatibility with anytree/bigtree - Add parameters
backend
andnode_label
totree.to_image()
- Remove
tree.show(img=True)
. Usetree.to_image().show()
instead. - New method
tree.transform()
that creates a modified or pruned copy of a tree. - New method
tree.compare()
that compares different trees to each other. - Rewrite
copy()
in terms of transform. Usetree.copy()
for shallow copy. Usetree.copy({})
for deep copy. - Remove style
minimal
, but add stylelist
fortree.show()
. - Add option
escape_comments
to newick serializer to escape newick modifiers in node data. - For now use
distance
andcomment
instead ofdistance_field
andcomment_field
in NewickSerializer. - Changed default format of
to_dict
to containidentifier
. - Rewrite RowSerializer
- Refactor RelationSerializer
- Streamline
DotExporter
. Create temporary files in memory. Add optionas_bytes
toto_image()
. Remove unused parameterseparator
. - Add more default styles to
StringExporter
. Some have been renamed.const
has been renamed tosquare
. - Simplify signature of
from_newick
. It accepts a string. For files a Path or file object should be passed. - Add
tree.show()
for quickly rendering a tree to console. Same asprint(tree.to_string())
.
- Make dictserialization work on large trees.
- Improve newick serialization. It's much faster now and works on big trees.
- Because of how it is implemented, it now also works on preorder format
A(b, c)
, even though the standard form is(b, c)A
.
- Add
node.path.to
- Remove
node.height()
. Tutorial shows alternative one-liner. - Fix bug in post-order iteration
- Fix bug in
copy
anddeepcopy
- Add support for serializing to and from Newick format