-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🤔 为啥 scroller plugin, 没有 抹平 translate 差异 #3435
Comments
|
X6 代码现在有些地方确实和 plugin 存在耦合,当时的思考是:怎么让用户无感升级,也就是使用 api 不变,达到和 1.x 一样的效果,比如上面的 |
我也遇到了相同的问题,使用scroll插件之后,画布的translate事件就失效了 ,以及使用scroll插件滚动后画布的translate值没有更新@NewByVector |
我现在是自己加了个判断 if hasScroller xxx else yyy |
我尝试在container和外层的x6-graph-scroller上去监听滚动事件,都没有生效,可以请教下是如何实现的吗,感谢。 @0jinxing |
translate值倒是可以用滚动条偏移量去自己算 |
const scroller = graph.getPlugin<Scroller>('scroller');
scroller?.container.addEventListener('scroll', handleScroll); 可以这么搞 |
好的,我试下,感谢 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the feature you'd like to request
需求 原来用 x6 做了一个简单的画布协同(依赖了 画布的 translate)
现在想修改下 画布 滚动逻辑,发现 scroller plugin 不仅没有 抹平 translate
我还没甚至找到 trigger 画布滚动的事件(我需要自己去 container addEventListener 🤔)
这样做是出于什么考虑吗?
还有一个疑问是 scroller 是一个 plugin
但是
X6/packages/x6/src/graph/graph.ts
Line 559 in 8fada57
为什么感觉这么耦合🤔
Describe the solution you'd like
可以抹平 scroller 和 translate
Describe alternatives you've considered
可以抹平 scroller 和 translate
Your Example Website or App
No response
Screenshots or Videos
No response
The text was updated successfully, but these errors were encountered: