plotly / plotly/plotly.py

Jupyterlab additional view is not updated

Abierto
#4,650 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug P3
Lenguaje dominante
Python
Estrellas
18.8k
Forks
2.8k
Merge medio
16 h 26 min
PR fusionados (30 d)
21

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el ejemplo de slider de Plotly proporcionado en JupyterLab con una vista adicional y, después, sigue la ruta de actualización de los cambios realizados en cualquiera de las dos vistas. Se considera terminado cuando los cambios en el origen del eje y en el slider de una vista actualizan la otra sin requerir una recarga y un guardado; el issue no indica archivos del repositorio ni tests desde los que comenzar.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, jupyter-notebook, python
Área
data-visualization, frontend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.