apache / apache/echarts

Clone label in LabelManager instead of using save and restore methods

Open
#14,617 0 comments 0 reactions 1 assignee Claimed by @pissang View on GitHub
en topic: label
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.