diff --git a/MsBackendMassIVE/MsBackendMassIVE.R b/MsBackendMassIVE/MsBackendMassIVE.R new file mode 100644 index 0000000..d2ab6e4 --- /dev/null +++ b/MsBackendMassIVE/MsBackendMassIVE.R @@ -0,0 +1,109 @@ +library(ggplot2) +library(png) +library(grid) +library(hexSticker) + +#' @param x x offset of the hexagon's center +#' +#' @param y y offset of the hexagon's center +#' +#' @param radius the radius (side length) of the hexagon. +#' +#' @param from_radius from where should the segment be drawn? defaults to the center +#' +#' @param to_radius to where should the segment be drawn? defaults to the radius +#' +#' @param from_angle from which angle should we draw? +#' +#' @param to_angle to which angle should we draw? +#' +#' @param fill fill color +#' +#' @param color line color +#' +#' @param size size of the line? +hex_segment2 <- function(x = 1, y = 1, radius = 1, from_radius = 0, + to_radius = radius, from_angle = 30, to_angle = 90, + fill = NA, color = NA, linewidth = 1.2) { + from_angle <- from_angle * pi / 180 + to_angle <- to_angle * pi / 180 + coords <- data.frame(x = x + c(from_radius * cos(from_angle), + to_radius * cos(from_angle), + to_radius * cos(to_angle), + from_radius * cos(to_angle)), + y = y + c(from_radius * sin(from_angle), + to_radius * sin(from_angle), + to_radius * sin(to_angle), + from_radius * sin(to_angle)) + ) + geom_polygon(aes(x = coords$x, y = coords$y), data = coords, + fill = fill, color = color, linewidth = linewidth) +} + + +img <- readPNG("drawings/MassIVE-hero-bw.png") +img <- rasterGrob(img, width = 1.6, x = 0.5, y = 0.5, + interpolate = TRUE) + +## Manually define... +col_dark = "#0c2461" +col_middle = "#1e3799" +col_light = "#8395a7" +col_bg = "#ffffff" + +## MassIVE header colors +col_dark = "#333399" +col_middle = "#4b5da5" + +font_text <- "Aller_Rg" +## font_text <- "SpaceMono-Regular" + +hex <- ggplot() + + geom_hexagon(size = 1.2, fill = col_bg, color = NA) + + + hex_segment2(linewidth = 0, fill = paste0(col_middle, 10), # right + from_radius = 0, to_radius = 0.9, + from_angle = 330, to_angle = 30) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, 20), # top right + from_radius = 0, to_radius = 0.9, + from_angle = 30, to_angle = 90) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, 20), # top left + from_radius = 0, to_radius = 0.9, + from_angle = 90, to_angle = 150) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, 10), # left + from_radius = 0, to_radius = 0.9, + from_angle = 150, to_angle = 210) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, 10), # bottom + from_radius = 0, to_radius = 0.9, + from_angle = 210, to_angle = 270) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, 10), # bottom + from_radius = 0, to_radius = 0.9, + from_angle = 270, to_angle = 330) + + ## border + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ce"), # right + from_radius = 0.9, to_radius = 1, + from_angle = 330, to_angle = 30) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "aa"), # top right + from_radius = 0.9, to_radius = 1, + from_angle = 30, to_angle = 90) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "aa"), # top left + from_radius = 0.9, to_radius = 1, + from_angle = 90, to_angle = 150) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ce"), # left + from_radius = 0.9, to_radius = 1, + from_angle = 150, to_angle = 210) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ec"), # bottom left + from_radius = 0.9, to_radius = 1, + from_angle = 210, to_angle = 270) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ec"), # bottom right + from_radius = 0.9, to_radius = 1, + from_angle = 270, to_angle = 330) + + + geom_subview(subview = img, x = 1.0, y = 0.93, + width = 0.95, height = 0.95) + + ## font size for linux: 6.5, macOS + geom_url("www.bioconductor.org", x = 0.98, y = 0.17, + color = col_dark, size = 6.5, family = font_text) + + theme_sticker() +save_sticker(filename = "MsBackendMassIVE.png", hex) + diff --git a/MsBackendMassIVE/MsBackendMassIVE.png b/MsBackendMassIVE/MsBackendMassIVE.png new file mode 100644 index 0000000..743504b Binary files /dev/null and b/MsBackendMassIVE/MsBackendMassIVE.png differ diff --git a/MsBackendMassIVE/README.md b/MsBackendMassIVE/README.md new file mode 100644 index 0000000..beeab21 --- /dev/null +++ b/MsBackendMassIVE/README.md @@ -0,0 +1,10 @@ +# The `MsBackendMassIVE` sticker + +- Design: Johannes Rainer (@jorainer). +- The MassIVE logo was downloaded from the MassIVE web page. +- License: Creative Commons Attribution + [CC-BY](https://creativecommons.org/licenses/by/2.0/). Feel free to + share and adapt, but don't forget to credit the author. + + + diff --git a/MsBackendMassIVE/drawings/MassIVE-hero-bw.png b/MsBackendMassIVE/drawings/MassIVE-hero-bw.png new file mode 100644 index 0000000..621e414 Binary files /dev/null and b/MsBackendMassIVE/drawings/MassIVE-hero-bw.png differ diff --git a/MsBackendMassIVE/drawings/MassIVE-hero-bw.xcf b/MsBackendMassIVE/drawings/MassIVE-hero-bw.xcf new file mode 100644 index 0000000..069da0d Binary files /dev/null and b/MsBackendMassIVE/drawings/MassIVE-hero-bw.xcf differ diff --git a/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.R b/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.R new file mode 100644 index 0000000..7dcc295 --- /dev/null +++ b/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.R @@ -0,0 +1,103 @@ +library(ggplot2) +library(png) +library(grid) +library(hexSticker) + +#' @param x x offset of the hexagon's center +#' +#' @param y y offset of the hexagon's center +#' +#' @param radius the radius (side length) of the hexagon. +#' +#' @param from_radius from where should the segment be drawn? defaults to the center +#' +#' @param to_radius to where should the segment be drawn? defaults to the radius +#' +#' @param from_angle from which angle should we draw? +#' +#' @param to_angle to which angle should we draw? +#' +#' @param fill fill color +#' +#' @param color line color +#' +#' @param size size of the line? +hex_segment2 <- function(x = 1, y = 1, radius = 1, from_radius = 0, + to_radius = radius, from_angle = 30, to_angle = 90, + fill = NA, color = NA, linewidth = 1.2) { + from_angle <- from_angle * pi / 180 + to_angle <- to_angle * pi / 180 + coords <- data.frame(x = x + c(from_radius * cos(from_angle), + to_radius * cos(from_angle), + to_radius * cos(to_angle), + from_radius * cos(to_angle)), + y = y + c(from_radius * sin(from_angle), + to_radius * sin(from_angle), + to_radius * sin(to_angle), + from_radius * sin(to_angle)) + ) + geom_polygon(aes(x = coords$x, y = coords$y), data = coords, + fill = fill, color = color, linewidth = linewidth) +} + +img <- readPNG("drawings/MetabolomicsWorkbench-hero-bw-v2.png") +img <- rasterGrob(img, width = 1.6, x = 0.5, y = 0.5, + interpolate = TRUE) + +## MetabolomicsWorkbench header colors +col_dark = "#bfbe07" +col_middle = "#D4D45A" +col_bg = "#ffffff" + +font_text <- "Aller_Rg" +## font_text <- "SpaceMono-Regular" + +hex <- ggplot() + + geom_hexagon(size = 1.2, fill = col_bg, color = NA) + + + hex_segment2(linewidth = 0, fill = paste0(col_middle, "05"), # right + from_radius = 0, to_radius = 0.9, + from_angle = 330, to_angle = 30) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "10"), # top right + from_radius = 0, to_radius = 0.9, + from_angle = 30, to_angle = 90) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "10"), # top left + from_radius = 0, to_radius = 0.9, + from_angle = 90, to_angle = 150) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, "05"), # left + from_radius = 0, to_radius = 0.9, + from_angle = 150, to_angle = 210) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, "05"), # bottom + from_radius = 0, to_radius = 0.9, + from_angle = 210, to_angle = 270) + + hex_segment2(linewidth = 0, fill = paste0(col_middle, "05"), # bottom + from_radius = 0, to_radius = 0.9, + from_angle = 270, to_angle = 330) + + ## border + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ce"), # right + from_radius = 0.9, to_radius = 1, + from_angle = 330, to_angle = 30) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "8a"), # top right + from_radius = 0.9, to_radius = 1, + from_angle = 30, to_angle = 90) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "8a"), # top left + from_radius = 0.9, to_radius = 1, + from_angle = 90, to_angle = 150) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "ce"), # left + from_radius = 0.9, to_radius = 1, + from_angle = 150, to_angle = 210) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "fc"), # bottom left + from_radius = 0.9, to_radius = 1, + from_angle = 210, to_angle = 270) + + hex_segment2(linewidth = 0, fill = paste0(col_dark, "fc"), # bottom right + from_radius = 0.9, to_radius = 1, + from_angle = 270, to_angle = 330) + + + geom_subview(subview = img, x = 1.0, y = 0.93, + width = 0.9, height = 0.9) + + ## font size for linux: 6.5, macOS + geom_url("www.bioconductor.org", x = 0.98, y = 0.17, + color = col_dark, size = 6.5, family = font_text) + + theme_sticker() +save_sticker(filename = "MsBackendMetabolomicsWorkbench.png", hex) + diff --git a/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.png b/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.png new file mode 100644 index 0000000..f193d2c Binary files /dev/null and b/MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.png differ diff --git a/MsBackendMetabolomicsWorkbench/README.md b/MsBackendMetabolomicsWorkbench/README.md new file mode 100644 index 0000000..c8af7c7 --- /dev/null +++ b/MsBackendMetabolomicsWorkbench/README.md @@ -0,0 +1,11 @@ +# The `MsBackendMetabolomicsWorkbench` sticker + +- Design: Gabriele Tomè (@gabrieletome). +- The Metabolomics Workbench logo was downloaded from the Metabolomics Workbench + web page. +- License: Creative Commons Attribution + [CC-BY](https://creativecommons.org/licenses/by/2.0/). Feel free to + share and adapt, but don't forget to credit the author. + + + diff --git a/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw-v2.png b/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw-v2.png new file mode 100644 index 0000000..1619cc4 Binary files /dev/null and b/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw-v2.png differ diff --git a/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw.svg b/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw.svg new file mode 100644 index 0000000..b33c30a --- /dev/null +++ b/MsBackendMetabolomicsWorkbench/drawings/MetabolomicsWorkbench-hero-bw.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 8573fec..4e2885a 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,9 @@ please open an issue and discuss changes with the sticker maintainer. + + @@ -211,7 +213,7 @@ please open an issue and discuss changes with the sticker maintainer. - + @@ -357,8 +359,8 @@ to design your stickers manually in `Illustrator`. would be a sensible choice here. Otherwise, CC0 applies (see below). + The height of the final png should be 5cm, resolution should be at least 300dpi. -+ Ensure the sticker artwork fills most of the image canvas and avoid large transparent - margins around the hex shape, as this can cause stickers to appear very small ++ Ensure the sticker artwork fills most of the image canvas and avoid large transparent + margins around the hex shape, as this can cause stickers to appear very small (e.g. in the hexwall display). + The area outside the hex should be transparent. + While it is not mandatory, it is suggested to use the *Aller* font for the