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

[Lens] Improve reporting image size for each visualization type #154894

Closed
dej611 opened this issue Apr 13, 2023 · 6 comments · Fixed by #154931
Closed

[Lens] Improve reporting image size for each visualization type #154894

dej611 opened this issue Apr 13, 2023 · 6 comments · Fixed by #154931
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@dej611
Copy link
Contributor

dej611 commented Apr 13, 2023

Describe the feature:

With the new reporting feature merged in Lens users can now print in PDF/PNG formats visualizations.
The reporting tool is using a default size ratio for all visualizations at the moment as shown in #153429 .

It would be nice to have a per-visualization tailored size to better fit each report format.

@dej611 dej611 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Apr 13, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@drewdaemon
Copy link
Contributor

@dej611
Copy link
Contributor Author

dej611 commented Apr 13, 2023

Did some quick investigation on this topic and found some interesting behaviour.
It is possible to force layout dimensions for the final PNG screenshot (i.e. dimensions: { height: 999, width: 1793 } ), this information is forwarded as job params, but a 2x zoom is applied to that ( { height: 999, width: 1793, zoom: 2 } ).
On the server side a headless chrome instance is launched with the following params: Launching with viewport: width=1793 height=1200 scaleFactor=2 - can you spot the subtle difference here? The height magically 🪄 changed from 999 to 1200px 🤔 .
From that the actual viewport is about 10% vertically smaller than the given params (1200px => 1086px) but it probably depends from OS implementation of the Chromium app.
The final picture taken as screenshot will then have the following dimensions: height: 1086 x width: 1793 x zoom: 2 => ~3500 x 2170 px

Can you confirm all this is correct @tsullivan ?
If I understood the full process correctly then we might have a problem on the Lens side as some specific visualizations might require a lower height size than the fixed one used for the chromium app.
cc @gvnmagni

@tsullivan tsullivan added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Apr 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@dej611
Copy link
Contributor Author

dej611 commented Apr 18, 2023

Discussed with @gvnmagni offline about this issue and made up a plan:

  1. Integrate the PoC [Lens] Improve reporting size for Lens visualizations #154931 to fix most of Lens' visualizations providing a better ratio dimensions (even if upscaled)
  2. Work together with the @elastic/appex-sharedux team in order to provide a better reporting experience to the user (16:9, 4:3, Preserve current screen dimensions)
  3. Find together with the @elastic/appex-sharedux team a solution for those visualization types that require a custom dimensions layout (height lower than 1200px).

@dej611 dej611 closed this as completed in 9d096c5 Apr 18, 2023
@gvnmagni
Copy link

Exactly, especially points 2 and 3 are worth a conversation around users expectations. I believe that could affect how we offer this functionality. Happy to talk about it when we can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants