plotly-resampler
plotly-resampler copied to clipboard
fix: check if update_data contains update before batch_update
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)
- Zoom in in a region
- 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:
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
@@ 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.