From 75d386757988ce4202c4581cb9642514d0ccb0dd Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 16 Jul 2025 08:13:48 +0200 Subject: [PATCH 01/30] Line 24-25 : control the size of the clickable boxes. Line 36-37 : Style of margin modified from 10px to 2px. Aim to adapt the app size to smaller PC screens. --- R/mod_analysis.R | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/R/mod_analysis.R b/R/mod_analysis.R index f27d795..560410e 100644 --- a/R/mod_analysis.R +++ b/R/mod_analysis.R @@ -21,7 +21,8 @@ mod_analysis_ui <- function(id){ tags$head( tags$style( HTML(" - .form-group{margin-bottom: 10px} + .form-group{} + .nav-pills > li > a {line-height: 5%;} ") ) ), # head @@ -33,19 +34,20 @@ mod_analysis_ui <- function(id){ # stats together with selected axis # below show distribution plots of selection fluidRow( - style = "margin-top: 10px; margin-bottom: 10px; margin-left: 10px;", + style = "margin-top: 2px; margin-bottom: 2px; margin-left: 2px;", textOutput(ns("selection_textUI")), column( width = 9, hr(), # horizontal line + fluidRow(style = "margin-top: 2px; margin-bottom: -55px;"), uiOutput(ns("selact_tableUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), # overview table hr(), # horizontal line - fluidRow(style = "margin-top: 20px;"), + fluidRow(style = "margin-top: 2px; margin-bottom: 2px;"), plotlyOutput(ns("selact_plotUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), # distribution plot ), column( width = 3, - div( + div(style = "height: 20%;", id = ns("selact_modifications"), multiInput( inputId = ns("selact_metric_select"), @@ -66,14 +68,15 @@ mod_analysis_ui <- function(id){ ))), tabPanel("Comparaison des Régions", fluidRow( - style = "margin-top: 10px; margin-bottom: 10px; margin-left: 10px;", + style = "margin-top: 2px; margin-bottom: 2px; margin-left: 2px;", column( width = 9, hr(), # horizontal line + fluidRow(style = "margin-top: 5px; margin-bottom: 10px;"), reactableOutput(ns("regions_table"), width = "100%") %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), hr(), - fluidRow(style = "margin-top: 20px;"), - plotlyOutput(ns("regions_plotUI"), width = "100%") %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours...") + fluidRow(style = "margin-top: 12px; margin-bottom: 2px;"), + #plotlyOutput(ns("regions_plotUI"), width = "100%") %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours...") ), column( width = 3, @@ -96,7 +99,7 @@ mod_analysis_ui <- function(id){ actionButton(inputId = ns("regions_apply_button"), "Actualiser") ) ) - ) + ), ), tabPanel("Analyse Bimétrique", mod_analysis_bimetric_ui("analysis_bimetric_1") From 00851b34e623cc79964c8f2ad0a67be7ba318a0d Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 16 Jul 2025 08:15:37 +0200 Subject: [PATCH 02/30] Adding a central legend to the graph to indicate the location within the catchment based on the outlet. --- R/fct_plot_crosssection.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/fct_plot_crosssection.R b/R/fct_plot_crosssection.R index 14a3c4e..cb65e54 100644 --- a/R/fct_plot_crosssection.R +++ b/R/fct_plot_crosssection.R @@ -67,6 +67,11 @@ cr_profile_main <- function(data, axis_toponyme){ xref = "paper", yref = "paper", showarrow = FALSE, font = list(size = 14, weight = "bold") ), + list( + text = paste("depuis l'exutoire ", sep = ""), x = 0.5, y = 1.1, + xref = "paper", yref = "paper", showarrow = FALSE, + font = list(size = 14, weight = "bold") + ), list( text = axis_toponyme, x = 1, y = -0.18, xref = "paper", yref = "paper", showarrow = FALSE, From 629d819dd184cc2aa78ac45a39b44d45a9e77d76 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 16 Jul 2025 08:26:23 +0200 Subject: [PATCH 03/30] Line 66 : Height : 75vh to control the horizontal size of the table being displayed. --- R/mod_download.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_download.R b/R/mod_download.R index 7ab5cf5..ce4e9b5 100644 --- a/R/mod_download.R +++ b/R/mod_download.R @@ -63,7 +63,7 @@ mod_download_ui <- function(id) { ), # table - div(style = 'overflow-x: auto; width: 100%;', # Horizontal scroll and full-width div + div(style = 'overflow-x: auto; width: 100%; height: 75vh', # Horizontal scroll and full-width div tableOutput(ns("table_data")) ), ) From 30146dc94050c4d8e9fcd7a2130b20e31065a38a Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 17 Jul 2025 09:17:50 +0200 Subject: [PATCH 04/30] line 16 adding : class = "btn-primary", to make the button leu and standout more --- R/mod_help_guide.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_help_guide.R b/R/mod_help_guide.R index 128d516..a88407a 100644 --- a/R/mod_help_guide.R +++ b/R/mod_help_guide.R @@ -13,7 +13,7 @@ mod_help_guide_ui <- function(id) { ns <- NS(id) tagList( - actionButton(ns("help_btn"), " Aide", + actionButton(ns("help_btn"), " Aide", class = "btn-primary", icon = icon("circle-question")), use_cicerone() # Load the cicerone dependencies ) From bff1ad2c031da197738b976987971cb9aee98cd5 Mon Sep 17 00:00:00 2001 From: JohMail Date: Mon, 21 Jul 2025 08:24:25 +0200 Subject: [PATCH 05/30] Remove plotly logo for every possible plot. --- R/fct_analysis_plots.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/R/fct_analysis_plots.R b/R/fct_analysis_plots.R index 85f4179..008ab07 100644 --- a/R/fct_analysis_plots.R +++ b/R/fct_analysis_plots.R @@ -293,7 +293,8 @@ analysis_plot_classes_distr <- function(df){ yaxis = list(title = "Pourcentage", showgrid = T, showticklabels = T), showlegend = TRUE # margin = list(b = 70, autoexpand = FALSE) - ) + )%>% + plotly::config(displaylogo = FALSE) # Remove plotly logo return(plot) } @@ -389,7 +390,8 @@ create_analysis_biplot <- function(df, metric_x, metric_y, classes = FALSE, lm = metric_x_title, get(metric_x), metric_y_title, get(metric_y), measure / 1000), # Convert measure to kilometers - hoverinfo = 'text') + hoverinfo = 'text')%>% + plotly::config(displaylogo = FALSE) # Remove plotly logo } @@ -415,7 +417,8 @@ create_analysis_biplot <- function(df, metric_x, metric_y, classes = FALSE, lm = xref = 'paper', yref = 'paper', # Use 'paper' units (relative to the plot) bgcolor = "#ffccd5", bordercolor = "#000", borderwidth = 1, font = list(size = 11) - )) + ))%>% + plotly::config(displaylogo = FALSE) # Remove plotly logo } From a611576fa70ee4d29b1978ece861d2bc23e31c67 Mon Sep 17 00:00:00 2001 From: JohMail Date: Mon, 21 Jul 2025 08:26:01 +0200 Subject: [PATCH 06/30] enhance the info button icon and colour it in blue. --- R/mod_analysis_bimetric.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/mod_analysis_bimetric.R b/R/mod_analysis_bimetric.R index 992e3d0..cdd7af4 100644 --- a/R/mod_analysis_bimetric.R +++ b/R/mod_analysis_bimetric.R @@ -37,7 +37,7 @@ mod_analysis_bimetric_ui <- function(id) { span( style = "display: flex; margin-left: 10px; margin-top: 20px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_metric_x") @@ -52,7 +52,7 @@ mod_analysis_bimetric_ui <- function(id) { span( style = "display: flex; margin-left: 10px; margin-top: 20px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_metric_y") @@ -67,7 +67,7 @@ mod_analysis_bimetric_ui <- function(id) { span( style = "display: flex; margin-left: 10px; margin-top: -5px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_lm") From 6fec57e84db4d7f07448fef642991df6941b2e4c Mon Sep 17 00:00:00 2001 From: JohMail Date: Mon, 21 Jul 2025 08:26:40 +0200 Subject: [PATCH 07/30] Same size of tab options than the mod_explore one. --- R/mod_download.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/mod_download.R b/R/mod_download.R index ce4e9b5..fd24823 100644 --- a/R/mod_download.R +++ b/R/mod_download.R @@ -14,7 +14,8 @@ mod_download_ui <- function(id) { tags$head( tags$style( HTML(" - .form-group{margin-bottom: 10px} + .form-group{margin-bottom: 5px} + .nav-pills > li > a {line-height: 5%;} ") ) ), # head From 0fc91735a8c913d1dbf9c1506806b06476fda1cc Mon Sep 17 00:00:00 2001 From: JohMail Date: Mon, 21 Jul 2025 08:27:07 +0200 Subject: [PATCH 08/30] Enhance the size of info button icon and colour it in blue. --- R/mod_expl_plot_long.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/mod_expl_plot_long.R b/R/mod_expl_plot_long.R index 07dd30b..4a22c64 100644 --- a/R/mod_expl_plot_long.R +++ b/R/mod_expl_plot_long.R @@ -102,7 +102,7 @@ mod_expl_plot_long_server <- function(id, r_val, globals){ span( style = "display: flex; margin-left: 10px; margin-top: 20px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_metric") @@ -122,7 +122,7 @@ mod_expl_plot_long_server <- function(id, r_val, globals){ span( style = "margin-left: 10px; margin-top: 20px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_metric2") From abf18c82a98008a7c8b051dc075ce940d0bf43b9 Mon Sep 17 00:00:00 2001 From: JohMail Date: Mon, 21 Jul 2025 08:27:58 +0200 Subject: [PATCH 09/30] Control the size of margins and navigation tabs, making them thinner --- R/mod_explore.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/mod_explore.R b/R/mod_explore.R index c499e66..f96c4a2 100644 --- a/R/mod_explore.R +++ b/R/mod_explore.R @@ -28,7 +28,8 @@ mod_explore_ui <- function(id){ tags$head( tags$style( HTML(" - .form-group{margin-bottom: 10px} + .form-group{margin-bottom: 5px} + .nav-pills > li > a {line-height: 5%;} ") ) ), # head From 53dc777996b4a60bddba35f773584aa2be457912 Mon Sep 17 00:00:00 2001 From: JohMail Date: Tue, 23 Sep 2025 07:55:06 +0200 Subject: [PATCH 10/30] =?UTF-8?q?Changement=20de=20taille=20des=20onglets?= =?UTF-8?q?=20principaux=20(Explore=20/=20analyse=20/=20t=C3=A9l=C3=A9char?= =?UTF-8?q?gement=20/=20information),=20de=20la=20couleur=20du=20fond=20et?= =?UTF-8?q?=20du=20texte,=20plus=20mise=20en=20gras.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/app_ui.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/R/app_ui.R b/R/app_ui.R index 0f91fd5..1c21581 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -44,6 +44,22 @@ app_ui <- function(request){ title = img(src = "www/logos_mapdo_evs_ofb.png"), windowTitle = "Mapd'O App", + header = tagList( + tags$head( + tags$style(HTML(" + /* texte des onglets */ + .navbar-nav > li > a { + font-size: 24px; /* augmenter taille */ + font-weight: bold; /* mettre en gras */ + color: #000000 !important; /* couleur texte */ + } + + /* barre du haut */ + .navbar { + background-color: #DEEDFF; /* gris clair */ + } + ")) + )), tabPanel("Exploration & Classification", icon = icon("compass"), # find more icons here: https://fontawesome.com/search?q=info&o=r&m=free mod_explore_ui("explore_1") ), From 86f38abcb0578f2b00c9301cc185f7e58020e8d5 Mon Sep 17 00:00:00 2001 From: JohMail Date: Tue, 23 Sep 2025 07:56:18 +0200 Subject: [PATCH 11/30] Simple mise en forme du texte --- R/fct_params.R | 72 +++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/R/fct_params.R b/R/fct_params.R index b73bbe0..9a36b1a 100644 --- a/R/fct_params.R +++ b/R/fct_params.R @@ -274,12 +274,12 @@ params_classes <- function() { "Répresent la complexité du réseaux hydrographique. L'ordre de Strahler est de 1 pour tout cours d'eau entre sa source et sa première confluence et mont avec chaque confluence.", # topographie "Classification simple basée sur la pente et la hauteur du cours de la rivière : - - plaines de basse altitude (> 0 m & < 0.5 % pente) - - plaines de moyenne altitude (> 300 m & < 0.5 % pente) - - plaines de montagne (> 1000 m & < 0.5 % pente) - - pentes de basse altitude (> 0 m & > 0.5 % pente) - - pentes de moyenne altitude (> 300 m & > 0.5 % pente) - - pentes de montagne (> 1000 m & > 0.5 % pente) + - Plaines de basse altitude (> 0 m & < 0.5 % pente) + - Plaines de moyenne altitude (> 300 m & < 0.5 % pente) + - Plaines de montagne (> 1000 m & < 0.5 % pente) + - Pentes de basse altitude (> 0 m & > 0.5 % pente) + - Pentes de moyenne altitude (> 300 m & > 0.5 % pente) + - Pentes de montagne (> 1000 m & > 0.5 % pente) ", # dominant land use "Indique la classe d'utilisation des sols la plus dominante dans la zone du fond de vallée de chaque segment de cours d'eau : @@ -290,39 +290,39 @@ params_classes <- function() { ", # urban areas "Indique le degré de couverture urbaine du fond de vallée du segment : - - fortement urbanisé (> 70 % zones construites) - - urbanisé (> 40 % zones construites) - - modérément urbanisé (> 10 % zones construites) - - Presque pas/pas urbanisé (< 10 % zones construites)", + - Fortement urbanisé (> 70 % zones construites) + - Urbanisé (> 40 % zones construites) + - Modérément urbanisé (> 10 % zones construites) + - Presque pas/Pas urbanisé (< 10 % zones construites)", # agriculture "indique la part de l'utilisation des terres agricoles dans la zone du fond de vallée de chaque segment de cours d'eau - - Forte impact agricole (> 70 % cultures) - - Impact agricole élevé (> 40 % cultures) - - Impact agricole modéré (> 10 % cultures) - - Presque pas/pas d'impact agricole (< 10 % cultures)", + - Très Forte (> 70 % cultures) + - Très élevé (> 40 % cultures) + - Modéré (> 10 % cultures) + - Basse/Absente (< 10 % cultures)", # natural "indique la part de l'occupation naturelle des sols dans la zone du fond de vallée de chaque tronçon fluvial : - Très forte utilisation naturelle (> 70 % espaces naturels) - Forte utilisation naturelle (> 40 % espaces naturels) - Utilisation naturelle modérée (> 10 % espaces naturels) - - Presque pas/pas naturelle (< 10 % espaces naturels)", + - Presque pas/Pas naturelle (< 10 % espaces naturels)", # gravel bars "la présence de bancs sédimentaires. Basé sur le ratio entre la surface des sédiments et la surface du chenal actif, qui se compose des surfaces de sédiments et d'eau : - Absent (pas des bancs sédimentaires) - - occasionnel (bancs sédimentaires < 50 % du chenal actif) - - fréquent (bancs sédimentaires >= 50 % du chenal actif)", + - Occasionnel (bancs sédimentaires < 50 % du chenal actif) + - Fréquent (bancs sédimentaires >= 50 % du chenal actif)", # confinement "Indique le dégrée du confinement du chenal actif. Basé sur le ratio entre la largeur du chenal actif et la largeur du fond de la vallée. - - espace abondant (chenal actif > 70 % du fond de la vallée) - - modérement espace (chenal actif > 40 % du fond de la vallée) - - confiné (chenal actif > 10 % du fond de la vallée) - - très confiné (chenal actif < 10 % du fond de la vallée)", + - Peu confiné (chenal actif > 70 % du fond de la vallée) + - Modérement confiné (chenal actif > 40 % du fond de la vallée) + - Confiné (chenal actif > 10 % du fond de la vallée) + - Très confiné (chenal actif < 10 % du fond de la vallée)", # habitat connectivity "Indique la présence d'un corridor riverain naturel. Basé sur ratio de la surface du corridor connecté (comprenant le chenal actif, le corridor naturel et les corridors semi-naturels) et le fond de la vallée : - - très bien connecté (>= 70 %) - - bien connecté (>= 40 %) - - moyen connecté (>= 10 % ) - - faible / absente (< 10 %)" + - élevée (>= 70 %) + - Bonne (>= 40 %) + - Moyenne (>= 10 % ) + - Faible / Absente (< 10 %)" ), class_name = c( "class_strahler", @@ -477,7 +477,7 @@ params_classes_colors <- function() { setNames(c(1,2,3,4,5,6)) # TOPOGRAPHY - df$class_topographie <- c( "#bb3e03", "#e9d8a6", "#a3b18a", + df$class_topographie <- c( "#bb3e03", "#85ba55", "#2ca555", "#780000","#ee9b00", "#3a5a40") %>% setNames( c("Plaines de montagne", @@ -495,39 +495,39 @@ params_classes_colors <- function() { # URBAN df$class_urban <- c("#6a040f", "#dc2f02", "#ffdd00", "#74c69d") %>% setNames( - c("fortement urbanisé", "urbanisé", "modérément urbanisé", "Presque pas/pas urbanisé") + c("Fortement urbanisé", "Urbanisé", "Modérément urbanisé", "Presque pas/Pas urbanisé") ) - # AGRICULTURE + # AGRICULTURE / impact agricole df$class_agriculture <- c("#6a040f", "#dc2f02", "#ffdd00", "#74c69d") %>% setNames( - c("Forte impact agricole", "Impact agricole élevé", - "Impact agricole modéré", "Presque pas/pas d'impact agricole") + c("Très Forte", "Forte", + "Modéré", "Basse/Absente") ) - # NATURE + # NATURE / utilisation naturelle df$class_nature <- c("#081c15", "#2d6a4f", "#74c69d", "#d8f3dc") %>% setNames( - c("Très forte utilisation naturelle", "Forte utilisation naturelle", - "Utilisation naturelle modérée", "Presque pas/pas naturelle") + c("Très forte", "Forte", + "Modérée", "Presque pas/Pas naturelle") ) # GRAVEL BARS df$class_gravel <- c("#603808", "#e7bc91", "#0077b6") %>% setNames( - c("abundant", "moyennement présente", "absent") + c("Fréquent", "Occasionnel", "Absent") ) # CONFINEMENT df$class_confinement <- c("#2d6a4f", "#99d98c", "#ffdd00", "#ba181b") %>% setNames( - c("espace abondant", "modérement espace", "confiné", "très confiné") + c("Peu confiné", "Modérément confiné", "Confiné", "Très confiné") ) # HABITAT CONNECTIVITY df$class_habitat <- c("#2d6a4f", "#99d98c", "#ffdd00", "#ba181b") %>% setNames( - c("très bien connecté", "bien connecté", "moyen connecté", "faible / absente") + c("Élevée", "Bonne", "Moyenne", "Faible / Absente") ) return(df) From 245ec30725cc30db872543a8008d091a2e750a56 Mon Sep 17 00:00:00 2001 From: JohMail Date: Tue, 23 Sep 2025 07:57:29 +0200 Subject: [PATCH 12/30] button d'icon info mis en bleu, pour le rendre plus visible et augmentation de sa taille --- R/mod_expl_classes_manual.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_expl_classes_manual.R b/R/mod_expl_classes_manual.R index a1e33b4..00a00af 100644 --- a/R/mod_expl_classes_manual.R +++ b/R/mod_expl_classes_manual.R @@ -77,7 +77,7 @@ mod_expl_classes_manual_server <- function(id, con, r_val, globals){ span( style = "display: flex; margin-left: 10px; margin-top: -10px", popover( - trigger = bsicons::bs_icon("info-circle"), + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), "", placement = "right", id = ns("popover_metric") From 8352aa94db42437673a8fc23c57861dd0142cfb0 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 24 Sep 2025 09:43:26 +0200 Subject: [PATCH 13/30] Correction du texte --- R/fct_params.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/fct_params.R b/R/fct_params.R index 9a36b1a..13fd063 100644 --- a/R/fct_params.R +++ b/R/fct_params.R @@ -271,7 +271,7 @@ params_classes <- function() { ), description = c( # strahler - "Répresent la complexité du réseaux hydrographique. L'ordre de Strahler est de 1 pour tout cours d'eau entre sa source et sa première confluence et mont avec chaque confluence.", + "Représente la complexité du réseaux hydrographique. L'ordre de Strahler est de 1 pour tout cours d'eau entre sa source et sa première confluence et mont avec chaque confluence.", # topographie "Classification simple basée sur la pente et la hauteur du cours de la rivière : - Plaines de basse altitude (> 0 m & < 0.5 % pente) From 93557834e047a69408201b05b0b06fc34fc6d9b1 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 24 Sep 2025 16:47:38 +0200 Subject: [PATCH 14/30] =?UTF-8?q?Rectification=20des=20bordures=20du=20bou?= =?UTF-8?q?ton=20info-circle=20qui=20=C3=A9tait=20orange=20en=20blanc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/app_ui.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/app_ui.R b/R/app_ui.R index 1c21581..7e8b4bc 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -26,6 +26,13 @@ app_ui <- function(request){ z-index: 1000; /* Make sure it's above other UI elements */ } + /* quand l'icône est focus ou actif (sélectionné) */ + .bi-info-circle { + border: 2px solid white !important; + border-radius: 50%; + outline: none !important; + } + .navbar { position: relative; } From 7273569171f8bd566995da89fd8b4c089e85cf3a Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 24 Sep 2025 16:50:17 +0200 Subject: [PATCH 15/30] =?UTF-8?q?Ajout=20d'un=20bouton=20d'information=20s?= =?UTF-8?q?ur=20l'homog=C3=A9n=C3=A9isation=20des=20donn=C3=A9es=20qui=20s?= =?UTF-8?q?era=20=C3=A0=20documenter=20avec=20une=20vraie=20description.?= =?UTF-8?q?=20+=20l=C3=A9g=C3=A8re=20modification=20de=20la=20position=20d?= =?UTF-8?q?e=20button=20de=20s=C3=A9lection=20qui=20lui=20est=20associ?= =?UTF-8?q?=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/mod_expl_plot_long.R | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/R/mod_expl_plot_long.R b/R/mod_expl_plot_long.R index 4a22c64..7898a61 100644 --- a/R/mod_expl_plot_long.R +++ b/R/mod_expl_plot_long.R @@ -32,7 +32,7 @@ mod_expl_plot_long_ui <- function(id){ uiOutput(ns("profile_backgroundUI")), uiOutput(ns("profile_background_smoothUI")), uiOutput(ns("profile_background_smooth_selUI"), - style = "margin-left : 23px;") + style = "margin-left : 15px;") ) ) ) @@ -149,12 +149,24 @@ mod_expl_plot_long_server <- function(id, r_val, globals){ # selectinput for background classification smoothing output$profile_background_smooth_selUI <- renderUI({ - r_val_local$ui_background_smooth_sel + if (!is.null(r_val_local$ui_background_smooth_sel)) { + div( + style = "display: flex; align-items: center", + r_val_local$ui_background_smooth_sel, + span( + style = "margin-left: 10px; margin-bottom: -10px; margin-top: 20px", + popover( + trigger = bsicons::bs_icon("info-circle", size="1.5rem", class = "text-primary"), + "", + placement = "right", + id = ns("popover_metric3") + ) + ) + ) + } }) - - # make plot available to other observe({ r_val$plot_long_proxy <- plotlyProxy("long_profile") @@ -209,6 +221,23 @@ mod_expl_plot_long_server <- function(id, r_val, globals){ } }) + ## update infobutton when metric selected changes for the homogeneisation "singuliers" et "en paires" + observe({ + if (!is.null(input$background_profile)) { + update_popover("popover_metric3", + HTML( + # check if no metric is selected + if (is.null(input$background_smooth_sel)){ + "Permet l'affichage en fond de la classification" + } else if (input$background_smooth_sel == "singuliers") { + "description de l'homogénéisation dites singuliers" + } else { + "description de l'homogénéisation dites en paires" + } + )) + } + }) + #### plot 1st metric #### observeEvent(c(!is.null(input$profile_first_metric), globals$axis_data()), { From 3376cba11b19fb64e22b3249c03f25f603836a00 Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 25 Sep 2025 19:26:36 +0200 Subject: [PATCH 16/30] =?UTF-8?q?ajout=20de=20la=20variable=20selected=5Fd?= =?UTF-8?q?go=20pour=20afficher=20la=20distance=20=C3=A0=20l'exutoire=20su?= =?UTF-8?q?r=20le=20plot=5Fcrosssection,=20pour=20cela=20il=20est=20pass?= =?UTF-8?q?=C3=A9=20en=20argument=20dans=20l'appel=20de=20la=20fonction=20?= =?UTF-8?q?cr=5Fprofile=5Fmain=20avec=20la=20valeur=20r=5Fval$swath=5Fdata?= =?UTF-8?q?=5Fdgo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/fct_plot_crosssection.R | 4 ++-- R/mod_expl_plot_crosssection.R | 1 + man/cr_profile_main.Rd | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/R/fct_plot_crosssection.R b/R/fct_plot_crosssection.R index cb65e54..a9586f1 100644 --- a/R/fct_plot_crosssection.R +++ b/R/fct_plot_crosssection.R @@ -43,7 +43,7 @@ cr_profile_empty <- function() { #' #' @return plotly cross section plot. #' @export -cr_profile_main <- function(data, axis_toponyme){ +cr_profile_main <- function(data, selected_dgo, axis_toponyme){ section <- plot_ly(data = data, x = ~distance, y = ~profile, type = 'scatter', yaxis = 'y1', key = data$id, # the "id" column for hover text mode = 'lines+markers', fill = 'tozeroy', fillcolor = '#B0B0B0', @@ -68,7 +68,7 @@ cr_profile_main <- function(data, axis_toponyme){ font = list(size = 14, weight = "bold") ), list( - text = paste("depuis l'exutoire ", sep = ""), x = 0.5, y = 1.1, + text = paste(round(selected_dgo$measure/1000, 2)," km depuis l'exutoire ", sep = ""), x = 0.5, y = 1.1, xref = "paper", yref = "paper", showarrow = FALSE, font = list(size = 14, weight = "bold") ), diff --git a/R/mod_expl_plot_crosssection.R b/R/mod_expl_plot_crosssection.R index 746d0ba..aeb2830 100644 --- a/R/mod_expl_plot_crosssection.R +++ b/R/mod_expl_plot_crosssection.R @@ -43,6 +43,7 @@ mod_expl_plot_crosssection_server <- function(id, r_val){ # check if dgo is selected if (!is.null(r_val$swath_data_section)) { r_val_locals$section = cr_profile_main(data = r_val$swath_data_section, + selected_dgo = r_val$swath_data_dgo, axis_toponyme = r_val$axis_name) } diff --git a/man/cr_profile_main.Rd b/man/cr_profile_main.Rd index d45464f..55d93fd 100644 --- a/man/cr_profile_main.Rd +++ b/man/cr_profile_main.Rd @@ -4,7 +4,7 @@ \alias{cr_profile_main} \title{Create a cross section plot for selected DGO data.} \usage{ -cr_profile_main(data, axis_toponyme) +cr_profile_main(data, selected_dgo, axis_toponyme) } \arguments{ \item{data}{data.frame elevation profiles from selected dgo.} From b2c768b8944c02a55ee2e90eff16f73acadb794d Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 23 Oct 2025 09:12:47 +0200 Subject: [PATCH 17/30] modify the map_add_axis_dgos to add a new parameter to be display by the tooltip_label in fct_map. Proposed_class select the name of the selected --- R/mod_explore.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_explore.R b/R/mod_explore.R index f96c4a2..04a4813 100644 --- a/R/mod_explore.R +++ b/R/mod_explore.R @@ -425,7 +425,7 @@ mod_explore_server <- function(id, con, r_val, globals, waitress){ # add axis to map r_val$map_proxy %>% map_add_axes(globals$axes(), group = globals$map_group_params[["axis"]], selected_axis_id = r_val$axis_id) %>% - map_add_axis_dgos(globals$axis_data(), group = globals$map_group_params[["dgo_axis"]]) %>% + map_add_axis_dgos(globals$axis_data(), Proposed_class = globals$classes_proposed[r_val$classes_proposed_selected,]$class_name, group = globals$map_group_params[["dgo_axis"]]) %>% map_add_axis_start_end(axis_start_end = r_val$axis_start_end, group = globals$map_group_params[["axis_start_end"]]) %>% clearGroup(globals$map_group_params[["dgo"]]) From c9f5ae0c6df4b56e11f61bd2e5d9705a216bc74a Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 23 Oct 2025 09:16:23 +0200 Subject: [PATCH 18/30] Call for the Proposed_class in the function, defined in the mod_explore observeEvent line 426 "r_val$map_proxy" parameter and use it to display the class selected on mouseover --- R/fct_map.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/fct_map.R b/R/fct_map.R index 27d38d7..ff20686 100644 --- a/R/fct_map.R +++ b/R/fct_map.R @@ -521,11 +521,11 @@ map_add_axes <- function(map, data_axis, group, selected_axis_id = NULL) { #' #' @return An updated Leaflet map with axis data added. #' @export -map_add_axis_dgos <- function(map, axis_data, group) { - +map_add_axis_dgos <- function(map, axis_data, Proposed_class, group) { # create HTML conditional tooltip labels tooltip_label <- lapply(paste0(' ', axis_data$toponyme, '
', - ' ', round(axis_data$measure/1000, 2), ' km depuis l\'exutoire', ' '), + ' ', round(axis_data$measure/1000, 2), ' km depuis l\'exutoire', '
', + ' Classe : ', axis_data[[Proposed_class]], ' '), #axis_data[[Proposed_class]], htmltools::HTML) map %>% From 06fb728f56781d5d63a802fae7d3e4027f53c54d Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 23 Oct 2025 09:28:32 +0200 Subject: [PATCH 19/30] This part actualise the tooltip_label of the map when the Proposed_class selected is changed. --- R/mod_expl_classes_proposed.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/mod_expl_classes_proposed.R b/R/mod_expl_classes_proposed.R index 24b1613..36bc5c8 100644 --- a/R/mod_expl_classes_proposed.R +++ b/R/mod_expl_classes_proposed.R @@ -87,6 +87,12 @@ mod_expl_classes_proposed_server <- function(id, r_val, globals){ assign_classes_proposed(proposed_class = globals$classes_proposed[r_val$classes_proposed_selected,]$class_name, colors_df = globals$classes_proposed_colors) } + + # reload of the tooltip_label for the axis dgo + if(r_val$classes_proposed_selected!=1){ + r_val$map_proxy %>% + map_add_axis_dgos(globals$axis_data(), Proposed_class = globals$classes_proposed[r_val$classes_proposed_selected,]$class_name, group = globals$map_group_params[["dgo_axis"]]) + } }) }) From b970e672a5fe35ab3f2517ca8b7727c710a6d38e Mon Sep 17 00:00:00 2001 From: JohMail Date: Thu, 23 Oct 2025 09:32:45 +0200 Subject: [PATCH 20/30] Modify the list of parameters for the creation of the map_add_axis_dgos function --- man/map_add_axis_dgos.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/map_add_axis_dgos.Rd b/man/map_add_axis_dgos.Rd index 70da837..5201801 100644 --- a/man/map_add_axis_dgos.Rd +++ b/man/map_add_axis_dgos.Rd @@ -4,7 +4,7 @@ \alias{map_add_axis_dgos} \title{Add Axis Data to an Existing Leaflet Map} \usage{ -map_add_axis_dgos(map, axis_data, group) +map_add_axis_dgos(map, axis_data, Proposed_class, group) } \arguments{ \item{map}{An existing Leaflet map to which axis data will be added.} From 77359c7d48aba0617800c5b7be0ca4588afd9bbd Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 14:45:20 +0100 Subject: [PATCH 21/30] Annotations d'ordre de passe dans le code --- R/fct_analysis_tables.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/fct_analysis_tables.R b/R/fct_analysis_tables.R index 4d397e1..7aec359 100644 --- a/R/fct_analysis_tables.R +++ b/R/fct_analysis_tables.R @@ -57,6 +57,7 @@ prepare_selact_stats_for_table <- function(data, .names = "{.col}_{.fn}")) %>% mutate(scale = "Axe", strahler = max(axis_data$strahler)) # Add the scale and strahler column + #browser() } # default and only France-scale stats @@ -101,6 +102,7 @@ prepare_selact_stats_for_table <- function(data, .default = scale )) %>% select(-scale) + #browser() #Here en 3ème } #' Prepare metrics-statistics dataframe for reactable table for regions @@ -120,8 +122,9 @@ prepare_regions_stats_for_table <- function(data, region_names = NULL) { # if_else(strahler != 0, # paste0(r_names[level_name], ", Ordre ", strahler), # r_names[level_name])) - + #browser() return(df) + #Passe ici en premier } @@ -187,17 +190,16 @@ create_analysis_table <- function(df, vars, scale_name = "") { ) } - # Create the reactable table <- reactable( data = df, columns = columns_list, - height = 420, + height = "auto", defaultPageSize = 9, highlight = TRUE, # highlight rows on hover compact = TRUE, pagination = FALSE, striped = TRUE ) - + #browser() #Here 2èmes return(table) } From afa49927f71a7357e0b39962f2f68e4c563f8f26 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 15:23:46 +0100 Subject: [PATCH 22/30] Correction des marges entre les objets visuels et changement de place du textOuput(ns("selection_textUI")) --- R/mod_analysis.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/R/mod_analysis.R b/R/mod_analysis.R index 560410e..a359a87 100644 --- a/R/mod_analysis.R +++ b/R/mod_analysis.R @@ -33,17 +33,16 @@ mod_analysis_ui <- function(id){ # show table with France, basin, region (+ same stats but just for the strahler order of selected axis), # stats together with selected axis # below show distribution plots of selection - fluidRow( - style = "margin-top: 2px; margin-bottom: 2px; margin-left: 2px;", - textOutput(ns("selection_textUI")), + fluidRow(style = "margin-top: 2px; margin-bottom: 2px", column( width = 9, hr(), # horizontal line - fluidRow(style = "margin-top: 2px; margin-bottom: -55px;"), - uiOutput(ns("selact_tableUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), # overview table + fluidRow(style = "margin-top: 2px; margin-bottom: 0px", + uiOutput(ns("selact_tableUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours...")), # overview table hr(), # horizontal line - fluidRow(style = "margin-top: 2px; margin-bottom: 2px;"), - plotlyOutput(ns("selact_plotUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), # distribution plot + textOutput(ns("selection_textUI")), + fluidRow(style = "margin-top:2px; margin-bottom: 0px;"), + plotlyOutput(ns("selact_plotUI")) %>% shinycssloaders::withSpinner(type = 8, caption = "Calculs en cours..."), # distribution plot ), column( width = 3, From 2f7cc990a131b57333c6091c6d7291b2eb24b4ea Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 15:24:11 +0100 Subject: [PATCH 23/30] Commentaire de l'ordre de passage du code --- R/fct_analysis_tables.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/R/fct_analysis_tables.R b/R/fct_analysis_tables.R index 7aec359..74524a9 100644 --- a/R/fct_analysis_tables.R +++ b/R/fct_analysis_tables.R @@ -102,7 +102,7 @@ prepare_selact_stats_for_table <- function(data, .default = scale )) %>% select(-scale) - #browser() #Here en 3ème + #browser() #Go through here 3rd } #' Prepare metrics-statistics dataframe for reactable table for regions @@ -122,9 +122,8 @@ prepare_regions_stats_for_table <- function(data, region_names = NULL) { # if_else(strahler != 0, # paste0(r_names[level_name], ", Ordre ", strahler), # r_names[level_name])) - #browser() + #browser() #Go through here 1st return(df) - #Passe ici en premier } @@ -200,6 +199,6 @@ create_analysis_table <- function(df, vars, scale_name = "") { pagination = FALSE, striped = TRUE ) - #browser() #Here 2èmes + #browser() ##Go through here 2nd return(table) } From 486af1a892ccf11830fd09c745a40f590f6f0889 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 15:29:28 +0100 Subject: [PATCH 24/30] Ajout d'indication de chargement des options de selection de classe manuelle --- R/mod_expl_classes_manual.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_expl_classes_manual.R b/R/mod_expl_classes_manual.R index 00a00af..77d341a 100644 --- a/R/mod_expl_classes_manual.R +++ b/R/mod_expl_classes_manual.R @@ -22,7 +22,7 @@ mod_expl_classes_manual_ui <- function(id){ id = ns("manual_classificationUI"), fluidRow( style = "margin-top: 10px;", - uiOutput(ns("metric_selectUI")) + uiOutput(ns("metric_selectUI"))%>% shinycssloaders::withSpinner(type = 1, caption = "Construction...") ), fluidRow( style = "margin-bottom: 0px; padding-bottom: 0px;", From 79cdc7e0b0f9fcfc6f70d3bcca6d5fa56ddaeef5 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 15:29:54 +0100 Subject: [PATCH 25/30] =?UTF-8?q?Commentaire=20des=20parenth=C3=A8ses=20po?= =?UTF-8?q?ur=20rep=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/mod_explore.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_explore.R b/R/mod_explore.R index 04a4813..f168657 100644 --- a/R/mod_explore.R +++ b/R/mod_explore.R @@ -31,7 +31,7 @@ mod_explore_ui <- function(id){ .form-group{margin-bottom: 5px} .nav-pills > li > a {line-height: 5%;} ") - ) + ) # style ), # head fluidRow( column( From b45306b711a0a10b097b6b90d04a7644314c5aff Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 15:30:40 +0100 Subject: [PATCH 26/30] Clignotement du bouton d'aide. --- R/mod_help_guide.R | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/R/mod_help_guide.R b/R/mod_help_guide.R index a88407a..18788f9 100644 --- a/R/mod_help_guide.R +++ b/R/mod_help_guide.R @@ -13,7 +13,20 @@ mod_help_guide_ui <- function(id) { ns <- NS(id) tagList( - actionButton(ns("help_btn"), " Aide", class = "btn-primary", + tags$head( + tags$style(HTML(" + .highlight-on-start { + animation: pulseGlow 2.5s ease-in-out 100; + } + + @keyframes pulseGlow { + 0% { box-shadow: 0 0 5px 2px #2e61d9; } + 50% { box-shadow: 0 0 20px 8px #2e61d9; } + 100% { box-shadow: 0 0 5px 2px #2e61d9; } + } +")) + ), + actionButton(ns("help_btn"), " Aide", class = "btn-primary highlight-on-start", icon = icon("circle-question")), use_cicerone() # Load the cicerone dependencies ) @@ -28,8 +41,6 @@ mod_help_guide_server <- function(id, r_val){ moduleServer(id, function(input, output, session){ ns <- session$ns - - # Set up a dynamic observer based on the active tab observeEvent(input$help_btn, { @@ -83,7 +94,7 @@ mod_help_guide_server <- function(id, r_val){ if (r_val$tab_classes == "Classification manuelle") { tour$step("expl_classes_manual_1-manual_classificationUI", "Classification manuelle", - description = "Créez une classification basée sur une mesure spécifique. Choisissez d'abord une métrique, puis éditez les noms de classe, les seuils et les couleurs pour chaque classe. Les seuils initiaux des classes sont, pour exclure les valeurs aberrantes, basés sur le quantile à 95 % de la métrique correspondante pour l'ensemble du réseau français. En cliquant sur la flèche en haut à droite, vous pouvez ajuster l'étendue du quantile ou la base de l'échelle. En outre, vous pouvez définir le nombre de classes que vous souhaitez appliquer. Des informations sur la métrique sélectionnée peuvent être obtenues en cliquant sur le bouton info à côté de la sélection de la métrique.", + description = "Créez une classification basée sur une mesure spécifique. Choisissez d'abord une métrique, puis éditez les noms de classe, les seuils et les couleurs pour chaque classe. Les seuils initiaux des classes sont, pour exclure les valeurs aberrantes, basés sur le quantile à 95 % de la métrique correspondante pour l'ensemble du réseau français. En cliquant sur la flèche en haut à droite, vous pouvez ajuster l'étendue du quantile ou la base de l'échelle. En outre, vous pouvez définir le nombre de classes que vous souhaitez appliquer dans la flèche en-dessous du i d'information. Des informations sur la métrique sélectionnée peuvent être obtenues en cliquant sur le bouton info à côté de la sélection de la métrique.", position = "left") } From e999f881647e38f09b108151aeb0ca401df85bc0 Mon Sep 17 00:00:00 2001 From: JohMail Date: Wed, 5 Nov 2025 17:07:51 +0100 Subject: [PATCH 27/30] =?UTF-8?q?Actualise=20le=20tooltip=5Flabel=20de=20l?= =?UTF-8?q?a=20carte=20seulement=20lorsqu'un=20tron=C3=A7on=20est=20s?= =?UTF-8?q?=C3=A9lectionn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/mod_expl_classes_proposed.R | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/R/mod_expl_classes_proposed.R b/R/mod_expl_classes_proposed.R index 36bc5c8..70bfc85 100644 --- a/R/mod_expl_classes_proposed.R +++ b/R/mod_expl_classes_proposed.R @@ -89,9 +89,13 @@ mod_expl_classes_proposed_server <- function(id, r_val, globals){ } # reload of the tooltip_label for the axis dgo - if(r_val$classes_proposed_selected!=1){ - r_val$map_proxy %>% - map_add_axis_dgos(globals$axis_data(), Proposed_class = globals$classes_proposed[r_val$classes_proposed_selected,]$class_name, group = globals$map_group_params[["dgo_axis"]]) + if(r_val$selection_text != ""){ + if(r_val$classes_proposed_selected!=1){ + r_val$map_proxy %>% + map_add_axis_dgos(globals$axis_data(), + Proposed_class = globals$classes_proposed[r_val$classes_proposed_selected,]$class_name, + group = globals$map_group_params[["dgo_axis"]]) + } } }) From 107a08379ae2cb9235b140914132e325726a4ee9 Mon Sep 17 00:00:00 2001 From: JohMail Date: Fri, 14 Nov 2025 10:04:04 +0100 Subject: [PATCH 28/30] =?UTF-8?q?Correction=20de=20texte=20entre=20fct=5Fp?= =?UTF-8?q?arams=20et=20fct=5Fdata=20pour=20l'affichage=20de=20la=20classi?= =?UTF-8?q?fication=20en=20arri=C3=A8re=20plan.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/fct_data.R | 132 ++++++++++++++++++++++++------------------------- R/fct_params.R | 6 +-- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/R/fct_data.R b/R/fct_data.R index b1bd1e7..977deb6 100644 --- a/R/fct_data.R +++ b/R/fct_data.R @@ -319,28 +319,28 @@ data_get_distr_class <- function(con, class_name) { class_name == "class_urban" ~ "CASE WHEN built_environment_pc IS NULL THEN 'unvalid' - WHEN built_environment_pc >= 70 THEN 'fortement urbanisé' - WHEN built_environment_pc >= 40 THEN 'urbanisé' - WHEN built_environment_pc >= 10 THEN 'modérément urbanisé' - WHEN built_environment_pc >= 0 THEN 'Presque pas/pas urbanisé' + WHEN built_environment_pc >= 70 THEN 'Fortement urbanisé' + WHEN built_environment_pc >= 40 THEN 'Urbanisé' + WHEN built_environment_pc >= 10 THEN 'Modérément urbanisé' + WHEN built_environment_pc >= 0 THEN 'Presque pas/Pas urbanisé' ELSE 'unvalid' END AS class_name", class_name == "class_agriculture" ~ "CASE WHEN crops_pc IS NULL THEN 'unvalid' - WHEN crops_pc >= 70 THEN 'Forte impact agricole' - WHEN crops_pc >= 40 THEN 'Impact agricole élevé' - WHEN crops_pc >= 10 THEN 'Impact agricole modéré' - WHEN crops_pc >= 0 THEN 'Presque pas/pas d''impact agricole' + WHEN crops_pc >= 70 THEN 'Très Forte' + WHEN crops_pc >= 40 THEN 'Forte' + WHEN crops_pc >= 10 THEN 'Modéré' + WHEN crops_pc >= 0 THEN 'Basse/Absente' ELSE 'unvalid' END AS class_name", class_name == "class_nature" ~ "CASE WHEN natural_open_pc IS NULL OR forest_pc IS NULL OR grassland_pc IS NULL THEN 'unvalid' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Utilisation naturelle modérée' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/pas naturelle' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Modérée' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/Pas naturelle' ELSE 'unvalid' END AS class_name", class_name == "class_gravel" ~ @@ -354,19 +354,19 @@ data_get_distr_class <- function(con, class_name) { class_name == "class_confinement" ~ "CASE WHEN idx_confinement IS NULL THEN 'unvalid' - WHEN idx_confinement >= 0.7 THEN 'espace abondant' - WHEN idx_confinement >= 0.4 THEN 'modérement espace' - WHEN idx_confinement >= 0.1 THEN 'confiné' - WHEN idx_confinement >= 0 THEN 'très confiné' + WHEN idx_confinement >= 0.7 THEN 'Peu confiné' + WHEN idx_confinement >= 0.4 THEN 'Modérement confiné' + WHEN idx_confinement >= 0.1 THEN 'Confiné' + WHEN idx_confinement >= 0 THEN 'Très confiné' ELSE 'unvalid' END AS class_name", class_name == "class_habitat" ~ "CASE WHEN riparian_corridor_pc IS NULL OR semi_natural_pc IS NULL THEN 'unvalid' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'très bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'moyen connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'faible / absente' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'Élevée' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'Bonne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'Moyenne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'Faible/Absente' ELSE 'unvalid' END AS class_name", .default = NULL @@ -772,59 +772,59 @@ data_get_axis_dgos <- function(selected_axis_id, con) { -- Urban Land Use Classification CASE WHEN built_environment_pc IS NULL THEN 'unvalid' - WHEN built_environment_pc >= 70 THEN 'fortement urbanisé' - WHEN built_environment_pc >= 40 THEN 'urbanisé' - WHEN built_environment_pc >= 10 THEN 'modérément urbanisé' - WHEN built_environment_pc >= 0 THEN 'Presque pas/pas urbanisé' + WHEN built_environment_pc >= 70 THEN 'Fortement urbanisé' + WHEN built_environment_pc >= 40 THEN 'Urbanisé' + WHEN built_environment_pc >= 10 THEN 'Modérément urbanisé' + WHEN built_environment_pc >= 0 THEN 'Presque pas/Pas urbanisé' ELSE 'unvalid' END AS class_urban, -- Agricultural Land Use Classification CASE WHEN crops_pc IS NULL THEN 'unvalid' - WHEN crops_pc >= 70 THEN 'Forte impact agricole' - WHEN crops_pc >= 40 THEN 'Impact agricole élevé' - WHEN crops_pc >= 10 THEN 'Impact agricole modéré' - WHEN crops_pc >= 0 THEN 'Presque pas/pas d''impact agricole' + WHEN crops_pc >= 70 THEN 'Très Forte' + WHEN crops_pc >= 40 THEN 'Forte' + WHEN crops_pc >= 10 THEN 'Modéré' + WHEN crops_pc >= 0 THEN 'Basse/Absente' ELSE 'unvalid' END AS class_agriculture, -- Natural Land Use Classification CASE WHEN natural_open_pc IS NULL OR forest_pc IS NULL OR grassland_pc IS NULL THEN 'unvalid' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Utilisation naturelle modérée' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/pas naturelle' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Modérée' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/Pas naturelle' ELSE 'unvalid' END AS class_nature, -- Gravel Bars Classification CASE WHEN gravel_bars IS NULL OR water_channel IS NULL THEN 'unvalid' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) >= 0.5 THEN 'abundant' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) > 0 THEN 'moyennement présente' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) = 0 THEN 'absent' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) >= 0.5 THEN 'Fréquent' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) > 0 THEN 'Occasionnel' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) = 0 THEN 'Absent' ELSE 'unvalid' END AS class_gravel, -- Confinement Classification CASE WHEN idx_confinement IS NULL THEN 'unvalid' - WHEN idx_confinement >= 0.7 THEN 'espace abondant' - WHEN idx_confinement >= 0.4 THEN 'modérement espace' - WHEN idx_confinement >= 0.1 THEN 'confiné' - WHEN idx_confinement >= 0 THEN 'très confiné' + WHEN idx_confinement >= 0.7 THEN 'Peu confiné' + WHEN idx_confinement >= 0.4 THEN 'Modérément confiné' + WHEN idx_confinement >= 0.1 THEN 'Confiné' + WHEN idx_confinement >= 0 THEN 'Très confiné' ELSE 'unvalid' END AS class_confinement, -- Habitat Classification CASE WHEN riparian_corridor_pc IS NULL OR semi_natural_pc IS NULL THEN 'unvalid' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'très bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'moyen connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'faible / absente' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'Élevée' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'Bonne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'Moyenne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'Faible/Absente' ELSE 'unvalid' END AS class_habitat FROM network_metrics @@ -916,59 +916,59 @@ data_get_axis_dgos_from_region <- function(selected_region_id, con) { -- Urban Land Use Classification CASE WHEN built_environment_pc IS NULL THEN 'unvalid' - WHEN built_environment_pc >= 70 THEN 'fortement urbanisé' - WHEN built_environment_pc >= 40 THEN 'urbanisé' - WHEN built_environment_pc >= 10 THEN 'modérément urbanisé' - WHEN built_environment_pc >= 0 THEN 'Presque pas/pas urbanisé' + WHEN built_environment_pc >= 70 THEN 'Fortement urbanisé' + WHEN built_environment_pc >= 40 THEN 'Urbanisé' + WHEN built_environment_pc >= 10 THEN 'Modérément urbanisé' + WHEN built_environment_pc >= 0 THEN 'Presque pas/Pas urbanisé' ELSE 'unvalid' END AS class_urban, -- Agricultural Land Use Classification CASE WHEN crops_pc IS NULL THEN 'unvalid' - WHEN crops_pc >= 70 THEN 'Forte impact agricole' - WHEN crops_pc >= 40 THEN 'Impact agricole élevé' - WHEN crops_pc >= 10 THEN 'Impact agricole modéré' - WHEN crops_pc >= 0 THEN 'Presque pas/pas d''impact agricole' + WHEN crops_pc >= 70 THEN 'Très Forte' + WHEN crops_pc >= 40 THEN 'Forte' + WHEN crops_pc >= 10 THEN 'Modéré' + WHEN crops_pc >= 0 THEN 'Basse/Absente' ELSE 'unvalid' END AS class_agriculture, -- Natural Land Use Classification CASE WHEN natural_open_pc IS NULL OR forest_pc IS NULL OR grassland_pc IS NULL THEN 'unvalid' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte utilisation naturelle' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Utilisation naturelle modérée' - WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/pas naturelle' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 70 THEN 'Très forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 40 THEN 'Forte' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 10 THEN 'Modérée' + WHEN (natural_open_pc + forest_pc + grassland_pc) >= 0 THEN 'Presque pas/Pas naturelle' ELSE 'unvalid' END AS class_nature, -- Gravel Bars Classification CASE WHEN gravel_bars IS NULL OR water_channel IS NULL THEN 'unvalid' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) >= 0.5 THEN 'abundant' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) > 0 THEN 'moyennement présente' - WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) = 0 THEN 'absent' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) >= 0.5 THEN 'Fréquent' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) > 0 THEN 'Occasionnel' + WHEN (gravel_bars / NULLIF(water_channel + gravel_bars, 0)) = 0 THEN 'Absent' ELSE 'unvalid' END AS class_gravel, -- Confinement Classification CASE WHEN idx_confinement IS NULL THEN 'unvalid' - WHEN idx_confinement >= 0.7 THEN 'espace abondant' - WHEN idx_confinement >= 0.4 THEN 'modérement espace' - WHEN idx_confinement >= 0.1 THEN 'confiné' - WHEN idx_confinement >= 0 THEN 'très confiné' + WHEN idx_confinement >= 0.7 THEN 'Peu confiné' + WHEN idx_confinement >= 0.4 THEN 'Modérément confiné' + WHEN idx_confinement >= 0.1 THEN 'Confiné' + WHEN idx_confinement >= 0 THEN 'Très confiné' ELSE 'unvalid' END AS class_confinement, -- Habitat Classification CASE WHEN riparian_corridor_pc IS NULL OR semi_natural_pc IS NULL THEN 'unvalid' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'très bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'bien connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'moyen connecté' - WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'faible / absente' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 70 THEN 'Élevée' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 40 THEN 'Bonne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 10 THEN 'Moyenne' + WHEN (riparian_corridor_pc + semi_natural_pc) >= 0 THEN 'Faible/Absente' ELSE 'unvalid' END AS class_habitat FROM network_metrics diff --git a/R/fct_params.R b/R/fct_params.R index 13fd063..04e6662 100644 --- a/R/fct_params.R +++ b/R/fct_params.R @@ -319,10 +319,10 @@ params_classes <- function() { - Très confiné (chenal actif < 10 % du fond de la vallée)", # habitat connectivity "Indique la présence d'un corridor riverain naturel. Basé sur ratio de la surface du corridor connecté (comprenant le chenal actif, le corridor naturel et les corridors semi-naturels) et le fond de la vallée : - - élevée (>= 70 %) + - Élevée (>= 70 %) - Bonne (>= 40 %) - Moyenne (>= 10 % ) - - Faible / Absente (< 10 %)" + - Faible/Absente (< 10 %)" ), class_name = c( "class_strahler", @@ -527,7 +527,7 @@ params_classes_colors <- function() { # HABITAT CONNECTIVITY df$class_habitat <- c("#2d6a4f", "#99d98c", "#ffdd00", "#ba181b") %>% setNames( - c("Élevée", "Bonne", "Moyenne", "Faible / Absente") + c("Élevée", "Bonne", "Moyenne", "Faible/Absente") ) return(df) From 8e1e660fafad0782be81523236a5e974b2198f19 Mon Sep 17 00:00:00 2001 From: JohMail Date: Fri, 14 Nov 2025 10:06:03 +0100 Subject: [PATCH 29/30] nettoyage de code test --- R/fct_map.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/fct_map.R b/R/fct_map.R index ff20686..4f1637e 100644 --- a/R/fct_map.R +++ b/R/fct_map.R @@ -525,7 +525,7 @@ map_add_axis_dgos <- function(map, axis_data, Proposed_class, group) { # create HTML conditional tooltip labels tooltip_label <- lapply(paste0(' ', axis_data$toponyme, '
', ' ', round(axis_data$measure/1000, 2), ' km depuis l\'exutoire', '
', - ' Classe : ', axis_data[[Proposed_class]], ' '), #axis_data[[Proposed_class]], + ' Classe : ', axis_data[[Proposed_class]], ' '), htmltools::HTML) map %>% From 3f713ada5d319d55b4703bb5b8176e9fe18b8ef8 Mon Sep 17 00:00:00 2001 From: JohMail Date: Fri, 14 Nov 2025 10:53:17 +0100 Subject: [PATCH 30/30] Option de titre des colonnes flottantes. --- R/mod_download.R | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/R/mod_download.R b/R/mod_download.R index fd24823..0385e0c 100644 --- a/R/mod_download.R +++ b/R/mod_download.R @@ -16,6 +16,17 @@ mod_download_ui <- function(id) { HTML(" .form-group{margin-bottom: 5px} .nav-pills > li > a {line-height: 5%;} + .sticky-table thead th { + position: sticky; + top: 0; + background-color: white; + z-index: 2; + } + .sticky-wrapper { + height: 300px; /* zone scrollable */ + overflow-y: scroll; + border: 1px solid #ccc; + } ") ) ), # head @@ -64,7 +75,8 @@ mod_download_ui <- function(id) { ), # table - div(style = 'overflow-x: auto; width: 100%; height: 75vh', # Horizontal scroll and full-width div + div(class = "sticky-wrapper", + class = "sticky-table", style = 'overflow-x: auto; width: 100%; height: 75vh', # Horizontal scroll and full-width div tableOutput(ns("table_data")) ), )