Lifemap.layer_heatmap

Lifemap.layer_heatmap(
    data=None,
    *,
    taxid_col='taxid',
    radius=5.0,
    blur=5.0,
    opacity=1.0,
    gradient=('#4675ed', '#39a2fc', '#1bcfd4', '#24eca6', '#61fc6c', '#a4fc3b', '#d1e834', '#f3363a'),
)

Add an 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 5.0 5.0
blur float Heatmap blur, by default 5.0 5.0
opacity float Heatmap opacity as a floating number between 0 and 1, by default 1.0 1.0
gradient tuple Tuple of CSS colors to define the heatmap gradient. By default gradient inspired from the “turbo” color ramp. ('#4675ed', '#39a2fc', '#1bcfd4', '#24eca6', '#61fc6c', '#a4fc3b', '#d1e834', '#f3363a')

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().show()