superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(dashboard): run query for chart only if visible

Open justinpark opened this issue 3 years ago • 0 comments

SUMMARY

Since the current Dashboard requests entire apis for runQuery all together, it easily exceeds the maximum parallel HTTP connections. This commit introduces the react-intersection-observer to minimize the runQuery for charts. It will only request the runQuery only if the current Chart is within the visible viewport. (As scroll down to the bottom chart, it will gradually request the remaining runQuery.)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before:

https://user-images.githubusercontent.com/1392866/190525695-ddbda65e-33a4-454f-aff0-138c2b8bb8c2.mov

  • After:

https://user-images.githubusercontent.com/1392866/190525690-1cb9c806-c89a-46bd-91d8-ebc471340096.mov

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
  • [x] Introduces new feature or API
  • [ ] Removes existing feature or API

justinpark avatar Sep 15 '22 23:09 justinpark