-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat(Export as PDF - rasterized): Adding rasterized pdf functionality to dashboard #25696
Conversation
Adding initial functionality for rasterized screenshot pdfs inspired in large part by @Yaswanth-Perumalla in PR #25460 Additional improvements to the pdf function will be needed to move it away from static screenshots. |
Thanks @fisjac for the PR. Would you mind completing the PR description or switch to draft mode if this is still WIP. Maybe there should be a discussion about whether we should use the the native browser print to PDF option. |
If the PDF is rasterized, does it have any advantage over the PNG export? The main reason to export PDF would seem to be to support text and vectors. |
@rusackas Agree, Ideally we'll move toward a vector PDF, but since we don't have great responsive css, it all just looks broken when we try to resize the window to an A11 sheet of paper size. Same with using the built in print to PDF functionality in the browser @john-bodley. It was much easier to take a screenshot image and then resize the image. Definitely an MVP for a larger feature in the near future to have a vector PDF once we can tackle the responsive CSS functionality. Happy to hear any other thoughts as to whether this interim functionality is a good short-term solution. |
.then(() => { | ||
// nothing to be done | ||
}) | ||
.catch((e: Error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think it would be good to do success toast here to let the user know that download was successful. Just search examples of successToast
in our codebase + you already have it imported above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hughhhh I was following the same flow for other downloads throughout superset. Since there are no successToasts in the download flow when downloading images from dashboard and explore tabs, does it still make sense to add this? If so, we should probably add those consistently to the other download buttons.
/testenv up |
@yousoph Ephemeral environment spinning up at http://34.220.83.24:8080. Credentials are |
@fisjac on the test environment ^ I was able to get the Video Game Sales dashboard as a PDF, but not the Slack Dashboard. Slack Dashboard worked properly when downloading as image. |
@yousoph I just tried the slack dashboard in the test environment. It worked for me, but took a bit longer than Video Game Sales. |
Ephemeral environment shutdown and build artifacts deleted. |
Not sure if this is directly related, but I've seen frontend build errors while running the project in docker-compose with the latest master:
and it looks like |
@giftig, I'll create a separate bug ticket for this. It looks like this is being caused due to |
I haven't opened a PR ye, but it seems like this is resolved if you drop |
SUMMARY
This PR changes the UI on the dashboard page to include an export as pdf button to the rightmost dropdown menu of the header on the dashboard page. This download functionality takes rasterized screenshots of each individual chart component and joins them into a downloadable pdf printout of the dashboard.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before menu:
After menu:
After download functionality:
https://www.loom.com/share/a8c39c1b81f04226beb5fa2a2d24010a?sid=87eed984-97db-4016-8ff9-32ad8b6b39e2
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION