modeBarButtonsToAdd doesn’t appear to be working as intended
未关闭
还没有人认领这个 Issue。
bug
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Using "modeBarButtonsToAdd" to add buttons for interactive annotations and shape drawing in plotly figures, it prevents the HTML plot to be shown at all with plotly.offline rendering!
import plotly.offline as offline
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
fig.update_layout(
dragmode='drawopenpath',
newshape_line_color='cyan',
title_text='Draw a path to separate versicolor and virginica'
)
config = dict({'scrollZoom': True,'displaylogo': False, 'modeBarButtonsToAdd':['drawline','drawopenpath','drawcircle','drawrect','eraseshape']})
offline.plot(fig,
auto_open=True, image = None, config =config,
filename='./foo.html', include_plotlyjs='directory')
If the 'modeBarButtonsToAdd':[ ] is emptied, the HTML is correctly rendered again. Any idea with this weird behaviour?
Please, see also https://eoss-image-processing.github.io/2020/05/06/shape-drawing.html
Environment:
Python 3.7
Plotly 4.14.1
dash 1.18.1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 plotly.offline.plot 和 modeBarButtonsToAdd 配置运行所提供的 Python 复现代码,并将其与空按钮列表进行比较。跟踪离线 HTML 的生成过程,并验证在启用绘图按钮时输出能够成功渲染;检查行为时使用所报告的 Python 3.7 和 Plotly 4.14.1 环境。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100