-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing serverless shiny forecast page using github actions
- Loading branch information
Showing
6 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Workflow derived from https://github.com/posit-dev/r-shinylive/tree/actions-v1/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
# | ||
# Basic example of a GitHub Actions workflow that builds a Shiny app and deploys | ||
# it to GitHub Pages. | ||
name: Deploy app to gh-pages | ||
|
||
on: | ||
# Manually trigger the workflow | ||
workflow_dispatch: | ||
# Trigger on push to `main` branch | ||
push: | ||
branches: ["main"] | ||
# Trigger on pull request to all branches (but do not deploy to gh-pages) | ||
pull_request: | ||
|
||
jobs: | ||
shinylive: | ||
uses: posit-dev/r-shinylive/.github/workflows/deploy-app.yaml@actions-v1 | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ Maintainer: Johnathan Evanilla <[email protected]> | |
Author: Johnathan Evanilla <[email protected]> | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
### Interactive PSP Forecast Result Explorer ### | ||
|
||
suppressPackageStartupMessages({ | ||
library(shiny) | ||
library(leaflet) | ||
library(dplyr) | ||
library(readr) | ||
}) | ||
|
||
current_forecast <- read_csv("https://github.com/BigelowLab/pspforecast/raw/master/inst/forecastdb/current_forecast.csv") | ||
|
||
ui <- fluidPage( | ||
titlePanel("Experimental Maine PSP 4-10 Day Forecast"), | ||
mainPanel( | ||
verticalLayout( | ||
leafletOutput("current_forecast")) | ||
) | ||
) | ||
|
||
server <- function(input, output) { | ||
|
||
output$current_forecast <- renderLeaflet({ | ||
pal <- colorNumeric(c("dimgray","gold", "orange", "red"), 0:3) | ||
|
||
leaflet() |> | ||
setView(lng=-68.5,lat = 44, zoom = 7) |> | ||
addTiles(group= "Default Background") |> | ||
#addProviderTiles("Esri.NatGeoWorldMap") |> | ||
addCircleMarkers(data=current_forecast, | ||
lng = ~lon, | ||
lat = ~lat, | ||
popup = paste(sep= "<br>", | ||
paste("<b> Location: <b>", current_forecast$name), | ||
paste("<b> Location ID: <b>", current_forecast$location), | ||
paste("<b> Forecast Window Start Date: <b>", current_forecast$forecast_start_date), | ||
paste("<b> Forecast Window End Date: <b>", current_forecast$forecast_end_date), | ||
paste("<b> Probability of Closure-level Toxicity: <b>", current_forecast$p_3, "%", sep="")), | ||
color = ~pal(predicted_class)) |> | ||
addLegend(position = "bottomright", | ||
title = "Predicted Toxicity Class", | ||
colors = c("dimgray", "gold", "orange", "red"), | ||
labels = c("Low", "Medium", "High", "Closure-level")) | ||
}) | ||
} | ||
|
||
# Run the application | ||
shinyApp(ui = ui, server = server) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.