heat_tree
heat_tree(
tree=None,
metadata=None,
aesthetics=None,
*,
tree_names=None,
embed=True,
open_browser=True,
width='100%',
height='500px',
**options,
)Create an interactive phylogenetic tree visualisation.
In Jupyter environments, the JavaScript library is automatically loaded when heattree_py is imported. All widgets in the same notebook share this single JS load, making widget outputs small and efficient.
In non-Jupyter environments (plain Python, IPython terminal), the embed parameter controls whether the JS is bundled with each widget (for offline use) or loaded from CDN. When open_browser is True (the default), the visualization is saved to a temporary HTML file and opened in the default web browser.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| tree | Tree input (Newick string, file path, ete3 TreeNode, dendropy Tree, Biopython Phylo tree, or scikit-bio TreeNode). | None |
|
| metadata | Optional metadata as pandas DataFrame, file path, or TSV/CSV string. | None |
|
| aesthetics | Optional dictionary mapping visual properties to metadata columns. | None |
|
| tree_names | Optional list of names for each tree. Must be the same length as the number of trees. If not provided, trees are named “tree 1”, “tree 2”, etc. | None |
|
| embed | If True (default), bundle the JavaScript library with the widget. If False, load from CDN. Ignored in Jupyter. | True |
|
| open_browser | If True (default) and not in Jupyter, save the widget to a temporary HTML file and open in the default browser. Has no effect in Jupyter environments. | True |
|
| width | CSS width for the widget container. Default is “100%”. | '100%' |
|
| height | CSS height for the widget container. Default is “500px”. | '500px' |
|
| **options | Additional options passed to the JavaScript widget. | {} |
Returns
| Name | Type | Description |
|---|---|---|
| HeatTreeWidget | The widget object. |