fix(dashboard): ensure full chart capture in dashboard image exports#34201
Closed
ongdisheng wants to merge 1 commit intoapache:masterfrom
ongdisheng:fix/issue-33904
Closed
fix(dashboard): ensure full chart capture in dashboard image exports#34201ongdisheng wants to merge 1 commit intoapache:masterfrom ongdisheng:fix/issue-33904
ongdisheng wants to merge 1 commit intoapache:masterfrom
ongdisheng:fix/issue-33904
Conversation
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Incomplete scrollable element detection ▹ view | 🧠 Not in scope | |
| Noisy Style Assignments ▹ view | 🧠 Not in standard |
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/utils/downloadAsImage.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
Comment on lines
+149
to
+151
| if (element.scrollHeight > element.clientHeight) { | ||
| return true; | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Comment on lines
+87
to
+95
| // Make sure all children don't clip | ||
| cloned.querySelectorAll<HTMLElement>('*').forEach(el => { | ||
| // eslint-disable-next-line no-param-reassign | ||
| el.style.overflow = 'visible'; | ||
| // eslint-disable-next-line no-param-reassign | ||
| el.style.maxHeight = 'none'; | ||
| // eslint-disable-next-line no-param-reassign | ||
| el.style.height = 'auto'; | ||
| }); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Problem
The image export process was based on the visible DOM snapshot, without accounting for overflowed (scrollable) content within the chart.
Solution
To resolve the issue, a new utility function
hasScrollableDescendant()was introduced. This function traverses the DOM tree of the target chart element to determine whether it contains any scrollable descendants.When scrollable content is detected, the chart element is cloned to preserve the original layout. The cloned element is then styled to expand its dimensions based on its
scrollHeightandscrollWidth, ensuring the full content area is visible.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION