Adding more options to st.map

I realize that st.map is supposed to be for quick and simple plots while st.deck_gl_chart is meant for more complex maps. But I’m wondering if it would be reasonable to add a couple more features to st.map to cover the most common usecases. Primarily I’m thinking about adding a color option where you can select which column to use for setting the points’ colors. If the column is numeric it will use a colormap over that range, if the column is categorical it will attribute a random color to each category. Perhaps also have something similar for radius.

These two options would cover many of the common uses for plotting on maps that I currently have.

Hey @dwastberg,

Welcome to the forums!

I’ve filed an issue for this for us to discuss internally. https://github.com/streamlit/streamlit/issues/757

We currently have similar functionality for st.deck_gl_chart with getColor and getRadius as mentioned in the docs https://streamlit.io/docs/api.html#streamlit.deck_gl_chart

Is adding this functionality to st.map what you’re looking for?

Hey @dwastberg,

After some internal discussion… st.map is meant to be a one-shot solution that is not configurable.

Looks like you’ll need to go through st.deck_gl_chart for color support.

We’re also re-writing our DeckGL implementation and will be moving towards PyDeck in the near future so keep your eyes peeled for that.

Fair enough. The move to PyDeck sounds interesting. I’ll definitely keep an eye out for that.

Sounds good.

Just to give you a bit more info… the thinking is that creating a charting library is hard and other projects are devoted 100% to that. So let’s use those projects and plug directly into their api as much as possible instead of creating our own charting library api via st.map.

Cheers

Makes sense. Looking closer at PyDeck (which I hadn’t heard of), I’m thinking it might more sense to build the things I have in mind within that space and then have them show up ‘for free’ in streamlit down the road.