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

feat(frontend): add ability to download dashboard and chart as image #9819

Merged
merged 5 commits into from
May 17, 2020
Merged

feat(frontend): add ability to download dashboard and chart as image #9819

merged 5 commits into from
May 17, 2020

Conversation

ChristianMurphy
Copy link
Contributor

@ChristianMurphy ChristianMurphy commented May 16, 2020

SUMMARY

Adds an additional menu option and functionality to export dashboards and charts as an image.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

download dashboard

download-image-example

download chart

download-chart-example

TEST PLAN

CI and click testing.

  • Pull down branch
  • Start superset
  • Navigate to a dashboard
  • Open menu and select "Download as image"
  • After some processing, a prompt to download image should appear
  • Image should match dashboard

ADDITIONAL INFORMATION

  • Has associated issue: how to export chart image #6737
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented May 16, 2020

Codecov Report

Merging #9819 into master will increase coverage by 4.70%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9819      +/-   ##
==========================================
+ Coverage   66.16%   70.86%   +4.70%     
==========================================
  Files         585      586       +1     
  Lines       30427    30452      +25     
  Branches     3152     3158       +6     
==========================================
+ Hits        20133    21581    +1448     
+ Misses      10113     8760    -1353     
+ Partials      181      111      -70     
Flag Coverage Δ
#cypress 53.58% <37.50%> (?)
#javascript 59.24% <50.00%> (-0.02%) ⬇️
#python 71.02% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
...d/src/dashboard/components/SliceHeaderControls.jsx 67.44% <ø> (+55.81%) ⬆️
...set-frontend/src/dashboard/util/downloadAsImage.ts 44.44% <44.44%> (ø)
...src/dashboard/components/HeaderActionsDropdown.jsx 79.16% <100.00%> (+9.60%) ⬆️
superset/viz.py 71.91% <0.00%> (-0.10%) ⬇️
...rontend/src/SqlLab/components/AceEditorWrapper.tsx 56.98% <0.00%> (+1.07%) ⬆️
superset-frontend/src/components/EditableTitle.jsx 81.69% <0.00%> (+1.40%) ⬆️
...perset-frontend/src/components/CopyToClipboard.jsx 36.36% <0.00%> (+1.51%) ⬆️
...hboard/components/resizable/ResizableContainer.jsx 71.87% <0.00%> (+1.56%) ⬆️
...ashboard/components/gridComponents/ChartHolder.jsx 81.35% <0.00%> (+1.69%) ⬆️
... and 140 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea9b7f2...b4b954e. Read the comment docs.

@ChristianMurphy ChristianMurphy changed the title feat(frontend): add ability to export dashboard as image (#6973) feat(frontend): add ability to export dashboard as image May 16, 2020
@ChristianMurphy ChristianMurphy changed the title feat(frontend): add ability to export dashboard as image feat(frontend): add ability to export dashboard and chart as image May 16, 2020
@ChristianMurphy ChristianMurphy changed the title feat(frontend): add ability to export dashboard and chart as image feat(frontend): add ability to download dashboard and chart as image May 16, 2020
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

this is a great feature, thanks for adding it! (I know there's been work on it in the past, but those PRs got abandoned i think...)

A few comments, but otherwise it looks good

superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

one more nit, otherwise lgtm

superset-frontend/src/dashboard/util/downloadAsImage.ts Outdated Show resolved Hide resolved
@etr2460 etr2460 merged commit b8eaa11 into apache:master May 17, 2020
@ChristianMurphy ChristianMurphy deleted the feat/export-dashboard-as-image branch May 17, 2020 21:51
@pradhangn
Copy link

Huge thanks to @ChristianMurphy! This is a feature users have been craving for. Can I ask if this will make it into 0.37?

@villebro
Copy link
Member

villebro commented Jul 9, 2020

Huge thanks to @ChristianMurphy! This is a feature users have been craving for. Can I ask if this will make it into 0.37?

Absolutely @pradhangn 😃 I'm going to try to cut 0.37 today, stay tuned.

@pradhangn
Copy link

Super! Thanks @villebro and @ChristianMurphy!

auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
…pache#9819)

* feat(frontend): add ability to export dashboard and chart as image (apache#6973)

* refactor: migrate download image as to typescript

* feature(frontend): download as image updates

add toast message if error occurs.
make generate file stem an internal method.

* refactor(frontend): move default background color to a const

* feat(frontend): wrap download image toast in translate function
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants