ouhenio commited on
Commit
8d2ed24
·
verified ·
1 Parent(s): 977a1ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -12
app.py CHANGED
@@ -205,7 +205,7 @@ class MapVisualization:
205
  async () => {{
206
  // Load D3.js modules
207
  const script1 = document.createElement("script");
208
- script1.src = "https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js";
209
  document.head.appendChild(script1);
210
 
211
  // Wait for D3 to load
@@ -217,7 +217,7 @@ class MapVisualization:
217
 
218
  // Load topojson
219
  const script2 = document.createElement("script");
220
- script2.src = "https://cdn.jsdelivr.net/npm/topojson-client@3.1.0/dist/topojson-client.min.js";
221
  document.head.appendChild(script2);
222
 
223
  await new Promise(resolve => {{
@@ -520,19 +520,22 @@ class ApplicationFactory:
520
  map_data = gr.JSON(value=app_state.to_json(), visible=False)
521
 
522
  with gr.Column(scale=1):
523
-
524
  # Overall statistics
525
- total_docs, avg_completion, countries_over_50 = app_state.get_stats()
526
- total_docs_ui = gr.Number(value=total_docs, label="Total Documents", interactive=False)
527
- avg_completion_ui = gr.Number(value=avg_completion, label="Average Completion (%)", interactive=False)
528
- countries_over_50_ui = gr.Number(value=countries_over_50, label="Countries Over 50%", interactive=False)
 
 
529
 
530
  # Country details
531
- country_selector = gr.Dropdown(
532
- choices=[f"{data.name} ({code})" for code, data in app_state.countries.items()],
533
- label="Select Country"
534
- )
535
- country_progress = gr.JSON(label="Country Progress", value={})
 
 
536
 
537
  # Refresh button
538
  refresh_btn = gr.Button("Refresh Map")
 
205
  async () => {{
206
  // Load D3.js modules
207
  const script1 = document.createElement("script");
208
+ script1.src = "https://cdn.jsdelivr.net/npm/d3@7";
209
  document.head.appendChild(script1);
210
 
211
  // Wait for D3 to load
 
217
 
218
  // Load topojson
219
  const script2 = document.createElement("script");
220
+ script2.src = "https://cdn.jsdelivr.net/npm/topojson@3";
221
  document.head.appendChild(script2);
222
 
223
  await new Promise(resolve => {{
 
520
  map_data = gr.JSON(value=app_state.to_json(), visible=False)
521
 
522
  with gr.Column(scale=1):
 
523
  # Overall statistics
524
+ with gr.Box():
525
+ gr.Markdown("### Statistics")
526
+ total_docs, avg_completion, countries_over_50 = app_state.get_stats()
527
+ total_docs_ui = gr.Number(value=total_docs, label="Total Documents", interactive=False)
528
+ avg_completion_ui = gr.Number(value=avg_completion, label="Average Completion (%)", interactive=False)
529
+ countries_over_50_ui = gr.Number(value=countries_over_50, label="Countries Over 50%", interactive=False)
530
 
531
  # Country details
532
+ with gr.Box():
533
+ gr.Markdown("### Country Details")
534
+ country_selector = gr.Dropdown(
535
+ choices=[f"{data.name} ({code})" for code, data in app_state.countries.items()],
536
+ label="Select Country"
537
+ )
538
+ country_progress = gr.JSON(label="Country Progress", value={})
539
 
540
  # Refresh button
541
  refresh_btn = gr.Button("Refresh Map")