r"""
PAOH: a dynamic hypergraph without clutter
==========================================

The Parallel Aggregated Ordered Hypergraph view (Valdivia et al. 2021) draws
vertices as rows and hyperedges as vertical segments, grouped by time. Here a
sample of synthetic news articles is shown: each article is a hyperedge of
themes, and the three periods reveal how the mix of narratives changes.
"""

# %%
import matplotlib.pyplot as plt

import hatvis as hv
from hatvis.plotting import plot_paoh

T = hv.datasets.make_news_transactions(n_per_period=14, random_state=0)
print(T, T.times)
# [snippet:paoh]
ax = plot_paoh(T, time="time")
# [/snippet:paoh]
ax.figure.set_size_inches(11, 5.5)
plt.tight_layout()
