"""
How support splits when sequences grow
======================================

A new view of the extension network: columns are pattern lengths, ribbons carry
the support of a pattern to its one-event extensions, and the rest of the
support (the sequences in which the pattern is not continued by a kept child)
flows to *stop*. It reads like a funnel of frequent sequences.
"""

import matplotlib.pyplot as plt

import spmviz as sv
from spmviz.viz import plot_growth_sankey

db = sv.datasets.make_daily_routines(300, random_state=0)
ps = sv.mine(db, 0.25, max_gap=1, max_length=5)
plot_growth_sankey(ps, start_items=["wake up"], max_length=5, top=3)
# %%
# Two starting activities
# -----------------------
plot_growth_sankey(ps, start_items=["work", "lunch"], max_length=4, top=3)
plt.show()
