Skip to content

Commit

Permalink
added modalDialogue with content of NEWS.md (#44)
Browse files Browse the repository at this point in the history
* added modalDialogue with content of NEWS.md

* improve style NEWS.md in pop-up

* Refine header and modal style (#43, #38)

* Also updated NEWS.md with dates and development version

Co-authored-by: riccardoporreca <riccardo.porreca@mirai-solutions.com>
  • Loading branch information
fvitalini and riccardoporreca authored Mar 25, 2020
1 parent e4ff9f7 commit 24c02f3
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 36 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Imports:
plotly,
DT,
RColorBrewer,
grid
grid,
markdown
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export(fix_legend_position)
export(from_contagion_day_bar_facet_plot)
export(from_contagion_day_bar_plot)
export(getTableOptions)
export(get_Covid19_version)
export(get_daily_data)
export(get_date_data)
export(get_timeseries_by_contagion_day_data)
Expand All @@ -36,6 +37,7 @@ export(time_evol_line_facet_plot)
export(time_evol_line_plot)
import(RColorBrewer)
import(ggplot2)
import(markdown)
import(shiny)
importFrom(DT,DTOutput)
importFrom(DT,datatable)
Expand Down
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Covid19 1.0.0
### Covid19 1.0.0.9000 (development version)

## First versioned release of Covid19
- The app header was improved: it now shows the app version and change-log in a modal dialog (#38, #43).

Covid19 is a Shiny App for understanding the coronavirus spread and compare their perverse effects between countries.

### Covid19 1.0.0 (2020-03-20)

#### First versioned release of Covid19

Covid19 is a Shiny App for understanding the COVID-19 spread and compare their perverse effects between countries.

The application uses data from the [Johns Hopkins CSSE Repository.](https://github.com/CSSEGISandData/COVID-19)
14 changes: 14 additions & 0 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#' @import shiny
#' @importFrom dplyr select
#' @importFrom tidyr ends_with
#' @import markdown
#'
#' @noRd
app_server <- function(input, output, session) {

Expand All @@ -24,4 +26,16 @@ app_server <- function(input, output, session) {
callModule(mod_global_server, "global", orig_data = orig_data)
callModule(mod_country_server, "country", orig_data = orig_data)
callModule(mod_country_comparison_server, "country_comparison", orig_data = orig_data)

# what is new pop-up
observeEvent(input$btn_whatsnew, {
showModal(modalDialog(
title = "What's New:",
includeMarkdown("./NEWS.md"),
footer = modalButton("Dismiss"),
size = "l",
easyClose = TRUE,
fade = FALSE
))
})
}
16 changes: 10 additions & 6 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@ app_ui <- function(request) {
a(
href = "https://github.com/miraisolutions/Covid19",
target = "_blank",
h1("Covid19")
span(id = "app-name", "Covid19")
),
a(
href = "https://github.com/miraisolutions/Covid19/blob/master/NEWS.md",
target = "_blank",
span(id = "version", get_Covid19_version())
),
actionButton(
inputId = "btn_whatsnew",
label = "",
icon = icon("exclamation-circle")
# style = "color: white; background-color: transparent; border-color: transparent; padding: 0px 10px !important; margin: -10px!important; vertical-align: baseline !important;"
)
),
a(
href = "https://github.com/CSSEGISandData/COVID-19",
target = "_blank",
div(
span(
id = "subtitle",
h3(
"Data Repository by Johns Hopkins CSSE:",
textOutput("last_update", inline = TRUE)
)
"Data Repository by Johns Hopkins CSSE:",
textOutput("last_update", inline = TRUE)
)
)
), # end header-left
Expand Down
65 changes: 39 additions & 26 deletions inst/app/www/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body {

#header {
padding-top: 25px;
padding-bottom: 5px;
padding-bottom: 10px;
padding-left: 25px;
padding-right: 25px;
margin-bottom: 10px;
Expand All @@ -23,15 +23,35 @@ body {
float: left;
}

#title {
margin-top: 0;
}

#app-name {
font-family: inherit;
color: white;
font-size: 36px;
line-height: normal;
}


#version {
font-family: inherit;
color: white;
font-size: 16px;
}

#subtitle {
margin-top: 3px;
margin-bottom: 10px;
font-size: 16px;
color: black;
}

#header-right {
float: right;
}

#sticker-header {
float: left;
margin-right: 15px;
height: 90px;
}

#footer {
padding-top: 15px;
Expand All @@ -44,6 +64,7 @@ body {

#git-footer {
float: left;
font-size: 16px;
}

#mirai-logo-header{
Expand All @@ -59,13 +80,19 @@ body {
padding: 0;
}

#title {
margin-top: 0;


.modal-body p {
margin: 0;
}

#subtitle{
margin-top: 3px;
margin-bottom: 10px;
#btn_whatsnew{
color: white;
background-color: transparent;
border-color: transparent;
padding: 0px 10px !important;
margin: -10px!important;
vertical-align: baseline !important;
}

h5 {
Expand All @@ -81,13 +108,6 @@ h4 {
color: black;
}

h1 {
font-family: inherit;
color: white;
text-align: left;
display: inline;
}

h2 {
font-family: inherit;
color: #ea8b5b;
Expand All @@ -97,26 +117,19 @@ h2 {
display: inline;
}

#version {
font-family: inherit;
color: white;
font-size: 16px;
}

h3 {
font-family: inherit;
margin-top: 0;
color: #000000;
font-size: 16px;
text-align: left;
display: inline;
}

#title a:hover, #title a:visited, #title a:link, #title a:active {
text-decoration: none;
}

a {
font-size: 16px;
color: #008cc3;
text-align: left;
font-weight: normal;
Expand Down
14 changes: 14 additions & 0 deletions man/get_Covid19_version.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24c02f3

Please sign in to comment.