VChart
VChart copied to clipboard
[Bug] 风神brush交互问题
Version
1.13.11
Link to Minimal Reproduction
aeolus
Steps to Reproduce
null
Current Behavior
- 拖动brush,未超过阈值,图表会“闪”
- 声明brush后,图元无法交互
-
框选后, 点击图表外部, brush不消失
-
仪表盘编辑页缩放比例设置为50%,框选时, 鼠标的起点位置不正确
Expected Behavior
上述问题得到解决
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
原因分析:
- 跟brush交互改造有关,需要调整brush激活状态,当超过阈值时才激活(vrender侧修改)
- brush在绘制过程中,会将图元设为不可交互,以保证不触发其他状态。绘制结束后,应该将图元重置为可交互,这一步逻辑出错了(vchart修改)
- vrender remove api 使用上有问题,导致brush没有被正确清空(vrender侧修改)
- eventpos转换时,没有考虑到stage scale的情况(vrender侧修改)
接入后还有这两个问题:
- 框选后, 点击图表外部, brush不消失
- 仪表盘编辑页缩放比例设置为50%,框选时, 鼠标的起点位置不正确
__VizChart.instance._chart.getAllComponents()[5]._brushComponents[0].stage.eventPointTransform = (e) => { const point = this.global.mapToCanvasPoint(e, this.window); return this.stage.window.pointTransform(point.x, point.y); }