Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

relayoutData not used when switching tabs #726

Open
emmanuelle opened this issue Dec 25, 2019 · 2 comments
Open

relayoutData not used when switching tabs #726

emmanuelle opened this issue Dec 25, 2019 · 2 comments

Comments

@emmanuelle
Copy link
Contributor

See the community post https://community.plot.ly/t/bug-maintaining-interactive-graph-state-across-tab-switches/32937/, which includes a standalone app reproducing the problem.

Problem: for an app with several tabs, if one tab includes a dcc.Graph, then switching tab loses information such as zoom or selection.

Is it related to #311 ?

@emmanuelle
Copy link
Contributor Author

Here is the example, for the record

import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
import numpy as np


external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

fig = go.Figure()
x = [n * .1 for n in range(100)]
y = np.sin(x)
fig.add_trace(go.Scattergl(x=x, y=y, mode='lines'))

app.layout = html.Div(
    html.Div([
        html.H4('Interactive Graph in Tab Test'),
        dcc.Tabs(id="plot-tabs", value='graph',
                 children=[dcc.Tab(label='Graph', value='graph',
                                   children=[dcc.Graph(id='interactive-graph', figure=fig)]),
                           dcc.Tab(label='Other', value='other')])
    ])
)


if __name__ == '__main__':
    app.run_server(debug=True)

@jauerb
Copy link

jauerb commented Jan 11, 2021

Hi, just curious if there has been any update on this in the last year?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants