Altair map chart is not rendered
See original GitHub issueSummary
I am trying to render an altair chart through st.altair_chart
. This chart happens to be a map representation of Africa. I constructed this chart through the altair library and wanted to render it in streamlit.
Steps to reproduce
import geopandas as gpd
import altair as alt
import streamlit as st
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
africa = world[world.continent == "Africa"]
chart = alt.Chart(africa).mark_geoshape().encode(color="pop_est:Q")
st.altair_chart(chart)
Expected behavior:
Should render the image referenced:
Actual behavior:
Not implemented error: Dtype geometry not understood
Is this a regression?
This is not a regression
Debug info
- Streamlit version: 0.53
- Python version: 3.8.1
- Altair version: 4.0.1
- Geopandas version: 0.6.1
- Using Conda
- OS version: Ubuntu 19.10
- Browser version: Firefox 72.0.1
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11
Top Results From Across the Web
Display Troubleshooting — Altair 4.2.0 documentation
If you have done the above steps and charts still do not render, it likely means that you are using a different Kernel...
Read more >Altair not rendering mark_geoshape - geopandas
The data loads fine in QGIS and Matplotlib but doesn't seem to render properly in Altair. For reference, the CRS is set to...
Read more >altair.Chart — Altair 4.1.0 documentation
A key-value mapping between encoding channels and definition of fields. ... Open a browser window and display a rendering of the chart.
Read more >Creating Choropleth Visualizations with Altair
In order to render Altair plots in Jupyter Notebook, you must enable the ... because we're passing a JSON, not a dataframe into...
Read more >Problems integrating an altair choroplet map - Using Streamlit
Currently im working in a project of visualizing air polution in a choropleth map, and I started using Altair.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can repro this - it’s an issue with our dataframe marshaling code.
@kantuni is currently overhauling our dataframe serialization code in #1021. Hopefully Arrow just knows how to handle this out of the box? Let’s circle back when that PR lands.
@kantuni Here is a demo of the problem: https://share.streamlit.io/fgenoese/st_bugreports/main/geopandas_map.py