Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,24 +111,33 @@ with gr.Blocks(title="EGISInsight", theme=gr.themes.Soft()) as demo:
|
|
| 111 |
html_output = gr.HTML(label="分析报告")
|
| 112 |
# sankey_plot = gr.Plot(label="桑基图(完整交互式)")
|
| 113 |
# cluster_plot = gr.Plot(label="聚类图(完整交互式)")
|
| 114 |
-
# 桑基图:居中
|
| 115 |
-
with gr.Box(elem_style={"display": "flex", "justify-content": "center", "margin": "20px 0"}):
|
| 116 |
-
sankey_plot = gr.Plot(label="桑基图(完整交互式)")
|
| 117 |
|
| 118 |
-
#
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
file_input.change(
|
| 125 |
fn=analyze_report,
|
| 126 |
inputs=file_input,
|
| 127 |
-
outputs=[html_output, sankey_plot, cluster_plot, stats_json]
|
| 128 |
)
|
| 129 |
|
| 130 |
gr.Markdown("---")
|
| 131 |
-
gr.Markdown("
|
| 132 |
|
| 133 |
# ================== 启动 ==================
|
| 134 |
if __name__ == "__main__":
|
|
|
|
| 111 |
html_output = gr.HTML(label="分析报告")
|
| 112 |
# sankey_plot = gr.Plot(label="桑基图(完整交互式)")
|
| 113 |
# cluster_plot = gr.Plot(label="聚类图(完整交互式)")
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
+
# 桑基图:居中
|
| 116 |
+
# 桑基图:用 HTML 容器模拟居中
|
| 117 |
+
sankey_html = gr.HTML(
|
| 118 |
+
value='<div style="display: flex; justify-content: center; margin: 20px 0;"><h3>桑基图(交互式)</h3></div>',
|
| 119 |
+
label=""
|
| 120 |
+
)
|
| 121 |
+
sankey_plot = gr.Plot()
|
| 122 |
+
|
| 123 |
+
# 聚类图:同上
|
| 124 |
+
cluster_html = gr.HTML(
|
| 125 |
+
value='<div style="display: flex; justify-content: center; margin: 20px 0;"><h3>聚类图(交互式)</h3></div>',
|
| 126 |
+
label=""
|
| 127 |
+
)
|
| 128 |
+
cluster_plot = gr.Plot()
|
| 129 |
+
|
| 130 |
+
# 统计数据(可选隐藏)
|
| 131 |
+
stats_json = gr.JSON(visible=False)
|
| 132 |
|
| 133 |
file_input.change(
|
| 134 |
fn=analyze_report,
|
| 135 |
inputs=file_input,
|
| 136 |
+
outputs=[html_output, sankey_html, sankey_plot, cluster_html, cluster_plot, stats_json]
|
| 137 |
)
|
| 138 |
|
| 139 |
gr.Markdown("---")
|
| 140 |
+
gr.Markdown("**已集成通义千问大模型,对分析结果自动生成教案、微课脚本、作业设计**")
|
| 141 |
|
| 142 |
# ================== 启动 ==================
|
| 143 |
if __name__ == "__main__":
|