apache / apache/echarts

[Bug] Selected state not correctly redrawn when updating map data with `setOption`

Open
#20,502 5 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://codepen.io/SupergGrobi/pen/YzmdOKW

### Steps to Reproduce

1. Select an area by clicking on it.
2. click the "new data" button
3. hover above one of the two areas

### Current Behavior

when clicking the "new data" button (which updates the `data.value` field of every entry in the `map` series) while an area is selected, the new data is accurately updated for all areas, however, the state of the current selection is no longer shown, but re-appears when hovering over the dataseries.

### Expected Behavior

the unselected areas are redrawn with the new colors and the selected area is drawn considering the styling for highlighted/selected datapoints. No hovering should be required to get to this state.

### Environment

```markdown
- OS:macOS Sonoma
- Browser: Chrome
- Framework: plain javascript as well as Vue@3
```

### Any additional comments?

This behaviour seems to be connected to having the `geo` component explicitly present in the options. In my usecase, I need it explicitly, as I want to scatter some points into the same map later on (see the mwe). (although the behaviour in that case is not super smooth either)

Somehow, this seems to work with an svg map, as in this example: [modified french beef map](https://echarts.apache.org/examples/en/editor.html?c=geo-beef-cuts&code=CQOg5gpgLgFASgeQQFQPoAUCCyASACAajwHIB6AEwEMpLTKBne6UyAe1ICEIIAzVAYwCuUeqgBiAJ0oA7fhBD0AbmGIAaPD0GyoAS1bS8MJWACUeAN4AoPHgj8AFpQkiQEiGB30oECQFlKAA4wxFy8AsKikjJyahZ4xgBc8cp4AL4mANzWeKwBuvp4ALwW2TZQrKwANroBSeapqqV4ip6ClJX-tSU2PXiVvFBJxHLS3hJqTTYARqxQ5QC2QwCMAAwApBO9NvM60kkArI1bePOUAB5JqytHW6wSOhCjQ_Z3OgBe-jSVm1veZ4N4ADaxFixHQ9xiAF0br03O1dPMIEkoBJBBAYT1-O0hJVKFN-sjUejJnhdnAZJA6iSbPwqncksCAMTkKaUfgrFag5lTABsEA5XP4PA5AshJNSTQaTTYDJJVmOZQAngEkSRTgEfs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KjWjjOAo0AEB5D0NIGAuR8jSEyNkeYP8_5QBAPoYI3FtwOApKTWImhtAgMMBBKQ8x6BmHvEwKAyAdCIg8rATB25sEwEISSHgdxDBdVJEUdiGQWEAB5wIQIAWheggIViQhAJJSgIB-giQnOwnQBACB0M9OAkBvCHj8MEcI6glBAQ6CEdtaKxR_ATlcDIcgrB5i0LwAAKjwE_QgeB9hfy2IhD80h6BVHkJ2MAYDgH6CgVqWBTh4HEKARAzxECfE9AaP3EUYT0hZBiUAA) (which updates the data a second after each selection)

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.