Streaming perspective

Download this notebook from GitHub (right-click to download).

In [ ]:
import numpy as np
import pandas as pd
import panel as pn

pn.extension('perspective', sizing_mode='stretch_width')
In [ ]:
df = pd.DataFrame(np.random.randn(10, 4), columns=list('ABCD')).cumsum()

rollover = pn.widgets.IntInput(name='Rollover', value=15)

perspective = pn.pane.Perspective(
    df, sizing_mode='stretch_width', height=400, theme='material-dark'

def stream():
    data = df.iloc[-1] + np.random.randn(4), rollover=rollover.value)

cb = pn.state.add_periodic_callback(stream, 50)

    pn.Row(cb.param.period, rollover, perspective.param.theme),
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).