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

[Question] How to recall/reopen plot window in Rmarkdown #57

Closed dcstang closed 3 years ago

dcstang commented 3 years ago

Hi, thanks for this super work. Plotting in R is splendid now. (Un)fortunately I need to work with some RMarkdown files.

Plotting works in RMarkdown for me, but when I close the plot window - I am having difficulty getting it back. I have tried to edit the keyboard shortcut as below to include 'rmd'

    {
        "key": "shift+alt+p",
        "command": "r.runCommand",
        "when": "editorTextFocus && editorLangId == 'r' || 'rmd'",
        "args": ".vsc.browser(httpgd::hgd_url(), viewer = \"Beside\")"
    }

Am I missing something in the when: bit of the keybindings.json?

Nb. manually running .vsc.browser(httpgd::hgd_url(), viewer = "Beside") in R Interactive terminal works. I think its just the way my keyboard shortcut is setup wrong? Thanks, David.

nx10 commented 3 years ago

Hi, thank you for checking out httpgd.

This seems to be a problem with vscode / the vscode-r extension. So maybe it would be better to open an issue on their repository.

For troubleshooting, I would suggest checking if your keybindings.json file is in the right folder and the binding is listed in the visual editor https://code.visualstudio.com/docs/getstarted/keybindings

It would be great to integrate httpgd support directly in vscode-r in the future to make the setup easer for users.

dcstang commented 3 years ago

Hi Florian, thanks for your reply.

Good thinking - I did check and the binding is listed in visual editor as your suggestion. keybinding in visual editor

I will proceed to open an issue on the vscode-r extension as mentioned. Yes it would be super easy for users in the future hopefully!

Regards, David.

nx10 commented 3 years ago

Closing for now, let us know if you run into any more problems.