diff --git a/R/graphFuncs.R b/R/graphFuncs.R index 3c2b785..e0bf9af 100755 --- a/R/graphFuncs.R +++ b/R/graphFuncs.R @@ -1036,16 +1036,17 @@ plotMS <- function( text.cex = 1) { plot(x, y, type = 'n', - xlim = xlim, xlab = xlab, cex.axis=0.75, + xlim = xlim, xlab = xlab, cex.axis=0.75, xaxt = 'n', ylim = ylim, ylab = 'Mole fraction', yaxs ='i', main = main) # Axis - if(diff(range(xlim)) <= 20) + if(diff(range(xlim)) <= 20) { step = 1 - else + } else { step = 5 - ti = seq(floor(xlim[1]), ceiling(xlim[2]), by = step) + } + ti = seq(floor(xlim[1]/step)*step, ceiling(xlim[2]/step)*step, by = step) axis(side = 1, at = ti, labels = ti, cex.axis=0.75) grid() diff --git a/global.R b/global.R index 79409aa..6f3c3e0 100755 --- a/global.R +++ b/global.R @@ -1,3 +1,5 @@ +version = 1.5 + # Options #### Sys.setlocale( category = "LC_NUMERIC", diff --git a/server_files/analysis.R b/server_files/analysis.R index 7e61c0c..932f7f7 100755 --- a/server_files/analysis.R +++ b/server_files/analysis.R @@ -381,7 +381,8 @@ generateCategories = function(species) { radic[is.na(radic)] = 0 ## Define species groups according to composition - grp = rep('Misc.',length(species)) + lnk = '.' + grp = rep('Dummy',length(species)) sel = colSums(compo) != 0 ns = sum(sel) elt = elements[sel] @@ -398,7 +399,7 @@ generateCategories = function(species) { e2 = elt[j] sel = cop[,i] & cop[,j] if(any(sel)) - grp[sel] = paste0(e1,'&',e2) + grp[sel] = paste0(e1,lnk,e2) } } if(ns >= 3) @@ -410,7 +411,7 @@ generateCategories = function(species) { e3 = elt[k] sel = cop[,i] & cop[,j] & cop[,k] if(any(sel)) - grp[sel] = paste0(e1,'&',e2,'&',e3) + grp[sel] = paste0(e1,lnk,e2,lnk,e3) } } } @@ -425,7 +426,7 @@ generateCategories = function(species) { e4 = elt[l] sel = cop[,i] & cop[,j] & cop[,k] & cop[,l] if(any(sel)) - grp[sel] = paste0(e1,'&',e2,'&',e3,'&',e4) + grp[sel] = paste0(e1,lnk,e2,lnk,e3,lnk,e4) } } } @@ -433,15 +434,15 @@ generateCategories = function(species) { ## Mass mass = apply(compo, 1, massFormula) - if(any(species %in% spDummy)){ - dummyMass = round(max(mass,na.rm=TRUE) + 2 ) + if (any(species %in% spDummy)) { + dummyMass = round(max(mass, na.rm = TRUE) + 2) mass[species %in% spDummy] = dummyMass } ## Nb of heavy atoms nbh = nbHeavyAtoms(species) - if(any(species %in% spDummy)) - nbh[species %in% spDummy] = max(nbh) + 1 + if (any(species %in% spDummy)) + nbh[species %in% spDummy] = max(nbh, na.rm = TRUE) + 2 # nbh[is.na(nbh)] = 0 list( @@ -636,7 +637,7 @@ output$categsPlot <- renderUI({ ui = list( br(), strong("Selection"), - hr(style="border-color: #666;") + hr() ) ii = 3 @@ -837,7 +838,7 @@ req(speciesCategories()) ui = list( br(), strong("Selection"), - hr(style="border-color: #666;") + hr() ) ii = 3 diff --git a/server_files/model.R b/server_files/model.R index dc0150e..8950885 100755 --- a/server_files/model.R +++ b/server_files/model.R @@ -510,7 +510,8 @@ setGroups = function(species, netColoring, vlpI) { } else if (netColoring == 'compo') { # Define species groups according to composition - grp = rep('Misc.',length(species)) + lnk = '.' + grp = rep('Dummy',length(species)) sel = colSums(compo) != 0 ns = sum(sel) elt = elements[sel] @@ -527,7 +528,7 @@ setGroups = function(species, netColoring, vlpI) { e2 = elt[j] sel = cop[,i] & cop[,j] if(any(sel)) - grp[sel] = paste0(e1,'&',e2) + grp[sel] = paste0(e1,lnk,e2) } } if(ns >= 3) @@ -539,7 +540,7 @@ setGroups = function(species, netColoring, vlpI) { e3 = elt[k] sel = cop[,i] & cop[,j] & cop[,k] if(any(sel)) - grp[sel] = paste0(e1,'&',e2,'&',e3) + grp[sel] = paste0(e1,lnk,e2,lnk,e3) } } } @@ -554,7 +555,7 @@ setGroups = function(species, netColoring, vlpI) { e4 = elt[l] sel = cop[,i] & cop[,j] & cop[,k] & cop[,l] if(any(sel)) - grp[sel] = paste0(e1,'&',e2,'&',e3,'&',e4) + grp[sel] = paste0(e1,lnk,e2,lnk,e3,lnk,e4) } } } @@ -562,8 +563,9 @@ setGroups = function(species, netColoring, vlpI) { } else if (netColoring == 'mass') { nbh = nbHeavyAtoms(species) - nbh[is.na(nbh)] = 0 - grp = paste0('C',nbh) + nbh[species %in% spDummy] = max(nbh, na.rm = TRUE) + 2 + # nbh[is.na(nbh)] = 0 + grp = nbh } return(grp) diff --git a/ui.R b/ui.R index ee1c1b1..3df53a0 100755 --- a/ui.R +++ b/ui.R @@ -11,6 +11,13 @@ function(request) { theme = shinythemes::shinytheme( c("cosmo", "cerulean", "spacelab", "yeti")[3] ), + tags$head(tags$style(HTML(" + hr { + height: 1px; + margin-top: 0.0em; + background: #666; + }" + ))), tabPanel( title = "Project", source_ui("project.R") @@ -30,14 +37,14 @@ function(request) { tabPanel( title = "Fluxes", source_ui("fluxes.R") - ), + )#, # tabPanel( # title = "Downloads", # source_ui("downloads.R") # ), - tabPanel( - title = "About", - source_ui("about.R") - ) + # tabPanel( + # title = "About", + # source_ui("about.R") + # ) ) } diff --git a/ui_files/about.R b/ui_files/about.Rold similarity index 100% rename from ui_files/about.R rename to ui_files/about.Rold diff --git a/ui_files/analysis.R b/ui_files/analysis.R index dc462d4..57b1dd0 100755 --- a/ui_files/analysis.R +++ b/ui_files/analysis.R @@ -68,6 +68,11 @@ sidebarLayout( column( width = 3, wellPanel( + uiOutput( + "categsPlot" + ), + strong("Plot"), + hr(), checkboxInput( "mcPlot", "Show error bands", @@ -87,9 +92,6 @@ sidebarLayout( "ppscale", "Draw PPM scale", value = FALSE - ), - uiOutput( - "categsPlot" ) ) ), @@ -117,6 +119,11 @@ sidebarLayout( column( width = 3, wellPanel( + uiOutput( + "categsPlotMS" + ), + strong("Plot"), + hr(), checkboxInput( "mcPlotMS", "Show error bars", @@ -127,9 +134,6 @@ sidebarLayout( "Draw PPM scale", value = FALSE ), - uiOutput( - "categsPlotMS" - ), sliderInput( "timeMS", "Log sampling time", @@ -183,6 +187,28 @@ sidebarLayout( column( width = 3, wellPanel( + fluidRow( + column(6, + textInput( + "SASpecies", + "Target", + width = "100%", + value = NULL, + placeholder = "Species" + ) + ), + column(6, + actionButton( + 'doSA', + 'Run SA', + icon = icon('gear') + ), + tags$style( + type = 'text/css', + "#doSA { width:100%; margin-top: 27px;}" + ) + ) + ), radioButtons( "anaType", "Sensitivity indices", @@ -192,19 +218,6 @@ sidebarLayout( "dHSIC" = "hsic" ) ), - textInput( - "SASpecies", - "Choose species", - width = "50%", - value = NULL, - placeholder = "Type species" - ), - actionButton( - 'doSA', - 'Run SA', - icon = icon('gear') - ), - hr(), radioButtons( "SAPlotType", "Plot Type", diff --git a/ui_files/model.R b/ui_files/model.R index 06c0dab..ec1185a 100755 --- a/ui_files/model.R +++ b/ui_files/model.R @@ -2,7 +2,7 @@ sidebarLayout( sidebarPanel( width = sideWidth, h4("Model control"), - hr( style="border-color: #666;"), + # hr( style="border-color: #666;"), verbatimTextOutput("contentsNmlMsg") ), mainPanel( @@ -84,7 +84,7 @@ sidebarLayout( 'netColoring', 'Color scheme', choiceNames = list( - 'Volpert','Charge','Radicals','Composition','Mass' + 'Volpert','Charge','Radicals','Composition','Heavy atoms' ), choiceValues = list( 'volpert','charge','radicals','compo','mass' diff --git a/ui_files/project.R b/ui_files/project.R index 2a74e21..a43c5b0 100755 --- a/ui_files/project.R +++ b/ui_files/project.R @@ -34,7 +34,25 @@ sidebarLayout( 'Save Project', icon = icon('gear') ) - + ), + br(),br(),br(), + wellPanel( + h4("About"), + hr(), + h5("Author : P. Pernot"), + h5("Affiliation : ",a(href="https://www.cnrs.fr/","CNRS")), + h5(paste0("Version : ",version)), + # h5("Date : 2022/09/19"), + br(), + a(href="https://github.com/ppernot/ReactorUI","How to cite..."), + br(), + a(href="https://github.com/ppernot/ReactorUI","code@github"), + br(), + a(href="https://github.com/ppernot/ReactorUI/issues", + "Bugs report, Features request"), + br(), + a(href="https://ppernot.github.io/ReactorUI", + "User's manual") ) ) ), diff --git a/ui_files/run.R b/ui_files/run.R index e828e1a..d1153a1 100755 --- a/ui_files/run.R +++ b/ui_files/run.R @@ -2,7 +2,7 @@ sidebarLayout( sidebarPanel( width = sideWidth, h4("Run Reactor"), - hr( style="border-color: #666;"), + hr(), uiOutput("nMCRunSelect"), tabsetPanel( tabPanel(