Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在镜像分面中使用滚动条报错 #3152

Closed
1 task done
Dante-dan opened this issue Dec 22, 2020 · 6 comments
Closed
1 task done

在镜像分面中使用滚动条报错 #3152

Dante-dan opened this issue Dec 22, 2020 · 6 comments
Assignees

Comments

@Dante-dan
Copy link

Dante-dan commented Dec 22, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

如果给 view 添加 scrollbar 会导致视图只展示一小部分, 而且上下两个 view 不会同步滚动。

语义上来讲,scrollbar 应该属于 Chart,且会同步滚动。

Environment Info
g2 4.1.4
System bigsur
Browser chrome v87

希望能给出临时的解决方案,或者有没有其他办法实现滚动逻辑。

@hustcc
Copy link
Member

hustcc commented Jan 29, 2021

暂时不支持,问题是滚动条目前没有指定针对什么字段进行滚动。

这个在规划中,解决方案是可以指定滚动条作用的字段,然后进行数据过滤。

@hustcc hustcc self-assigned this Jan 29, 2021
@bigfacewo
Copy link

同样的问题,其实我只是希望在分面字段很多的时候,在不缩放每个子图表的情况下,能够通过滚动条上下查看所有的子图表。

@hustcc
Copy link
Member

hustcc commented Apr 25, 2023

同样的问题,其实我只是希望在分面字段很多的时候,在不缩放每个子图表的情况下,能够通过滚动条上下查看所有的子图表。

建议这种情况是把滚动条外置,然后通过事件去处理图表的绘制。

@hustcc hustcc closed this as completed Apr 25, 2023
@Dante-dan
Copy link
Author

Dante-dan commented Apr 28, 2023 via email

@bigfacewo
Copy link

@Dante-dan
其实也有优化的办法,至少Tableau就是这样做的,当较快滚动时,并不触发渲染,而且等停止滚动时才触发渲染。

@Dante-dan
Copy link
Author

Dante-dan commented May 6, 2023

优化手段确实是有的吖, 但是这其实是一个设计哲学的问题. 当我们认为 ta 有滚动条时, 其实是将 data 和 view 分开看的.
当用事件去处理图表绘制的时候, 其实只是过滤数据.

当较快滚动时,并不触发渲染,而且等停止滚动时才触发渲染。

而且这种优化, 其实是丢失用户体验的. 如果明确 x 轴不动, 而仅仅是滚动 or 放大, 计算量也不会有变化.


不过在我的场景, 我已经放弃使用啦.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants