File size: 810 Bytes
22405ac 57f85d0 088de9e 975a88f 57f85d0 975a88f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
import pandas as pd
import numpy as np
data = pd.DataFrame({
'awesome cities' : ['Chicago', 'Minneapolis', 'Louisville', 'Topeka'],
'lat' : [41.868171, 44.979840, 38.257972, 39.030575],
'lon' : [-87.667458, -93.272474, -85.765187, -95.702548]
})
# Adding code so we can have map default to the center of the data
midpoint = (np.average(data['lat']), np.average(data['lon']))
st.deck_gl_chart(
viewport={
'latitude': midpoint[0],
'longitude': midpoint[1],
'zoom': 4
},
layers=[{
'type': 'ScatterplotLayer',
'data': data,
'radiusScale': 250,
'radiusMinPixels': 5,
'getFillColor': [248, 24, 148],
}]
) |