Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend scroll echarts #27766

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nelsondrew
Copy link

@nelsondrew nelsondrew commented Mar 28, 2024

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

@john-bodley john-bodley marked this pull request as draft March 29, 2024 17:21
@michael-s-molina
Copy link
Member

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

@nelsondrew
Copy link
Author

@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

@michael-s-molina
Copy link
Member

@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.

@nelsondrew
Copy link
Author

@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

@michael-s-molina
Copy link
Member

@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.

@sfirke
Copy link
Member

sfirke commented Apr 5, 2024

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.

@cdr4321
Copy link

cdr4321 commented Apr 5, 2024

Created an echarts issue too apache/echarts#19796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants