Clone label in LabelManager instead of using save and restore methods
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
In https://github.com/apache/echarts/blob/d8d0ea69fb4c0df714a2c7390f88328d36d5456e/src/label/LabelManager.ts#L253 we save the label properties when the label has layout options so we can restore them later. It's not so robust because we can't make sure what we saved is right. In the case like zooming/panning maps. Each operation will trigger `label save` and cause original properties can't be restored. Currently, we workaround by force reset necessary properties in https://github.com/apache/echarts/blob/d8d0ea69fb4c0df714a2c7390f88328d36d5456e/src/component/helper/MapDraw.ts#L542
Perhaps it's better we can clone a new label and save the original label to avoid the LabelManager modify the original attributes.
Contributor guide
Assessment
This issue has not been assessed yet.