Lifemap
Lifemap(
data=None,
*,
taxid_col='taxid',
width=DEFAULT_WIDTH,
height=DEFAULT_HEIGHT,
center='default',
zoom=None,
theme='dark',
controls=('zoom', 'reset_zoom', 'png_export', 'search', 'full_screen'),
legend_width=None,
hide_labels=False,
)Build visualization.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| data | pl.DataFrame | pd.DataFrame | None |
Visualization data. | None |
| taxid_col | str | Name of the data column with taxonomy ids. By default 'taxid' |
'taxid' |
| width | int | str | Lifemap visualization width, in pixels or CSS units. By default DEFAULT_WIDTH |
DEFAULT_WIDTH |
| height | int | str | Lifemap visualization height, in pixels or CSS units. By default DEFAULT_HEIGHT |
DEFAULT_HEIGHT |
| center | Literal['default', 'auto'] | int | Lifemap initial center. Can be 'default' (tree center), 'auto' (center on data) or a taxid value. Defaults to 'default'. |
'default' |
| zoom | int | float | None | Lifemap initial zoom level, if not specified, it is computed depending on the center argument value. Defaults to None. |
None |
| theme | str | Color theme for the basemap. Can be one of 'light', 'dark', 'lightblue', 'lightgrey', or 'lightgreen'. Defaults to 'dark'. |
'dark' |
| controls | Sequence[str] | List of controls to be displayed on the widget. By default all controls are displayed. Available controls are: - 'zoom': zoom in and zoom out buttons - 'reset_zoom': zoom reset button - 'png_export': button to export current view to a PNG file - 'search': taxa search button - 'full_screen': full screen toggle button |
('zoom', 'reset_zoom', 'png_export', 'search', 'full_screen') |
| legend_width | int | None | Legend width in pixels. By default None. |
None |
| hide_labels | bool | If True, hide the taxa name labels. Defaults to False. |
False |
Examples
>>> import polars as pl
>>> from pylifemap import Lifemap
>>> d = pl.DataFrame({"taxid": [9685, 9615, 9994]})
>>> Lifemap(d, width="100%", height="100vh").layer_points().show()Methods
| Name | Description |
|---|---|
layer_points |
Add a points layer. |
layer_lines |
Add a lines layer. |
layer_donuts |
Add a donuts layer. |
layer_heatmap |
Add an heatmap layer. |
layer_heatmap_deck |
Add a deck.gl heatmap layer. |
layer_screengrid |
Add a screengrid layer. |
layer_text |
Add a text labels layer. |
layer_icons |
Add an icons layer. |
show |
Display the Jupyter widget for this instance. |
save |
Save the Jupyter widget for this instance to an HTML file. |