Spaces:
Sleeping
Sleeping
kunifujiwara
commited on
Commit
•
6eba30e
1
Parent(s):
4afa38b
modify pages
Browse files
Home.py
CHANGED
@@ -17,10 +17,10 @@ st.set_page_config(layout="wide")
|
|
17 |
|
18 |
# Data source
|
19 |
data_links = {
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
}
|
25 |
|
26 |
@st.cache_data
|
@@ -60,12 +60,12 @@ def calculate_zoom_level(bbox):
|
|
60 |
return min(max(1, zoom), 20) # Clamp zoom between 1 and 20
|
61 |
|
62 |
def app():
|
63 |
-
st.title("
|
64 |
st.markdown(
|
65 |
"""**Introduction:** This interactive dashboard visualizes Japan Fractional Vegetation Cover at town block levels."""
|
66 |
)
|
67 |
|
68 |
-
prefecture = st.selectbox("
|
69 |
|
70 |
gdf = get_geom_data(prefecture)
|
71 |
|
@@ -75,7 +75,7 @@ def app():
|
|
75 |
|
76 |
# City filter
|
77 |
cities = sorted(gdf['CITY_NAME_x'].unique().tolist())
|
78 |
-
selected_cities = st.multiselect("
|
79 |
|
80 |
# Filter GeoDataFrame based on selected cities
|
81 |
if selected_cities:
|
@@ -84,22 +84,22 @@ def app():
|
|
84 |
gdf_filtered = gdf
|
85 |
|
86 |
attributes = get_data_columns(gdf_filtered)
|
87 |
-
selected_attribute = st.selectbox("
|
88 |
|
89 |
col1, col2, col3, col4, col5, col6 = st.columns(6)
|
90 |
with col1:
|
91 |
-
n_colors = st.slider("
|
92 |
with col2:
|
93 |
-
alpha = st.slider("
|
94 |
with col3:
|
95 |
-
vmin = st.number_input("
|
96 |
with col4:
|
97 |
-
vmax = st.number_input("
|
98 |
with col5:
|
99 |
-
show_3d = st.checkbox("
|
100 |
with col6:
|
101 |
if show_3d:
|
102 |
-
elev_scale = st.slider("
|
103 |
else:
|
104 |
elev_scale = 1
|
105 |
|
|
|
17 |
|
18 |
# Data source
|
19 |
data_links = {
|
20 |
+
"東京都": "https://raw.githubusercontent.com/kunifujiwara/data/master/frac_veg/FRAC_VEG_Tokyo.geojson",
|
21 |
+
"神奈川県": "https://raw.githubusercontent.com/kunifujiwara/data/master/frac_veg/FRAC_VEG_Kanagawa.geojson",
|
22 |
+
"千葉県": "https://raw.githubusercontent.com/kunifujiwara/data/master/frac_veg/FRAC_VEG_Chiba.geojson",
|
23 |
+
"埼玉県": "https://raw.githubusercontent.com/kunifujiwara/data/master/frac_veg/FRAC_VEG_Saitama.geojson",
|
24 |
}
|
25 |
|
26 |
@st.cache_data
|
|
|
60 |
return min(max(1, zoom), 20) # Clamp zoom between 1 and 20
|
61 |
|
62 |
def app():
|
63 |
+
st.title("緑被率マップ")
|
64 |
st.markdown(
|
65 |
"""**Introduction:** This interactive dashboard visualizes Japan Fractional Vegetation Cover at town block levels."""
|
66 |
)
|
67 |
|
68 |
+
prefecture = st.selectbox("都道府県", ["東京都", "神奈川県", "千葉県", "埼玉県"])
|
69 |
|
70 |
gdf = get_geom_data(prefecture)
|
71 |
|
|
|
75 |
|
76 |
# City filter
|
77 |
cities = sorted(gdf['CITY_NAME_x'].unique().tolist())
|
78 |
+
selected_cities = st.multiselect("市区町村", cities, default=[])
|
79 |
|
80 |
# Filter GeoDataFrame based on selected cities
|
81 |
if selected_cities:
|
|
|
84 |
gdf_filtered = gdf
|
85 |
|
86 |
attributes = get_data_columns(gdf_filtered)
|
87 |
+
selected_attribute = st.selectbox("指標", attributes)
|
88 |
|
89 |
col1, col2, col3, col4, col5, col6 = st.columns(6)
|
90 |
with col1:
|
91 |
+
n_colors = st.slider("カラースケールの分割数", min_value=2, max_value=20, value=8)
|
92 |
with col2:
|
93 |
+
alpha = st.slider("透過率", min_value=0.0, max_value=1.0, value=0.8, step=0.1)
|
94 |
with col3:
|
95 |
+
vmin = st.number_input("最大値", value=float(gdf_filtered[selected_attribute].min()), step=0.1)
|
96 |
with col4:
|
97 |
+
vmax = st.number_input("最小値", value=float(gdf_filtered[selected_attribute].max()), step=0.1)
|
98 |
with col5:
|
99 |
+
show_3d = st.checkbox("3Dビュー", value=False)
|
100 |
with col6:
|
101 |
if show_3d:
|
102 |
+
elev_scale = st.slider("スケール", min_value=1, max_value=10000, value=1, step=10)
|
103 |
else:
|
104 |
elev_scale = 1
|
105 |
|