Contributing¶
Getting Started¶
Prerequisites¶
- R 4.3+
- Git with LFS
- Docker (optional, for local testing)
Clone the Repository¶
git clone https://github.com/FASTR-Analytics/disruption-mapping.git
cd disruption-mapping
git lfs pull # Download large GeoJSON files
Install Dependencies¶
install.packages(c(
"shiny", "shinydashboard", "shinyWidgets",
"sf", "leaflet", "dplyr", "ggplot2",
"ggspatial", "ggrepel", "DT"
))
Run Locally¶
Code Structure¶
R/
├── data_functions.R # Data loading, country list, period parsing
├── map_functions.R # Leaflet maps, ggplot maps, PNG export
├── translations.R # UI text, country names in EN/FR
├── indicators.R # Indicator definitions and labels
└── ui_components.R # Reusable UI elements
Making Changes¶
Branch Naming¶
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updates
Code Style¶
- Use tidyverse style for R code
- Comment complex logic
- Keep functions focused and modular
Testing¶
Before submitting:
- Run the app locally
- Test with multiple countries
- Test both English and French
- Verify map exports work
Adding a New Country¶
- Add GeoJSON file
# Add to data/geojson/
cp newcountry_backbone.geojson data/geojson/
git lfs track "data/geojson/*.geojson"
- Update country list in
R/data_functions.R:
- Add translations in
R/translations.R:
country_names <- list(
en = list(..., newcountry = "New Country"),
fr = list(..., newcountry = "Nouveau Pays")
)
Submitting Changes¶
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Describe your changes clearly
Questions?¶
Open an issue on GitHub for questions or suggestions.