superset
superset copied to clipboard
Legend scroll echarts
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
Hi @nelsondrew. I think the solution here would be to not scroll at all when interacting the legend.
@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 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 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 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.
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.
Created an echarts issue too https://github.com/apache/echarts/issues/19796