apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.62k stars 13.81k forks source link

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

Open sfirke opened 3 months ago

sfirke commented 3 months ago

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

sfirke commented 3 months ago

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?

rusackas commented 3 months ago

I think this is a duplicate of https://github.com/apache/superset/issues/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 commented 3 months ago

@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 commented 3 months ago

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 commented 3 months ago

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

kgabryje commented 3 months ago

I think this might be fixed by https://github.com/apache/superset/pull/29272 (CC @geido)

Xyrai commented 2 months ago

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 commented 2 months ago

any update on this issue.

MNITD commented 1 month ago

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:

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 commented 1 month ago

Thanks, looking into it