Description
If I use jupyterlab with plotly, for example with the simple slider example:
import plotly.graph_objects as go
import numpy as np
# Create figure
fig = go.Figure()
# Add traces, one for each slider step
for step in np.arange(0, 5, 0.1):
fig.add_trace(
go.Scatter(
visible=False,
line=dict(color="#00CED1", width=6),
name="𝜈 = " + str(step),
x=np.arange(0, 10, 0.01),
y=np.sin(step * np.arange(0, 10, 0.01))))
# Make 10th trace visible
fig.data[10].visible = True
# Create and add slider
steps = []
for i in range(len(fig.data)):
step = dict(
method="update",
args=[{"visible": [False] * len(fig.data)},
{"title": "Slider switched to step: " + str(i)}], # layout attribute
)
step["args"][0]["visible"][i] = True # Toggle i'th trace to "visible"
steps.append(step)
sliders = [dict(
active=10,
currentvalue={"prefix": "Frequency: "},
pad={"t": 50},
steps=steps
)]
fig.update_layout(
sliders=sliders
)
fig.show()
from the documentation.
Then, I created an additional view in Jupyter Lab. (Actually, I intend to use a similar mechanism for remote communication in university teaching in a different setup.)
If I move the axis origin or the sliders in the original view, only the original view is updated. Analogously, if I use the additional output for changes, only this output will be updated. On the other hand, after reloading the file and saving it, both views are updated after some time.
So, I assume that a model update is not triggered on the other view after a change.
Can you give me a pointer to what or where I should change? (I may make a PR if I have an idea of what to fix, but I am relatively new to the Jupyter code base and not fluent in Python but in Javascript, where I assume the problem is.)
I have seen that there are some filters, so a message to the kernel is not resent to the js side.