Closed BearLemma closed 5 months ago
Hi @BearLemma,
You are seeing gaps because, under the hood, plotly-resampler
introduces NaNs
for regions with large gaps. As your data is not regularly sampled, you see these gaps.
This is caused by the gap_handler
argument defaulting to the MedDiffGapHandler
. As such, by adding the NoGapHandler
as gap_handler
argument to the FigureResampler, your issue will be resolved.
...
from plotly_resampler.aggregation import NoGapHandler # Added this
fig = make_subplots(
rows=1,
cols=1,
shared_xaxes=True,
vertical_spacing=0.02,
)
fr_fig = FigureResampler(
fig,
default_downsampler=MinMaxLTTB(),
default_n_shown_samples=2000,
default_gap_handler=NoGapHandler(), # Added this
)
fr_fig.add_trace(
go.Scatter(x=mid.index, y=mid.values, name="mid", line=dict(color="grey")),
row=1,
col=1,
)
Kind regards, Jonas
Hi @jonasvdd , ohhhh! I was thinking that something like that is happening but couldn't figure it out. Thank you very much sir :heart:
Best regards, Jan
Describe the bug :crayon: When I use plotly_resampler in dash, my lines become broken (interrupted) after a few zoom-ins.
Reproducing the bug :mag: The mids file is attached (compressed form) mids.zip
Sample print of the data:
Expected behavior :wrench: I want my plotted lines to be nicely continuous even when zoomed in.
Screenshots :camera_flash: Zoomed out a bit: Zoomed a bit further
Environment information: (please complete the following information)