Toniiiio / viewerWindow

Choose if you want to open the viewer in new window or pane
https://stackoverflow.com/questions/49062761/make-rs-view-open-in-a-new-window-automatically
0 stars 0 forks source link

The addin is not working. No error message is displayed. #1

Open GitHunter0 opened 4 years ago

GitHunter0 commented 4 years ago

It is really a great idea this addin. However, it is not working. I follow the instruction and select the desired addin in RStudio Addins list but the dataframes are still being displayed as usual in tabs in the Source Panel. No error message appears. Below is my sessionInfo() infomation. I would be very greatful if you help make this addin work, I believe it adds a very important feature that RStudio should have natively.

sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18362)

Matrix products: default

Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding

locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] compiler_3.6.1 tools_3.6.1 packrat_0.5.0 viewerWindow_0.1.0

Toniiiio commented 4 years ago

Thanks for your feedback.

Could you give me the output of the following two code snippets (after you ran the addin):

1) options()$viewer

2)

writeLines(text = "DummyText", con = "test.html")
invisible(.Call("rs_showPageViewer", "test.html", title = "RStudio", 
                self_contained = FALSE))
GitHunter0 commented 4 years ago

For sure, thank you very much for the reply. Here is the output:

1. > options()$viewer function (url, height = NULL) { if (!is.character(url) || (length(url) != 1)) stop("url must be a single element character vector.", call. = FALSE) if (identical(height, "maximize")) height <- -1 if (!is.null(height) && (!is.numeric(height) || (length(height) != 1))) stop("height must be a single element numeric vector or 'maximize'.", call. = FALSE) invisible(.Call("rs_showPageViewer", url, title = "RStudio", self_contained = FALSE)) } <bytecode: 0x000001b7d49729d8> <environment: 0x000001b7e142e980>

  1. As for: writeLines(text = "DummyText", con = "test.html") invisible(.Call("rs_showPageViewer", "test.html", title = "RStudio", self_contained = FALSE)) The output is nothing but a new window appears displaying "DummyText". In that operation, my OS (Windows 10) requested the permission to use/thrust pandoc.exe

Toniiiio commented 4 years ago

Hmm, i actually expected that at least one "fails".

  1. ensures that rs_showPageViewer is set in your options
  2. tests if rs_showPageViewer envokes a page viewer.

I am not sure what changed so that the options$viewer settings are not taken anymore. One could try to go through the View/Plot function and see how its called. I guess that becomes too much of a workaround. For now i cant help sry. If you want to get deeper you could try to go through the View/Plot function or file an "enhancement" issue on rstudio/github, since this is anyway only a workaround.

I make a note to this repository and #SO that this little hack might not work anymore.

GitHunter0 commented 4 years ago

It is a pity, the ideia of your addin is awesome. I will try to do what you suggested. Thank you, sir.

fabeit commented 4 years ago

Too bad this is not working anymore. +1 for the effort.