The Streamz
pane renders Streamz Stream objects emitting arbitrary objects, unlike the DataFrame
pane which specifically handles streamz DataFrame and Series objects and exposes various formatting objects.
If you are not already a user of the Streamz library, we recommend using functionality from the Param and Panel ecosystem, such as reactive expressions, generator functions and/ or periodic callbacks. We find these features to be more robustly supported.
Parameters:
For details on other options for customizing the component see the layout and styling how-to guides.
always_watch
(boolean, default=False): Whether to watch the stream even when not displayed.object
(streamz.Stream): The streamz.Stream object being watchedrate_limit
(float, default=0.1): The minimum interval between events in seconds.
The Streamz
pane uses the default panel resolution to figure out the appropriate way to render the object returned by a Stream. By default the pane will only watch the Stream
if it is displayed, we can tell it to watch the stream as soon as it is created by setting always_watch=True
.
We can now define a periodic callback which emits an increasing count on the Stream
:
Lets reset the pane
The Streamz
stream can be used to stream any kind of data, e.g. we can create a streamz DataFrame, accumulate the data into a sliding window and then map it to a altair line_plot
function
Now we can emit additional data on the DataFrame and watch the plot update: