Skip to content
Snippets Groups Projects
Unverified Commit d99f7081 authored by Todor Kondic's avatar Todor Kondic
Browse files

cmpd, sets: Add server functions

* R/shiny-ui-cmpd.R(server_cmpd): New server function.

* R/shiny-ui-sets.R(server_sets): New server function.

* R/shiny-ui-top.R(mk_shinyscreen) <plugin-servers>: Add server_cmpd
  and server_sets.
parent 879a34fe
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......@@ -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
}
......@@ -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()))
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment