Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

223 minimal theme by default #233

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export(useDarkTheme)
export(useExcelTheme)
export(useHighChartTheme)
export(useMatlabTheme)
export(useMinimalTheme)
export(useTemplateTheme)
export(useTheme)
import(ggplot2)
Expand Down
11 changes: 11 additions & 0 deletions R/utilities-theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,17 @@ useHighChartTheme <- function() {
useTheme(loadThemeFromJson(system.file("themes", "hc-theme.json", package = "tlf")))
}

#' @title useMinimalTheme
#' @description
#' Set default minimal theme to be used as the current default of the tlf environment
#' @export
#' @examples
#' useMinimalTheme()
#' addScatter(x = seq(1,10), y = rnorm(10))
useMinimalTheme <- function() {
useTheme(loadThemeFromJson(system.file("themes", "minimal-theme.json", package = "tlf")))
}

## -------------------------------------------------
#' @title runThemeMaker
#' @description
Expand Down
2 changes: 2 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ ifIncluded <- function(x, y, outputIfIncluded, outputIfNotIncluded = NULL) {
# Because collate put tlf-env and themes before utils,
# The curretnTheme is defined here: after the definition of %||%
tlfEnv$currentTheme <- Theme$new()
# Default theme is minimal when package is loaded
useMinimalTheme()
358 changes: 358 additions & 0 deletions inst/themes/minimal-theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,358 @@
{
"fonts": {
"title": {
"color": "grey20",
"size": 12,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
},
"subtitle": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
},
"xlabel": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
},
"ylabel": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 90
},
"watermark": {
"color": "grey20",
"size": 12,
"fontFace": "plain",
"fontFamily": "",
"angle": 30
},
"legend": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
},
"xAxis": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
},
"yAxis": {
"color": "grey20",
"size": 10,
"fontFace": "plain",
"fontFamily": "",
"angle": 0
}
},
"background": {
"watermark": "",
"legendPosition": "insideTopRight",
"plot": {
"fill": "white",
"color": "grey20",
"size": 0.5,
"linetype": "blank"
},
"panel": {
"fill": "white",
"color": "grey20",
"size": "0.5",
"linetype": "blank"
},
"xAxis": {
"color": "grey20",
"size": "0.5",
"linetype": "solid"
},
"yAxis": {
"color": "grey20",
"size": "0.5",
"linetype": "solid"
},
"xGrid": {
"color": "grey20",
"size": "0.5",
"linetype": "blank"
},
"yGrid": {
"color": "grey20",
"size": "0.5",
"linetype": "blank"
},
"legend": {
"fill": "white",
"color": "white",
"size": "0.5",
"linetype": "blank"
}
},
"aestheticMaps": {
"color": [
"#0078D7",
"#D83B01",
"#107C10",
"#A80000",
"#002050",
"#B4009E"
],
"fill": [
"#0078D7",
"#D83B01",
"#107C10",
"#A80000",
"#002050",
"#B4009E"
],
"shape": [
"square",
"dot",
"circle",
"diamond",
"star",
"plus",
"cross",
"triangle"
],
"linetype": [
"solid",
"longdash",
"dotted",
"dashed",
"twodash",
"dotdash"
],
"size": [
1,
2,
3,
4,
5
],
"alpha": [
0.75,
0.5,
0.25
]
},
"plotConfigurations": {
"addScatter": {
"color": "next",
"fill": "NA",
"shape": "next",
"linetype": "blank",
"size": "first",
"alpha": 1
},
"addLine": {
"color": "next",
"fill": "NA",
"shape": "blank",
"linetype": "same",
"size": "first",
"alpha": 1
},
"addRibbon": {
"color": "next",
"fill": "next",
"shape": "blank",
"linetype": "same",
"size": "first",
"alpha": "first"
},
"addErrorbar": {
"color": "next",
"fill": "NA",
"shape": "blank",
"linetype": "first",
"size": "first",
"alpha": 1
},
"plotPKRatio": {
"points": {
"color": "reset",
"fill": "NA",
"shape": "reset",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"lines": {
"color": "grey20",
"fill": "NA",
"shape": "blank",
"linetype": "longdash",
"size": 0.5,
"alpha": 1
},
"errorbars": {
"color": "reset",
"fill": "NA",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": 1
}
},
"plotDDIRatio": {
"points": {
"color": "reset",
"fill": "NA",
"shape": "reset",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"lines": {
"color": "grey20",
"fill": "NA",
"shape": "blank",
"linetype": "longdash",
"size": 0.5,
"alpha": 1
},
"errorbars": {
"color": "reset",
"fill": "NA",
"shape": "blank",
"linetype": "solid",
"size": 1,
"alpha": 1
}
},
"plotTimeProfile": {
"points": {
"color": "reset",
"fill": "NA",
"shape": "reset",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"lines": {
"color": "reset",
"fill": "NA",
"shape": "blank",
"linetype": "reset",
"size": 0.5,
"alpha": 1
},
"ribbons": {
"color": "reset",
"fill": "reset",
"shape": "blank",
"linetype": "blank",
"size": 0.5,
"alpha": "first"
},
"errorbars": {
"color": "reset",
"fill": "NA",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": 1
}
},
"plotObsVsPred": {
"points": {
"color": "reset",
"fill": "NA",
"shape": "reset",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"lines": {
"color": "grey20",
"fill": "NA",
"shape": "blank",
"linetype": "longdash",
"size": 0.5,
"alpha": 1
},
"errorbars": {
"color": "reset",
"fill": "NA",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": 1
}
},
"plotBoxWhisker": {
"points": {
"color": "grey20",
"fill": "NA",
"shape": "dot",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"ribbons": {
"color": "grey20",
"fill": "reset",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": "first"
}
},
"plotTornado": {
"lines": {
"color": "grey20",
"fill": "NA",
"shape": "blank",
"linetype": "longdash",
"size": 0.5,
"alpha": 1
},
"points": {
"color": "reset",
"fill": "NA",
"shape": "reset",
"linetype": "blank",
"size": 2,
"alpha": 1
},
"ribbons": {
"color": "reset",
"fill": "reset",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": "first"
}
},
"plotHistogram": {
"lines": {
"color": "next",
"fill": "NA",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": 1
},
"ribbons": {
"color": "grey20",
"fill": "reset",
"shape": "blank",
"linetype": "solid",
"size": 0.5,
"alpha": "first"
}
}
}
}
Loading