superset icon indicating copy to clipboard operation
superset copied to clipboard

Legend scroll echarts

Open nelsondrew opened this issue 11 months ago • 7 comments

SUMMARY

This pr was raised as an issue by a user in this slack thread -> https://apache-superset.slack.com/archives/CCKHMGRRB/p1711551298288129 This is an experimental PR on maintaining legend scroll , the problem is whenever we scroll the legend in echarts and click on a legend the list gets reset to its initial scroll position, This pr maintains the scroll state of the horizontal legend list

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: screen-capture (18).webm

After: screen-capture (15).webm

However there are some still issues with echarts library such that it reanimates the legend list even after persisting the legend index

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

nelsondrew avatar Mar 28 '24 15:03 nelsondrew

Hi @nelsondrew. I think the solution here would be to not scroll at all when interacting the legend.

michael-s-molina avatar Mar 29 '24 17:03 michael-s-molina

@michael-s-molina Then what would be the replacement for legend scroll in echarts ... as when there are excess number of legends we need the scroll... the end user needs to interact with the scroll but the problem is whenever they click a legend icon the scroll state gets reset

nelsondrew avatar Mar 29 '24 17:03 nelsondrew

@nelsondrew What I meant was not to remove the scroll but to keep the current "page" when interacting with the values instead of going to the first "page". In other words, just remove the following behavior:

the problem is whenever they click a legend icon the scroll state gets reset

In your AFTER video, you can see that the items are still moving when you select/unselect.

michael-s-molina avatar Mar 29 '24 18:03 michael-s-molina

@michael-s-molina Thats what i am trying to do here ... but i am unable to remove that behaviour of scroll state getting reset ... is this behaviour in any way built into echarts itself

nelsondrew avatar Mar 30 '24 10:03 nelsondrew

@michael-s-molina Thats what i am trying to do here ... but i am unable to remove that behaviour of scroll state getting reset ... is this behaviour in any way built into echarts itself

@nelsondrew Yes. We don't implement this behavior in Superset.

michael-s-molina avatar Apr 01 '24 11:04 michael-s-molina

I encouraged the involved people in Slack to file a bug report in Apache ECharts, then file one in Superset and link to the ECharts one so we can track progress on this.

sfirke avatar Apr 05 '24 12:04 sfirke

Created an echarts issue too https://github.com/apache/echarts/issues/19796

cdr4321 avatar Apr 05 '24 18:04 cdr4321