Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapbox layers fail to update on second callback #223

Closed
araichev opened this issue Mar 14, 2018 · 20 comments
Closed

mapbox layers fail to update on second callback #223

araichev opened this issue Mar 14, 2018 · 20 comments

Comments

@araichev
Copy link

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.

@tomasfarias
Copy link

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
Copy link
Author

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
Copy link
Author

@tomasfarias what versions of Plotly, Dash, etc. are you using?
My Pipfile.lock is attached.
Pipfile.lock.txt

@araichev
Copy link
Author

Can somebody else try the example too?
It boggles my mind.

@tomasfarias
Copy link

@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
Copy link

@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
Copy link
Author

araichev commented Mar 16, 2018

OK, it appears we have a regression bug.
Any Dash developer out there up for fixing it?

@araichev araichev changed the title Scattermapbox bug? Scattermapbox bug Mar 22, 2018
@bcdunbar
Copy link

bcdunbar commented Apr 4, 2018

Specifically, the layers issue was introduced in dash-core-components 0.21.0 https://github.com/plotly/dash-core-components/blob/d034e25f6f56423ef2de7e5905328396040cf4d8/CHANGELOG.md#0210---2018-03-12

@bcdunbar bcdunbar changed the title Scattermapbox bug mapbox layers fail to update on second callback Apr 4, 2018
@bcdunbar bcdunbar added the bug label Apr 4, 2018
@ckaros
Copy link

ckaros commented Apr 30, 2018

any progress on this? Would the solution be an update to Dash or to Plotly.js?

@eddy-oj
Copy link

eddy-oj commented May 5, 2018

I have the same question as araichev!

@pikhovkin
Copy link
Contributor

Any progress on this? I have same issue.

@janfreyberg
Copy link

+1 from me - this is quite a problem since this is the only way to do choropleth easily right now!

@chriddyp
Copy link
Member

chriddyp commented 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.js

@pikhovkin
Copy link
Contributor

pikhovkin commented 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
Copy link
Author

araichev commented Jun 12, 2018

@pikhovkin no, it won't.

@yamunamaccarana
Copy link

yamunamaccarana commented Jun 13, 2018

I encountered the same issue with:

dash 0.21.0 
dash-core-components 0.22.1                    
dash-html-components 0.10.0                   
dash-renderer 0.12.1  

The only (temporary) solution I found was: pip install dash-core-components==0.18.1 as suggested above.

@charleyferrari
Copy link

This was fixed in plotly/plotly.js#2734

Once the new plotly.js version is released and added this can be closed.

@leejt489
Copy link

Timeline for getting this fix propagated into dash?

@chriddyp
Copy link
Member

Timeline for getting this fix propagated into dash?

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
Copy link
Member

chriddyp commented Jul 9, 2018

Solved in plotly/dash-core-components#228.

Many thanks to everyone who reported ❤️

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

No branches or pull requests