Bootstrap, plots, and window zoom don't play nicely

6 views
Skip to first unread message

Roger Day

unread,
Jan 8, 2018, 10:51:43 AM1/8/18
to Shiny - Web Framework for R
Hi everybody,

The app of concern here is
("dose utility explorer")

Looks great if the browser window is set at normal zoom.
If it is zoomed in, bootstrap handles everything pretty well except the plots.
Currently I detect the initial zoom level
and give the user a warning via a JS script:
if(window.innerWidth > 3500) {
  alert('Window zoom is too low. For best appearance, please zoom in (e.g. on OSX, Cmd-plus).');
}
if(window.innerWidth < 2500) {
  alert('Window zoom is too high. For best appearance, please zoom out (e.g. on OSX, Cmd-minus).');
}
But this is a lame "solution".
I wish I could use window.innerWidth
to re-adjust the plot size.
Or better, be able to set the window.innerWidth
in the app, but changing it appears to be generally impossible with browsers.

Here's why my lame solution is even lamer than at first sight. 
Clicking on the Info button brings up the app vignette in a separate window.
But the text is way too small. (BTW why is it so small???)
If you zoom in to read it, then going back to the app window,
now the plots are way too big again.

Got some ideas how to tackle this?

Thanks you for giving this a read.

Reply all
Reply to author
Forward
0 new messages