From feae3bac337a5d598f101302df0f7d588a8f5e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Todor=20Kondi=C4=87?= <kontrapunkt@uclmail.net> Date: Sat, 25 Feb 2023 16:59:14 +0100 Subject: [PATCH] shiny-ui-base: Adapt to no_structure_plots option. --- R/shiny-ui-base.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/shiny-ui-base.R b/R/shiny-ui-base.R index 9646bd4..5ac9c7a 100644 --- a/R/shiny-ui-base.R +++ b/R/shiny-ui-base.R @@ -875,12 +875,14 @@ mk_shinyscreen_server <- function(projects,init) { }) rf_plot_struct <- reactive({ - cind = rf_get_cindex() - key = rf_get_cindex_key() - req(NROW(cind)>0L) - row = req(input$cindex_row_last_clicked) - id = cind[row][,..key][["ID"]][[1]] - smi = rvs$m$out$tab$comp[ID==(id),SMILES][[1]] + smi = if (!init$envopts$no_structure_plots) { + cind = rf_get_cindex() + key = rf_get_cindex_key() + req(NROW(cind)>0L) + row = req(input$cindex_row_last_clicked) + id = cind[row][,..key][["ID"]][[1]] + rvs$m$out$tab$comp[ID==(id),SMILES][[1]] + } else NA_character_ make_struct_plot(smi) }) -- GitLab