Draft
Conversation
Collaborator
🔴 PR audit failed. 🔴🔥 PNPM Audit issues detected.PR with those issues cannot be merged. How to resolve:
🔥 No test coverage detected.This PR does not include any test coverage changes, but it modifies source code. Please add appropriate tests to cover the changes made in this PR. If you believe this is a false positive or if there are valid reasons for not including test coverage changes, please request an exemption by adding the |
Collaborator
Preview components from this PR in consuming applicationIn consuming application project install preview versions of shared packages generated by this PR: |
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
POC
This will add an available function to the DashboardRenderer for exporting a dashboard as a PDF. It's very bare-bones at the moment, no header/footer, timestamp, etc.
It uses snapdom to create a canvas of the dom, then provides the canvas to jspdf to generate a PDF from the canvas. Some calculation is performed to ensure tiles aren't split between pages but attempts to retain the layout of a dashboard.
Sandbox demo
export-pdf.webm
One thing that is immediately apparent is the inability of snapdom to properly capture the Map chart into a canvas, some investigation would be needed to fix this.
Snapdom seemed the most capable and well maintained when comparing with html2canvas. jsPDF is probably not the best library as it's a bit out of date, but there are plenty of alternatives that could be considered.