streamz icon indicating copy to clipboard operation
streamz copied to clipboard

Streamz hvplot resets zoom and pan on each update

Open josephwinston opened this issue 2 years ago • 4 comments

I'm plotting a large amount of streaming data using streamz and I'm very happy with the performance.

Here is how I create the stream, data frame, and the line:

        self.stream = streamz.Stream()
        example = pd.DataFrame({'Time': [], 'Depth': []}, index=[])
        df = streamz.dataframe.DataFrame(self.stream, example=example)

        self.line = df.hvplot.line(width=800,
                                   x='Time',
                                   y='Depth',
                                   ).opts(
            title='Depth',
            xlabel='Time',
            ylabel='Depth')

The data frame is periodically updated like this:

        df = pd.DataFrame([(date, value)], columns=['Time', 'Depth'])

        self.stream.emit(df)

This builds a nice line that changes as new data arrives. However, zooming and panning don't work as the historical data is apparently not present for the hvplot.line.

Ideally, I can provide the missing data. If this is possible, please point me to some documentation or example.

If I cannot use zooming and panning, what is the correct way to disable them?

See https://discourse.holoviz.org/t/streamz-hvplot-resets-zoom-and-pan-on-each-update/4609/1 for the first report of this I can find.

josephwinston avatar Oct 25 '23 17:10 josephwinston

I hope you hear something from the hv people, I'm not sure there's much we can do about it on this side.

martindurant avatar Oct 25 '23 18:10 martindurant

Closing...

josephwinston avatar Oct 25 '23 18:10 josephwinston

Asking HV for help

josephwinston avatar Oct 25 '23 18:10 josephwinston