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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import streamlit as st import numpy as np import pandas as pd import leafmap.foliumap as leafmap print("\x1b[1;92mStreamlit script running...\x1b[0m") st.title("streamlit on pycafe") st.markdown( """ Py.cafe is a platform that allows you to create, run, edit, and share Python applications directly in your browser. There's no need for any installation; it works with just a single click. And now, you can use Streamlit on py.cafe! Streamlit is a popular Python library for creating web applications with simple Python scripts. You can create interactive web applications with just a few lines of code. """ ) st.header("Example components") st.subheader("Text input") name = st.text_input("Your name?") st.write("Hello,", name or "world", "!") m = leafmap.Map() m.split_map( left_layer='ESA WorldCover 2020 S2 FCC', right_layer='ESA WorldCover 2020' ) m.add_legend(title='ESA Land Cover', builtin_legend='ESA_WorldCover') m.to_streamlit(height=500) st.subheader("Slider") value = st.slider("Value?") st.write("The slider value is", value) st.subheader("Chart sample") chart_data = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"]) st.area_chart(chart_data) st.subheader("DataFrame sample") df = pd.DataFrame(np.random.randn(50, 20), columns=("col %d" % i for i in range(20))) st.dataframe(df) # Same as st.write(df) st.subheader("Camera and image") if st.checkbox("Show camera"): picture = st.camera_input("Take a picture") if picture: st.image(picture) st.markdown( """ ### Useful links: * [Streamlit official website](https://streamlit.io/) * [Streamlit documentation](https://docs.streamlit.io/) ### Alternatives Also take a look at [stlite](https://edit.share.stlite.net/), a similar platform that allows you to create, run, edit, and share Python applications directly in your browser. Py.cafe runs an unmodified version of streamlit, compared to stlite which has some modifications to make it work in the browser. ### Community * [Py.cafe Discord](https://discord.gg/RpwWnFV3Dv) * [Streamlit community forum](https://discuss.streamlit.io/) """ ) m = leafmap.Map(minimap_control=True) m.add_basemap("OpenTopoMap") m.to_streamlit(height=500)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import streamlit as st import numpy as np import pandas as pd import leafmap.foliumap as leafmap print("\x1b[1;92mStreamlit script running...\x1b[0m") st.title("streamlit on pycafe") st.markdown( """ Py.cafe is a platform that allows you to create, run, edit, and share Python applications directly in your browser. There's no need for any installation; it works with just a single click. And now, you can use Streamlit on py.cafe! Streamlit is a popular Python library for creating web applications with simple Python scripts. You can create interactive web applications with just a few lines of code. """ ) st.header("Example components") st.subheader("Text input") name = st.text_input("Your name?") st.write("Hello,", name or "world", "!") m = leafmap.Map() m.split_map( left_layer='ESA WorldCover 2020 S2 FCC', right_layer='ESA WorldCover 2020' ) m.add_legend(title='ESA Land Cover', builtin_legend='ESA_WorldCover') m.to_streamlit(height=500) st.subheader("Slider") value = st.slider("Value?") st.write("The slider value is", value) st.subheader("Chart sample") chart_data = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"]) st.area_chart(chart_data) st.subheader("DataFrame sample") df = pd.DataFrame(np.random.randn(50, 20), columns=("col %d" % i for i in range(20))) st.dataframe(df) # Same as st.write(df) st.subheader("Camera and image") if st.checkbox("Show camera"): picture = st.camera_input("Take a picture") if picture: st.image(picture) st.markdown( """ ### Useful links: * [Streamlit official website](https://streamlit.io/) * [Streamlit documentation](https://docs.streamlit.io/) ### Alternatives Also take a look at [stlite](https://edit.share.stlite.net/), a similar platform that allows you to create, run, edit, and share Python applications directly in your browser. Py.cafe runs an unmodified version of streamlit, compared to stlite which has some modifications to make it work in the browser. ### Community * [Py.cafe Discord](https://discord.gg/RpwWnFV3Dv) * [Streamlit community forum](https://discuss.streamlit.io/) """ ) m = leafmap.Map(minimap_control=True) m.add_basemap("OpenTopoMap") m.to_streamlit(height=500)