Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open plots in external browser by default #139

Open
joshpersi opened this issue Aug 27, 2023 · 0 comments
Open

Open plots in external browser by default #139

joshpersi opened this issue Aug 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@joshpersi
Copy link

I find httpgd really enjoyable to use in VS Code and in my dual-monitor setup, I often open the plot viewer externally in a browser, close the plot viewer in VS code, and have my plots updating on my second monitor as I tweak my graphing code on my first monitor.

The issue with this is when I re-run my updated plotting code the plot viewer window re-opens in VS code. Is there any way to prevent httpgd from re-opening the VS Code plot viewer and to only update the external browser?

A setting to choose where or how httpgd shows plots by default may be helpful. From this post by @renkun-ken, I found the following .Rprofile code and tried to update the viewer argument to External or Browser but to no avail.

if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") {
  if ("httpgd" %in% .packages(all.available = TRUE)) {
    options(vsc.plot = FALSE)
    options(device = function(...) {
      httpgd::hgd(silent = TRUE)
      .vsc.browser(httpgd::hgd_url(), viewer = "Beside")
    })
  }
}
@joshpersi joshpersi added the enhancement New feature or request label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant