Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
75d3867
Line 24-25 : control the size of the clickable boxes.
JohMail Jul 16, 2025
00851b3
Adding a central legend to the graph to indicate the location within …
JohMail Jul 16, 2025
629d819
Line 66 : Height : 75vh to control the horizontal size of the table b…
JohMail Jul 16, 2025
30146dc
line 16 adding : class = "btn-primary",
JohMail Jul 17, 2025
bff1ad2
Remove plotly logo for every possible plot.
JohMail Jul 21, 2025
a611576
enhance the info button icon and colour it in blue.
JohMail Jul 21, 2025
6fec57e
Same size of tab options than the mod_explore one.
JohMail Jul 21, 2025
0fc9173
Enhance the size of info button icon and colour it in blue.
JohMail Jul 21, 2025
abf18c8
Control the size of margins and navigation tabs, making them thinner
JohMail Jul 21, 2025
53dc777
Changement de taille des onglets principaux (Explore / analyse / télé…
JohMail Sep 23, 2025
86f38ab
Simple mise en forme du texte
JohMail Sep 23, 2025
245ec30
button d'icon info mis en bleu, pour le rendre plus visible et augmen…
JohMail Sep 23, 2025
8352aa9
Correction du texte
JohMail Sep 24, 2025
9355783
Rectification des bordures du bouton info-circle qui était orange en …
JohMail Sep 24, 2025
7273569
Ajout d'un bouton d'information sur l'homogénéisation des données qui…
JohMail Sep 24, 2025
3376cba
ajout de la variable selected_dgo pour afficher la distance à l'exuto…
JohMail Sep 25, 2025
b2c768b
modify the map_add_axis_dgos to add a new parameter to be display by …
JohMail Oct 23, 2025
c9f5ae0
Call for the Proposed_class in the function, defined in the mod_expl…
JohMail Oct 23, 2025
06fb728
This part actualise the tooltip_label of the map when the Proposed_cl…
JohMail Oct 23, 2025
b970e67
Modify the list of parameters for the creation of the map_add_axis_dg…
JohMail Oct 23, 2025
77359c7
Annotations d'ordre de passe dans le code
JohMail Nov 5, 2025
afa4992
Correction des marges entre les objets visuels et changement de place du
JohMail Nov 5, 2025
2f7cc99
Commentaire de l'ordre de passage du code
JohMail Nov 5, 2025
486af1a
Ajout d'indication de chargement des options de selection de classe m…
JohMail Nov 5, 2025
79cdc7e
Commentaire des parenthèses pour repère
JohMail Nov 5, 2025
b45306b
Clignotement du bouton d'aide.
JohMail Nov 5, 2025
e999f88
Actualise le tooltip_label de la carte seulement lorsqu'un tronçon es…
JohMail Nov 5, 2025
107a083
Correction de texte entre fct_params et fct_data pour l'affichage de …
JohMail Nov 14, 2025
8e1e660
nettoyage de code test
JohMail Nov 14, 2025
3f713ad
Option de titre des colonnes flottantes.
JohMail Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -44,6 +51,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")
),
Expand Down
9 changes: 6 additions & 3 deletions R/fct_analysis_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}


Expand All @@ -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
}


Expand Down
9 changes: 5 additions & 4 deletions R/fct_analysis_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -101,6 +102,7 @@ prepare_selact_stats_for_table <- function(data,
.default = scale
)) %>%
select(-scale)
#browser() #Go through here 3rd
}

#' Prepare metrics-statistics dataframe for reactable table for regions
Expand All @@ -120,7 +122,7 @@ 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() #Go through here 1st
return(df)
}

Expand Down Expand Up @@ -187,17 +189,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() ##Go through here 2nd
return(table)
}
132 changes: 66 additions & 66 deletions R/fct_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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" ~
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/fct_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -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('<span style="color:#212529;"> <b>', axis_data$toponyme, '</b> </span> <br/>',
'<span style="color:#495057;"> <b>', round(axis_data$measure/1000, 2), ' km depuis l\'exutoire', '</b> </span>'),
'<span style="color:#495057;"> <b>', round(axis_data$measure/1000, 2), ' km depuis l\'exutoire', '</b> </span> <br/>',
'<span style="color:#495057;"> Classe : <b>', axis_data[[Proposed_class]], '</b> </span>'),
htmltools::HTML)

map %>%
Expand Down
Loading