plotly / plotly/plotly.js

Scroll zoom does not work properly when minimum and maximum range is enabled

未关闭
#7,440 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

Scroll zoom does not work as expected when minimum and maximum range is enabled. Graphical side effects are constantly visible while zooming in/out.

See the provided example of the scatter plot chart:

  • Scrolling zoom (mouse wheel) is enabled (with scrollZoom property).
  • Minimum and maximum range is set (with minallowed and maxallowed properties).
  • (The grids and axes are visualised for better understanding the issue.)

https://codepen.io/zabka5/full/XJbYrZV

Use the mouse wheel to zoom out beyond allowed range.
The plotted trace is zoomed out even beyond the range. After a while, the plotting is "corrected" to the right zoom level. The effect is stronger if you zoom out faster. What is interesting, the axes and the grids are always scaled correctly. It means that plotting of the grid lines is always aware of the range limits but plotting the trace not.

The same effect can be reproduced while zooming IN relatively fast, even if the plot is "in the range". Then, the plotted trace exceeds the area defined by the X and Y axes and then i.e. the bigger than expected, but after a while, plotting is corrected. With this attached example, it is hard to observe this scenario. (Maybe bigger amount of data or slowness of the refreshing of the plot plays a role - with my custom environment, I can see it constantly).

The observed flickering is very annoying and shows a serious weakness in this function.

I have checked the different versions of the plotly library. The issue is easy to reproduce from the very first version introducing the minimum and maximum range, i.e. version v2.26.0 #6547

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从提供的 CodePen 复现和 v2.26.0 (#6547) 中引入的最小值/最大值范围实现开始。在快速滚动缩放事件期间,将 trace 的渲染与正确缩放的坐标轴和网格进行比较。当 trace 保持在允许的范围内,且不会闪烁或在之后被修正时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。