Skip to content

Latest commit

 

History

History
103 lines (68 loc) · 3.61 KB

README.md

File metadata and controls

103 lines (68 loc) · 3.61 KB

Open Fibre Data Standard visualisation tool (prototype)

This repository contains R code and a Shiny app for generating maps from multiple networks published according to the Open Fibre Data Standard.

Install the app

devtools::install_github('Open-Telecoms-Data/ofdsmaps@main')

Run the app

shiny::runApp('inst/shiny/ofdsmaps')

Add or remove data

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.

Development

Set up your development environment

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.

Local machine

  1. Download and install R

  2. In an R console, install packages

    install.packages('devtools')
    install.packages('shiny')
    install.packages('rsconnect')
    install.packages('leaflet')

GitHub Codespaces

  1. Go to GitHub Codespaces and click New Codespace
  2. Select the 'Open-Telecoms-Data/ofdsmaps' repository and click Create Codespace
  3. In your codespace, add an R container configuration:
    1. Open the command palette (F1) and type or select:
      1. 'Codespaces: Add dev container configuration files'
      2. 'Create a new configuration'
      3. 'Show all definitions'
      4. 'R (rocker/r-ver base)'
      5. '4 (default)'
      6. 'geospatial'
    2. Click OK. Do not install additional features.
  4. Rebuild the container: Click Rebuild Now or type or select 'Codespaces: Full rebuild container' in the command palette

Edit files

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.

Preview your changes

  1. Install the app
  2. Run the app

Commit your changes

Commit your changes to the GitHub repository.

Deploy your changes

One-time setup

Configure rsconnect to deploy to ShinyApps.io:

  1. Log in to the ShinyApps.io admin dashboard. You can find credentials in the co-op password database.
  2. Open the tokens screen and click Show.
  3. Click Show secret, copy the rsconnect command to your R console and run it.

Generate a new Google Drive authentication token

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:

  1. Delete the contents of /.secrets

  2. Quit any running R console sessions:

    quit()
  3. Run the app

  4. In the app, click Get latest data

  5. 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

  1. Install the app from GitHub.

  2. Deploy the app:

    rsconnect::deployApp('inst/shiny/ofdsmaps',account = 'opendataservices')