This repository contains R code and a Shiny app for generating maps from multiple networks published according to the Open Fibre Data Standard.
devtools::install_github('Open-Telecoms-Data/ofdsmaps@main')
shiny::runApp('inst/shiny/ofdsmaps')
The app reads data from a public Google Drive folder. If you have permission to edit the folder, you can upload or delete files to add or remove networks from the app.
You can set up your development environment on your local machine or using GitHub codespaces. If you need to generate a new Google Drive authentication token, you should use your local machine.
-
In an R console, install packages
install.packages('devtools') install.packages('shiny') install.packages('rsconnect') install.packages('leaflet')
- Go to GitHub Codespaces and click New Codespace
- Select the 'Open-Telecoms-Data/ofdsmaps' repository and click Create Codespace
- In your codespace, add an R container configuration:
- Open the command palette (F1) and type or select:
- 'Codespaces: Add dev container configuration files'
- 'Create a new configuration'
- 'Show all definitions'
- 'R (rocker/r-ver base)'
- '4 (default)'
- 'geospatial'
- Click OK. Do not install additional features.
- Open the command palette (F1) and type or select:
- Rebuild the container: Click Rebuild Now or type or select 'Codespaces: Full rebuild container' in the command palette
The R scripts for downloading, reading and plotting OFDS data are located in /R
.
The R script for the Shiny app is located in /inst/shiny/ofdsmaps
.
Commit your changes to the GitHub repository.
Configure rsconnect
to deploy to ShinyApps.io:
- Log in to the ShinyApps.io admin dashboard. You can find credentials in the co-op password database.
- Open the tokens screen and click Show.
- Click Show secret, copy the
rsconnect
command to your R console and run it.
You need only complete this step if there are authentication issues in the deployed app. You must use a development environment on your local machine to complete this step.
The app uses a project-level oAuth cache to authenticate to Google Drive. To clear the cache and generate a new token:
-
Delete the contents of
/.secrets
-
Quit any running R console sessions:
quit()
-
In the app, click Get latest data
-
Authenticate using your Google account and grant permission for the app to ‘See, edit, create, and delete all of your Google Drive files’
-
Deploy the app:
rsconnect::deployApp('inst/shiny/ofdsmaps',account = 'opendataservices')