# Copyright 2020 Observational Health Data Sciences and Informatics
#
# This file is part of PathwayVisualizer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#' Publication
#' @keywords
#' @return
#' @examples
#' @import scales
#' @import ggplot2
#' @import grid
#' @import ggthemes
#' @export theme_Publication
#' @export scale_fill_Publication
#' @export scale_colour_Publication
theme_Publication <- function(base_size=14) {
(theme_foundation(base_size=base_size)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "none",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.title = element_blank(),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33","#00798c","#d1495b","#edae49",'#66a182','#2e4057','#8d96a3',"#0073C2","#EFC000","#CD534C","#7AA6DC","#003C67","#8F7700","#3B3B3B","#A73030","#4A6990")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33","#00798c","#d1495b","#edae49",'#66a182','#2e4057','#8d96a3',"#0073C2","#EFC000","#CD534C","#7AA6DC","#003C67","#8F7700","#3B3B3B","#A73030","#4A6990")), ...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.