Skip to content

Commit

Permalink
Initialise shiny project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pixup1 committed Dec 1, 2024
1 parent 6f56e3d commit 07d5ab8
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 1 deletion.
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
shiny (>= 1.9.1),
bslib (>= 0.8.0)
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(run)
import(bslib)
import(shiny)
6 changes: 6 additions & 0 deletions R/ADSPlanner-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is used to define the imports that will be updated by roxygen2 when running `devtools::document()`.

#' @import shiny
#' @import bslib
NULL
#> NULL
1 change: 0 additions & 1 deletion R/main.R

This file was deleted.

16 changes: 16 additions & 0 deletions R/run.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
library(shiny)

source("R/ui.R")
source("R/server.R")

#' Run the Shiny application
#'
#' This function launches the Shiny application.
#'
#' @export
run <- function() {
runApp(shinyApp(
ui = ui,

Check warning on line 13 in R/run.R

View workflow job for this annotation

GitHub Actions / checks

file=R/run.R,line=13,col=14,[object_usage_linter] no visible binding for global variable 'ui'
server = server

Check warning on line 14 in R/run.R

View workflow job for this annotation

GitHub Actions / checks

file=R/run.R,line=14,col=18,[object_usage_linter] no visible binding for global variable 'server'
))
}
10 changes: 10 additions & 0 deletions R/server.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
library(shiny)

server <- function(input, output) {
output$download <- downloadHandler(
filename = "affectations.xlsx",
content = function(file) {
write("Not implemented yet.", file)
}
)
}
26 changes: 26 additions & 0 deletions R/ui.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
library(bslib)

ui <- page_sidebar(
title = "ADS-Planner",
sidebar = sidebar(
width = 350,
card(
fileInput("file", "R\u00E9sultats du sondage", accept = c(".xlsx", ".ods"), buttonLabel = "Parcourir...", placeholder = "Aucun fichier", multiple = FALSE),
),
downloadButton("download", "T\u00E9l\u00E9charger affectations"),
),
navset_tab(
nav_panel(
"Visualisation des choix",
"Not implemented yet.",
),
nav_panel(
"Sans r\u00E9ponse",
"Not implemented yet.",
),
nav_panel(
"Affectations",
"Not implemented yet.",
),
),
)
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

A tool to distribute INSA students into ADS sessions.

## Installing & Running

To install (or update) the ADS-Planner R package, simply clone this repo, start an interactive R session from the root folder and run :

```R
install.packages(".",repos=NULL)
```

And to run the app :

```R
ADSPlanner::run()
```

The web interface should open automatically. If it doesn't, you can open the link next to `Browsing` in the command output.

For development purposes, the app can be started more simply by running `shiny::runApp("R")` from the root of the repo.

## ADS

ADS (Action Découverte des Spécialités) is a teaching module aimed at presenting the specialties of the engineering program at INSA to students in the preparatory program. This module consists of three sessions. Each student is asked to rank the specialties by preference to assign them to the three half-day sessions.
Expand Down
11 changes: 11 additions & 0 deletions man/run.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07d5ab8

Please sign in to comment.