Closed r2evans closed 4 years ago
Thank you for your suggestion!
The R graphic engine is DPI based which makes it a bit hard to define the zoom level in percent. I will think about this further. In the meanwhile I have set up the 0
key on the keyboard to reset zoom level. (You can zoom in and out with +
and -
)
With percent, I was thinking "difference from the default value", where 100% means no change, press -
once and go to 90% (or however the reduction works internally). I realize in hindsight that there was vagueness: in the first example, the 0
is clickable, meaning "reset to the default zoom; in the second example, the percentage labels were just indicators, not clickables, just to indicate where in the increase/decrease range the display was showing, making it easier numerically to return to default. Sorry about that.
I think adding 0
is a great step, percentage is not critical or wholly necessary. Thanks!
Clicking the zoom level could be made revert to normal, just like it in Firefox and other web browsers:
I have just added the visual zoom level indicator. I also looked at how browsers handle this. Clicking on it resets the zoom level. The displayed value is default scaling factor divided by current scaling factor.
That actually brings a very interesting point (to me):
-
, I get some undetermined reduction in element size. The browser does not show any percentage, and the browser's Ctrl 0
does not do anything.Ctrl -
(browser shortcut, not page) three times invoking the browser-level zoom level, then I see the percentage in the browser URL block (I'm in FF), and the size reduction seems to be the same as above. (One notable difference: doing it via the browser-zoom also reduces the page left, right, +, -, save, clear.)To me, that says I don't need the additional +/- buttons on my page, I can instead use the browser-level increase/decrease, get the same effect, and have the browser builtin Ctrl 0
to reset. (Muscle-memory is preserved!)
If the page +/- is intended to be a convenience, calling the same JS mechanisms as the browser, then there is some minor difference. If this is just coincidence, however, then ... I don't know. Regardless, do you need the +/- buttons? I suspect most browsers provide zoom capability themselves, likely with keyboard shortcuts and/or known reset mechanisms.
Unless I am misunderstanding something, you can close this issue. Thanks!
I guess a major use case of +/- buttons is showing the webpage in an R code editor such as showing in a WebView in VSCode. Although VSCode also has zoom just like a browser, but it applies to everything from UI to code.
Nice package! Its timely reveal to me might better enable working in WSL2 where I don't want to rely on an x-server in windows to show the plots. (I still have to test it in wsl2, networking b/w wsl2 and windows is allegedly not always perfect.)
The ability to increase/decrease fonts is nice, but if I had a moment of caffeine-induced impatience and pressed it several times, I don't know how many clicks it takes to restore to "neutral" (default). I can reload the page, but then I lose the image cache.
Two suggestions, not necessarily exclusive:
add a "0" button to restore to the default size
display the percentage (or raw size) increase/decrease