File size: 1,304 Bytes
f8bf7d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# lets try using map stuff without folium, maybe stlite doesnt support that.

import streamlit as st
import pandas as pd

# Load data
f = 'mountains_clr.csv'
df = pd.read_csv(f).dropna()

print(df)

st.markdown("# :whale: :whale: Cetaceans :red[& friends] :balloon:")

st.markdown("## :mountain: Mountains")
st.markdown(f"library version: **{st.__version__}**")
# not sure where my versions are getting pegged from, but we have a 1y spread :(
# https://github.com/streamlit/streamlit/blob/1.24.1/lib/streamlit/elements/map.py
#    rather hard to find the docs for old versions, no selector unlike many libraries.

visp_loc = 46.295833, 7.883333
tile_xyz = 'https://tile.opentopomap.org/{z}/{x}/{y}.png'
tile_attr = '<a href="https://opentopomap.org/">Open Topo Map</a>'
st.map(df, latitude='lat', longitude='lon', color='color', size='size', zoom=7)
#, tiles=tile_xyz, attr=tile_attr)

#st.map(df)

#st.map(df, latitude="col1", longitude="col2", size="col3", color="col4")

import numpy as np

df2 = pd.DataFrame(
    {
        "col1": np.random.randn(1000) / 50 + 37.76,
        "col2": np.random.randn(1000) / 50 + -122.4,
        "col3": np.random.randn(1000) * 100,
        "col4": np.random.rand(1000, 4).tolist(),
    }
)
#st.map(df, latitude="col1", longitude="col2", size="col3", color="col4")