updatemenu button moves on 2nd click
未关闭
还没有人认领这个 Issue。
bug
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Adding an updatemenu button to toggle the legend, the button shifts to the left on 2nd click under certain conditions.
Minimal Example
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species")
legend = dict(
x=1, y=1, xanchor="right", yanchor="top", groupclick="toggleitem"
)
legend_toggle = dict(
args=["showlegend", True],
args2=["showlegend", False],
label="Toggle legend",
method="relayout",
)
fig.update_layout(
legend=legend,
updatemenus=[
dict(type="buttons", buttons=[legend_toggle], showactive=True, x=1, y=1)
],
)
fig.update_xaxes(range=[0, 10])
fig.show()
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行最小 Python 示例,并在切换图例的同时重现 updatemenu 按钮在第二次点击时的移动。跟踪图例和 updatemenu 的布局处理,然后验证在所报告的条件下,重复切换不会改变按钮的位置。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100