feat(elements): support control whether to execute draw methods #5874
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
effect
装饰器,用于控制依赖更新效果对比:
图规模:34 个节点、60 条边
优化前:
执行 keyShape 绘制 1W+ 次
优化后:
执行 keyShape 绘制 2k+ 次
优化前:
拖拽元素过程中执行子图形重绘
优化后:
跳过子图形重绘
effect
decorator to control dependency updatesComparison:
Graph size: 34 nodes, 60 edges
Before optimization:
Perform 1W+ keyShape draws
After optimization:
Perform 2k+ keyShape draws
Interaction
Before optimization:
Performs a child redraw while dragging an element
After optimization:
Skip the child graphics redraw