predict-idlab / plotly-resampler

Visualize large time series data with plotly.py
https://predict-idlab.github.io/plotly-resampler/latest
MIT License
1.03k stars 68 forks source link

fix: check if update_data contains update before batch_update #316

Open jvdd opened 2 months ago

jvdd commented 2 months ago

When using FigureWidgetResampler using traces that are not resampled (e.g., Histogram, Bar, etc.), the following action chain resulted in a TypeError (because update_data is NoUpdate)

  1. Zoom in in a region
  2. Reset the axis (house icon)

Reproducible code:

import numpy as np
from plotly_resampler import FigureWidgetResampler

x = np.random.randn(100)
fig = FigureWidgetResampler(go.Figure(go.Histogram(x=x)))
fig

Error :arrow_down: image

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.38%. Comparing base (f58db50) to head (b2f9975). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #316 +/- ## ========================================== - Coverage 96.49% 92.38% -4.12% ========================================== Files 14 13 -1 Lines 1141 1129 -12 ========================================== - Hits 1101 1043 -58 - Misses 40 86 +46 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.