awacke1 commited on
Commit
82efd8d
·
1 Parent(s): a7a4739

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -12
app.py CHANGED
@@ -75,21 +75,27 @@ def plot_state_outline(state_code, us_states_geojson, state_names):
75
  fig.update_layout(title=f"{state_name} State Outline")
76
  st.plotly_chart(fig)
77
 
78
- geojson_path = 'gz_2010_us_040_00_500k.json'
79
- with open(geojson_path, 'r') as file:
80
- us_states_geojson = json.load(file)
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
- state_names = {
83
- 'MN': 'Minnesota', 'CA': 'California', 'WA': 'Washington',
84
- 'FL': 'Florida', 'TX': 'Texas', 'NY': 'New York', 'NV': 'Nevada'
85
- }
86
 
87
- states = ['MN', 'CA', 'WA', 'FL', 'TX', 'NY', 'NV']
88
- icons = ['🦆', '🌴', '🍎', '🌞', '🤠', '🗽', '🎰']
89
 
90
- for state, icon in zip(states, icons):
91
- st.write(f"{icon} {state}")
92
- plot_state_outline(state, us_states_geojson, state_names)
93
 
94
  # Display maps
95
  MapInfo = ListMaps()
@@ -98,6 +104,8 @@ MapInfo = ListMaps()
98
  for state, icon in zip(states, icons):
99
  st.write(f"{icon} {state}")
100
  plot_state_outline(state, us_states_geojson, state_names)
 
 
101
 
102
  # Main code
103
  st.title('U.S. States Trivia 🗺️')
 
75
  fig.update_layout(title=f"{state_name} State Outline")
76
  st.plotly_chart(fig)
77
 
78
+ def PlotOutlines():
79
+ geojson_path = 'gz_2010_us_040_00_500k.json'
80
+ with open(geojson_path, 'r') as file:
81
+ us_states_geojson = json.load(file)
82
+
83
+ state_names = {
84
+ 'MN': 'Minnesota', 'CA': 'California', 'WA': 'Washington',
85
+ 'FL': 'Florida', 'TX': 'Texas', 'NY': 'New York', 'NV': 'Nevada'
86
+ }
87
+
88
+ states = ['MN', 'CA', 'WA', 'FL', 'TX', 'NY', 'NV']
89
+ icons = ['🦆', '🌴', '🍎', '🌞', '🤠', '🗽', '🎰']
90
+
91
+ for state, icon in zip(states, icons):
92
+ st.write(f"{icon} {state}")
93
+ plot_state_outline(state, us_states_geojson, state_names)
94
 
95
+ return us_states_geojson
 
 
 
96
 
 
 
97
 
98
+
 
 
99
 
100
  # Display maps
101
  MapInfo = ListMaps()
 
104
  for state, icon in zip(states, icons):
105
  st.write(f"{icon} {state}")
106
  plot_state_outline(state, us_states_geojson, state_names)
107
+
108
+ Geo = PlotOutlines()
109
 
110
  # Main code
111
  st.title('U.S. States Trivia 🗺️')