DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

cyto_gate_draw in a shiny app #121

Closed jsaintvanne closed 2 years ago

jsaintvanne commented 3 years ago

Hi, I'm actually using your function cyto_gate_draw and it works pretty well thanks ! But when I run it it open 2 R windows whereas I have only one with a picture where I must select my gate... And when it's done with my gate they do not closed... I just would like they close even if there are 2 windows it is not a problem

Have you got experienced the same thing already ? Do you have a solution for that ?

Thanks !

DillonHammill commented 3 years ago

@jsaintvanne thanks for using CytoExploreR. I am not exactly sure what your problem is. Are you able to share code, screenshots or recording to demonstrate the problem in more detail so that I can take a closer look?

jsaintvanne commented 3 years ago

Thanks for this very fast answer !!

Here is where the function is used :

gate = tryCatch({
                 cyto_gate_draw(
                                cs_temp,
                                parent = input$parent_gate,
                                alias = c(input$gate_Name),
                                channels = c(input$xcol, input$ycol),
                                point_col = input$color_channel,
                                axes_limits = "auto")
                 }, invalid = function(i) NULL
                  ,error = function(e){
                        toastr_error("Error !", "You haven't drawn your gate")
                        return(error_status = list("type" = "error", "message" = err$message))
                 })

And here the 2 windows that opened when I run it : image

When I select my gate with left clic : image

And when I right clicked and it completed the gate itself : image

And then it stays here... I just would like to close these windows and ask myself why there is 2 windows opened

Is it clearest for you ?

DillonHammill commented 3 years ago

Can you run dev.off() and run the code again. There should only be one window that opens, but it is fine to close both.

DillonHammill commented 3 years ago

Running cyto_plot_reset() will reset all cyto_plot related settings which may also fix the problem.

jsaintvanne commented 3 years ago

Hi ! Sorry I was not working on it since 2 days ! I tried with dev.off() after selected a gate and it works well to close my 2 windows (with 2 dev.off()) and I think I will use it for the moment... I will try the cyto_plot_reset() function and come back to say to you ! But this looks strange to have to do it and I don't really know why this is like this

Thanks a lot for your help for the moment ! And I hope I will find why it does it

DillonHammill commented 3 years ago

It is not designed to work in shiny so it is likely that shiny opens the extra device, in which case there isn't much you can do with the current version of CytoExploreR. Keep an eye out for the coming version of CytoExploreR, it is a significant upgrade that will probably may resolve this issue.

DillonHammill commented 2 years ago

Closing this issue. please reopen if the issue persists with version 2.0.0 of CytoExploreR (coming soon).