plotly doesn't render html for data with long descriptions
未关闭
还没有人认领这个 Issue。
bug
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
When trying to create a scatter plot with long descriptions (~5k chars), the html file stops running. Unfortunately, the description cannot be shortened. Here's a code snipped that will help reproduce the problem:
import numpy as np
import pandas as pd
import plotly.express as px
embedding2d = # generate np.array with shape: (389000, 2)
x = embedding2d[:, 0]
y = embedding2d[:, 1]
data = pd.DataFrame({
'x': x,
'y': y,
'text': # generate list of 389000 samples with 10k chars each sample
})
# Визуализация с plotly
fig = px.scatter(
data, x='x', y='y',
#template='plotly_dark',
hover_data=['text'], # Добавляем данные, которые будут отображаться при наведении
title="2D Vector Visualization with Labels",
)
fig.update_layout(
width=1520, height=685,
title_x=0.5
)
fig.show()
fig.write_html('visualization.html') # open browser
P.s. Changing browser doesn't help. I waited about 20 minutes
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用提供的 Python 代码片段重现该故障,包括大型散点数据和较长的文本值,然后比较 fig.show() 与 fig.write_html('visualization.html')。调查生成的 HTML 如何处理 hover_data 负载;当生成的 HTML 能够可靠地打开并渲染带有长描述的图表时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- numpy, pandas, plotly, python
- 领域
- data-visualization, performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 28/100