Spaces:
Running
Running
Update cluster_insight.py
Browse files- cluster_insight.py +5 -4
cluster_insight.py
CHANGED
|
@@ -248,9 +248,10 @@ def cluster_and_visualize(
|
|
| 248 |
text=[f"聚类 {l}" for l in labels],
|
| 249 |
hoverinfo='text',
|
| 250 |
hoverlabel=dict(
|
| 251 |
-
font=dict(family=
|
| 252 |
bgcolor='white'
|
| 253 |
),
|
|
|
|
| 254 |
showlegend=False
|
| 255 |
))
|
| 256 |
# 聚类中心
|
|
@@ -264,17 +265,17 @@ def cluster_and_visualize(
|
|
| 264 |
marker=dict(size=30, color=cluster_colors[i], line=dict(width=2, color='black')),
|
| 265 |
text=[keyword],
|
| 266 |
textposition="top center",
|
| 267 |
-
textfont=dict(family=
|
| 268 |
showlegend=False
|
| 269 |
))
|
| 270 |
|
| 271 |
fig.update_layout(
|
| 272 |
title="EGISInsight:学生反馈聚类洞察",
|
| 273 |
titlefont=dict(
|
| 274 |
-
family=
|
| 275 |
size=22
|
| 276 |
),
|
| 277 |
-
font=dict(family=
|
| 278 |
width=900, height=600,
|
| 279 |
plot_bgcolor='#F5F5F5',
|
| 280 |
autosize=False, # 关闭自动缩放
|
|
|
|
| 248 |
text=[f"聚类 {l}" for l in labels],
|
| 249 |
hoverinfo='text',
|
| 250 |
hoverlabel=dict(
|
| 251 |
+
font=dict(family="Noto Sans CJK SC", size=16), # hover 字体适配中文
|
| 252 |
bgcolor='white'
|
| 253 |
),
|
| 254 |
+
textfont=dict(family="Noto Sans CJK SC"),
|
| 255 |
showlegend=False
|
| 256 |
))
|
| 257 |
# 聚类中心
|
|
|
|
| 265 |
marker=dict(size=30, color=cluster_colors[i], line=dict(width=2, color='black')),
|
| 266 |
text=[keyword],
|
| 267 |
textposition="top center",
|
| 268 |
+
textfont=dict(family="Noto Sans CJK SC", size=20, color='black'),
|
| 269 |
showlegend=False
|
| 270 |
))
|
| 271 |
|
| 272 |
fig.update_layout(
|
| 273 |
title="EGISInsight:学生反馈聚类洞察",
|
| 274 |
titlefont=dict(
|
| 275 |
+
family="Noto Sans CJK SC",
|
| 276 |
size=22
|
| 277 |
),
|
| 278 |
+
font=dict(family="Noto Sans CJK SC", size=18),
|
| 279 |
width=900, height=600,
|
| 280 |
plot_bgcolor='#F5F5F5',
|
| 281 |
autosize=False, # 关闭自动缩放
|