question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Choropleth_mapbox and FigureWidget - 'mapbox._derived' Value Error

See original GitHub issue

When plotting a choropleth_mapbox using plotly express and containing it within a figure widget, I am encountering a ValueError when I drag the plot around. The error does not affect the interactivity of the plot, but it does create a huge error log in the output. I thought about trying go.add_choroplethmapbox(), but realized that the arguments are different from the plotly express version.

I have included a sample code below.

Plotly [offline] jupyter core : 4.6.3 jupyter-notebook : 6.0.3 ipywidgets : 7.5.1 traitlets : 4.3.3 plotly : 4.8.1

import plotly.express as px
import plotly.graph_objs as go

df = px.data.election()
geojson = px.data.election_geojson()

fig = px.choropleth_mapbox(df, geojson=geojson, color="Bergeron",
                           locations="district", featureidkey="properties.district",
                           center={"lat": 45.5517, "lon": -73.7073},
                           mapbox_style="carto-positron", zoom=9)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
figwid = go.FigureWidget(fig)
display(figwid)
ValueError: 
Invalid property path 'mapbox._derived' for layout

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
pjirelandcommented, Feb 11, 2021

I’m also having the same issue. Are there any updates on when this will be addressed?

5reactions
macadologycommented, Jun 29, 2021

Here you go. https://github.com/macadology/plotly_binder https://mybinder.org/v2/gh/macadology/plotly_binder/master?filepath=%2Fmin_code.ipynb

Once the plot is generated, moving it or interacting with it will cause error messages to appear in the output cell below the plot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotly figurewidget overview in Python
Construct a FigureWidget from a Figure graph object¶. A standard Figure object can be passed to the FigureWidget constructor.
Read more >
Mapping with Choropleth mapbox in python but figure does ...
I obtained the JSON file for Europe maps from GitHub and defined an "id" as the name of the country. url_eu="https://raw.githubusercontent.com/ ...
Read more >
plotly.graph_objects package — 5.11.0 documentation
Sets the data corresponding the length of each error bar. Values are plotted relative ... If “mapbox” (the default value), the data refer...
Read more >
Blame | Modules/plotly_4_2_1/plotly/graph_objs/_ ... - GitLab
Layout - A dict of string/value properties that will be passed to the Layout constructor Supported dict properties: angularaxis plotly.graph_objects.layout.
Read more >
Create Choropleth Maps by Using Plotly | by Baysan - Medium
They separated float values with ',' in Excel file but we are ... Plotly created Choropleth MapBox for create choropleth with MapBox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found