diff --git a/R/shiny-ui-cmpd.R b/R/shiny-ui-cmpd.R index 68a77e3f8f2884d27e69004573e7e075424dc896..a12a8f1dcc68dbc3fb8cc36b385005e65c236ecb 100644 --- a/R/shiny-ui-cmpd.R +++ b/R/shiny-ui-cmpd.R @@ -42,3 +42,27 @@ mk_ui_cmpd <- function() { return(list(tab=cmpListTab, side=compListSideItem)) } + +server_cmpd <- function(input,output,session,rv,rf,roots) { + output$knownCtrl <- rhandsontable::renderRHandsontable({ + df<-rv$m$input$tab$known + out<-if (!is.null(df)) { + df + } else { + data.frame(ID=numeric(),Name=character(),SMILES=character(),RT=numeric()) + } + rhandsontable::rhandsontable(out,stretchH="all") + }) + + output$unkCtrl <- rhandsontable::renderRHandsontable({ + df<-rv$m$input$tab$unknown + out<-if (!is.null(df)) { + df + } else { + data.frame(ID=numeric(),mz=numeric()) + } + rhandsontable::rhandsontable(out,stretchH="all") + }) + + rv +} diff --git a/R/shiny-ui-sets.R b/R/shiny-ui-sets.R index fbf82ff22da41d91c8cf4298f02f7ffe7291e146..72c67400ea8380fea59c38bc6e8eba61c3991868 100644 --- a/R/shiny-ui-sets.R +++ b/R/shiny-ui-sets.R @@ -34,4 +34,16 @@ mk_ui_sets <- function() { icon=shiny::icon("table")) return(list(tab=setIdTab, side=setIdSideItem)) + +} + + +server_sets <- function(input,output,session,rv,rf,roots) { + output$setIdCtrl<- rhandsontable::renderRHandsontable({ + df<-rv$m$input$tab$setid + rhandsontable::rhandsontable(df,stretchH="all") + }) + + rv + } diff --git a/R/shiny-ui-top.R b/R/shiny-ui-top.R index 43d2b0f2563aec8a5dcf6fe321152c3d7c93805e..07b154621aea0948e8dd33256a03937a672d8da7 100644 --- a/R/shiny-ui-top.R +++ b/R/shiny-ui-top.R @@ -72,8 +72,13 @@ mk_shinyscreen <- function(wd=getwd(),fn_style=system.file('www/custom.css',pack rf <- react_conf_f(input,output,session,rv=rv,rf=rf) # Config related r. functions. - ## ## Observers and renderers. + ## Plugin servers. rv <- server_conf(input,output,session,rv=rv,rf=rf,roots=roots) + rv <- server_cmpd(input,output,session,rv=rv,rf=rf,roots=roots) + rv <- server_sets(input,output,session,rv=rv,rf=rf,roots=roots) + + + obsrv_e(rv,{ message(paste("rv changed at ",Sys.time())) })