Skip to content
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
109 changes: 109 additions & 0 deletions MsBackendMassIVE/MsBackendMassIVE.R
Original file line number Diff line number Diff line change
@@ -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)

Binary file added MsBackendMassIVE/MsBackendMassIVE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions MsBackendMassIVE/README.md
Original file line number Diff line number Diff line change
@@ -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.

<img src="./MsBackendMassIVE.png" height="200">

Binary file added MsBackendMassIVE/drawings/MassIVE-hero-bw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBackendMassIVE/drawings/MassIVE-hero-bw.xcf
Binary file not shown.
103 changes: 103 additions & 0 deletions MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.R
Original file line number Diff line number Diff line change
@@ -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)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions MsBackendMetabolomicsWorkbench/README.md
Original file line number Diff line number Diff line change
@@ -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.

<img src="./MsBackendMetabolomicsWorkbench.png" height="200">

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ please open an issue and discuss changes with the sticker maintainer.
<a href="MotifPeeker/README.md"><img src="MotifPeeker/MotifPeeker.png" height="100"></a>
<a href="motifTestR/README.md"><img src="motifTestR/motifTestR.png" height="100"></a>
<a href="MsBackendMassbank/README.md"><img src="MsBackendMassbank/MsBackendMassbank.png" height="100"></a>
<a href="MsBackendMassIVE/README.md"><img src="MsBackendMassIVE/MsBackendMassIVE.png" height="100"></a>
<a href="MsBackendMetaboLights/README.md"><img src="MsBackendMetaboLights/MsBackendMetaboLights.png" height="100"></a>
<a href="MsBackendMetabolomicsWorkbench/README.md"><img src="MsBackendMetabolomicsWorkbench/MsBackendMetabolomicsWorkbench.png" height="100"></a>
<a href="MsBackendMgf/README.md"><img src="MsBackendMgf/MsBackendMgf.png" height="100"></a>
<a href="MsBackendMsp/README.md"><img src="MsBackendMsp/MsBackendMsp.png" height="100"></a>
<a href="MsBackendSql/README.md"><img src="MsBackendSql/MsBackendSql.png" height="100"></a>
Expand Down Expand Up @@ -211,7 +213,7 @@ please open an issue and discuss changes with the sticker maintainer.
<a href="scPipe/README.md"><img src="scPipe/scPipe.png" height="100"></a>
<a href="scran/README.md"><img src="scran/scran.png" height="100"></a>
<a href="scry/README.md"><img src="scry/scry.png" height="100"></a>
<a href="seqpac/README.md"><img src="seqpac/seqpac.png" height="100"></a>
<a href="seqpac/README.md"><img src="seqpac/seqpac.png" height="100"></a>
<a href="scTensor/README.md"><img src="scTensor/scTensor.png" height="100"></a>
<a href="scTGIF/README.md"><img src="scTGIF/scTGIF.png" height="100"></a>
<a href="signifinder/README.md"><img src="signifinder/signifinder.png" height="100"></a>
Expand Down Expand Up @@ -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
Expand Down