Points layer

The points layer displays observations as points on the lifemap tree.

It is possible to make the fill color and the radius of the points depending on a data variable.

import polars as pl
from pylifemap import Lifemap, aggregate_count

# Load iucn dataset
iucn = pl.read_csv(
    "https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)

# Aggregate observations count along branches
iucn_agg = aggregate_count(iucn)

(
    Lifemap(iucn_agg)
    .layer_points(fill_col="n", radius_col="n", opacity=0.7, popup=True)
    .show()
)
/home/runner/work/pylifemap/pylifemap/src/pylifemap/data.py:98: UserWarning: 4 taxids have not been found in Lifemap database: [None, 210648, 303018, 1221133]
  warnings.warn(msg, stacklevel=0)

For a detailed list of layer_points arguments you can take a look at its documentation.