Arcs layer

The arcs layer displays curved or straight arc lines between two arbitrary taxa.

import polars as pl
from pylifemap import Lifemap
d = pl.DataFrame(
    {
        "taxid": [
            9685,
            9615,
            9994,
            2467430,
            2514524,
            2038938,
            1021470,
            1415565,
            1928562,
            1397240,
        ],
        "dest_taxid": [
            9615,
            1415565,
            2467430,
            9994,
            9685,
            2514524,
            2038938,
            1397240,
            1021470,
            1928562,
        ],
        "relation": ["A", "A", "B", "C", "A", "A", "B", "C", "B", "A"],
    }
)
Lifemap(d, theme="lightgrey").layer_arcs(
    taxid_dest_col="dest_taxid",
    color="relation",
    arrow=True
).show()
Note

Performance is degraded when using arrow=True. On a typical laptop, displaying more than a few thousand arcs with arrow heads will lead to slow rendering. If you have a lot of arcs to plot you can either disable arrows, use lazy loading or try layer_arcs_deck.

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

For an alternative arcs visualization, see layer_arcs_deck.