You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When plot outputs appear inside scaled regions of the DOM, Shiny reports the output area in absolute pixels (i.e. the size of the output area after the scaling is applied). The returned image, however, ends up being smaller than desired because it doesn't take into account the scaling.
I've applied a red outline to the plot output area and a blue outline to the actual image. Ideally these would overlap and the image would take up the full output area.
In this example, on app load, the histCentile output reports size 259 x 180px and receives an image with those dimensions. But the output appears in an absolute panel (#controls) that has zoom: 0.9 applied. Those are indeed the absolute dimensions of the #histCentile container after the browser has scaled the output container. Once placed, the image ends up with the absolute size of 233.09 x 162px. The image should instead be 287.78 x 200px (taking into account the scaling) to end up with the correct size.
The implementation of the previously non-standard CSS zoom property has been updated to align with the new standard. This changes various JavaScript APIs to align with the specification, changes zoom to apply to iframe content documents, and changes it to apply to all inherited length properties where previously it only changed the inherited font-size.
You may find the newly-added Element.currentCSSZoom property useful for handling these values. If you think there's missing functionality, please file a spec issue.
Activity
gadenbuie commentedon Sep 30, 2024
The error first appeared in shinycoreci 2024-08-29. This is most likely when GitHub rolled out the 20240825.1 MacOS image -- or generally updated their runners to use Chrome 128 (from 127). This is almost certainly because Chrome 128 changed their implementation of zoom to be in line with standards.
Thanks to this useful comment providing context: select2/select2#6338 (comment).
Also, from the Chromium dev mailing list:
Fix #4135: Plot outputs incorrectly sized inside scaled outputs
Fix #4135: Plot outputs incorrectly sized inside scaled outputs
Plot outputs incorrectly sized inside scaled outputs (#4139)
Fix observer cleanup, zoom-aware sizing, and edge cases in resize han…
Replace jQuery event-driven output info with per-output ResizeObserve…
Replace jQuery event-driven output info with per-output ResizeObserve…
Replace jQuery event-driven output info with per-output ResizeObserve…
Fix: Allow users to opt out of shiny's download autoenable (#4371)