plotly-resampler icon indicating copy to clipboard operation
plotly-resampler copied to clipboard

fix: check if update_data contains update before batch_update

Open jvdd opened this issue 1 year ago • 1 comments

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

jvdd avatar Aug 25 '24 12:08 jvdd

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.

codecov-commenter avatar Aug 29 '24 08:08 codecov-commenter