File size: 989 Bytes
88bf058
785d551
88bf058
 
 
 
 
 
 
 
 
69b5d49
17a9ce7
69b5d49
4f5fa3f
88bf058
 
 
 
 
 
 
 
 
69b5d49
88bf058
69b5d49
88bf058
 
46c159e
232908b
46c159e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr
from utils_gdmk import (
    inicializar_grafo, cargar_normativas, cargar_estudiantes, mostrar_detalles,
    visualizar_grafo, agregar_aporte
)

# Initialize graph before launching UI
inicializar_grafo()
normativas = cargar_normativas()
estudiantes = cargar_estudiantes()

coleccion = "normativa_peruana_gestion_riesgos"
#coleccion = "propuestas_gestion_incertidumbre"

norm_options = [norm['nombre'] for norm in normativas[coleccion]]
student_names = estudiantes["estudiantes"]

# Gradio Interface
iface = gr.Blocks()

with iface:
    gr.Markdown("# Foro Dinámico con Visualización de Red")

    with gr.Row():
        gr.Markdown('## Selección del Documento')   
    
    normativa_dropdown = gr.Dropdown(choices=norm_options, label="Documentos a Explorar")
    normativa_html = gr.HTML()

    # 📌 Update HTML when a norm is selected
    normativa_dropdown.change(fn=mostrar_detalles, inputs=normativa_dropdown, outputs=normativa_html)

iface.launch(share=True)