From f987815e50f8c5f327de6acdb0289df039121fd3 Mon Sep 17 00:00:00 2001 From: agouy Date: Wed, 3 Feb 2021 00:37:27 +0100 Subject: [PATCH] 1.3.3 --- server.R | 33 +++++++++++++++++++++------------ ui.R | 13 ++++++++++--- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/server.R b/server.R index c013a17..62e1299 100644 --- a/server.R +++ b/server.R @@ -8,6 +8,7 @@ suppressPackageStartupMessages({ library(hierfstat) library(DT) library(car) + library(plotly) }) shinyServer(function(input, output) { @@ -514,7 +515,7 @@ shinyServer(function(input, output) { }) # plot in the reactive UI - output$plotIndices <- renderPlot({ + output$plotIndices <- renderPlotly({ if(is.null(input$selectPop2)) return(NULL) else taB <- reacIndices()[[input$selectPop2]] @@ -525,21 +526,29 @@ shinyServer(function(input, output) { if(is.null(input$plotIndicesFOR)) return(NULL) par(mar=rep(input$margin,4)) - barplot( - dat[,input$plotIndicesFOR], - names.arg = dat[,"locus"], - horiz = TRUE, - las = 1, - col = transp(input$barplotcolor, input$transparency), - border = as.numeric(input$borderbarplot), - cex.axis = input$cexaxis, - cex.names = input$cexaxis, - xlab = input$plotIndicesFOR + library(plotly) + + fig <- plot_ly( + x = dat[, input$plotIndicesFOR], + y = dat[, "locus"], + name = "bp_for", + type = "bar", + text = paste0( + "Locus: ", dat[, "locus"], + "\nValue: ", round(dat[, input$plotIndicesFOR], 4) + ), + hoverinfo = 'text', + marker = list(color = transp(input$barplotcolor, input$transparency)) + ) %>% layout( + xaxis = list(title = input$plotIndicesFOR, zeroline = FALSE), + yaxis = list(title = "Locus") ) + + (fig) }) output$plotFOR <- renderUI({ - plotOutput('plotIndices', width=paste(input$width,"%",sep=""), + plotlyOutput('plotIndices', width=paste(input$width,"%",sep=""), height=input$height) }) diff --git a/ui.R b/ui.R index 36ddfe6..889bd7e 100644 --- a/ui.R +++ b/ui.R @@ -11,7 +11,7 @@ shinyUI( navbarPage( - "STRAF 1.3.2: STR Analysis for Forensics", + "STRAF 1.3.3: STR Analysis for Forensics", ##### ANALYSIS TAB ---------------------------------------------------------- tabPanel( @@ -20,6 +20,12 @@ shinyUI( theme = "bootstrap.css", tags$head(includeHTML(("./www/googleanalytics.html"))), tags$head(tags$style(type="text/css", ".container-fluid {max-width: 1200px}")), + tags$head(tags$style('body {font-family: Arial;}')), + tags$head(tags$style('table {font-family: Arial;}')), + tags$head(tags$style('h1 {font-family: Arial;}')), + tags$head(tags$style('h2 {font-family: Arial;}')), + tags$head(tags$style('h3 {font-family: Arial;}')), + tags$head(tags$style('h4 {font-family: Arial;}')), sidebarLayout( @@ -60,8 +66,8 @@ shinyUI( condition="input.hidegraph", p("Barplot color"), - colourInput("barplotcolor", NULL, "#AEA79F", showColour = "background"), - checkboxInput("borderbarplot", "Bar border", TRUE), + colourInput("barplotcolor", NULL, "#36648B", showColour = "background"), + checkboxInput("borderbarplot", "Bar border", FALSE), sliderInput("transparency", "Tranparency", 0, 1, 0.8, ticks = FALSE), sliderInput("width", "Plot width", 40, 100, 100, ticks = FALSE, post = "%"), sliderInput("height", "Plot height", 300, 800, 500, ticks = FALSE, post = "px"), @@ -450,6 +456,7 @@ shinyUI( h3("Updates"), tags$ul( + tags$li("1.3.3 (03/02/2021) – Minor bug fixes in file conversion and PIC computation. Improved graphics."), tags$li("1.3.0 (01/02/2021) – STRAF can convert files to the Genepop and Familias formats. A File conversion tab has been added."), tags$li("1.2.2 (09/01/2021) – STRAF has moved to an AWS server (without any changes in the License)."), tags$li("1.1.2 (03/10/2020) – Preparation for integration to Tercen; few minor updates"),