spanofzero commited on
Commit
9cb2234
·
verified ·
1 Parent(s): 106a995

gradio 6.0 update theme

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -154,7 +154,8 @@ custom_theme = gr.themes.Base(
154
  input_background_fill="#0f172a",
155
  )
156
 
157
- with gr.Blocks(theme=custom_theme) as demo:
 
158
  # Invisible states to track coordinates without breaking UI
159
  lat_state = gr.State(0.0)
160
  lon_state = gr.State(0.0)
@@ -165,4 +166,23 @@ with gr.Blocks(theme=custom_theme) as demo:
165
 
166
  loc_input = gr.Textbox(placeholder="Type a City or Zip Code and press Enter...", show_label=False)
167
 
168
- main_table = gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  input_background_fill="#0f172a",
155
  )
156
 
157
+ # FIXED: Removed 'theme' from gr.Blocks() constructor per Gradio 6.0 rules
158
+ with gr.Blocks() as demo:
159
  # Invisible states to track coordinates without breaking UI
160
  lat_state = gr.State(0.0)
161
  lon_state = gr.State(0.0)
 
166
 
167
  loc_input = gr.Textbox(placeholder="Type a City or Zip Code and press Enter...", show_label=False)
168
 
169
+ main_table = gr.Dataframe(headers=["Date", "Historical Forecast", "Aqua Forecast", "Drift Applied"], interactive=False)
170
+
171
+ with gr.Accordion("🗺️ Regional Spatial Map (250 Mile Radius)", open=True):
172
+ with gr.Row():
173
+ day_selector = gr.Radio(["Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7"], label="Forecast Day", value="Day 1")
174
+ map_toggle = gr.Radio(["Historical (Grey)", "Aqua (Red)", "Both"], label="Display Mode", value="Both")
175
+ spatial_map = gr.Plot()
176
+
177
+ # Events Engine
178
+ loc_input.submit(
179
+ fn=process_search,
180
+ inputs=[loc_input, day_selector, map_toggle],
181
+ outputs=[main_table, spatial_map, tz_display, lat_state, lon_state]
182
+ )
183
+
184
+ day_selector.change(fn=update_map, inputs=[lat_state, lon_state, day_selector, map_toggle], outputs=spatial_map)
185
+ map_toggle.change(fn=update_map, inputs=[lat_state, lon_state, day_selector, map_toggle], outputs=spatial_map)
186
+
187
+ # FIXED: Moved 'theme' parameter directly into the launch method
188
+ demo.launch(theme=custom_theme)