Lifemap.layer_heatmap_deck

Lifemap.layer_heatmap_deck(
    data=None,
    *,
    taxid_col='taxid',
    radius=30,
    intensity=5,
    threshold=0.05,
    opacity=0.5,
    color_range=None,
)

Add a deck.gl heatmap layer.

This layer is used to display observations distribution.

Parameters

Name Type Description Default
data pl.DataFrame | pd.DataFrame | None Layer data. If not provided, use the base widget data. None
taxid_col str If data is provided, name of the data column with taxonomy ids, by default "taxid" 'taxid'
radius float Heatmap radius, by default 30 30
intensity float Heatmap intensity, by default 5 5
threshold float Heatmap threshold, by default 0.05 0.05
opacity float Heatmap opacity as a floating number between 0 and 1, by default 0.5 0.5
color_range list | None List of colors to define a custom color gradient. None

Returns

Name Type Description
Lifemap A Lifemap visualization object.

Examples

>>> import polars as pl
>>> from pylifemap import Lifemap
>>> d = pl.DataFrame(
...     {
...         "taxid": [
...             9685,
...             9615,
...             9994,
...             2467430,
...             2514524,
...             2038938,
...             1021470,
...             1415565,
...             1928562,
...             1397240,
...             230741,
...         ],
...     }
... )
>>> Lifemap(d).layer_heatmap_deck().show()