Skip to content

Commit

Permalink
shiny app : add clusterRes input & import
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Thieurmel committed Sep 29, 2021
1 parent dfd4afc commit 8a50576
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: antaresViz
Type: Package
Title: Antares Visualizations
Version: 0.16
Version: 0.17
Authors@R: c(
person("Veronique", "Bachelier", email = "[email protected]", role = c("aut", "cre")),
person("Jalal-Edine", "Zawam", role = "aut"),
Expand All @@ -22,7 +22,7 @@ BugReports: https://github.com/rte-antares-rpackage/antaresViz/issues
License: GPL (>= 2) | file LICENSE
Encoding: UTF-8
Depends:
antaresRead (>= 2.2.7),
antaresRead (>= 2.2.9),
antaresProcessing (>= 0.13.0),
spMaps (>= 0.2)
Imports:
Expand Down
10 changes: 10 additions & 0 deletions inst/application/src/server/01_set_read_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,31 @@ observe({
isolate({
# areas
areas <- c("all", opts$areaList)
if(isTRUE(all.equal(c("all"), areas))) areas <- c("", "all")
updateSelectInput(session, "read_areas", paste0(antaresViz:::.getLabelLanguage("Areas", current_language), " : "),
choices = areas, selected = areas[1])

# links
links <- c("all", opts$linkList)
if(isTRUE(all.equal(c("all"), links))) links <- c("", "all")
updateSelectInput(session, "read_links", paste0(antaresViz:::.getLabelLanguage("Links", current_language), " : "),
choices = links, selected = links[1])

# clusters
clusters <- c("all", opts$areasWithClusters)
if(isTRUE(all.equal(c("all"), clusters))) clusters <- c("", "all")
updateSelectInput(session, "read_clusters", paste0(antaresViz:::.getLabelLanguage("Clusters", current_language), " : "),
choices = clusters, selected = clusters[1])

# clustersRes
clustersRes <- c("all", opts$areasWithResClusters)
if(isTRUE(all.equal(c("all"), clustersRes))) clustersRes <- c("", "all")
updateSelectInput(session, "read_clusters_res", paste0(antaresViz:::.getLabelLanguage("ClustersRes", current_language), " : "),
choices = clustersRes, selected = clustersRes[1])

# districts
districts <- c("all", opts$districtList)
if(isTRUE(all.equal(c("all"), districts))) districts <- c("", "all")
updateSelectInput(session, "read_districts", paste0(antaresViz:::.getLabelLanguage("Districts", current_language), " : "),
choices = districts, selected = districts[1])

Expand Down
3 changes: 2 additions & 1 deletion inst/application/src/server/02_load_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ observe({
# import data
data <- withCallingHandlers({
tryCatch({
readAntares(areas = input$read_areas, links = input$read_links, clusters = input$read_clusters,
readAntares(areas = input$read_areas, links = input$read_links,
clusters = input$read_clusters, clustersRes = input$read_clusters_res,
districts = input$read_districts, misc = input$read_misc,
thermalAvailabilities = input$read_thermalAvailabilities,
hydroStorage = input$read_hydroStorage, hydroStorageMaxPower = input$read_hydroStorageMaxPower,
Expand Down
25 changes: 15 additions & 10 deletions inst/application/src/ui/01_ui_import_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,22 @@ tabPanel(textOutput("label_tab_import_data"),

h3(textOutput("title_readAntares")),
fluidRow(
column(3,
selectInput("read_areas", "Areas :", choices = NULL, selected = NULL, multiple = TRUE)
column(6,
selectInput("read_areas", "Areas :", choices = NULL, selected = NULL, multiple = TRUE, width = "100%")
),
column(3,
selectInput("read_links", "Links :", choices = NULL, selected = NULL, multiple = TRUE)
),
column(3,
selectInput("read_clusters", "Clusters : ", choices = NULL, selected = NULL, multiple = TRUE)
),
column(3,
selectInput("read_districts", "Districts :", choices = NULL, selected = NULL, multiple = TRUE)
column(6,
selectInput("read_links", "Links :", choices = NULL, selected = NULL, multiple = TRUE, width = "100%")
)
),
fluidRow(
column(4,
selectInput("read_clusters", "Clusters : ", choices = NULL, selected = NULL, multiple = TRUE, width = "100%")
),
column(4,
selectInput("read_clusters_res", "ClustersRes : ", choices = NULL, selected = NULL, multiple = TRUE, width = "100%")
),
column(4,
selectInput("read_districts", "Districts :", choices = NULL, selected = NULL, multiple = TRUE, width = "100%")
)
),
conditionalPanel(condition = "output.current_opts_h5 === false",
Expand Down
14 changes: 13 additions & 1 deletion inst/language_columns.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@ MISC. NDG;renouvelable_autre
LOAD;consommation
H. ROR;hydraulique_fil
WIND;eolien
WIND OFFSHORE;eolien offshore
WIND ONSHORE;eolien onshore
SOLAR;solaire
SOLAR CONCRT.;solaire à concentration
SOLAR PV;solaire PV
SOLAR ROOFT;solaire toiture
NUCLEAR;nucleaire
LIGNITE;lignite
COAL;charbon
GAS;gaz
OIL;fioul
MIX. FUEL;thermique_mixte
MISC. DTG;thermique_autre
MISC. DTG 2;thermique_autre 2
MISC. DTG 3;thermique_autre 3
MISC. DTG 4;thermique_autre 4
H. STOR;hydraulique_lac
UNSP. ENRG;energie_non_distribuee
SPIL. ENRG;deversement
Expand Down Expand Up @@ -68,4 +76,8 @@ hydraulicRor;Hydraulique_fil
hydraulicStor;Hydraulique_lac
totalProduction;Production Totale
netLoad;Consommation nette
thermalAvailability;Marge disponible
thermalAvailability;Marge disponible
RENW. 1;RENW. 1
RENW. 2;RENW. 2
RENW. 3;RENW. 3
RENW. 4;RENW. 4

0 comments on commit 8a50576

Please sign in to comment.