Spaces:
Sleeping
Sleeping
Charles De Dampierre
commited on
Commit
•
f144f21
1
Parent(s):
5251d02
add population files when it is here
Browse files- app.py +69 -47
- data/population/Arabic world.png +3 -0
- data/population/Balkans.png +3 -0
- data/population/British Islands.png +3 -0
- data/population/Central Europe.png +3 -0
- data/population/Chinese world.png +3 -0
- data/population/Eastern Europe.png +3 -0
- data/population/France.png +3 -0
- data/population/German world.png +3 -0
- data/population/Greek World.png +3 -0
- data/population/Indian world.png +3 -0
- data/population/Italy.png +3 -0
- data/population/Japan.png +3 -0
- data/population/Korea.png +3 -0
- data/population/Latin World.png +3 -0
- data/population/Low countries.png +3 -0
- data/population/Muslim world.png +3 -0
- data/population/Nordic countries.png +3 -0
- data/population/Ottoman Turkey.png +3 -0
- data/population/Persian world.png +3 -0
- data/population/Portugal.png +3 -0
- data/population/Southwestern Europe.png +3 -0
- data/population/Spain.png +3 -0
- data/population/United Kingdom.png +3 -0
- data/population/Western Europe.png +3 -0
- moving_pictures.sh +4 -0
- todo.md +2 -2
app.py
CHANGED
@@ -1,58 +1,80 @@
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
|
|
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 |
-
"Japan":
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
"
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
-
|
43 |
-
|
|
|
44 |
|
45 |
# Allow the user to select a region
|
46 |
selected_region = st.sidebar.selectbox("Region:", regions)
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
# Add more information or charts specific to the selected region here
|
54 |
else:
|
55 |
-
st.write("Please select
|
56 |
-
|
57 |
-
# You can add more content and visualizations for the selected region below
|
58 |
-
# For example, charts, statistics, and other relevant data
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
+
import os
|
4 |
|
5 |
+
|
6 |
+
st.title("Our History in Data")
|
7 |
+
|
8 |
+
# Set the global index path
|
9 |
+
global_index_path = "data/immaterial_index/figures_trends_R/results"
|
10 |
+
unseen_index_path = (
|
11 |
+
"data/immaterial_index/figures_trends_R/figures_unseen/results_unseen"
|
12 |
+
)
|
13 |
+
unseen_capita_index_path = (
|
14 |
+
"data/immaterial_index/figures_trends_R/figures_unseen/results_unseen/per_capita"
|
15 |
+
)
|
16 |
+
|
17 |
+
|
18 |
+
population_path = "data/population"
|
19 |
+
|
20 |
+
|
21 |
+
# Update image_paths using global_index_path
|
22 |
+
index_paths = {
|
23 |
+
"India": {
|
24 |
+
"global_index": f"{global_index_path}/india.png",
|
25 |
+
"unseen_index": f"{unseen_index_path}/india.png",
|
26 |
+
"unseen_index_capita": f"{unseen_capita_index_path}/india.png",
|
27 |
+
"population_index": f"{population_path}/Indian world.png",
|
28 |
+
},
|
29 |
+
"Japan": {
|
30 |
+
"global_index": f"{global_index_path}/japan.png",
|
31 |
+
"unseen_index": f"{unseen_index_path}/japan.png",
|
32 |
+
"unseen_index_capita": f"{unseen_capita_index_path}/Japan.png",
|
33 |
+
"population_index": f"{population_path}/Japan.png",
|
34 |
+
},
|
35 |
+
"France": {
|
36 |
+
"global_index": f"{global_index_path}/france.png",
|
37 |
+
"unseen_index": f"{unseen_index_path}/france.png",
|
38 |
+
"unseen_index_capita": f"{unseen_capita_index_path}/France.png",
|
39 |
+
"population_index": f"{population_path}/France.png",
|
40 |
+
},
|
41 |
+
"Italy": {
|
42 |
+
"global_index": f"{global_index_path}/italy.png",
|
43 |
+
"unseen_index": f"{unseen_index_path}/italy.png",
|
44 |
+
"unseen_index_capita": f"{unseen_capita_index_path}/Italy.png",
|
45 |
+
"population_index": f"{population_path}/Italy.png",
|
46 |
+
},
|
47 |
+
"Spain": {
|
48 |
+
"global_index": f"{global_index_path}/spain.png",
|
49 |
+
"unseen_index": f"{unseen_index_path}/spain.png",
|
50 |
+
"unseen_index_capita": f"{unseen_capita_index_path}/Spain.png",
|
51 |
+
"population_index": f"{population_path}/Spain.png",
|
52 |
+
},
|
53 |
}
|
54 |
|
55 |
+
|
56 |
+
# Get the region names (keys) from the index_paths dictionary
|
57 |
+
regions = list(index_paths.keys())
|
58 |
|
59 |
# Allow the user to select a region
|
60 |
selected_region = st.sidebar.selectbox("Region:", regions)
|
61 |
|
62 |
+
# Display the selected region's images vertically
|
63 |
+
if selected_region in index_paths:
|
64 |
+
for key, path in index_paths[selected_region].items():
|
65 |
+
if os.path.exists(path):
|
66 |
+
if key == "global_index":
|
67 |
+
st.subheader("Global Index")
|
68 |
+
elif key == "unseen_index":
|
69 |
+
st.subheader("Unsee-Species Index")
|
70 |
+
elif key == "unseen_index_capita":
|
71 |
+
st.subheader("Unsee-Species per capita Index")
|
72 |
+
elif key == "population_index":
|
73 |
+
st.subheader("")
|
74 |
|
75 |
+
st.image(Image.open(path), caption=key.capitalize(), use_column_width=True)
|
76 |
+
else:
|
77 |
+
st.write(f"File for {key.capitalize()} does not exist.")
|
78 |
+
# Add more information or charts specific to India here
|
|
|
79 |
else:
|
80 |
+
st.write("Please select India as the region from the sidebar on the left.")
|
|
|
|
|
|
data/population/Arabic world.png
ADDED
Git LFS Details
|
data/population/Balkans.png
ADDED
Git LFS Details
|
data/population/British Islands.png
ADDED
Git LFS Details
|
data/population/Central Europe.png
ADDED
Git LFS Details
|
data/population/Chinese world.png
ADDED
Git LFS Details
|
data/population/Eastern Europe.png
ADDED
Git LFS Details
|
data/population/France.png
ADDED
Git LFS Details
|
data/population/German world.png
ADDED
Git LFS Details
|
data/population/Greek World.png
ADDED
Git LFS Details
|
data/population/Indian world.png
ADDED
Git LFS Details
|
data/population/Italy.png
ADDED
Git LFS Details
|
data/population/Japan.png
ADDED
Git LFS Details
|
data/population/Korea.png
ADDED
Git LFS Details
|
data/population/Latin World.png
ADDED
Git LFS Details
|
data/population/Low countries.png
ADDED
Git LFS Details
|
data/population/Muslim world.png
ADDED
Git LFS Details
|
data/population/Nordic countries.png
ADDED
Git LFS Details
|
data/population/Ottoman Turkey.png
ADDED
Git LFS Details
|
data/population/Persian world.png
ADDED
Git LFS Details
|
data/population/Portugal.png
ADDED
Git LFS Details
|
data/population/Southwestern Europe.png
ADDED
Git LFS Details
|
data/population/Spain.png
ADDED
Git LFS Details
|
data/population/United Kingdom.png
ADDED
Git LFS Details
|
data/population/Western Europe.png
ADDED
Git LFS Details
|
moving_pictures.sh
CHANGED
@@ -2,3 +2,7 @@
|
|
2 |
cp -r ../immaterial_index data/
|
3 |
find data/immaterial_index -type f ! -name "*.png" -exec rm {} \;
|
4 |
|
|
|
|
|
|
|
|
|
|
2 |
cp -r ../immaterial_index data/
|
3 |
find data/immaterial_index -type f ! -name "*.png" -exec rm {} \;
|
4 |
|
5 |
+
|
6 |
+
cp -r ../figures_notebooks/figures/environment/population data/
|
7 |
+
find data/population -type f ! -name "*.png" -exec rm {} \;
|
8 |
+
|
todo.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# ToDo List Cultura
|
2 |
|
3 |
-
- [] Faire une commande qui bouge les fichiers dans le nouveau répo
|
4 |
-
- [] Afficher la première région avec le plus d'informations possibles (GDP per capita, CPi, CPi per capita, unseen, unseen per capita, population)
|
5 |
- []
|
6 |
- []
|
7 |
- []
|
|
|
1 |
# ToDo List Cultura
|
2 |
|
3 |
+
- [x] Faire une commande qui bouge les fichiers dans le nouveau répo
|
4 |
+
- [x] Afficher la première région avec le plus d'informations possibles pour un Use case (GDP per capita, CPi, CPi per capita, unseen, unseen per capita, population)
|
5 |
- []
|
6 |
- []
|
7 |
- []
|