apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Feature] Enable mouse zooming and translating on maps even when the mouse is not over the map itself #20444

Open jgoncab-arte opened 1 month ago

jgoncab-arte commented 1 month ago

What problem does this feature solve?

It's a bit confusing that you can only zoom with the mouse when it's over the map. On some maps with too much space between regions you can't zoom with the mouse in the middle. On the other hand, on any map (like https://echarts.apache.org/examples/en/editor.html?c=map-usa) if you zoom out enough, the map becomes very small and there's not much room left to zoom again: image Additionally, it appears that regions with no associated data are also ignored when zooming the map.

What does the proposed API look like?

Probably the API shouldn't change, but in case someone prefers to keep the current behavior maybe something like: { roam: true, roamOn: ("everywhere" | "map")}

helgasoft commented 2 weeks ago

Chart size should not get out of control. There is scaleLimit.min for that. There is also toolbox Restore button. Is a new feature really needed ?

jgoncab-arte commented 2 weeks ago

Of course, users have other options, but I found it confusing the first time until I realized that the problem was that the mouse was not over the map. Perhaps the case shown in the image is not the most concerning, but I have a world map where I cannot zoom if the mouse is over the Atlantic Ocean.

I tried to solve it with events but the performance is clearly worse. It's probably not the most urgent thing on your plate, but it would be nice to have.

helgasoft commented 2 weeks ago

I have a world map where I cannot zoom if the mouse is over the Atlantic Ocean.

Could you share it? Same ocean works fine in official example.