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

Upon download as PDF, charts on a long dashboard render as loading image #29719

Open
3 tasks done
sfirke opened this issue Jul 26, 2024 · 10 comments
Open
3 tasks done

Upon download as PDF, charts on a long dashboard render as loading image #29719

sfirke opened this issue Jul 26, 2024 · 10 comments
Labels
dashboard:export Related to exporting dashboards

Comments

@sfirke
Copy link
Member

sfirke commented Jul 26, 2024

Bug description

My user has a long dashboard - 41 charts on the tab she is downloading to PDF. I wait for the charts to all load. Then when I click Download -> PDF, the first 7 charts (Firefox) or 9 charts (Chrome) are rendered, followed by the remaining ~32 charts that have the loading symbol.

If I use my browser (both Chrome and Firefox) print function, the first 9 charts are rendered, followed by 32 with loading symbols. Possible duplicate of #27008 which was closed for lack of details.

How to reproduce the bug

Create a dashboard with very many charts in one tab, each with a moderate load time (say 0.5+ seconds). Let all the charts load. Export to PDF or use the browser print-to-PDF function.

Screenshots/recordings

image

Superset version

4.0.2

Python version

Not applicable

Node version

Not applicable

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • 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.
@sfirke
Copy link
Member Author

sfirke commented Jul 26, 2024

A naive question: if all of the charts have loaded in my browser, why would any of them be the loading icon when I print to PDF?

@dosubot dosubot bot added the dashboard:export Related to exporting dashboards label Jul 26, 2024
@rusackas
Copy link
Member

I think this is a duplicate of #29719
I also think @kgabryje might have looked at this while I was away on vacation... but I haven't caught up on the result yet.

@sfirke
Copy link
Member Author

sfirke commented Jul 26, 2024

@rusackas you linked back to this same issue, did you mean to link to a different one? EDIT: I bet you meant #28713, yes that looks similar

@Xyrai
Copy link

Xyrai commented Aug 1, 2024

Same issue here, I want my users to be able to print the graphs on the page that are rendered outside of their viewport.

I am using the @superset-ui/embedded-sdk NPM package, it would be really nice to have an update within there or an option to toggle this kind of feature. Also, is there a way to check when the rendering of all graphs have finished?

@nandwalritik
Copy link

@sfirke Same Issue occurs when downloading as image, any fix available for above bug?

@kgabryje
Copy link
Member

kgabryje commented Aug 7, 2024

I think this might be fixed by #29272 (CC @geido)

@Xyrai
Copy link

Xyrai commented Aug 16, 2024

Still seems to be broken on my side sadly while using superset-ui/embedded-sdk. I tried a workaround where you have to adjust the iframeSandboxExtras options and include allow-modals to it. This way you can focus on the iframe via the DOM tree and fire a window.print() event to only have the dashboard rendering on the browser PDF.

However, this still seems to showcase only the graphs that are within the viewport of a user.
In case the version matters, I tried this on the latest one "@superset-ui/embedded-sdk": "^0.1.0-alpha.12"

@123srikan
Copy link

any update on this issue.

@MNITD
Copy link

MNITD commented Sep 9, 2024

From what my team investigated it might be due to the virtualization feature - i.e. the superset UI off-loads charts that are away from the viewport

So I am not sure there is such thing as "all-charts-were-loaded" event

In our case, we found a workaround:

  • we disabled the virtulaization feature by changing the superset config (docker/pythonpath_dev/superset_config_docker.py)
  • inside the config we updated the FEATURE_FLAGS variable:
FEATURE_FLAGS = {
    "DASHBOARD_VIRTUALIZATION": False,
}

Now the dashboard loads charts once without off-loading them during the scroll
In result, we don't have any loading spinners on the downloaded PDF

Perhaps it will help someone 👀

@geido
Copy link
Member

geido commented Sep 9, 2024

Thanks, looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:export Related to exporting dashboards
Projects
None yet
Development

No branches or pull requests

8 participants