Spaces:
Sleeping
Sleeping
cassiebuhler
commited on
Commit
·
2670113
1
Parent(s):
374a500
filters "on" by default
Browse files
app.py
CHANGED
@@ -55,10 +55,10 @@ justice40_color = "#00008B" #purple
|
|
55 |
svi_color = "#850101" #red
|
56 |
white = "#FFFFFF"
|
57 |
|
58 |
-
# gap codes
|
59 |
default_gap = {
|
60 |
-
|
61 |
-
|
62 |
}
|
63 |
|
64 |
from functools import reduce
|
@@ -171,7 +171,7 @@ def getButtons(style_options, style_choice, default_gap=None): #finding the butt
|
|
171 |
opts = [style[0] for style in style_options[style_choice]['stops']]
|
172 |
default_gap = default_gap or {}
|
173 |
buttons = {
|
174 |
-
name: st.checkbox(f"{name}", value=default_gap.get(name,
|
175 |
for name in opts
|
176 |
}
|
177 |
filter_choice = [key for key, value in buttons.items() if value] # return only selected
|
@@ -180,7 +180,6 @@ def getButtons(style_options, style_choice, default_gap=None): #finding the butt
|
|
180 |
return d
|
181 |
|
182 |
|
183 |
-
|
184 |
def getColorVals(style_options, style_choice):
|
185 |
#df_tab only includes filters selected, we need to manually add "color_by" column (if it's not already a filter).
|
186 |
column = style_options[style_choice]['property']
|
@@ -335,6 +334,16 @@ st.caption("ℹ️ Tip: Use the left sidebar to color-code the map by different
|
|
335 |
|
336 |
|
337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
# m = leafmap.Map(style="positron")
|
339 |
m = leafmap.Map()
|
340 |
m.add_basemap("CartoDB.PositronNoLabels")
|
|
|
55 |
svi_color = "#850101" #red
|
56 |
white = "#FFFFFF"
|
57 |
|
58 |
+
# gap codes 3 and 4 are off by default.
|
59 |
default_gap = {
|
60 |
+
3: False,
|
61 |
+
4: False,
|
62 |
}
|
63 |
|
64 |
from functools import reduce
|
|
|
171 |
opts = [style[0] for style in style_options[style_choice]['stops']]
|
172 |
default_gap = default_gap or {}
|
173 |
buttons = {
|
174 |
+
name: st.checkbox(f"{name}", value=default_gap.get(name, True), key=column + str(name))
|
175 |
for name in opts
|
176 |
}
|
177 |
filter_choice = [key for key, value in buttons.items() if value] # return only selected
|
|
|
180 |
return d
|
181 |
|
182 |
|
|
|
183 |
def getColorVals(style_options, style_choice):
|
184 |
#df_tab only includes filters selected, we need to manually add "color_by" column (if it's not already a filter).
|
185 |
column = style_options[style_choice]['property']
|
|
|
334 |
|
335 |
|
336 |
|
337 |
+
# '''
|
338 |
+
# # CA 30X30 Prototype (Safari/iOS Compatible)
|
339 |
+
|
340 |
+
# An interactive cloud-native geospatial tool for exploring and visualizing California’s protected lands through open data and generative AI.
|
341 |
+
# - ⬅️ Use the left sidebar to color-code the map by different attributes, toggle on data layers and view summary charts, or filter data.
|
342 |
+
|
343 |
+
|
344 |
+
# '''
|
345 |
+
# st.divider()
|
346 |
+
|
347 |
# m = leafmap.Map(style="positron")
|
348 |
m = leafmap.Map()
|
349 |
m.add_basemap("CartoDB.PositronNoLabels")
|