_subplots' or _redrawFromAutoMarginCount undefined using dcc.Loading and dcc.graph
See original GitHub issueHi All,
I have console error message when the graph loads. With a simple scenario as code shows below, I get this error:
plotly-1.49.4.min.js:7 Uncaught (in promise) TypeError: Cannot read property ‘_subplots’ of undefined at plotly-1.49.4.min.js:7 at Object.r.drawFramework (plotly-1.49.4.min.js:7) at e (plotly-1.49.4.min.js:7) at Object.l.syncOrAsync (plotly-1.49.4.min.js:7) at i (plotly-1.49.4.min.js:7)
if I set the figure to {} or to {layout:{}} then I get a warning (which is good) and the following error: plotly-1.49.4.min.js:7 Uncaught (in promise) TypeError: Cannot read property ‘_redrawFromAutoMarginCount’ of undefined at C (plotly-1.49.4.min.js:7) at plotly-1.49.4.min.js:7
Here sample code:
@app.callback(Output('my-graph-2', 'figure'),
[Input('my-dropdown', 'value')])
def update_graph(value):
values = [1,2,3]
range = [1,2,3]
return {
'data': [{
'x': range ,
'y': values,
'line': {
'width': 1,
'shape': 'spline'
}
}],
'layout': {
'margin': {
'l': 30,
'r': 20,
'b': 30,
't': 20
}
},
}
def layout(unresolved_path=None, resolved_path=None):
return html.Div([
dcc.Dropdown(
id='my-dropdown',
options=[
{'label': 'option1', 'value': 'option1'},
{'label': 'option2', 'value': 'option2'},
],
value= 'option1'
),
dcc.Loading(id="loading-chart",
children=[dcc.Graph(id='my-graph-2')],
type="circle")
])
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
dcc.Loading on First Load Only (Python) - Stack Overflow
Loading generates not only a div, but a parent div for itself. Fortunately, we can access it by using the 'parent_style' property in...
Read more >Loading | Dash for Python Documentation | Plotly
dcc.Loading. Here's a simple example that wraps the outputs for a couple of Input components in the Loading component. As you can see,...
Read more >Loading states and Loading component - Dash Python
I have a callback that sometimes takes 3+ seconds to load, so this new component could be quite useful in those cases, but...
Read more >Loading States | Dash for Python Documentation | Plotly
Getting the loading state of a component and adding a loading component.
Read more >dcc.Loading for loading graph(s) - Dash Python
I have a dashboard with several dcc.Graph components. Due to the size of the dataframe on which the graphs are built, the graphs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/plotly/dash-core-components/issues/684
Closing as fixed by #681