marineenergy / apps

shiny apps for marineenergy.app
https://marineenergy.github.io/apps/
MIT License
3 stars 1 forks source link

migrate Projects into Tool #12

Closed bbest closed 2 years ago

bbest commented 3 years ago

See commit https://github.com/marineenergy/apps/commit/c9d15ebafc86a855ab522a8bf52c3df30aae6059 for code to build initial https://shiny.mhk-env.us/projects.

So far we're using plotly to make a ggplot interactive:

g <- ggplot(...)
plotly::ggplotly(g)

Probably going to get more control and less customization with ability to detect clicks and other ui interaction by using native plotly for R, such as Server-side linking with Shiny | plotly for R.

And app visible via:

sudo ln -s /share/github/apps_dev/projects /srv/shiny-server/projects

at https://shiny.marineenergy.app/projects:

image

bbest commented 3 years ago

Yay, got flyto to sync with plotly figure in latest commit:

image

bbest commented 3 years ago

Next steps are:

Neil-Swanson commented 3 years ago

Notes on progress:

pick the color and shape scale

scale <- RColorBrewer::brewer.pal(n=10, name = 'PiYG') #For permit type
scale <- scale[c(1:5, 5, 7, 7:10)] #Create discrete values for permit type
scale2 <- c("#30A4E1", "#999999", scale) #Concatenate with color scale for Active/Inactive Projects
scale2 <- setNames( #Create named color scale
  scale2, 
  c("Active Project",
    "Inactive Project",
    "Notice of Intent/Preliminary Permit Application",
    "Draft Pilot License App",
    "Final Pilot License App",
    "Pilot License Issued",
    "Draft License App",
    "Draft Re-License App",
    "Final License App",
    "Final Re-License App",
    "Environmental Assessment",
    "Settlement Agreement",
    "Permit Issued"))

shp   <- c(rep('triangle-up', 3), 'triangle-down', 'triangle-up', 'triangle-down', 'triangle-up', 'triangle-down', rep('triangle-up', 3)) #Create shape for permit type symbols
shp2 <- c(rep(NA, 2), shp) #Concatenate with shapes (NA) for Active/Inactive Projects
shp2 <- setNames( #Create named shape scale
  shp2, 
  c("Active Project",
    "Inactive Project",
    "Notice of Intent/Preliminary Permit Application",
    "Draft Pilot License App",
    "Final Pilot License App",
    "Pilot License Issued",
    "Draft License App",
    "Draft Re-License App",
    "Final License App",
    "Final Re-License App",
    "Environmental Assessment",
    "Settlement Agreement",
    "Permit Issued"))

image

bbest commented 2 years ago

Fold this and #24 into report generation