-
Hi, thanks for writing a great package. I'm trying to show two figures on two tabs of the browser so that I can compare two figures side by side with resampling function. However, as FigureResampler occupies the main thread, I cannot run both instances at the same time. What would be the best way to achieve my goal? hanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dbdq, Thank you for your kind words. I am missing some context in your question on how you utilize plotly-resampler. Given that you are not able to spawn multiple figures, I suppose that you utilize the automatic (i.e., the However, It is certainly possible to run multiple plotly-resampler figures within a same dash-app or notebook instance.
import plotly.graph_objects as go
from plotly_resampler import FigureResampler
import numpy as np
N = 1_000_000
x = np.arange(N)
y = np.sin(x / (N / 50))
fig1 = FigureResampler(go.Figure())
fig1.add_trace(go.Scatter(name='a trace'), hf_x=x, hf_y=y)
# NOTE: via manual mode - you can specify the port on which each figure can run
fig1.show_dash(mode='external', port=8001)
fig2 = FigureResampler(go.Figure())
fig2.add_trace(go.Scatter(name='a trace'), hf_x=x, hf_y=-y) # y is flipped
fig2.show_dash(mode='external', port=8002) I hope this resolves your issue. Kind regards, |
Beta Was this translation helpful? Give feedback.
Hi @dbdq,
Thank you for your kind words.
I am missing some context in your question on how you utilize plotly-resampler. Given that you are not able to spawn multiple figures, I suppose that you utilize the automatic (i.e., the
register_plotly_resampler
) mode.However, It is certainly possible to run multiple plotly-resampler figures within a same dash-app or notebook instance.
go.Figure
with aFigureResampler
and callshow_dash
for which you pass the network port on which the app runs as an argument.