dash-preview: swap browser window's width and height if landscape#254
dash-preview: swap browser window's width and height if landscape#254antoinerg merged 1 commit into3.3-releasefrom
Conversation
|
Looks good to me 💃 |
|
Tested with docker image quay.io/plotly/image-exporter:d5d6a741047dc56fa5a63e713725e8fd40bc710e for confined sized snapshot The outmost container is set to {'width': '11.69in', 'height': '8.23in'} to validate we have same pdf layout for
Result as follows: All tests are giving me proper sized snapshot. This means browser size for landscape is swapped for adaptation. Thanks @antoinerg The only remaining problem which might need me a tweak is height rounding of container size. A standard A4 page orca has returned to me is measured 11.69 in x 8.26 in(as below). However I have to set container size a bit shorter as 8.23 in in order to get all components fit in, a one-to-one size (by setting container 11.69 x 8.26 will start excluding graphs as like dash_spc_customized_w_h_container_landscape_A4_false_826inx1169in_A4.pdf This could be replicated on above container by 1v1 matching pdf size to be ~8.23in x 11.69in Let me know if we need further test for it. Otherwise everything looks good. |
Ok so I'll merge this |


This PR is a follow-up to #250 which makes the browser size equivalent to the page size to make sure figures have correct dimensions and positioning. Although it works well as reported by @ycaokris, it didn't take into account the
landscapeoption which led to badly laid out PDFs.The fix is to simply swap width and height of the browser size when printing in landscape mode.