echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Panning is broken in the multi-dataset public treemap example "How $3.7 Trillion is Spent"

Open erosca opened this issue 1 year ago • 8 comments

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=treemap-obama&lang=js&version=5.5.1

Steps to Reproduce

  1. Open public example: https://echarts.apache.org/examples/en/editor.html?c=treemap-obama&lang=js&version=5.5.1
  2. Hold left mouse click, make sure that panning works on the dataset opened by default (2012Budget)
  3. Switch to 2011Budget by pressing the button in the Legend. Panning by left-mouse-click-hold still works.
  4. Switch back to 2012Budget. Panning no longer works. Position of the chart is fixed.

Current Behavior

See "Steps to Reproduce"

Expected Behavior

Panning by mouse click should work regardless how many times you switch between legend datasets/tabs.

Environment

- OS: Ubuntu 22.04
- Browser: Firefox 130.0.1, Chrome 128.0.6613.137
- Framework: https://echarts.apache.org/

Any additional comments?

No response

erosca avatar Sep 22 '24 08:09 erosca

confirmed bug in treemap. It seems legend switch resets roam to false. Series types tree and graph are not affected. Demo

helgasoft avatar Sep 23 '24 20:09 helgasoft

@helgasoft Do you have any feeling how serious the issue is (looks like it's deep in the core implementation) and do you know if there is anyone likely to provide some guidance on the way to fixing it?

erosca avatar Sep 23 '24 23:09 erosca

My feeling is that this bug is low priority and heavy workload, and wont be fixed anytime soon. Would love to be wrong though...

helgasoft avatar Sep 26 '24 17:09 helgasoft

Thanks @helgasoft . Sounds like a detour to d3 is unavoidable in this case, since switching between tabs (w/o losing panning/zooming) is a core feature in my personal application/use-case.

erosca avatar Sep 26 '24 18:09 erosca

d3 is a big bag to carry. CSS is simpler, just some way of keeping charts separate and avoid legend - Demo.

helgasoft avatar Sep 26 '24 22:09 helgasoft

d3 is a big bag to carry. CSS is simpler, just some way of keeping charts separate and avoid legend - Demo.

Cool. Wonderful insight and advice 👍. Appreciated 🙏.

erosca avatar Sep 27 '24 02:09 erosca

actually, legend can be replaced with graphic buttons (or toolbar custom buttons) - Demo

helgasoft avatar Sep 27 '24 18:09 helgasoft

actually, legend can be replaced with graphic buttons (or toolbar custom buttons) - Demo

Great tip for those who will be running into the same issue and will hopefully find this page.

erosca avatar Sep 30 '24 07:09 erosca