From b421d115680abedc5cf6f8bea05caefd25fccb99 Mon Sep 17 00:00:00 2001 From: cleger Date: Thu, 6 Nov 2025 11:06:33 -0400 Subject: [PATCH 1/2] This forces an autoscale upon loading. This addresses bug #34. I thank catherine for the inspiration with the fixedrange, and now it is just autorange instead of fixed range. --- shiny-visualization/app.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shiny-visualization/app.R b/shiny-visualization/app.R index 5b2d382..4a522ee 100644 --- a/shiny-visualization/app.R +++ b/shiny-visualization/app.R @@ -205,7 +205,8 @@ server <- function(input, output, session) { xaxis = list(title = "", tickmode = "linear", tick0 = 0, - dtick = 1), + dtick = 1, + autorange=TRUE), margin = list(l = 120) # Adjust left margin for longer y-axis labels ) }) From eefa3c9e91ca53d42e1f06313bc68a6a4bd5b081 Mon Sep 17 00:00:00 2001 From: clegergh <136511191+clegergh@users.noreply.github.com> Date: Thu, 27 Nov 2025 22:14:28 -0400 Subject: [PATCH 2/2] Update app.R with french translation Not all of these changes should be merged. I could not stage only some things. Some comments are in french now --- shiny-visualization/app.R | 43 +++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/shiny-visualization/app.R b/shiny-visualization/app.R index 4a522ee..bbab035 100644 --- a/shiny-visualization/app.R +++ b/shiny-visualization/app.R @@ -1,16 +1,16 @@ # Install required packages (uncomment to install) -# install.packages("shiny") -# install.packages("readr") -# install.packages("dplyr") +# install.packages("shiny") +# install.packages("readr") +# install.packages("dplyr") # install.packages("ggplot2") -# install.packages("bslib") -# install.packages("bsicons") -# install.packages("plotly") -# install.packages("leaflet") -# install.packages("htmltools") -# install.packages("DT") -# install.packages("stringr") -# install.packages("tidyr") +# install.packages("bslib") +# install.packages("bsicons") +# install.packages("plotly") +# install.packages("leaflet") +# install.packages("htmltools") +# install.packages("DT") +# install.packages("stringr") +# install.packages("tidyr") library(shiny) library(readr) @@ -26,14 +26,17 @@ library(stringr) library(tidyr) # Custom variables for file paths, organization, and dates -setwd("ENTER YOUR WORKING DIRECTORY HERE") -file_path <- "ENTER YOUR FILE PATH HERE" -organization_name <- "ENTER YOUR ORGANIZATION NAME HERE" -start_date <- "ENTER START DATE HERE" -update_date <- "ENTER UPDATE DATE HERE" +# Ce ci c'est les valuers qu'IL FAUT CHANGER pour les chemins de fichiers, organisation et dates +# Il n'y a pas des autre places pour changer la scripte +setwd("/home/cleger/ORCID-Data-Visualization/data") +file_path <- "/home/cleger/ORCID-Data-Visualization/data/orcid_data_latlng.csv" +organization_name <- "Mount Allison University" +start_date <- "Jan 1, 2023" +update_date <- "Dec 31, 2024" # Generate subtitle panel for displaying dates +# Cette partie du scripte c'est pour une panneau de sous-titres pour afficher les dates generateSubtitlePanel <- function(org_name = organization_name, start = start_date, end = update_date) { div( class = "subtitle", @@ -42,6 +45,7 @@ generateSubtitlePanel <- function(org_name = organization_name, start = start_da } # Generate title panel for the UI +# Générer le panneau titre pour l'interface utilisateur generateTitlePanel <- function(org_name = organization_name, start = start_date, end = update_date) { tagList( titlePanel(paste(organization_name, " (", start, " - ", end, ")", sep = "")), @@ -53,6 +57,7 @@ generateTitlePanel <- function(org_name = organization_name, start = start_date, } # UI function +# Le fonction de l'interface utilisateur ui <- page_navbar( theme = bs_theme(version = 5, preset = "bootstrap"), title = "ORCID Collaboration Dashboard", @@ -120,11 +125,14 @@ ui <- page_navbar( ) # Server function +# Fonction serveur server <- function(input, output, session) { # Create a reactive file reader to read the CSV file + # Créez un lecteur de fichiers réactif pour lire le fichier CSV reader <- reactiveFileReader(intervalMillis = 1000, session, filePath = file_path, readFunc = read.csv) # Reactive data frame to read and debug + # Trame de données réactive pour la lecture et le débogage data <- reactive({ df <- reader() print("Data read. Number of rows:") @@ -207,6 +215,7 @@ server <- function(input, output, session) { tick0 = 0, dtick = 1, autorange=TRUE), + ), margin = list(l = 120) # Adjust left margin for longer y-axis labels ) }) @@ -439,4 +448,4 @@ server <- function(input, output, session) { } # Run the application -shinyApp(ui, server) \ No newline at end of file +shinyApp(ui, server)