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

当graph中没有元素时,不会触发render:done事件 #3947

Open
whoisfucker opened this issue Sep 27, 2023 · 10 comments
Open

当graph中没有元素时,不会触发render:done事件 #3947

whoisfucker opened this issue Sep 27, 2023 · 10 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@whoisfucker
Copy link

Describe the bug

当graph中没有元素时,不会触发render:done事件

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

none

Expected behavior

正常触发render:done事件

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: electron
  • Version: [e.g. 2.11.1]

Additional context

No response

@NewByVector
Copy link
Contributor

没有元素为啥要触发 render:done 事件呢?

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Oct 1, 2023
@whoisfucker
Copy link
Author

@NewByVector 会更统一
大多数人没想到这个,因此可能用了 render:done ,但没想到没有触发一些必要的初始化操作

@NewByVector
Copy link
Contributor

只有元素渲染是异步的,才需要 render:done 事件。所以没有元素不触发是比较合理的。

@whoisfucker
Copy link
Author

render:done只是从字面意思就是渲染结束,并没有说是某个元素或者node的渲染,没有元素graph自然也就渲染结束了,用户可以统一做后续处理,就像html渲染结束并不意味着html中必须有任何元素

不过可能是牛角尖了,也可以close,或者记录为次要

@bighhhh
Copy link

bighhhh commented Oct 7, 2023

render:done只是从字面意思就是渲染结束,并没有说是某个元素或者node的渲染,没有元素graph自然也就渲染结束了,用户可以统一做后续处理,就像html渲染结束并不意味着html中必须有任何元素

不过可能是牛角尖了,也可以close,或者记录为次要

我认同这种说法,应该有一个画布准备完毕的回调函数,或者fromJSON应该有一个回调函数是整体渲染完毕的回调

@cuidong626
Copy link
Contributor

render:done 其实给我的感觉就是ready,感觉应该需要。

@wenhaoxu1
Copy link

wenhaoxu1 commented Dec 13, 2023

render:done事件,好像在渲染过程中会触发多次,我想要的是一个全部渲染完成后,触发的事件

@wenhaoxu1
Copy link

我们需要流程图数据进行计算,如果没有全部渲染完成后的事件,有时初始化计算的时候会因为拿不到画布的数据而出现报错

@wenhaoxu1
Copy link

我的流程图有的是会节点数量+1次调用这个函数,有的就会正确的只调用一次这个函数,我想知道区别是什么

@America-first-melon
Copy link

迷惑了 这个东西还会触发n次 因为开启了async 有没有只触发一次的api 啊。 既然都done了,还触发多次,感觉有歧义

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

6 participants