Skip to content

mapbox layers fail to update on second callback #223

Closed

Description

@araichev

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.

Activity

  1. tomasfarias commented on Mar 14, 2018

    @tomasfarias

    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.

  2. araichev commented on Mar 14, 2018

    @araichev
    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.

  3. araichev commented on Mar 14, 2018

    @araichev
    Author

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

  4. araichev commented on Mar 15, 2018

    @araichev
    Author

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

  5. tomasfarias commented on Mar 15, 2018

    @tomasfarias

    @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.

  6. dgatland commented on Mar 15, 2018

    @dgatland

    @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)

  7. araichev commented on Mar 16, 2018

    @araichev
    Author

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

  8. changed the title [-]Scattermapbox bug?[/-] [+]Scattermapbox bug[/+] on Mar 22, 2018
  9. bcdunbar commented on Apr 4, 2018

    @bcdunbar
  10. changed the title [-]Scattermapbox bug[/-] [+]mapbox layers fail to update on second callback[/+] on Apr 4, 2018
  11. ckaros commented on Apr 30, 2018

    @ckaros

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

  12. eddy-oj commented on May 5, 2018

    @eddy-oj

    I have the same question as araichev!

  13. pikhovkin commented on May 28, 2018

    @pikhovkin
    Contributor

    Any progress on this? I have same issue.

  14. janfreyberg commented on Jun 5, 2018

    @janfreyberg

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

  15. chriddyp commented on Jun 8, 2018

    @chriddyp
    Member

    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

  16. pikhovkin commented on Jun 8, 2018

    @pikhovkin
    Contributor

    @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?

  17. araichev commented on Jun 12, 2018

    @araichev
    Author

    @pikhovkin no, it won't.

  18. yamunamaccarana commented on Jun 13, 2018

    @yamunamaccarana

    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.

  19. charleyferrari commented on Jun 13, 2018

    @charleyferrari

    This was fixed in plotly/plotly.js#2734

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

  20. leejt489 commented on Jun 15, 2018

    @leejt489

    Timeline for getting this fix propagated into dash?

  21. chriddyp commented on Jun 16, 2018

    @chriddyp
    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

  22. chriddyp commented on Jul 9, 2018

    @chriddyp
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions