You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mapbox layers fail to update on second callback #223
Hi folks, i've been plotting maps with custom GeoJSON layers using Plotly Scattermapbox and following this Plotly Community thread.
It works fine until i introduce callbacks.
I wrote a minimal Dash app to demonstrate my problem and made an animated GIF of it in action.
(I can't attach the GIF for some reason.)
The app has a dropdown and two maps, one with a marker and one with a marker and a custom GeoJSON polygon layer.
Selecting different colors from the dropdown should change the marker and polygon colors on both maps, but it only works on the first map, the one without a polygon.
I'm running your test.py yet I cannot reproduce the bug. When selecting any color both maps (with marker only and with marker + GeoJSON polygon layer) change colors.
Might I make a small suggestion for you to try? There's no need to define a default argument for figure in the dcc.Graph elements of the app.layout, you can just leave them empty, like so: html.Div([ dcc.Graph(id='map1', className='six columns'), dcc.Graph(id='map2', className='six columns'), ])
When the app starts it will automatically call all of the app.callbacks and fill in those for you.
Besides trying that, I really can't reproduce your problem to think of anything else.
Thanks for the suggestion on initializing the map.
I incorporated it in my code (Gist updated), but the problem still persists; see the new GIF.
This time i can update the color once on both maps (from orange to blue), but after that the right-hand map stops reacting.
This happens to me using Firefox 58.0.2 and using Chromium Version 64.0.3282.167 (Official Build).
I'm running LinuxMint 18.3 (64-bit), in case that matters.
@araichev I ran your app on dash 0.20.0, dash-core-components 0.18.1 and dash-html-components 0.8.0 and didn't experience any problem.
However I repeated the test in my work laptop, where I was running the latest version of dash and it's components, and there it was. Exactly the same issue you showed in that gif.
@araichev I tested your updated code and have the same issue as you (can update the colour from orange to blue initially, but then the right-hand map no longer updates).
I ran it with dash 0.21.0, dash-core-components 0.21.0 and dash-html-components 0.9.0 (and viewed in Firefox browser)
This is likely a plotly.js issue with Plotly.react. It would be helpful if someone could recreate this issue in plotly.js with codepen and make in issue in https://github.com/plotly/plotly.js
Activity
tomasfarias commentedon Mar 14, 2018
I'm running your test.py yet I cannot reproduce the bug. When selecting any color both maps (with marker only and with marker + GeoJSON polygon layer) change colors.
Might I make a small suggestion for you to try? There's no need to define a default argument for figure in the dcc.Graph elements of the app.layout, you can just leave them empty, like so:
html.Div([ dcc.Graph(id='map1', className='six columns'), dcc.Graph(id='map2', className='six columns'), ])When the app starts it will automatically call all of the app.callbacks and fill in those for you.
Besides trying that, I really can't reproduce your problem to think of anything else.
araichev commentedon Mar 14, 2018
Thanks for the suggestion on initializing the map.
I incorporated it in my code (Gist updated), but the problem still persists; see the new GIF.
This time i can update the color once on both maps (from orange to blue), but after that the right-hand map stops reacting.
This happens to me using Firefox 58.0.2 and using Chromium Version 64.0.3282.167 (Official Build).
I'm running LinuxMint 18.3 (64-bit), in case that matters.
araichev commentedon Mar 14, 2018
@tomasfarias what versions of Plotly, Dash, etc. are you using?
My Pipfile.lock is attached.
Pipfile.lock.txt
araichev commentedon Mar 15, 2018
Can somebody else try the example too?
It boggles my mind.
tomasfarias commentedon Mar 15, 2018
@araichev I ran your app on dash 0.20.0, dash-core-components 0.18.1 and dash-html-components 0.8.0 and didn't experience any problem.
However I repeated the test in my work laptop, where I was running the latest version of dash and it's components, and there it was. Exactly the same issue you showed in that gif.
dgatland commentedon Mar 15, 2018
@araichev I tested your updated code and have the same issue as you (can update the colour from orange to blue initially, but then the right-hand map no longer updates).
I ran it with dash 0.21.0, dash-core-components 0.21.0 and dash-html-components 0.9.0 (and viewed in Firefox browser)
araichev commentedon Mar 16, 2018
OK, it appears we have a regression bug.
Any Dash developer out there up for fixing it?
[-]Scattermapbox bug?[/-][+]Scattermapbox bug[/+]bcdunbar commentedon Apr 4, 2018
Specifically, the layers issue was introduced in
dash-core-components 0.21.0https://github.com/plotly/dash-core-components/blob/d034e25f6f56423ef2de7e5905328396040cf4d8/CHANGELOG.md#0210---2018-03-12[-]Scattermapbox bug[/-][+]mapbox layers fail to update on second callback[/+]ckaros commentedon Apr 30, 2018
any progress on this? Would the solution be an update to Dash or to Plotly.js?
eddy-oj commentedon May 5, 2018
I have the same question as araichev!
pikhovkin commentedon May 28, 2018
Any progress on this? I have same issue.
janfreyberg commentedon Jun 5, 2018
+1 from me - this is quite a problem since this is the only way to do choropleth easily right now!
chriddyp commentedon Jun 8, 2018
This is likely a plotly.js issue with
Plotly.react. It would be helpful if someone could recreate this issue in plotly.js with codepen and make in issue in https://github.com/plotly/plotly.jspikhovkin commentedon Jun 8, 2018
@araichev, (your second gif) will the canvas of the second chart be updated (point will be orange) if you double-click on the second chart?
araichev commentedon Jun 12, 2018
@pikhovkin no, it won't.
yamunamaccarana commentedon Jun 13, 2018
I encountered the same issue with:
The only (temporary) solution I found was:
pip install dash-core-components==0.18.1as suggested above.charleyferrari commentedon Jun 13, 2018
This was fixed in plotly/plotly.js#2734
Once the new plotly.js version is released and added this can be closed.
leejt489 commentedon Jun 15, 2018
Timeline for getting this fix propagated into dash?
chriddyp commentedon Jun 16, 2018
As soon as plotly.js makes a release. Within 2 weeks usually. You can see their release schedule here: https://github.com/plotly/plotly.js/releases
chriddyp commentedon Jul 9, 2018
Solved in plotly/dash-core-components#228.
Many thanks to everyone who reported ❤️
Issue 217 - Fix Edge / IE console errors (plotly#223)
Issue 217 - Fix Edge / IE console errors (#223)