Streamz hvplot resets zoom and pan on each update

Open
#472 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
pandas, python

Research direction

Start with the Streamz DataFrame and hvplot example in the issue, then review the linked Discourse report to understand the zoom and pan reset. Determine whether historical data or a supported way to disable those interactions is available; done means the behavior and an actionable resolution are documented or the issue is directed to the responsible project.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
1.3k
Forks
149
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-streamz/streamz

All issues in python-streamz/streamz

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.