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.

Altair map chart is not rendered

See original GitHub issue

Summary

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: visualization

Actual behavior:

Not implemented error: Dtype geometry not understood

image

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:open
  • Created 4 years ago
  • Reactions:4
  • Comments:11

github_iconTop GitHub Comments

2reactions
tconklingcommented, Jan 29, 2020

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.

0reactions
fgenoesecommented, Nov 12, 2021
Read more comments on GitHub >

github_iconTop 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 >

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