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

feat: add grid line plugin #5498

Merged
merged 7 commits into from
Mar 6, 2024
Merged

feat: add grid line plugin #5498

merged 7 commits into from
Mar 6, 2024

Conversation

Aarebecca
Copy link
Contributor

Mar-05-2024 22-32-00

Mar-05-2024 22-32-04

  • 新增网格线插件,用于验证插件机制能力

  • Add the grid-line plugin to verify the plugin mechanism capability

@Aarebecca
Copy link
Contributor Author

由于 grid 是使用 dom 绘制的,所以没有添加截图

@@ -357,11 +358,11 @@ export class Graph extends EventEmitter {
* <en/> This process will execute data update, element rendering, and layout execution
*/
public async render(): Promise<void> {
emit(this, new RenderEvent(GraphEvent.BEFORE_RENDER));
emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_RENDER));
Copy link
Member

@hustcc hustcc Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用 this.emit 就可以了?完全没有必要再封装一层,我看 emit 方法也没有做额外的事情。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用 this.emit 就可以了?完全没有必要再封装一层,我看 emit 方法也没有做额外的事情。

主要还是简写,如果直接 emit 的话,所有 emit 的地方就需要拆成两行写

const event = new GraphLifeCycleEvent(GraphEvent.BEFORE_RENDER);
this.emit(event.type, event);

@Aarebecca Aarebecca merged commit 673546e into v5 Mar 6, 2024
3 of 5 checks passed
@Aarebecca Aarebecca deleted the feat/plugin-grid branch March 6, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants