Bug description

When exporting a dashboard with a high number of charts (e.g., 33 charts) as a PDF or PNG, the exported file does not include all charts. In one example, only the first 24 charts are visible in the downloaded file, and the last visible chart is partially cut off. In another attempt, not all the charts appear in the export but no partial charts are showing.

Repro steps: 1. Make sure the following feature flags are on: DASHBOARD_VIRTUALIZATION, ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS, ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT 2. Open a dashboard with a large number of charts (e.g., 33 charts, predominantly table and pivot table charts). 3. Make most of the tables full width and ensure the dashboard layout requires scrolling to see the charts 4. Export the dashboard as a PDF or PNG

Expected: The exported file should include all charts present in the dashboard, fully visible and not cut off. Current: Export doesn't contain all charts or has cut off charts.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: DachiCharkviani

Hello, I would like to work on this issue.

Comment From: geido


🎉 Preset Bounty Available: $250 USD 🎉

To claim this bounty, please carefully follow the steps below.


📋 Steps to Participate

  1. Review Guidelines:
    Read through the Preset Bounty Program Contribution Guide for complete details on bounty requirements.

  2. Show Your Interest:
    Complete the Preset Bounty Program Survey and comment this issue to express your interest.

  3. Join the Slack Channel:
    After completing the survey, you’ll receive an invitation to the dedicated Apache Superset Slack channel.

  4. Get Assigned:
    To officially start, ensure a Bounty Program Manager has assigned you to this issue.

  5. Submit Your Solution:
    When ready, submit your solution with the Fixes #{issue_number} notation in your Pull Request description.

  6. Claim Your Bounty:
    Sign up at GitPay.me and submit your solution via: https://gitpay.me/#/task/987


💡 Additional Notes

  • Only developers assigned by a Bounty Program Manager should start working on this issue to win the bounty.
  • Be sure to follow the guide closely to avoid any delays in payment. Please, allow a few days after your PR has been merged for the bounty to be released.

Good luck, and happy coding! 🎉

Comment From: alexandrusoare

Hello, I am interested on working on this

Comment From: geido

Hello, I would like to work on this issue.

Hi @DachiCharkviani have you joined our bounty program? This issue is going out as a bounty and I don't see you in the program yet. Feel free to join as we have a bunch more issues up for grab!

Comment From: geido

Currently holding on this as we could not reproduce the issue

Comment From: OOub

I'm running into the same issue for large dashboards.

Comment From: geido

I'm running into the same issue for large dashboards.

Hello @OOub it would be great if you could provide some repro steps as we are having hard times reproducing this issue. Thanks!

Comment From: OOub

Hello, sure, let me know if you need additional details.

It works fine on small dashboards, and the generated pdf is cutoff on dashboards that require scrolling.

The pdf with the screenshot endpoint disabled is in vertical format and all pages are present.

The pdf with the screenshot endpoint feature flags enabled seems to be in horizontal format, only the first page is downloaded, and the last visible chart is cutoff

  • superset version: 4.1.1

Enabled feature flags:

  • ALERT_REPORT_SLACK_V2
  • ALERT_REPORTS
  • ALERTS_ATTACH_REPORTS
  • ALLOW_ADHOC_SUBQUERY
  • DASHBOARD_NATIVE_FILTERS
  • DASHBOARD_VIRTUALIZATION (tried both ON and OFF)
  • DASHBOARD_RBAC
  • DRILL_BY
  • DRILL_TO_DETAIL
  • EMBEDDABLE_CHARTS
  • EMBEDDED_SUPERSET
  • ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS
  • ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT
  • ENABLE_JAVASCRIPT_CONTROLS
  • ENABLE_TEMPLATE_PROCESSING
  • HORIZONTAL_FILTER_BAR
  • SLACK_ENABLE_AVATARS
  • TAGGING_SYSTEM
  • THUMBNAILS
  • THUMBNAILS_SQLA_LISTENERS

Deployed on Kubernetes via the helm chart (version 0.13.4)

Comment From: Maissacrement

I'm interresed too

Comment From: OOub

Managed to solve my issue by using firefox instead of chrome as the webdriver in my custom docker image. Hope this helps

Comment From: geido

Thanks. This is still on hold while we investigate the problem. Thank you

Comment From: rusackas

@geido do you know if this one is still an issue that needs tackling?

Comment From: geido

@geido do you know if this one is still an issue that needs tackling?

We are still trying to repro consistently

Comment From: rusackas

These all seem like they might effectively be the same issue:

https://github.com/apache/superset/issues/29394 https://github.com/apache/superset/issues/31158 https://github.com/apache/superset/issues/29719 https://github.com/apache/superset/issues/28713 https://github.com/apache/superset/issues/27532

Can anyone here test this with DASHBOARD_VIRTUALIZATION set to false? I have a suspicion that may fix it. If so, we can probably just disable viewport virtualization when the headless browser is building the screencap.