|
import pandas as pd |
|
import numpy as np |
|
|
|
import gradio as gr |
|
import pygwalker as pyg |
|
|
|
|
|
from pygwalker.api.gradio import PYGWALKER_ROUTE, get_html_on_gradio |
|
|
|
|
|
from data import df |
|
from network import analysis |
|
|
|
|
|
with gr.Blocks(theme=gr.themes.Monochrome()) as demo: |
|
|
|
|
|
|
|
with gr.Row(): |
|
with gr.Column(): |
|
gr.Label("πͺ Visualize witches family connections", show_label=False) |
|
gr.Markdown("You can see the various parent-child-sibling-spouse relationships of the accused witches!") |
|
gr.HTML(analysis) |
|
|
|
with gr.Row(): |
|
with gr.Column(): |
|
gr.Label("π Visually explore witches family data", show_label=False) |
|
gr.Markdown("You can use drag-and-drop operations to explore the data, start your analysis now! In the given query, we see where the accused witches reside after filtering on the gender label (here, Female) and we show a breakdown of the class!") |
|
pyg_app = get_html_on_gradio(df, spec="./config.json") |
|
gr.HTML(pyg_app) |
|
|
|
demo.launch(app_kwargs={"routes": [PYGWALKER_ROUTE]}, share=True).queue() |
|
|