nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

How is png resolution determined? #47

Closed psobolewskiPhD closed 3 years ago

psobolewskiPhD commented 3 years ago

In the httpgd window, graphics are razor sharp, but PNGs are generated with relatively low resolution (72 dpi). On a retina screen Mac, this is painfully small and ugly. Is this user adjustable?

nx10 commented 3 years ago

Thank you for checking out httpgd!

This was a known issue (#35), but was very easy to fix (a99bd77bc24ce97471540b91fdad2b5c7ecee143).

Let us know if It works for you now.

psobolewskiPhD commented 3 years ago

Now the output is superb--example ggplot output attached. Perfect for quickly sharing some work in progress. Awesome! plot

nx10 commented 3 years ago

Looks great! You can now (ea18453e32a86a5ef016b41b59df4a0849781170) copy the plot directly to the clipboard with Ctrl + C. (On modern browsers)

psobolewskiPhD commented 3 years ago

That sounds fantastic!

Err, for me on Mac OS copy to clipboard isn't working—the other shortcuts work—whether in browser (Safari) or VS Code. Also, I now get a weird thing where the window is just white. If I plot something else, then go back, I the plot is there—but the latest is always blank... Actually, not always? 4rth and 5th plots render no problem, in VS Code, but if I pop it out to browser, blank. Also, fonts are not preserved when passed to browser... I'm on Apple Silicon Big Sur 11.1. Let me know if I can help test something!

nx10 commented 3 years ago

What browser are you using? Did these issues first appear with the last update?

Unfortunately macOS issues are very hard to debug for me because I do not have access to the required hardware. But I will see if I can setup a virtual machine for that soon.

psobolewskiPhD commented 3 years ago

I'm primarily using VS Code with WebViews triggered by https://github.com/Ikuyadeu/vscode-R r.sessionwatcher based on this post from @renkun-ken https://renkun.me/2020/06/16/using-httpgd-in-vscode-a-web-based-svg-graphics-device/

I restarted VS Code (I'm not sure I did after updating httpgd) and the blank windows thing seems to be resolved. However, the shortcut doesn't work to copy (tried Command and Ctrl), but the new T shortcut does work.

Regarding browsers, Safari 14.0.2 is my default. Here the shortcut doesn't work to copy (tried Command and Ctrl), but the new T shortcut does work. Also in Safari my font choice from R (Fira Sans, via firatheme for ggplot) does not show. In Chrome v 87 everything works fine!

I don't care about the browser so much, but getting it to work in VS Code would be super nice...