Spaces:
Running
Running
Update cluster_insight.py
Browse files- cluster_insight.py +3 -3
cluster_insight.py
CHANGED
|
@@ -224,9 +224,9 @@ def cluster_and_visualize(
|
|
| 224 |
margin=dict(l=50, r=50, t=80, b=50) # 让 Plotly 内部也居中
|
| 225 |
)
|
| 226 |
|
| 227 |
-
|
| 228 |
-
|
| 229 |
|
| 230 |
# return b64, stats
|
| 231 |
-
return fig, stats
|
| 232 |
|
|
|
|
| 224 |
margin=dict(l=50, r=50, t=80, b=50) # 让 Plotly 内部也居中
|
| 225 |
)
|
| 226 |
|
| 227 |
+
img_bytes = fig.to_image(format="png", width=900, height=600, scale=2 ) # 新增这一行!
|
| 228 |
+
b64 = base64.b64encode(img_bytes).decode()
|
| 229 |
|
| 230 |
# return b64, stats
|
| 231 |
+
return fig, b64, stats
|
| 232 |
|