biodt-shiny

This repository contains a shiny application which is intended as the simplest way of interacting with BioDT by end-users.

https://github.com/biodt/biodt-shiny

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 10 committers (30.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

This repository contains a shiny application which is intended as the simplest way of interacting with BioDT by end-users.

Basic Info
  • Host: GitHub
  • Owner: BioDT
  • License: other
  • Language: R
  • Default Branch: main
  • Size: 280 MB
Statistics
  • Stars: 8
  • Watchers: 4
  • Forks: 3
  • Open Issues: 19
  • Releases: 4
Created over 3 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

BioDT Web Application

Overview

This repository contains the codes for the Shiny web application hosted at app.biodt.eu. The Shiny app is intended as the simplest way of interacting with BioDT by end-users. The app uses Shiny framework on top of R language and is built using power of development framework Rhino.

Getting Started (development set up)

0. Prerequisites

On your local computer there have to be downloaded and installed these binaries and frameworks (ie. R packages):

1. Get the code

Clone the repository:

bash git clone git@github.com:BioDT/biodt-shiny.git

Open the project directory in your preferred IDE, for example (RStudio or (VS Code)[https://code.visualstudio.com/download]).

2. Install required packages

Start by installing renv package.

R install.packages("renv")

Then install all the dependencies by calling renv::restore() command. All the dependencies are stored in the renv.lock file.

R renv::restore()

3. Setup local development, or production, environment

We utilize a common way for setting up your enviroment. There are two common options depending whether you want to run the app locally for development purposes (dev), or in production environment (prod), ie. for example dockerized app hosted at app.biodt.eu.

In the working directory you need to create your own .Renviron file which is git ignored. You can easily do it by issuing the following command in your Bash (Zsh, etc) terminal

cp .Renviron.example .Renviron

Config env variable

In the file please config what enviroment you want the app run at. For development:

bash (...) R_CONFIG_ACTIVE="dev" (...)

For production delete the line R_CONFIG_ACTIVE="dev" and uncomment this line which results in:

bash (...) R_CONFIG_ACTIVE="prod" (...)

Other environment variables, which aren't secrets (ie. git ignored) and are publicily avaible, can be seen and/or edit in the file config.yml. At the time (May 2024) the file contains dummy variables, serving as an example only.

Config .Rprofile

We prefer to use PPM packages where possible and therefore it is advised to use following lines in the .Rprofile file in the home directory of the project.

```r source("renv/activate.R")

options(repos = c(PPM = "https://packagemanager.posit.co/cran/latest")) ```

In case of Windows and MacOS environment You might want to add one more line after these two:

r options(pkgType = "binary")

Note! You might probably want to restart (re-open) your R terminal at this moment and restart your R session.

4. Get local data

Download any required local data, first you need to create a folder to hold this data. This folder is ignored by git so you need to create it first. You can do this manually or run in R

dir.create("app/data")

Then download the data from the sharepoint (authenticated access required)

Each pDT's shiny module has it's own folder for local data within this which you can see specififed in this file: https://github.com/BioDT/biodt-shiny/blob/main/dev/rundev.R therefore you need to create a folder within the `localdata` folder. The folder names are:

  • Crop wild relatives: app/data/cwr
  • BEEHAVE: app/data/honeybee
  • Cultural ecosystem services: app/data/ces

5. Launch the app

Now you should be ready to launch the app, which you can do using this command in your R terminal.

R shiny::runApp()

Development

Please feel free to create a branch and pull requests for making significant changes to the Shiny app.

Modules

The app is modularized and each pDT have files in its own subfolder. UI files are located mainly in the app/view subfolder, R function mainly in the app/logic subfolder. UI files for each pDT is located:

  • BEEHAVE: app/view/honeybee
  • Cultural Ecosystem Services: TBD
  • Crop wild relatives: TBD
  • GRASSLAND: app/view/grassland
  • Invasive alien species: TBD
  • RTBM (Real-time Bird Monitoring): app/view/rtbm

Technicals

🔒 Authentication and access to running models on LUMI/KAROLINA is enabled using R package {r4lexis} https://github.com/It4innovations/r4lexis the package is only available on GitHub.

🎨 We use {bslib} in order to use Bootstrap 5 elements (https://rstudio.github.io/bslib/). The theme is a custom BioDT theme. The css, favicons, backgrounds etc. are located in inst/app/www.

✅ Tests are developed using the {testthat} package. Tests are written as .R files in tests/testthat/.

🌍 Maps are rendered using {leaflet}: https://rstudio.github.io/leaflet/.

Loading screens with {waiter}

If you have computations that take a long time then use the implemented waiter functionality. This will not make the app load faster but make it feel faster as it induces patience in your users and make the app feel slicker. To set this up in your module you can use waiter_text() function to prepare text message with custom HTML format.

r msg <- waiter_text(message = tags$h3("Computing Beehave simulation...", style = "color: #414f2f;" ))

Then create a waiter object

r w <- Waiter$new( html = msg[[1]], color = "rgba(256,256,256,0.9)" )

You can then use the following lines within your shiny code:

  • w$show() to show a loading screen
  • w$update() to update message in the middle of computation
  • w$hide() to hide a loading screen

See https://waiter.john-coene.com/ for more info

Tutorials with {cicerone}

We use cicerone to create guided tours of your shiny module to help users understand how to use the app. See https://cicerone.john-coene.com/ for more info

Owner

  • Name: BioDT
  • Login: BioDT
  • Kind: organization

Horizon EU Biodiversity Digital Twin

GitHub Events

Total
  • Create event: 40
  • Release event: 2
  • Issues event: 49
  • Watch event: 4
  • Delete event: 13
  • Member event: 3
  • Issue comment event: 50
  • Push event: 360
  • Pull request review event: 3
  • Pull request event: 80
  • Fork event: 2
Last Year
  • Create event: 40
  • Release event: 2
  • Issues event: 49
  • Watch event: 4
  • Delete event: 13
  • Member event: 3
  • Issue comment event: 50
  • Push event: 360
  • Pull request review event: 3
  • Pull request event: 80
  • Fork event: 2

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 862
  • Total Committers: 10
  • Avg Commits per committer: 86.2
  • Development Distribution Score (DDS): 0.639
Past Year
  • Commits: 512
  • Committers: 10
  • Avg Commits per committer: 51.2
  • Development Distribution Score (DDS): 0.666
Top Committers
Name Email Commits
Tomas Martinovic t****c@v****z 311
Ondřej Salamon o****n@v****z 278
Zhenggang Gao z****a@k****e 81
Kata Sara-aho k****o@c****i 81
Simon Rolph s****l@c****k 37
Souza Allan a****u@l****i 21
Radek Halfar h****8@v****z 21
Tuomas Rossi t****i@c****i 17
DylanCarbone d****r@c****k 11
julio.paneque j****e@l****u 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 54
  • Total pull requests: 80
  • Average time to close issues: 2 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 1.19
  • Average comments per pull request: 0.16
  • Merged pull requests: 74
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 43
  • Pull requests: 76
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 4 days
  • Issue authors: 4
  • Pull request authors: 5
  • Average comments per issue: 0.93
  • Average comments per pull request: 0.13
  • Merged pull requests: 70
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Nithador (39)
  • csckata (18)
  • simonrolph (8)
  • osalamon (7)
  • DylanCarbone (5)
  • sharifX (1)
Pull Request Authors
  • osalamon (46)
  • artyinfact (35)
  • DylanCarbone (10)
  • Nithador (8)
  • JulioLP (6)
  • trossi (4)
  • simonrolph (2)
Top Labels
Issue Labels
Cultural Ecosystem Services (16) enhancement (14) design (10) Grassland (6) accessibility (5) Honeybee (4) bug (4) documentation (1) invalid (1) tests (1) honeybee (1) Wild Boar Diseases (1) priority3 (1) feature (1)
Pull Request Labels
Grassland (1) feature (1)

Dependencies

.github/workflows/rhino-test.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v3 composite
  • cypress-io/github-action v6 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-renv v2 composite
Dockerfile docker
  • rocker/r-ver 4.3.3 build