Closed jonasvdd closed 9 months ago
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
9b48723
) 96.46% compared to head (3570b01
) 96.40%. Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
...tly_resampler/figure_resampler/figure_resampler.py | 33.33% | 2 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Ready for review @jvdd!
[BUG] Patch does not seem to work with
Reproduce issue - clone this branch and run this code in a notebook. ```python from plotly_resampler import FigureResampler from plotly.subplots import make_subplots import plotly.graph_objects as go import numpy as np x = np.arange(2_000_000) noisy_sin = (3 + np.sin(x / 200) + np.random.randn(len(x)) / 10) * x / 1_000 fig = FigureResampler( make_subplots(rows=2, cols=2, shared_xaxes="columns", horizontal_spacing=0.03) ) log = noisy_sin * 0.9999995**x exp = noisy_sin * 1.000002**x fig.add_trace(go.Scattergl(name="log"), hf_x=x, hf_y=log) fig.add_trace(go.Scattergl(name="exp"), hf_x=x, hf_y=exp) fig.add_trace(go.Scattergl(name="-log"), hf_x=x, hf_y=-exp, row=1, col=2) fig.add_trace(go.Scattergl(name="log"), hf_x=x, hf_y=-log, row=2, col=1) fig.add_trace(go.Scattergl(name="3-exp"), hf_x=x, hf_y=3 - exp, row=2, col=1) fig.add_trace(go.Scattergl(name="log"), hf_x=x, hf_y=log**2, row=2, col=2) fig.show_dash(mode="inline") ``` Patch does not seem to properly work with subplots. How I use patch to update a figure with subplots: ```python patched_figure = dash.Patch() # create patch for trace in update_data[1:]: # skip first item as it contains the relayout trace_index = trace.pop("index") # the index of the corresponding trace # All the other items are the trace data which needs to be updated patched_figure["data"][trace_index] = trace # TODO -> how to make this work with subplots? return patched_figure ```subplots
solved now!
TODO:
selenium
class to be compatible with patch type objects