C2MV commited on
Commit
904877c
·
verified ·
1 Parent(s): 246a909

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -28
app.py CHANGED
@@ -3,10 +3,10 @@ import numpy as np
3
  import plotly.express as px
4
  import plotly.graph_objects as go
5
  import gradio as gr
6
- from gradio.components import Plot
7
 
8
  #DATOS
9
 
 
10
  cities_data = {
11
  'Abancay': {
12
  'desempleo_trimestral': [
@@ -1151,6 +1151,7 @@ cities_data = {
1151
  }
1152
 
1153
 
 
1154
  #DATOS
1155
 
1156
  COLORES = {
@@ -1389,7 +1390,6 @@ with gr.Blocks(
1389
  .card {border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin: 10px 0; background: white}
1390
  .header {font-size: 28px; font-weight: bold; color: #2c3e50; margin-bottom: 20px}
1391
  .subheader {font-size: 20px; color: #3498db; margin: 15px 0}
1392
- .plot-container {min-height: 500px}
1393
  """
1394
  ) as app:
1395
 
@@ -1403,36 +1403,29 @@ with gr.Blocks(
1403
  )
1404
 
1405
  with gr.Tab("Análisis por Ciudad"):
1406
- radar_plot = Plot()
1407
- desempleo_plot = Plot()
1408
- ingresos_plot = Plot()
1409
- informalidad_plot = Plot()
1410
- actividad_plot = Plot()
1411
- brecha_plot = Plot()
1412
 
1413
- gr.Markdown("## 📍 Indicadores Clave", elem_classes="subheader")
1414
- radar_plot.render()
 
 
 
 
 
 
1415
 
1416
- gr.Markdown("## 📈 Tendencias Principales", elem_classes="subheader")
1417
- with gr.Row():
1418
- desempleo_plot.render()
1419
- ingresos_plot.render()
1420
- with gr.Row():
1421
- informalidad_plot.render()
1422
- actividad_plot.render()
1423
-
1424
- gr.Markdown("## 📉 Brecha Salarial", elem_classes="subheader")
1425
- brecha_plot.render()
1426
 
1427
  with gr.Tab("Análisis Comparativo"):
1428
- global_desempleo = Plot()
1429
- global_ingresos = Plot()
1430
- global_brecha = Plot()
1431
-
1432
- gr.Markdown("## 🏙️ Comparativa entre Ciudades", elem_classes="subheader")
1433
- global_desempleo.render()
1434
- global_ingresos.render()
1435
- global_brecha.render()
1436
 
1437
  @app.load()
1438
  def cargar_inicial():
 
3
  import plotly.express as px
4
  import plotly.graph_objects as go
5
  import gradio as gr
 
6
 
7
  #DATOS
8
 
9
+
10
  cities_data = {
11
  'Abancay': {
12
  'desempleo_trimestral': [
 
1151
  }
1152
 
1153
 
1154
+
1155
  #DATOS
1156
 
1157
  COLORES = {
 
1390
  .card {border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin: 10px 0; background: white}
1391
  .header {font-size: 28px; font-weight: bold; color: #2c3e50; margin-bottom: 20px}
1392
  .subheader {font-size: 20px; color: #3498db; margin: 15px 0}
 
1393
  """
1394
  ) as app:
1395
 
 
1403
  )
1404
 
1405
  with gr.Tab("Análisis por Ciudad"):
1406
+ with gr.Column(elem_classes="card"):
1407
+ gr.Markdown("## 📍 Indicadores Clave", elem_classes="subheader")
1408
+ radar_plot = Plot()
 
 
 
1409
 
1410
+ with gr.Column(elem_classes="card"):
1411
+ gr.Markdown("## 📈 Tendencias Principales", elem_classes="subheader")
1412
+ with gr.Row():
1413
+ desempleo_plot = Plot()
1414
+ ingresos_plot = Plot()
1415
+ with gr.Row():
1416
+ informalidad_plot = Plot()
1417
+ actividad_plot = Plot()
1418
 
1419
+ with gr.Column(elem_classes="card"):
1420
+ gr.Markdown("## 📉 Brecha Salarial", elem_classes="subheader")
1421
+ brecha_plot = Plot()
 
 
 
 
 
 
 
1422
 
1423
  with gr.Tab("Análisis Comparativo"):
1424
+ with gr.Column(elem_classes="card"):
1425
+ gr.Markdown("## 🏙️ Comparativa entre Ciudades", elem_classes="subheader")
1426
+ global_desempleo = Plot()
1427
+ global_ingresos = Plot()
1428
+ global_brecha = Plot()
 
 
 
1429
 
1430
  @app.load()
1431
  def cargar_inicial():