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

Mapbox Graph wrapped in dcc.Loading lags one update behind #756

Closed
ghost opened this issue Feb 15, 2020 · 6 comments · Fixed by #740
Closed

Mapbox Graph wrapped in dcc.Loading lags one update behind #756

ghost opened this issue Feb 15, 2020 · 6 comments · Fixed by #740

Comments

@ghost
Copy link

ghost commented Feb 15, 2020

Hi there,
when I wrap a Mapbox scatter plot in a dcc.Loading component, updates to this figure seem to be delayed by one update. The same logic with normal scatter plots works fine. I could reproduce this behavior with Dash Core Components 1.8.0 and previous versions.

Here's a demo:
withoutLoading
withLoading

and here's the code:

import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objects as go
from dash.dependencies import Output, Input

app = dash.Dash(__name__)

lat = [10, 10, 10, 10]
lon = [10, 20, 30, 40]

app.layout = html.Div([
    html.Div('Select a point on the map:'),
    dcc.Slider(min=0, max=3, step=1, value=0, marks=[0, 1, 2, 3], id='slider'),
    dcc.Loading(dcc.Graph(id='graphContainer'))
])

@app.callback(Output('graphContainer', 'figure'),
              [Input('slider', 'value')])
def UpdateGraph(value):
    return {'data': [go.Scattermapbox(lat=lat, lon=lon, selectedpoints=[value])],
            'layout': go.Layout(mapbox_style='carto-positron')}


app.run_server()
@chanderraja
Copy link

I am facing a similar issue. @IsThisTheRealName, did you figure out how to get around this?

@mikeypatt
Copy link

Hello, I was just wondering if you managed to fix this as I am having exactly the same problem. Thank you very much!

@alexcjohnson
Copy link
Collaborator

@mikeypatt do you have dash v1.12? What does pip list | grep dash say?

@mikeypatt
Copy link

Hi, I have version 1.4.1?

@mikeypatt
Copy link

The graphs hover text does update but likewise with the actual scatter markers they are one update behind which is so odd

@alexcjohnson
Copy link
Collaborator

v1.4.1 is well before we fixed this issue (actually it's before this issue was even filed!)

You can get the latest with pip install --upgrade dash, which should give you dash@1.12 and dash-core-components@1.10

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

Successfully merging a pull request may close this issue.

3 participants