| Title: | Editable Hex Stickers and Project Logos |
|---|---|
| Description: | Create publication-ready hexagon stickers for R packages interactively via a 'shiny' app or programmatically via R functions. Complements the 'hexSticker' package (which embeds R plots into stickers) by providing an interactive visual designer with 28 curated colour themes (dark and light variants, led by the nine families of the Computational Trauma and Tissue Injury Research (CTTIR) design, version 5 (CTTIR v5)), 46 built-in scientific and technical icons, custom image upload support, font selection, and export to transparent PNG. Designed for the R package ecosystem with presets for CRAN, Bioconductor, Tidyverse, and domain-specific colour palettes. Includes the CTTIR v5 library of 45 native R vector identities, editable shapes, reproducible JSON projects, and transparent PNG, SVG and PDF export with package names inside the hexagon. Project logos also support pentagonal and square frames. |
| Authors: | R. Heller [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8006-9742>), The JetBrains Mono Project Authors [cph] (JetBrains Mono font) |
| Maintainer: | R. Heller <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.4.1 |
| Built: | 2026-11-03 18:09:52 UTC |
| Source: | https://github.com/CTTIR/hexmakR |
Add an editable primitive to a logo
hex_add_part( design, type = c("circle", "rectangle", "line", "polygon"), ..., fill = "#009E73", col = "#FFFFFF", lwd = 1, alpha = 1 )hex_add_part( design, type = c("circle", "rectangle", "line", "polygon"), ..., fill = "#009E73", col = "#FFFFFF", lwd = 1, alpha = 1 )
design |
A |
type |
|
... |
Primitive geometry in normalised canvas coordinates: |
fill, col
|
Fill and outline colours, including |
lwd |
Outline width in points on the master canvas. |
alpha |
Opacity between zero and one. |
An updated design with a new stable part_ ID. The input is unchanged.
d <- logo_design("New project") d <- hex_add_part(d, "circle", x = .5, y = .6, r = .15) hex_layers(d)d <- logo_design("New project") d <- hex_add_part(d, "circle", x = .5, y = .6, r = .15) hex_layers(d)
The 270 SVG and 270 PDF files are the unchanged supplied masters. They are
installed in one compressed archive, which is unpacked once per session, and
an SVG or PDF request returns a copy with the master's exact bytes. PNG
versions are rendered from the SVG master on demand with the 'rsvg' package,
at the size of the supplied masters (1600 x 1848 pixels).
Icons are drawn by the package renderer, which needs R with Cairo support.
All files keep the master's file name and are written to
dir/<asset_dir>/, where asset_dir comes from hex_catalog(), and are
reused while the hexmakR version and build stay the same. A stamp file,
dir/.hexmakR-version, names the version and build that wrote them; after
an upgrade or a reinstall, each file is copied or rendered again on its
next request. Use hex_export() to regenerate artwork or export an edited
design.
hex_asset( package, mode = c("dark", "light", "mono"), layout = c("lockup", "hex", "icon"), format = c("svg", "png", "pdf"), size = 128L, dir = NULL )hex_asset( package, mode = c("dark", "light", "mono"), layout = c("lockup", "hex", "icon"), format = c("svg", "png", "pdf"), size = 128L, dir = NULL )
package |
Exact identity from |
mode |
One of |
layout |
|
format |
File format: |
size |
Icon width, one of 32, 48, 64, 128, 256. Icons use dark mode. |
dir |
Directory for the SVG and PDF copies and the rendered PNG and
icon files. The default is a folder in |
An absolute file path in dir: the copy of the SVG or PDF master,
or the rendered PNG or icon.
hex_asset("phenoscapR") # For a persistent cache, set dir = tools::R_user_dir("hexmakR", "cache"). if (requireNamespace("rsvg", quietly = TRUE)) { png <- hex_asset("phenoscapR", format = "png", dir = tempfile()) dim(png::readPNG(png)) } if (capabilities("cairo")) { hex_asset("phenoscapR", layout = "icon", format = "png", size = 64, dir = tempfile()) }hex_asset("phenoscapR") # For a persistent cache, set dir = tools::R_user_dir("hexmakR", "cache"). if (requireNamespace("rsvg", quietly = TRUE)) { png <- hex_asset("phenoscapR", format = "png", dir = tempfile()) dim(png::readPNG(png)) } if (capabilities("cairo")) { hex_asset("phenoscapR", layout = "icon", format = "png", size = 64, dir = tempfile()) }
The registry includes 37 R packages, five companion apps, two suites and the CTTIR organisation identity. Exact spelling and case are preserved.
hex_catalog(family = NULL)hex_catalog(family = NULL)
family |
Optional family key used to filter the registry. |
A data frame with identity, repository, family, symbol, kind and source.
hex_catalog() hex_catalog("spectral")hex_catalog() hex_catalog("spectral")
A call without a package starts a fresh composition with a frame and name.
Supplying a package explicitly loads its editable archive motif. Archive
artwork can also be reused one part at a time with hex_reuse_part().
All geometry is drawn in R. Name glyphs use the bundled JetBrains Mono font.
hex_design( package = "hexmakR", mode = c("dark", "light", "mono"), layout = c("lockup", "hex", "motif"), label = package, colors = list(), motif_x = 0.5, motif_y = NULL, motif_scale = 1, label_y = 0.215, label_size = 32, border_width = 5.5, shape = c("hex", "pentagon", "square"), icon = NULL, archive = !missing(package) )hex_design( package = "hexmakR", mode = c("dark", "light", "mono"), layout = c("lockup", "hex", "motif"), label = package, colors = list(), motif_x = 0.5, motif_y = NULL, motif_scale = 1, label_y = 0.215, label_size = 32, border_width = 5.5, shape = c("hex", "pentagon", "square"), icon = NULL, archive = !missing(package) )
package |
Exact identity from |
mode |
|
layout |
|
label |
Displayed name, defaulting to the exact identity. Names must use characters supported by the bundled JetBrains Mono font and fit inside the frame at a minimum size of six points; otherwise rendering reports an error instead of clipping or substituting characters. |
colors |
Named list of colour-role overrides, for example
|
motif_x, motif_y
|
Motif centre in normalised canvas coordinates. |
motif_scale |
Motif size multiplier. |
label_y |
Name centre in normalised canvas coordinates. |
label_size |
Maximum name size in points on the six-inch master. |
border_width |
Border width on the six-inch master. |
shape |
Frame shape: |
icon |
Optional generic icon key from |
archive |
Include the package's archive motif. By default this is true
only when |
A serialisable hex_design object.
design <- hex_design("phenoscapR") designdesign <- hex_design("phenoscapR") design
Duplicate or remove an editable part
hex_duplicate_part(design, layer) hex_remove_part(design, layer)hex_duplicate_part(design, layer) hex_remove_part(design, layer)
design |
A |
layer |
Stable native or added part ID from |
An updated design. Duplication preserves the current appearance. Removal hides native geometry or removes an added part; retaining the old design object permits undo.
d <- hex_add_part(logo_design("New project"), "circle") d <- hex_duplicate_part(d, "part_0001") d <- hex_remove_part(d, "part_0001") hex_layers(d)d <- hex_add_part(logo_design("New project"), "circle") d <- hex_duplicate_part(d, "part_0001") d <- hex_remove_part(d, "part_0001") hex_layers(d)
Edit one vector layer
hex_edit_layer(design, layer, ..., reset = FALSE)hex_edit_layer(design, layer, ..., reset = FALSE)
design |
A |
layer |
A stable layer ID from |
... |
Edits: |
reset |
Remove earlier edits to this layer before applying new values. |
An updated design. The input is unchanged.
d <- hex_design("phenoscapR") hex_edit_layer(d, "layer_0001", fill = "#193E36")d <- hex_design("phenoscapR") hex_edit_layer(d, "layer_0001", fill = "#193E36")
The same native grid geometry powers previews and all three export formats. SVG and PDF retain vector paths, including outlined package-name glyphs; uploaded PNG/JPEG figures remain embedded raster images. Rendering finishes in a temporary file beside the destination before replacing it, so a failed export preserves any previous file. Export restores the previously selected graphics device.
hex_export(design, filename, width = 1600L)hex_export(design, filename, width = 1600L)
design |
A |
filename |
Destination ending in |
width |
PNG width in pixels; vector masters use a six-inch canvas. |
The destination path, invisibly.
if (capabilities("cairo")) { f <- tempfile(fileext = ".svg") hex_export(hex_design("phenoscapR"), f) }if (capabilities("cairo")) { f <- tempfile(fileext = ".svg") hex_export(hex_design("phenoscapR"), f) }
Render a design to native grid geometry
hex_grob(design)hex_grob(design)
design |
A |
A grid gTree with stable, editable child layer names.
g <- hex_grob(logo_design("My project")) names(g$children)g <- hex_grob(logo_design("My project")) names(g$children)
Native designs begin with Frame, Icon and Name groups when those items are present. Custom groups have stable IDs and one membership per item. Grouping changes metadata only: appearance and stacking order are retained.
hex_groups(design) hex_group_layers(design, layers, label = "Group", group = NULL) hex_ungroup_layers(design, layers) hex_rename_group(design, group, label)hex_groups(design) hex_group_layers(design, layers, label = "Group", group = NULL) hex_ungroup_layers(design, layers) hex_rename_group(design, group, label)
design |
A |
layers |
Character vector of IDs from |
label |
Short item or group name, at most 80 characters. |
group |
Existing group ID to update; |
hex_groups() returns a named list of groups, each with a label
and members. The other functions return an updated design.
d <- hex_design("phenoscapR") hex_groups(d) d <- hex_group_layers(d, hex_groups(d)$icon$members, "Package icon")d <- hex_design("phenoscapR") hex_groups(d) d <- hex_group_layers(d, hex_groups(d)$icon$members, "Package icon")
PNG and JPEG are embedded in the project as portable raster parts. SVG
shapes become separate vector parts that can be recoloured, moved, rotated,
resized and edited with hex_edit_layer(). SVG exports retain vector paths;
curves are approximated with bounded polylines (32 segments per Bezier curve,
about 32 segments per radian for arcs, and 128 points per ellipse).
hex_import_art(design, path)hex_import_art(design, path)
design |
A |
path |
Local PNG, JPEG or SVG file. Its contents determine its format. |
Supported SVG elements are path, rect (including rounded corners),
circle, ellipse, line, polygon, polyline, and transformed groups.
Paths support M/L/H/V/C/S/Q/T/A/Z commands, fill rules, solid fills/strokes,
and individual opacity. Local defs/use references are expanded with cycle
checks. Simple convex clip paths are accepted only when they provably do not
cut the component; intersecting clips must first be flattened to paths.
Root viewport dimensions, viewBox and preserveAspectRatio are respected;
the viewport must provably contain each component, otherwise cropping must
first be flattened. Dimensions may use absolute
units (including px and pt), but not percentages or font-relative units.
An omitted viewport dimension is inferred from the viewBox aspect ratio.
Text must be outlined. Gradients, masks, filters, nested SVG viewports,
CSS stylesheets and group opacity are rejected with an explanation rather
than silently rasterised. Non-uniform
transforms on strokes require outlined strokes. Scripts, event handlers,
external resources and XML entities are always rejected.
Input files are limited to 10 MiB. Raster images are limited to 8192 pixels per side and 16 million pixels total; dimensions are checked before decoding. A project may contain at most 32 million embedded raster pixels altogether. SVG supports at most 512 components, 5000 points per component, 100000 points total per project, 32 nested groups and 8192 expanded element visits. The artwork is fitted proportionally above the project name. Image bytes or vector coordinates are stored in JSON; no original path is retained.
An updated design with additional stable part_ IDs. The input
design and the source file are unchanged.
svg <- tempfile(fileext = ".svg") writeLines('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <circle cx="50" cy="50" r="35" fill="#009E73"/></svg>', svg) d <- hex_import_art(logo_design("New project"), svg) d <- hex_edit_layer(d, "part_0001", angle = 20, alpha = .8) unlink(svg)svg <- tempfile(fileext = ".svg") writeLines('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <circle cx="50" cy="50" r="35" fill="#009E73"/></svg>', svg) d <- hex_import_art(logo_design("New project"), svg) d <- hex_edit_layer(d, "part_0001", angle = 20, alpha = .8) unlink(svg)
Label an editable logo item
hex_label_layer(design, layer, label)hex_label_layer(design, layer, label)
design |
A |
layer |
Stable item ID from |
label |
Short item name, at most 80 characters. |
An updated design. Labels survive project saves and duplication.
d <- hex_label_layer(hex_design("phenoscapR"), "layer_0001", "Border")d <- hex_label_layer(hex_design("phenoscapR"), "layer_0001", "Border")
Inspect editable vector layers
hex_layers(design)hex_layers(design)
design |
A |
A data frame with stable IDs, geometry type and current colour roles.
hex_layers(hex_design("phenoscapR"))hex_layers(hex_design("phenoscapR"))
Move a logo item in canvas coordinates
hex_move_layer(design, layer, dx, dy)hex_move_layer(design, layer, dx, dy)
design |
A |
layer |
Stable item ID from |
dx, dy
|
Horizontal and vertical canvas offsets between -1 and 1. Positive values move right and up. Native and imported viewport scales are accounted for; existing point edits, size and rotation are retained. |
An updated design. The input is unchanged.
d <- hex_add_part(logo_design("Project"), "circle") d <- hex_move_layer(d, "part_0001", .1, .05)d <- hex_add_part(logo_design("Project"), "circle") d <- hex_move_layer(d, "part_0001", .1, .05)
Inspect a design's palette roles
hex_palette(design)hex_palette(design)
design |
A |
A named list of colours.
hex_palette(hex_design("phenoscapR", "light"))hex_palette(hex_design("phenoscapR", "light"))
Write a reproducible R recipe
hex_recipe(design, path)hex_recipe(design, path)
design |
A |
path |
Destination R file. |
The path, invisibly.
path <- tempfile(fileext = ".R") hex_recipe(logo_design("My project"), path) head(readLines(path))path <- tempfile(fileext = ".R") hex_recipe(logo_design("My project"), path) head(readLines(path))
Regenerate the v5 catalogue
hex_render_catalog( directory, packages = hex_catalog()$name, modes = c("light", "dark", "mono"), layouts = c("lockup", "hex"), formats = c("svg", "png", "pdf"), width = 1600L, icons = TRUE )hex_render_catalog( directory, packages = hex_catalog()$name, modes = c("light", "dark", "mono"), layouts = c("lockup", "hex"), formats = c("svg", "png", "pdf"), width = 1600L, icons = TRUE )
directory |
Destination directory; one subdirectory per identity. |
packages |
Exact identities to render. Defaults to the entire catalogue. |
modes |
Colour modes to export. |
layouts |
Master layouts to export. |
formats |
File formats to export. |
width |
Master PNG width in pixels. |
icons |
Also create five square dark icons per identity. |
A data frame of generated file paths and identities, invisibly.
if (capabilities("cairo")) { files <- hex_render_catalog(tempfile(), packages = "hexmakR", formats = "svg", icons = FALSE) basename(files$path) }if (capabilities("cairo")) { files <- hex_render_catalog(tempfile(), packages = "hexmakR", formats = "svg", icons = FALSE) basename(files$path) }
Reused parts retain a validated snapshot of their native source settings, colour overrides and edits. They remain independently editable. No code, external files or serialised grid objects are loaded from a project.
hex_reuse_part(design, source, layer = NULL)hex_reuse_part(design, source, layer = NULL)
design |
Destination |
source |
A catalogue identity or a |
layer |
Native layer ID to reuse. |
An updated destination design; its frame, name and palette are retained.
d <- hex_reuse_part(logo_design("New project"), "phenoscapR", "layer_0007")d <- hex_reuse_part(logo_design("New project"), "phenoscapR", "layer_0007")
JSON projects store declarative settings, additional parts and layer edits; loading never evaluates R code. Files larger than 20 MiB and unknown fields are rejected.
hex_save_design(design, path) hex_read_design(path)hex_save_design(design, path) hex_read_design(path)
design |
A |
path |
JSON project path. |
hex_save_design() returns the path invisibly;
hex_read_design() returns a validated design.
path <- tempfile(fileext = ".json") design <- hex_add_part(logo_design("My project"), "circle") hex_save_design(design, path) restored <- hex_read_design(path) hex_layers(restored)path <- tempfile(fileext = ".json") design <- hex_add_part(logo_design("My project"), "circle") hex_save_design(design, path) restored <- hex_read_design(path) hex_layers(restored)
Generates a publication-ready hexagon sticker for an R package.
Returns a ggplot object that can be printed, further customised with +,
or saved with save_hex().
hex_sticker( name = "package", subtitle = NULL, url = NULL, icon = NULL, icon_image = NULL, icon_size = 1, theme = "stats", mode = "dark", bg = NULL, accent = NULL, text_color = NULL, border_color = NULL, sub_color = NULL, font_family = "mono", font_bold = TRUE, font_italic = FALSE, font_size = 12, border_width = 2, inner_border = TRUE, filename = NULL, width = 600, dpi = 300 )hex_sticker( name = "package", subtitle = NULL, url = NULL, icon = NULL, icon_image = NULL, icon_size = 1, theme = "stats", mode = "dark", bg = NULL, accent = NULL, text_color = NULL, border_color = NULL, sub_color = NULL, font_family = "mono", font_bold = TRUE, font_italic = FALSE, font_size = 12, border_width = 2, inner_border = TRUE, filename = NULL, width = 600, dpi = 300 )
name |
Character. The package name displayed on the sticker. |
subtitle |
Character or |
url |
Character or |
icon |
Character or |
icon_image |
Character or |
icon_size |
Numeric. Size multiplier for the icon (default |
theme |
Character. Theme name. One of |
mode |
Character. Colour mode, either |
bg |
Character or |
accent |
Character or |
text_color |
Character or |
border_color |
Character or |
sub_color |
Character or |
font_family |
Character. Font shorthand (e.g. |
font_bold |
Logical. Use bold weight. Default |
font_italic |
Logical. Use italic style. Default |
font_size |
Numeric. Base font size in pt for the package name.
Default |
border_width |
Numeric. Border line width in mm. Default |
inner_border |
Logical. Draw a thin inner accent ring. Default |
filename |
Character or |
width |
Integer. Export width in pixels (height is derived from the hex
aspect ratio). Default |
dpi |
Numeric. Resolution for PNG export. Default |
Create a hex sticker
A ggplot object (invisibly if filename is not NULL).
hexmakr_themes(), hexmakr_icons(), save_hex(),
hexmakr_app()
Other stickers:
hexmakr_app(),
save_hex(),
save_hex_svg()
# Minimal sticker hex_sticker("mypackage") # With icon and theme hex_sticker("mypackage", icon = "dna", theme = "genomics") # CTTIR v5 family colours and the bundled v5 name font hex_sticker("mypackage", icon = "microscope", theme = "spatial", font_family = "jetbrains_mono") # Save to file tmp <- tempfile(fileext = ".png") hex_sticker("mypackage", icon = "atom", theme = "stats", filename = tmp) file.exists(tmp)# Minimal sticker hex_sticker("mypackage") # With icon and theme hex_sticker("mypackage", icon = "dna", theme = "genomics") # CTTIR v5 family colours and the bundled v5 name font hex_sticker("mypackage", icon = "microscope", theme = "spatial", font_family = "jetbrains_mono") # Save to file tmp <- tempfile(fileext = ".png") hex_sticker("mypackage", icon = "atom", theme = "stats", filename = tmp) file.exists(tmp)
Opens an interactive Shiny app for designing hex stickers visually. The default workspace starts a new editable logo with a hexagonal, pentagonal or square frame. Add, duplicate, remove and edit individual parts; optionally reuse artwork from the secondary CTTIR Gallery. Portable projects, R recipes and PNG/SVG/PDF export preserve the current design. The classic designer remains available.
hexmakr_app(workspace = c("v5", "classic"), package = "hexmakR", ...)hexmakr_app(workspace = c("v5", "classic"), package = "hexmakR", ...)
workspace |
Use the new-logo |
package |
Initially selected CTTIR Gallery identity. The editable logo still starts as a new project until a gallery action is chosen. |
... |
Additional arguments passed to |
Launch the hexmakR Shiny App
Does not return; runs the Shiny app.
Other stickers:
hex_sticker(),
save_hex(),
save_hex_svg()
if (interactive()) { hexmakr_app() }if (interactive()) { hexmakr_app() }
Returns the built-in icon library as a named list. Icons are
organized by category. Each icon entry contains a label and draw
function.
hexmakr_icons(category = NULL)hexmakr_icons(category = NULL)
category |
Character or |
List available icons
A named list of icon entries (each with label and draw), or
a named list of categories if category = NULL.
Other themes:
hexmakr_preview_theme(),
hexmakr_themes()
icons <- hexmakr_icons() names(icons) hexmakr_icons("science")icons <- hexmakr_icons() names(icons) hexmakr_icons("science")
Renders a sample hex sticker to preview a theme's colours.
hexmakr_preview_theme(theme = "stats", mode = "dark")hexmakr_preview_theme(theme = "stats", mode = "dark")
theme |
Character. Theme name, one of |
mode |
Character. Either |
Preview a theme
A ggplot object (invisibly). Also prints the plot.
hexmakr_themes(), hex_sticker()
Other themes:
hexmakr_icons(),
hexmakr_themes()
hexmakr_preview_theme("stats") hexmakr_preview_theme("genomics", mode = "light") hexmakr_preview_theme("spatial")hexmakr_preview_theme("stats") hexmakr_preview_theme("genomics", mode = "light") hexmakr_preview_theme("spatial")
Returns a named list of all 28 built-in colour themes for hex
stickers. Each theme has dark and light sub-lists with colour values
for bg, accent, text, border, and sub (subtitle).
The first nine are the CTTIR v5 families (spectral, spatial, omics,
clinical, methods, simulation, evidence, platform, brand) and
are the house standard. They are derived from the bundled v5 design
tokens by the same engine as hex_design(): bg is the family's tile
face, border its rim, text the v5 heading ink and sub the muted
text colour. accent, used for icons and the inner ring, follows the
colour v5 motifs use on each tile: the mid shade (the default motif
fill) on dark tiles and the darker edge shade (strokes on a pale badge)
on light tiles. Icons reach at least 3:1 and text at least 4.5:1
contrast on every tile. The 19 generic themes follow unchanged. For
complete v5 artwork with motifs and outlined names, use hex_design().
hexmakr_themes()hexmakr_themes()
List available themes
A named list of length 28. Each element contains:
Human-readable theme name (character).
"CTTIR v5" for the nine v5 families; absent for the
generic themes.
List of 5 colour hex strings for dark mode.
List of 5 colour hex strings for light mode.
hex_sticker(), hexmakr_preview_theme(), hex_design()
Other themes:
hexmakr_icons(),
hexmakr_preview_theme()
themes <- hexmakr_themes() names(themes) themes$stats$dark themes$spatial$lightthemes <- hexmakr_themes() names(themes) themes$stats$dark themes$spatial$light
Start a fresh project with its name inside a hexagonal, pentagonal or
square frame. Add individual parts with hex_add_part(), optionally reuse
archive artwork with hex_reuse_part(), or choose a generic icon. The same
editing, project and export functions work with every frame shape.
logo_design( name, motif = NULL, shape = c("hex", "pentagon", "square"), icon = NULL, ... )logo_design( name, motif = NULL, shape = c("hex", "pentagon", "square"), icon = NULL, ... )
name |
Project name shown inside the frame. |
motif |
Optional CTTIR archive identity supplying a motif and palette.
|
shape |
|
icon |
Optional generic icon key, replacing the CTTIR motif. |
... |
Other settings passed to |
An editable hex_design object.
project <- logo_design("New project", shape = "pentagon") project <- hex_add_part(project, "circle") project <- hex_reuse_part(project, "phenoscapR") logo_design("Study", shape = "square", icon = "microscope")project <- logo_design("New project", shape = "pentagon") project <- hex_add_part(project, "circle") project <- hex_reuse_part(project, "phenoscapR") logo_design("Study", shape = "square", icon = "microscope")
Renders and saves a hex sticker ggplot object to a PNG file with a transparent background and the correct hexb.in aspect ratio (width / height = sqrt(3) / 2). Rendering finishes in a temporary file beside the destination before replacing it, so a failed export preserves any previous file. The previously selected graphics device is restored after export.
save_hex(sticker, filename, width = 600, dpi = 300)save_hex(sticker, filename, width = 600, dpi = 300)
sticker |
A ggplot object returned by |
filename |
Character. Output file path. Must end in |
width |
Integer. Width in pixels. Default |
dpi |
Numeric. Resolution. Default |
Save a hex sticker to a PNG file
The filename path, invisibly.
Other stickers:
hex_sticker(),
hexmakr_app(),
save_hex_svg()
s <- hex_sticker("mypackage", icon = "atom", theme = "stats") tmp <- tempfile(fileext = ".png") save_hex(s, tmp) file.exists(tmp)s <- hex_sticker("mypackage", icon = "atom", theme = "stats") tmp <- tempfile(fileext = ".png") save_hex(s, tmp) file.exists(tmp)
Renders and saves a hex sticker to SVG. Requires the svglite package. Rendering finishes in a temporary file beside the destination before replacing it, so a failed export preserves any previous file. The previously selected graphics device is restored.
save_hex_svg(sticker, filename, width = 2)save_hex_svg(sticker, filename, width = 2)
sticker |
A ggplot object returned by |
filename |
Character. Output file path. Must end in |
width |
Numeric. Width in inches. Default |
Save a hex sticker to an SVG file
The filename path, invisibly.
Other stickers:
hex_sticker(),
hexmakr_app(),
save_hex()
if (requireNamespace("svglite", quietly = TRUE)) { s <- hex_sticker("mypackage") tmp <- tempfile(fileext = ".svg") save_hex_svg(s, tmp) }if (requireNamespace("svglite", quietly = TRUE)) { s <- hex_sticker("mypackage") tmp <- tempfile(fileext = ".svg") save_hex_svg(s, tmp) }