So far as i can tell, it is necessary to write CoordRect$setup_panel_params() from scratch to get the desired effect (fixing the ratio of the window dimensions without changing the scales or the aspect ratio). However, since many critical objects are unexported in {ggplot2}, this required a lot of mimicry—writing analogous objects to perform their tasks, including the entire unexported ggproto ViewScaleRect.
This seems like it should be unnecessary, so another attempt should be made using ggproto_parent() and/or similar tricks. If no solution is found, then it might be appropriate to request that some of these internal objects be exported.
So far as i can tell, it is necessary to write
CoordRect$setup_panel_params()from scratch to get the desired effect (fixing the ratio of the window dimensions without changing the scales or the aspect ratio). However, since many critical objects are unexported in {ggplot2}, this required a lot of mimicry—writing analogous objects to perform their tasks, including the entire unexported ggprotoViewScaleRect.This seems like it should be unnecessary, so another attempt should be made using
ggproto_parent()and/or similar tricks. If no solution is found, then it might be appropriate to request that some of these internal objects be exported.