From 9b4b755d23ea0b7ab57938a93a994628d220ab63 Mon Sep 17 00:00:00 2001
From: Thomas Rushby <t.w.rushby@soton.ac.uk>
Date: Tue, 15 Sep 2020 11:26:26 +0100
Subject: [PATCH] Add static content & styling.

---
 howTo/shiny/Intensity_02.R | 40 ++++++++++++++++++++++++++------------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/howTo/shiny/Intensity_02.R b/howTo/shiny/Intensity_02.R
index 41fee9d..af31101 100644
--- a/howTo/shiny/Intensity_02.R
+++ b/howTo/shiny/Intensity_02.R
@@ -47,6 +47,11 @@ ui <- fluidPage(
     
     # Sidebar panel for inputs ----
     sidebarPanel(
+      fluidRow(
+        tags$p("Select the date to view by clicking in the box below (defaults to today's date)."),
+        tags$p("Data for forecast carbon intensity is available up to four days ahead."),
+        tags$hr()
+      ),
       
       # Input: Slider for the number of bins ----
       dateInput(inputId = "dateToGet",
@@ -63,17 +68,29 @@ ui <- fluidPage(
     
     # Main panel for displaying outputs ----
     mainPanel(
-      
-      # Output: Plot ----
-      textOutput(outputId = "dateText"),
-      #plotOutput(outputId = "intensityPlot")
-      
-      # Output: Histogram ----
-      plotOutput(outputId = "intensityPlot")
-      
-    )
-  )
-)
+      fluidRow(
+        tags$br(),
+        tags$p("The chart below shows the forecast and actual carbon intensity of electricity supplied by National Grid over the 24 hours selected.",
+               "The data illustrated by this app is retrieved from ", tags$a(href = "https://carbonintensity.org.uk/","National Grid ESO's Carbon Intensity API"),"."),
+        tags$p("This app was created by ", tags$a(href = "https://energy.soton.ac.uk/rushby/","Tom Rushby "), 
+               tags$a(href = "https://twitter.com/tom_rushby","(@tom_rushby)"),
+               "for the ",tags$a(href = "https://energy.soton.ac.uk/","Energy and Climate Change Division"), 
+               tags$a(href = "https://twitter.com/EnergySoton","(@EnergySoton)"),"at the University of Southampton."),
+        tags$p("Predicted carbon intensity of electricity is shown in blue (forecast).",
+               "The carbon intensity of electricity supplied is shown in red (actual)."),
+        tags$hr(),
+        
+        # Output: Text ----
+        textOutput(outputId = "dateText"),
+        #plotOutput(outputId = "intensityPlot")
+        
+        # Output: Histogram ----
+        plotOutput(outputId = "intensityPlot")
+        
+      ) # row
+    ) # panel
+  ) # layout
+) # page
 
 # Define server logic required to draw a histogram ----
 server <- function(input, output) {
@@ -105,4 +122,3 @@ server <- function(input, output) {
 }
 
 shinyApp(ui = ui, server = server)
-
-- 
GitLab