fardin-developer commented on code in PR #34233:
URL: https://github.com/apache/superset/pull/34233#discussion_r2225318285
##########
superset-frontend/src/utils/downloadAsImage.ts:
##########
@@ -71,18 +156,35 @@ export default function downloadAsImage(
};
return domToImage
- .toJpeg(elementToPrint, {
+ .toJpeg(clonedElement, {
bgcolor: theme?.colors.grayscale.light4,
filter,
+ quality: 0.95,
+ height: clonedElement.scrollHeight,
+ width: clonedElement.scrollWidth,
})
.then((dataUrl: string) => {
+ // Clean up the cloned element
+ const tempContainer = clonedElement.parentElement;
+ if (tempContainer && tempContainer.parentElement) {
+ tempContainer.parentElement.removeChild(tempContainer);
+ }
Review Comment:
Thank you for your suggestion I have modified createEnhancedClone function
signature: Now returns an object with both the clone element and a cleanup
function
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]