Skip to content
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

[Screenshotting] Added workaround for webgl driven canvases #131907

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented May 10, 2022

Summary

TL;DR additional mitigation for potentially getting blank maps in PDFs. Tested with 20 PDFs.

Added a long comment in the code to explain the reasoning behind the change.

Samples

Related

@jloleysens jloleysens added release_note:skip Skip the PR/issue when compiling release notes Team:Reporting Services v8.3.0 labels May 10, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)

@jloleysens jloleysens added the (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead label May 10, 2022
@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Hopefully Chrome will fix this webgl issue with page.pdf() soon!

const img = document.createElement('img');
img.src = (thisCanvas as HTMLCanvasElement).toDataURL('image/png');
newDiv.appendChild(img);
thisCanvas.parentNode!.replaceChild(newDiv, thisCanvas);
Copy link
Member

@tsullivan tsullivan May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @elastic/kibana-gis

for awareness: In print-layout PDF reports, we found a bug in Chromium that forces us to capture a screenshot of the map, and then replace the canvas element with the screenshot, before we take the PDF.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to lens charts as well, as Lens canvas tags.

@jloleysens jloleysens merged commit fb5aee2 into elastic:main May 11, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 11, 2022
@jloleysens jloleysens deleted the fix/canvas-gl-sometimes-not-rendering branch May 11, 2022 08:32
academo pushed a commit to academo/kibana that referenced this pull request May 12, 2022
…131907)

* added workaround for webgl driven canvases

* expand comment with link to origin of idea

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants