Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,28 +18,35 @@ iface = gr.Blocks()
|
|
| 18 |
with iface:
|
| 19 |
gr.Markdown("# Foro Din谩mico con Visualizaci贸n de Red")
|
| 20 |
|
| 21 |
-
# Norm Selection Section
|
| 22 |
with gr.Row():
|
| 23 |
gr.Markdown('## Selecci贸n de Norma')
|
| 24 |
|
| 25 |
normativa_dropdown = gr.Dropdown(choices=norm_options, label="Normativas")
|
| 26 |
normativa_html = gr.HTML()
|
| 27 |
|
| 28 |
-
# Update HTML when a norm is selected
|
| 29 |
normativa_dropdown.change(fn=mostrar_detalles, inputs=normativa_dropdown, outputs=normativa_html)
|
| 30 |
-
|
|
|
|
| 31 |
with gr.Row():
|
| 32 |
gr.Markdown("## Red de Aportes:")
|
| 33 |
graph_output = gr.Image(visualizar_grafo(), label="Red de Aportes")
|
| 34 |
|
|
|
|
| 35 |
with gr.Row():
|
| 36 |
nombre = gr.Dropdown(choices=student_names, label="Nombre del Estudiante")
|
| 37 |
-
enfoque = gr.Radio(["Determinista", "Sist茅mico"
|
| 38 |
|
| 39 |
with gr.Row():
|
| 40 |
texto = gr.Textbox(label="Tu aporte")
|
| 41 |
|
|
|
|
| 42 |
submit_button = gr.Button("Agregar Aporte")
|
| 43 |
-
submit_button.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
iface.launch(share=True)
|
|
|
|
| 18 |
with iface:
|
| 19 |
gr.Markdown("# Foro Din谩mico con Visualizaci贸n de Red")
|
| 20 |
|
| 21 |
+
# 馃搶 Norm Selection Section
|
| 22 |
with gr.Row():
|
| 23 |
gr.Markdown('## Selecci贸n de Norma')
|
| 24 |
|
| 25 |
normativa_dropdown = gr.Dropdown(choices=norm_options, label="Normativas")
|
| 26 |
normativa_html = gr.HTML()
|
| 27 |
|
| 28 |
+
# 馃搶 Update HTML when a norm is selected
|
| 29 |
normativa_dropdown.change(fn=mostrar_detalles, inputs=normativa_dropdown, outputs=normativa_html)
|
| 30 |
+
|
| 31 |
+
# 馃搶 Graph Display
|
| 32 |
with gr.Row():
|
| 33 |
gr.Markdown("## Red de Aportes:")
|
| 34 |
graph_output = gr.Image(visualizar_grafo(), label="Red de Aportes")
|
| 35 |
|
| 36 |
+
# 馃搶 Input Fields
|
| 37 |
with gr.Row():
|
| 38 |
nombre = gr.Dropdown(choices=student_names, label="Nombre del Estudiante")
|
| 39 |
+
enfoque = gr.Radio(["Determinista", "Sist茅mico"], label="Enfoque")
|
| 40 |
|
| 41 |
with gr.Row():
|
| 42 |
texto = gr.Textbox(label="Tu aporte")
|
| 43 |
|
| 44 |
+
# 馃搶 Submit Button (Now Uses `normativa_dropdown` Directly)
|
| 45 |
submit_button = gr.Button("Agregar Aporte")
|
| 46 |
+
submit_button.click(
|
| 47 |
+
fn=agregar_aporte,
|
| 48 |
+
inputs=[nombre, enfoque, normativa_dropdown, texto],
|
| 49 |
+
outputs=graph_output
|
| 50 |
+
)
|
| 51 |
|
| 52 |
+
iface.launch(share=True)
|