-
Notifications
You must be signed in to change notification settings - Fork 0
Source Code Overview
In order to have a working dashboard, your the software directory structure should resemble the following:
├── bizcluster-dashboard
| ├── scripts
| | ├── calculated_metrics.R
| ├── html
| | ├── employ-growth-comp.html
| | ├── employ-growth-spec.html
| | ├── employ-share-spec.html
| | ├── rev-growth-spec.html
| ├── data
| | ├── topojson
| ├── server.R
| ├── ui.R
└──
Note that the folder data
does not exist on this GitHub repository. Prior to running the application, create the folder data
and populate it with input data to be processed and visualized by the dashboard. Folder data
should contain CSV files with industry cluster data, as well as one CSV file with clusters labeled as "traded" or "local". Folder data/topojson
should contain a separate TopoJSON file for each geographic region that you want to visualize.
Per the typical structure of a Shiny web application, the heart of the app consists of a pair of R files located in the root directory: server.R
and ui.R
.
Functions that perform calculations of metrics used in industry cluster analysis is stored in the file calculated_metrics.R
, and imported into server.R
when the web application is launched.
The file ui.R
controls the layout and appearance of the dashboard's front-end user interface. For a more detailed overview of the ui.R
file in a typical Shiny web app, see the RStudio Shiny tutorial.
The file server.R
contains instructions that your computer needs to build the app. For Industry Cluster Dashboard, these include instructions to:
- Build user widgets that depend on datasets supplied by the user (e.g. the dropdown menu that allows data to be filtered by region)
- Build a bubble chart via the Google Charts API (via the
googleVis
R package) - Build an interactive map using the Leaflet JavaScript library (via the
leaflet
R package)
For a more detailed overview of the server.R
file in a typical Shiny web app, see the RStudio Shiny tutorial.
The file calculated_metrics.R
contains functions that calculate metrics used in industry cluster analysis. The functions in calculated_metrics.R
are imported into server.R
.
Functions in calculated_metrics.R
use industry cluster datasets provided by the user to calculate:
- Compound Annual Growth Rate (CAGR)
- Regional Share
- Location Quotient