├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── pattern-check.R ├── pattern-dot.R ├── pattern-gradient.R ├── pattern-hatch.R ├── pattern-hex.R ├── pattern-stipple.R ├── pattern-stripe.R └── svgpatternsimple.R ├── README.Rmd ├── README.md └── man ├── create_pattern_check.Rd ├── create_pattern_dot.Rd ├── create_pattern_gradient.Rd ├── create_pattern_hatch.Rd ├── create_pattern_hex.Rd ├── create_pattern_stipple.Rd ├── create_pattern_stripe.Rd ├── figures ├── README-all-patterns.svg ├── README-check.svg ├── README-dots.svg ├── README-example-dot.svg ├── README-gradients.svg ├── README-hatch.svg ├── README-hex.svg ├── README-stipple.svg ├── README-stripes.svg └── logo.svg └── svgpatternsimple.Rd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^README\.Rmd$ 4 | ^working$ 5 | ^example-patterns$ 6 | ^.*\.svg$ 7 | ^pkgdown$ 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .Rhistory 3 | *.Rproj 4 | .Rproj.user 5 | *.swp 6 | working 7 | *.txt 8 | inst/doc 9 | pkgdown 10 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: svgpatternsimple 2 | Type: Package 3 | Title: Generate Simple SVG Patterns 4 | Version: 0.2.0 5 | Author: mikefc 6 | Maintainer: mikefc 7 | Description: Generate simple SVG patterns. 8 | License: MIT + file LICENSE 9 | Encoding: UTF-8 10 | LazyData: true 11 | RoxygenNote: 7.0.2 12 | URL: https://coolbutuseless.github.io/package/svgpatternsimple/,https://github.com/coolbutuseless/svgpatternsimple 13 | Imports: 14 | poissoned, 15 | minisvg, 16 | glue 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019,2020 mikefc@coolbutuseless.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(create_pattern_check) 4 | export(create_pattern_dot) 5 | export(create_pattern_gradient) 6 | export(create_pattern_hatch) 7 | export(create_pattern_hex) 8 | export(create_pattern_stipple) 9 | export(create_pattern_stripe) 10 | import(glue) 11 | import(minisvg) 12 | importFrom(poissoned,poisson_disc) 13 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | 2 | # svgpatternsimple 0.2.0 2020-02-01 3 | 4 | * Remove old `{devoutsvg-0.1.0}` compatibility. 5 | 6 | # svgpatternsimple 0.1.1 7 | 8 | * Improved generation of pattern palettes 9 | * Stipple style now working 10 | 11 | # svgpatternsimple 0.1.0 12 | 13 | * Initial release 14 | -------------------------------------------------------------------------------- /R/pattern-check.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | #' Create an SVG checkerboard pattern 5 | #' 6 | #' Create an SVG pattern which will \code{fill} an element with checks. 7 | #' 8 | #' @inheritParams create_pattern_stripe 9 | #' 10 | #' @return minisvg::SVGPattern object 11 | #' 12 | #' @import minisvg 13 | #' @import glue 14 | #' @export 15 | #' 16 | #' 17 | #' @examples 18 | #' \dontrun{ 19 | #' # Create an SVG document 20 | #' library(minisvg) 21 | #' doc <- minisvg::svg_doc() 22 | #' 23 | #' # Create the pattern and add to the SVG definitions 24 | #' my_pattern <- create_pattern_check(id = 'mypattern') 25 | #' doc$defs(my_pattern) 26 | #' 27 | #' # Create a rectangle with the animation 28 | #' rect <- stag$rect( 29 | #' x = "10%", 30 | #' y = "10%", 31 | #' width = "80%", 32 | #' height = "80%", 33 | #' stroke = 'black', 34 | #' fill = my_pattern 35 | #' ) 36 | #' 37 | #' # Add this rectangle to the document, show the SVG text, then render it 38 | #' doc$append(rect) 39 | #' doc 40 | #' doc$show() 41 | #' } 42 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | create_pattern_check <- function(id, 44 | angle = 45, 45 | spacing = 20, 46 | alpha = 1.0, 47 | fg_alpha = 1.0, 48 | colour = '#000000', 49 | ...) { 50 | 51 | spacing <- max(spacing, 2) 52 | w <- spacing/2 53 | 54 | 55 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 56 | inner_style <- glue::glue('fill:{colour}; fill-opacity:{fg_alpha};') 57 | 58 | pattern <- minisvg::svg_pattern( 59 | id = id, 60 | width = spacing, 61 | height = spacing, 62 | patternTransform = glue::glue('rotate({angle} 0 0)'), 63 | patternUnits = 'userSpaceOnUse', 64 | minisvg::stag$rect( 65 | width = '100%', 66 | height = '100%', 67 | style = rect_style 68 | ), 69 | 70 | minisvg::stag$g( 71 | minisvg::stag$rect(width = w, height = w, x = 0, y = 0, style = inner_style), 72 | minisvg::stag$rect(width = w, height = w, x = w, y = w, style = inner_style) 73 | ) 74 | ) 75 | 76 | pattern 77 | } 78 | 79 | -------------------------------------------------------------------------------- /R/pattern-dot.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | #' Create an SVG dot pattern 5 | #' 6 | #' Create an SVG pattern which will \code{fill} an element with dots. 7 | #' 8 | #' @inheritParams create_pattern_stripe 9 | #' 10 | #' @return minisvg::SVGPattern object 11 | #' 12 | #' @import minisvg 13 | #' @import glue 14 | #' @export 15 | #' 16 | #' 17 | #' @examples 18 | #' \dontrun{ 19 | #' # Create an SVG document 20 | #' library(minisvg) 21 | #' doc <- minisvg::svg_doc() 22 | #' 23 | #' # Create the pattern and add to the SVG definitions 24 | #' my_pattern <- create_pattern_dot(id = 'mypattern') 25 | #' doc$defs(my_pattern) 26 | #' 27 | #' # Create a rectangle with the animation 28 | #' rect <- stag$rect( 29 | #' x = "10%", 30 | #' y = "10%", 31 | #' width = "80%", 32 | #' height = "80%", 33 | #' stroke = 'black', 34 | #' fill = my_pattern 35 | #' ) 36 | #' 37 | #' # Add this rectangle to the document, show the SVG text, then render it 38 | #' doc$append(rect) 39 | #' doc 40 | #' doc$show() 41 | #' } 42 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | create_pattern_dot <- function(id, 44 | angle = 45, 45 | spacing = 20, 46 | fill_fraction = 0.2, 47 | alpha = 1.0, 48 | fg_alpha = 1.0, 49 | colour = '#000000', 50 | ...) { 51 | 52 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | # convert fill_fraction into a radius 54 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | spacing <- max(spacing, 5) 56 | radius <- fill_fraction * spacing / 2.1 57 | 58 | 59 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 60 | inner_style <- glue::glue('stroke:{colour}; fill:{colour}; fill-opacity:{fg_alpha}; stroke-opacity:{fg_alpha};') 61 | 62 | pattern <- minisvg::svg_pattern( 63 | id = id, 64 | width = spacing, 65 | height = spacing, 66 | patternTransform = glue::glue('rotate({angle} 0 0)'), 67 | patternUnits = 'userSpaceOnUse', 68 | minisvg::stag$rect( 69 | width = '100%', 70 | height = '100%', 71 | style = rect_style 72 | ), 73 | minisvg::stag$circle( 74 | cx = round(spacing/2, 2), 75 | cy = round(spacing/2, 2), 76 | r = round(radius , 2), 77 | style = inner_style 78 | ) 79 | ) 80 | 81 | pattern 82 | } 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /R/pattern-gradient.R: -------------------------------------------------------------------------------- 1 | 2 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | #' Create an SVG gradient to use as a pattern 4 | #' 5 | #' Create an SVG pattern which will \code{fill} an element with a colour gradient. 6 | #' 7 | #' @inheritParams create_pattern_stripe 8 | #' @param colour1,colour2 the start and end colours of the gradient 9 | #' 10 | #' @return minisvg::SVGPattern object 11 | #' 12 | #' @import minisvg 13 | #' @import glue 14 | #' @export 15 | #' 16 | #' 17 | #' @examples 18 | #' \dontrun{ 19 | #' # Create an SVG document 20 | #' library(minisvg) 21 | #' doc <- minisvg::svg_doc() 22 | #' 23 | #' # Create the pattern and add to the SVG definitions 24 | #' my_pattern <- create_pattern_gradient(id = 'mypattern') 25 | #' doc$defs(my_pattern) 26 | #' 27 | #' # Create a rectangle with the animation 28 | #' rect <- stag$rect( 29 | #' x = "10%", 30 | #' y = "10%", 31 | #' width = "80%", 32 | #' height = "80%", 33 | #' stroke = 'black', 34 | #' fill = my_pattern 35 | #' ) 36 | #' 37 | #' # Add this rectangle to the document, show the SVG text, then render it 38 | #' doc$append(rect) 39 | #' doc 40 | #' doc$show() 41 | #' } 42 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | create_pattern_gradient <- function(id, 44 | angle = 45, 45 | colour1 = '#ffffff', 46 | colour2 = '#000000', 47 | alpha = 1.0, 48 | ...) { 49 | 50 | 51 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | # invert angle to cope with inverted y axis in svg coords. 53 | # i.e. convert angle so clockwise from x axis to be positive 54 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | angle <- (360 - (angle %% 360)) %% 360 56 | tinc <- tan((angle %% 45) * pi/180) 57 | tdec <- 1 - tinc 58 | 59 | if (angle < 1 * 45) { 60 | x1 = 0; y1 = 0; x2 = 1; y2 = tinc; 61 | } else if (angle < 2 * 45) { 62 | x1 = 0; y1 = 0; x2 = tdec; y2 = 1; 63 | } else if (angle < 3 * 45) { 64 | x1 = 1; y1 = 0; x2 = tdec; y2 = 1; 65 | } else if (angle < 4 * 45) { 66 | x1 = 1; y1 = 0; x2 = 0; y2 = tdec; 67 | } else if (angle < 5 * 45) { 68 | x1 = 1; y1 = 1; x2 = 0; y2 = tdec; 69 | } else if (angle < 6 * 45) { 70 | x1 = 1; y1 = 1; x2 = tinc; y2 = 0; 71 | } else if (angle < 7 * 45) { 72 | x1 = 0; y1 = 1; x2 = tinc; y2 = 0; 73 | } else if (angle < 8 * 45) { 74 | x1 = 0; y1 = 1; x2 = 1; y2 = tinc; 75 | } else { 76 | x1 = 0; y1 = 0; x2 = 1; y2 = 1 77 | } 78 | 79 | # Format as percentages 80 | x1 <- paste0(round(x1 * 100, 2), '%') 81 | y1 <- paste0(round(y1 * 100, 2), '%') 82 | x2 <- paste0(round(x2 * 100, 2), '%') 83 | y2 <- paste0(round(y2 * 100, 2), '%') 84 | 85 | 86 | pattern <- minisvg::svg_pattern( 87 | name = 'linearGradient', 88 | id = id, 89 | x1 = x1, 90 | y1 = y1, 91 | x2 = x2, 92 | y2 = y2, 93 | minisvg::stag$stop(offset = "0%", style = glue::glue("stop-color:{colour1};stop-opacity:{alpha}")), 94 | minisvg::stag$stop(offset = "100%", style = glue::glue("stop-color:{colour2};stop-opacity:{alpha}")) 95 | ) 96 | 97 | pattern 98 | } 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /R/pattern-hatch.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | #' Create an SVG cross-hatch pattern 5 | #' 6 | #' Create an SVG pattern which will \code{fill} an element with cross-hatching. 7 | #' 8 | #' @inheritParams create_pattern_stripe 9 | #' 10 | #' @return minisvg::SVGPattern object 11 | #' 12 | #' @import minisvg 13 | #' @import glue 14 | #' @export 15 | #' 16 | #' 17 | #' @examples 18 | #' \dontrun{ 19 | #' # Create an SVG document 20 | #' library(minisvg) 21 | #' doc <- minisvg::svg_doc() 22 | #' 23 | #' # Create the pattern and add to the SVG definitions 24 | #' my_pattern <- create_pattern_hatch(id = 'mypattern') 25 | #' doc$defs(my_pattern) 26 | #' 27 | #' # Create a rectangle with the animation 28 | #' rect <- stag$rect( 29 | #' x = "10%", 30 | #' y = "10%", 31 | #' width = "80%", 32 | #' height = "80%", 33 | #' stroke = 'black', 34 | #' fill = my_pattern 35 | #' ) 36 | #' 37 | #' # Add this rectangle to the document, show the SVG text, then render it 38 | #' doc$append(rect) 39 | #' doc 40 | #' doc$show() 41 | #' } 42 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | create_pattern_hatch <- function(id, 44 | angle = 45, 45 | spacing = 20, 46 | fill_fraction = 0.2, 47 | alpha = 1.0, 48 | fg_alpha = 1.0, 49 | colour = '#000000', 50 | ...) { 51 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | # convert fill_fraction into a line thickness 53 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | line_thickness <- fill_fraction * spacing * 2 55 | line_thickness <- max(line_thickness, 2) 56 | spacing <- max(spacing, 2) 57 | 58 | 59 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 60 | inner_style <- glue::glue('stroke:{colour}; stroke-width:{line_thickness}; stroke-opacity:{fg_alpha};') 61 | 62 | pattern <- minisvg::svg_pattern( 63 | id = id, 64 | width = spacing, 65 | height = spacing, 66 | patternTransform = glue::glue('rotate({angle} 0 0)'), 67 | patternUnits = 'userSpaceOnUse', 68 | minisvg::stag$rect( 69 | width = '100%', 70 | height = '100%', 71 | style = rect_style 72 | ), 73 | minisvg::stag$g( 74 | style = inner_style, 75 | minisvg::stag$line(x1=0, y1=0, x2=0, y2=spacing), 76 | minisvg::stag$line(x1=0, y1=0, x2=spacing, y2=0) 77 | ) 78 | ) 79 | 80 | pattern 81 | } 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /R/pattern-hex.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | #' Create an SVG hex pattern 6 | #' 7 | #' Create an SVG pattern which will \code{fill} an element with hexes. 8 | #' 9 | #' @inheritParams create_pattern_stripe 10 | #' 11 | #' @return minisvg::SVGPattern object 12 | #' 13 | #' @import minisvg 14 | #' @import glue 15 | #' @export 16 | #' 17 | #' 18 | #' @examples 19 | #' \dontrun{ 20 | #' # Create an SVG document 21 | #' library(minisvg) 22 | #' doc <- minisvg::svg_doc() 23 | #' 24 | #' # Create the pattern and add to the SVG definitions 25 | #' my_pattern <- create_pattern_hex(id = 'mypattern') 26 | #' doc$defs(my_pattern) 27 | #' 28 | #' # Create a rectangle with the animation 29 | #' rect <- stag$rect( 30 | #' x = "10%", 31 | #' y = "10%", 32 | #' width = "80%", 33 | #' height = "80%", 34 | #' stroke = 'black', 35 | #' fill = my_pattern 36 | #' ) 37 | #' 38 | #' # Add this rectangle to the document, show the SVG text, then render it 39 | #' doc$append(rect) 40 | #' doc 41 | #' doc$show() 42 | #' } 43 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | create_pattern_hex <- function(id, 45 | angle = 0, 46 | spacing = 20, 47 | fill_fraction = 0.01, 48 | alpha = 1.0, 49 | fg_alpha = 1.0, 50 | colour = '#000000', 51 | ...) { 52 | 53 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | # convert fill_fraction into a line thickness 55 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | lt <- fill_fraction * spacing * 1.6 57 | lt <- max(lt, 1) 58 | spacing <- max(spacing, 2) 59 | 60 | w <- sqrt(3) * spacing 61 | h <- 2 * spacing 62 | 63 | qh <- h/4 64 | hw <- w/2 65 | 66 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 67 | inner_style <- glue::glue('stroke:{colour}; stroke-width:{lt}; stroke-opacity:{fg_alpha};') 68 | 69 | pattern <- minisvg::svg_pattern( 70 | id = id, 71 | width = w, 72 | height = 6*qh, 73 | patternTransform = glue::glue('rotate({angle} 0 0)'), 74 | patternUnits = 'userSpaceOnUse', 75 | minisvg::stag$rect( 76 | width = '100%', 77 | height = '100%', 78 | style = rect_style 79 | ), 80 | 81 | minisvg::stag$g( 82 | style = inner_style, 83 | minisvg::stag$line(x1=hw, y1=qh , x2=0 , y2=2*qh), 84 | minisvg::stag$line(x1=hw, y1=qh , x2=w , y2=2*qh), 85 | minisvg::stag$line(x1=hw, y1=qh*5, x2=0 , y2=4*qh), 86 | minisvg::stag$line(x1=hw, y1=qh*5, x2=w , y2=4*qh), 87 | minisvg::stag$line(x1=hw, y1=0 , x2=hw, y2=1*qh), 88 | minisvg::stag$line(x1=hw, y1=qh*5, x2=hw, y2=6*qh), 89 | minisvg::stag$line(x1=0 , y1=qh*2, x2=0 , y2=4*qh), 90 | minisvg::stag$line(x1=w , y1=qh*2, x2=w , y2=4*qh) 91 | ) 92 | ) 93 | 94 | pattern 95 | } 96 | 97 | -------------------------------------------------------------------------------- /R/pattern-stipple.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | #' Create an SVG stipple pattern 6 | #' 7 | #' Create an SVG pattern which will \code{fill} an element with dots using 8 | #' poisson disc sampling. This makes use of the \code{poissoned} package. 9 | #' 10 | #' @inheritParams create_pattern_stripe 11 | #' 12 | #' @return minisvg::SVGPattern object 13 | #' 14 | #' @import minisvg 15 | #' @import glue 16 | #' @importFrom poissoned poisson_disc 17 | #' @export 18 | #' 19 | #' 20 | #' @examples 21 | #' \dontrun{ 22 | #' # Create an SVG document 23 | #' library(minisvg) 24 | #' doc <- minisvg::svg_doc() 25 | #' 26 | #' # Create the pattern and add to the SVG definitions 27 | #' my_pattern <- create_pattern_stipple(id = 'mypattern') 28 | #' doc$defs(my_pattern) 29 | #' 30 | #' # Create a rectangle with the animation 31 | #' rect <- stag$rect( 32 | #' x = "10%", 33 | #' y = "10%", 34 | #' width = "80%", 35 | #' height = "80%", 36 | #' stroke = 'black', 37 | #' fill = my_pattern 38 | #' ) 39 | #' 40 | #' # Add this rectangle to the document, show the SVG text, then render it 41 | #' doc$append(rect) 42 | #' doc 43 | #' doc$show() 44 | #' } 45 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | create_pattern_stipple <- function(id, 47 | spacing = 20, 48 | fill_fraction = 0.2, 49 | alpha = 1.0, 50 | colour = '#000000', 51 | fg_alpha = 1, ...) { 52 | 53 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | # Spacing corresponds to cell size 55 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | cell_size <- spacing 57 | nrows <- 20 58 | ncols <- 20 59 | width <- ncols * cell_size 60 | height <- nrows * cell_size 61 | 62 | 63 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 64 | # Generate a bunch of points using the 'poissoned' package 65 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | pts <- poissoned::poisson_disc(ncols = ncols, 67 | nrows = nrows, 68 | cell_size = cell_size, 69 | k = 20, 70 | keep_boundary = TRUE, 71 | verbose = FALSE) 72 | pts$x <- round(pts$x, 2) 73 | pts$y <- round(pts$y, 2) 74 | 75 | 76 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | # fill_fraction influences radius 78 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | r <- spacing * fill_fraction 80 | 81 | inner_style <- glue::glue("fill: {colour}; stroke: {colour}; fill-opacity: {fg_alpha}; stroke-opacity: {fg_alpha}") 82 | 83 | circles <- glue::glue("") 84 | circles <- paste(circles, collapse = "\n") 85 | circles <- minisvg::stag$g( 86 | circles 87 | ) 88 | 89 | 90 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | # Create the pattern 92 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 94 | 95 | pattern <- minisvg::svg_pattern( 96 | id = id, 97 | width = width, 98 | height = height, 99 | patternUnits = 'userSpaceOnUse', 100 | minisvg::stag$rect( 101 | width = '100%', 102 | height = '100%', 103 | style = rect_style 104 | ), 105 | circles 106 | ) 107 | 108 | 109 | 110 | 111 | pattern 112 | } 113 | 114 | 115 | -------------------------------------------------------------------------------- /R/pattern-stripe.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | #' Create an SVG stripe pattern 5 | #' 6 | #' Create an SVG pattern which will \code{fill} an element with stripes. 7 | #' 8 | #' @param angle rotation angle (degrees) 9 | #' @param spacing space between features 10 | #' @param fill_fraction size of features. In range [0, 1] 11 | #' @param alpha default: 1.0 (opaque) 12 | #' @param id id to use for pattern. If NULL then generate rando ID 13 | #' @param fg_alpha alpha of the features 14 | #' @param colour colour of the features. e.g. '#345678' 15 | #' @param ... other arguments ignored 16 | #' 17 | #' @return minisvg::SVGPattern object 18 | #' 19 | #' @import minisvg 20 | #' @import glue 21 | #' @export 22 | #' 23 | #' 24 | #' @examples 25 | #' \dontrun{ 26 | #' # Create an SVG document 27 | #' library(minisvg) 28 | #' doc <- minisvg::svg_doc() 29 | #' 30 | #' # Create the pattern and add to the SVG definitions 31 | #' my_pattern <- create_pattern_stripe(id = 'mypattern') 32 | #' doc$defs(my_pattern) 33 | #' 34 | #' # Create a rectangle with the animation 35 | #' rect <- stag$rect( 36 | #' x = "10%", 37 | #' y = "10%", 38 | #' width = "80%", 39 | #' height = "80%", 40 | #' stroke = 'black', 41 | #' fill = my_pattern 42 | #' ) 43 | #' 44 | #' # Add this rectangle to the document, show the SVG text, then render it 45 | #' doc$append(rect) 46 | #' doc 47 | #' doc$show() 48 | #' } 49 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 50 | create_pattern_stripe <- function(id, 51 | angle = 45, 52 | spacing = 20, 53 | fill_fraction = 0.2, 54 | alpha = 1.0, 55 | fg_alpha = 1.0, 56 | colour = '#000000', 57 | ...) { 58 | 59 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | # convert fill_fraction into a line thickness 61 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 | line_thickness <- fill_fraction * spacing * 2 63 | 64 | line_thickness <- max(line_thickness, 2) 65 | spacing <- max(spacing, 2) 66 | 67 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | # Create the pattern 69 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | rect_style <- glue::glue('fill:#ffffff; fill-opacity:{alpha}; stroke:none;') 71 | inner_style <- glue::glue('stroke:{colour}; stroke-width:{line_thickness}; stroke-opacity:{fg_alpha};') 72 | 73 | pattern <- minisvg::svg_pattern( 74 | id = id, 75 | width = spacing, 76 | height = spacing, 77 | patternTransform = glue::glue('rotate({angle} 0 0)'), 78 | patternUnits = 'userSpaceOnUse', 79 | minisvg::stag$rect( 80 | width = '100%', 81 | height = '100%', 82 | style = rect_style 83 | ), 84 | minisvg::stag$line(x1=0, y1=0, x2=0, y2=spacing, style = inner_style) 85 | ) 86 | 87 | pattern 88 | } 89 | 90 | -------------------------------------------------------------------------------- /R/svgpatternsimple.R: -------------------------------------------------------------------------------- 1 | #' svgpatternsimple: A package of parameterised SVG patterns built using \code{minisvg} 2 | #' 3 | #' @docType package 4 | #' @name svgpatternsimple 5 | NULL 6 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = FALSE, 10 | comment = " ", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | 15 | suppressPackageStartupMessages({ 16 | library(dplyr) 17 | library(ggplot2) 18 | library(tidyr) 19 | 20 | library(minisvg) 21 | library(svgpatternsimple) 22 | }) 23 | 24 | set.seed(1) # for repeatable stipple pattern 25 | ``` 26 | 27 | 28 | ```{r echo = FALSE, eval = FALSE} 29 | # pkgdown::build_site(override = list(destination = "../coolbutuseless.github.io/package/svgpatternsimple")) 30 | ``` 31 | 32 | 33 | 34 | # svgpatternsimple 35 | 36 | 37 | ![](http://img.shields.io/badge/cool-useless-green.svg) 38 | ![](http://img.shields.io/badge/mini-verse-blue.svg) 39 | 40 | 41 | `svgpatternsimple` provides a basic set of simple repeating SVG patterns. 42 | 43 | For online documentation, see the [svgpatternsimple pkgdown website](https://coolbutuseless.github.io/package/svgpatternsimple/index.html). 44 | 45 | ## Installation 46 | 47 | You can install from [GitHub](https://github.com/coolbutuseless/svgpatternsimple) with: 48 | 49 | ``` r 50 | # install.packages("devtools") 51 | install_github("coolbutuseless/poissoned") # Generate points via poisson disk sampling 52 | install_github("coolbutuseless/minnisvg") # Build SVG documents with R 53 | install_github("coolbutuseless/svgpatternsimple") # This package 54 | ``` 55 | 56 | 57 | ## Example: What is a pattern? 58 | 59 | The patterns generated by this package are SVG `` elements created 60 | with [`minisvg`](https://github.com/coolbutuseless/minisvg). 61 | 62 | `minisvg` elements are R6 objects which render to a string representing SVG. 63 | 64 | To wrap the pattern in a generic SVG document use the 65 | method `$as_full_svg()`, and to display it in an RStudio session use `$show()` 66 | 67 | ```{r fig.width=4} 68 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 | # Create a dot pattern 70 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | dot <- create_pattern_dot(id = 'dot') 72 | ``` 73 | 74 | ```{r eval=FALSE} 75 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | # All `minisvg::SVGPattern` objects have a built in '$show()' method. 77 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 | dot$show() 79 | ``` 80 | 81 | ```{r echo=FALSE, results='asis'} 82 | cat( 83 | "
",
 84 |   "
Show/hide SVG text ", 85 | htmltools::htmlEscape(as.character(dot$as_full_svg())), 86 | "
", 87 | "
", sep='') 88 | ``` 89 | 90 | 91 | ```{r echo = FALSE} 92 | if (interactive()) { 93 | dot$show() 94 | } 95 | dot$save_full_svg("man/figures/README-example-dot.svg", height=100, include_declaration = FALSE) 96 | ``` 97 | 98 | 99 | 100 | 101 | ## Applying a pattern within an SVG document 102 | 103 | 1. Create a `minisvg` document 104 | 2. Cretae a pattern 105 | 3. Add the pattern definition to the SVG document 106 | 4. Create a rectangle 107 | 5. Assign the pattern as the fill for the rectangle 108 | 6. Append the rectangle to the document. 109 | 110 | ```{r} 111 | library(minisvg) 112 | doc <- minisvg::svg_doc(width=400, height=100) 113 | 114 | mypattern <- create_pattern_hex(id = 'hexpattern') 115 | doc$defs(mypattern) 116 | 117 | myrect <- stag$rect(x=0, y=0, width=400, height=100, fill=mypattern) 118 | 119 | doc$append(myrect) 120 | 121 | # doc$show() 122 | ``` 123 | 124 | 125 | ```{r echo=FALSE} 126 | doc 127 | ``` 128 | 129 | 130 | 131 | 132 | ## Example: All patterns 133 | 134 | There are currently 7 pattern types included in this package. 135 | Patterns are created using `create_[type]_pattern()`, and arguments control the 136 | appearance of the generated pattern e.g. opacity, orientation etc. 137 | 138 | ```{r} 139 | dot <- create_pattern_dot (id = 'p1' , fill_fraction = 0.4) 140 | stripe <- create_pattern_stripe (id = 'p2' , angle = 60) 141 | hatch <- create_pattern_hatch (id = 'p3' , spacing = 50) 142 | stipple <- create_pattern_stipple (id = 'p4' , colour = 'hotpink') 143 | hex <- create_pattern_hex (id = 'p5' , fill_fraction = 0.1) 144 | check <- create_pattern_check (id = 'p6' , spacing = 30, colour = 'darkgreen') 145 | gradient <- create_pattern_gradient(id = 'p7' , colour1 = 'hotpink', colour2 = 'darkblue') 146 | 147 | pattern_list <- list(dot, stripe, hatch, stipple, hex, check, gradient) 148 | doc <- SVGPatternList_to_svg(pattern_list, height = 100, ncol = 2) 149 | # doc$show() 150 | doc$save("man/figures/README-all-patterns.svg") 151 | ``` 152 | 153 | 154 | ```{r echo=FALSE, results='asis'} 155 | cat( 156 | "
",
157 |   "
Show/hide SVG text ", 158 | htmltools::htmlEscape(as.character(doc)), 159 | "
", 160 | "
", sep='') 161 | ``` 162 | 163 | 164 | 165 | 166 | 167 | 168 | ### Stripes 169 | 170 | ```{r echo=TRUE} 171 | vars <- expand.grid( 172 | angle = c(0, 45, 90, 135), 173 | fill_fraction = c(0.05, 0.25, 0.5, 0.95) 174 | ) %>% 175 | mutate(id = paste('stripe', angle, fill_fraction, sep="_")) 176 | 177 | patterns <- vars %>% 178 | purrr::pmap(create_pattern_stripe) 179 | 180 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 181 | # doc$show() 182 | doc$save("man/figures/README-stripes.svg") 183 | ``` 184 | 185 | 186 | 187 | ```{r echo=FALSE, results='asis'} 188 | cat( 189 | "
",
190 |   "
Show/hide SVG text ", 191 | htmltools::htmlEscape(as.character(doc)), 192 | "
", 193 | "
", sep='') 194 | ``` 195 | 196 | 197 | 198 | 199 | 200 | 201 | ### Dot patterns 202 | 203 | 204 | ```{r echo=TRUE} 205 | vars <- expand.grid( 206 | angle = c(0, 22.5, 45, 67.5), 207 | fill_fraction = c(0.05, 0.25, 0.5, 0.95) 208 | ) %>% 209 | mutate(id = paste('dot', angle, fill_fraction, sep="_")) 210 | 211 | patterns <- vars %>% 212 | purrr::pmap(create_pattern_dot) 213 | 214 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 215 | # doc$show() 216 | doc$save("man/figures/README-dots.svg") 217 | ``` 218 | 219 | 220 | ```{r echo=FALSE, results='asis'} 221 | cat( 222 | "
",
223 |   "
Show/hide SVG text ", 224 | htmltools::htmlEscape(as.character(doc)), 225 | "
", 226 | "
", sep='') 227 | ``` 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | ### Hatching 236 | 237 | ```{r echo=TRUE} 238 | patterns <- vars %>% 239 | mutate(id = paste('hatch', angle, fill_fraction, sep="_")) %>% 240 | purrr::pmap(create_pattern_hatch) 241 | 242 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 243 | # doc$show() 244 | doc$save("man/figures/README-hatch.svg") 245 | ``` 246 | 247 | 248 | ```{r echo=FALSE, results='asis'} 249 | cat( 250 | "
",
251 |   "
Show/hide SVG text ", 252 | htmltools::htmlEscape(as.character(doc)), 253 | "
", 254 | "
", sep='') 255 | ``` 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | ### Stippling 264 | 265 | ```{r echo=TRUE} 266 | set.seed(1) 267 | patterns <- vars %>% 268 | mutate(id = paste('stipple', angle, fill_fraction, sep="_")) %>% 269 | purrr::pmap(create_pattern_stipple) 270 | 271 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 272 | # doc$show() 273 | doc$save("man/figures/README-stipple.svg") 274 | ``` 275 | 276 | 277 | 278 | 279 | ```{r echo=FALSE, results='asis'} 280 | cat( 281 | "
",
282 |   "
Show/hide SVG text ", 283 | htmltools::htmlEscape(as.character(doc)), 284 | "
", 285 | "
", sep='') 286 | ``` 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | ### Hex patterns 295 | 296 | ```{r echo=TRUE} 297 | patterns <- vars %>% 298 | mutate(id = paste('hex', angle, fill_fraction, sep="_")) %>% 299 | purrr::pmap(create_pattern_hex) 300 | 301 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 302 | # doc$show() 303 | doc$save("man/figures/README-hex.svg") 304 | ``` 305 | 306 | 307 | 308 | ```{r echo=FALSE, results='asis'} 309 | cat( 310 | "
",
311 |   "
Show/hide SVG text ", 312 | htmltools::htmlEscape(as.character(doc)), 313 | "
", 314 | "
", sep='') 315 | ``` 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | ### Check patterns 324 | 325 | 326 | ```{r echo=TRUE} 327 | vars <- expand.grid( 328 | angle = c(0, 22.5, 45, 67.5), 329 | spacing = c(0.1, 0.25, 0.5, 0.95) * 100 330 | ) %>% 331 | mutate(id = paste('check', angle, spacing, sep="_")) 332 | 333 | patterns <- vars %>% 334 | purrr::pmap(create_pattern_check) 335 | 336 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 337 | # doc$show() 338 | doc$save("man/figures/README-check.svg") 339 | ``` 340 | 341 | 342 | ```{r echo=FALSE, results='asis'} 343 | cat( 344 | "
",
345 |   "
Show/hide SVG text ", 346 | htmltools::htmlEscape(as.character(doc)), 347 | "
", 348 | "
", sep='') 349 | ``` 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | ### Gradients 358 | 359 | ```{r echo=TRUE} 360 | 361 | vars <- expand.grid( 362 | angle = c(0, 45), 363 | colour1 = c('#ffffff', '#000000'), 364 | colour2 = c('#aa7733', '#224466', '#77aa33', '#ffbb99') 365 | ) %>% 366 | mutate(id = paste('grad', angle, colour1, colour2, sep="_")) 367 | 368 | patterns <- vars %>% 369 | purrr::pmap(create_pattern_gradient) 370 | 371 | doc <- SVGPatternList_to_svg(patterns, width = 200, height = 100, ncol = 4) 372 | # doc$show() 373 | doc$save("man/figures/README-gradients.svg") 374 | ``` 375 | 376 | 377 | 378 | ```{r echo=FALSE, results='asis'} 379 | cat( 380 | "
",
381 |   "
Show/hide SVG text ", 382 | htmltools::htmlEscape(as.character(doc)), 383 | "
", 384 | "
", sep='') 385 | ``` 386 | 387 | 388 | 389 | 390 | 391 | ## Creating the logo for this package 392 | 393 | 394 | ```{r} 395 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 396 | # Building an SVG logo with an animated stripe 397 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 398 | logo <- svg_doc(width = 200, height = 200) 399 | 400 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 401 | # Create a simple pattern using the `svgpatternsimple` package 402 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 403 | stripes <- svgpatternsimple::create_pattern_hatch( 404 | id = 'stripe', 405 | colour = '#002366', 406 | fill_fraction = 0.2, 407 | spacing = 8, 408 | angle = 45 409 | ) 410 | 411 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 412 | # Add the pattern to the documents list of definitions 413 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 414 | logo$defs(stripes) 415 | 416 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 417 | # Create a hexagon filled with this pattern, and add it to the document 418 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 419 | len <- 100 420 | angles <- (seq(0, 360, 60) + 90) * pi/180 421 | xs <- round(len * cos(angles) + 100, 2) 422 | ys <- round(len * sin(angles) + 100, 2) 423 | hex <- stag$polygon(id = 'hex', xs = xs, ys = ys) 424 | hex$update(stroke = '#c0c0c0', fill = stripes) 425 | logo$append(hex) 426 | 427 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 428 | # output 429 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 430 | # logo$show() 431 | logo$save("man/figures/logo.svg") 432 | ``` 433 | 434 | 435 | 436 | ```{r echo=FALSE, results='asis'} 437 | cat( 438 | "
",
439 |   "
Show/hide SVG text ", 440 | htmltools::htmlEscape(as.character(logo)), 441 | "
", 442 | "
", sep='') 443 | ``` 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | -------------------------------------------------------------------------------- /man/create_pattern_check.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-check.R 3 | \name{create_pattern_check} 4 | \alias{create_pattern_check} 5 | \title{Create an SVG checkerboard pattern} 6 | \usage{ 7 | create_pattern_check( 8 | id, 9 | angle = 45, 10 | spacing = 20, 11 | alpha = 1, 12 | fg_alpha = 1, 13 | colour = "#000000", 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{id}{id to use for pattern. If NULL then generate rando ID} 19 | 20 | \item{angle}{rotation angle (degrees)} 21 | 22 | \item{spacing}{space between features} 23 | 24 | \item{alpha}{default: 1.0 (opaque)} 25 | 26 | \item{fg_alpha}{alpha of the features} 27 | 28 | \item{colour}{colour of the features. e.g. '#345678'} 29 | 30 | \item{...}{other arguments ignored} 31 | } 32 | \value{ 33 | minisvg::SVGPattern object 34 | } 35 | \description{ 36 | Create an SVG pattern which will \code{fill} an element with checks. 37 | } 38 | \examples{ 39 | \dontrun{ 40 | # Create an SVG document 41 | library(minisvg) 42 | doc <- minisvg::svg_doc() 43 | 44 | # Create the pattern and add to the SVG definitions 45 | my_pattern <- create_pattern_check(id = 'mypattern') 46 | doc$defs(my_pattern) 47 | 48 | # Create a rectangle with the animation 49 | rect <- stag$rect( 50 | x = "10\%", 51 | y = "10\%", 52 | width = "80\%", 53 | height = "80\%", 54 | stroke = 'black', 55 | fill = my_pattern 56 | ) 57 | 58 | # Add this rectangle to the document, show the SVG text, then render it 59 | doc$append(rect) 60 | doc 61 | doc$show() 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /man/create_pattern_dot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-dot.R 3 | \name{create_pattern_dot} 4 | \alias{create_pattern_dot} 5 | \title{Create an SVG dot pattern} 6 | \usage{ 7 | create_pattern_dot( 8 | id, 9 | angle = 45, 10 | spacing = 20, 11 | fill_fraction = 0.2, 12 | alpha = 1, 13 | fg_alpha = 1, 14 | colour = "#000000", 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{id}{id to use for pattern. If NULL then generate rando ID} 20 | 21 | \item{angle}{rotation angle (degrees)} 22 | 23 | \item{spacing}{space between features} 24 | 25 | \item{fill_fraction}{size of features. In range [0, 1]} 26 | 27 | \item{alpha}{default: 1.0 (opaque)} 28 | 29 | \item{fg_alpha}{alpha of the features} 30 | 31 | \item{colour}{colour of the features. e.g. '#345678'} 32 | 33 | \item{...}{other arguments ignored} 34 | } 35 | \value{ 36 | minisvg::SVGPattern object 37 | } 38 | \description{ 39 | Create an SVG pattern which will \code{fill} an element with dots. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | # Create an SVG document 44 | library(minisvg) 45 | doc <- minisvg::svg_doc() 46 | 47 | # Create the pattern and add to the SVG definitions 48 | my_pattern <- create_pattern_dot(id = 'mypattern') 49 | doc$defs(my_pattern) 50 | 51 | # Create a rectangle with the animation 52 | rect <- stag$rect( 53 | x = "10\%", 54 | y = "10\%", 55 | width = "80\%", 56 | height = "80\%", 57 | stroke = 'black', 58 | fill = my_pattern 59 | ) 60 | 61 | # Add this rectangle to the document, show the SVG text, then render it 62 | doc$append(rect) 63 | doc 64 | doc$show() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /man/create_pattern_gradient.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-gradient.R 3 | \name{create_pattern_gradient} 4 | \alias{create_pattern_gradient} 5 | \title{Create an SVG gradient to use as a pattern} 6 | \usage{ 7 | create_pattern_gradient( 8 | id, 9 | angle = 45, 10 | colour1 = "#ffffff", 11 | colour2 = "#000000", 12 | alpha = 1, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{id}{id to use for pattern. If NULL then generate rando ID} 18 | 19 | \item{angle}{rotation angle (degrees)} 20 | 21 | \item{colour1, colour2}{the start and end colours of the gradient} 22 | 23 | \item{alpha}{default: 1.0 (opaque)} 24 | 25 | \item{...}{other arguments ignored} 26 | } 27 | \value{ 28 | minisvg::SVGPattern object 29 | } 30 | \description{ 31 | Create an SVG pattern which will \code{fill} an element with a colour gradient. 32 | } 33 | \examples{ 34 | \dontrun{ 35 | # Create an SVG document 36 | library(minisvg) 37 | doc <- minisvg::svg_doc() 38 | 39 | # Create the pattern and add to the SVG definitions 40 | my_pattern <- create_pattern_gradient(id = 'mypattern') 41 | doc$defs(my_pattern) 42 | 43 | # Create a rectangle with the animation 44 | rect <- stag$rect( 45 | x = "10\%", 46 | y = "10\%", 47 | width = "80\%", 48 | height = "80\%", 49 | stroke = 'black', 50 | fill = my_pattern 51 | ) 52 | 53 | # Add this rectangle to the document, show the SVG text, then render it 54 | doc$append(rect) 55 | doc 56 | doc$show() 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /man/create_pattern_hatch.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-hatch.R 3 | \name{create_pattern_hatch} 4 | \alias{create_pattern_hatch} 5 | \title{Create an SVG cross-hatch pattern} 6 | \usage{ 7 | create_pattern_hatch( 8 | id, 9 | angle = 45, 10 | spacing = 20, 11 | fill_fraction = 0.2, 12 | alpha = 1, 13 | fg_alpha = 1, 14 | colour = "#000000", 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{id}{id to use for pattern. If NULL then generate rando ID} 20 | 21 | \item{angle}{rotation angle (degrees)} 22 | 23 | \item{spacing}{space between features} 24 | 25 | \item{fill_fraction}{size of features. In range [0, 1]} 26 | 27 | \item{alpha}{default: 1.0 (opaque)} 28 | 29 | \item{fg_alpha}{alpha of the features} 30 | 31 | \item{colour}{colour of the features. e.g. '#345678'} 32 | 33 | \item{...}{other arguments ignored} 34 | } 35 | \value{ 36 | minisvg::SVGPattern object 37 | } 38 | \description{ 39 | Create an SVG pattern which will \code{fill} an element with cross-hatching. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | # Create an SVG document 44 | library(minisvg) 45 | doc <- minisvg::svg_doc() 46 | 47 | # Create the pattern and add to the SVG definitions 48 | my_pattern <- create_pattern_hatch(id = 'mypattern') 49 | doc$defs(my_pattern) 50 | 51 | # Create a rectangle with the animation 52 | rect <- stag$rect( 53 | x = "10\%", 54 | y = "10\%", 55 | width = "80\%", 56 | height = "80\%", 57 | stroke = 'black', 58 | fill = my_pattern 59 | ) 60 | 61 | # Add this rectangle to the document, show the SVG text, then render it 62 | doc$append(rect) 63 | doc 64 | doc$show() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /man/create_pattern_hex.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-hex.R 3 | \name{create_pattern_hex} 4 | \alias{create_pattern_hex} 5 | \title{Create an SVG hex pattern} 6 | \usage{ 7 | create_pattern_hex( 8 | id, 9 | angle = 0, 10 | spacing = 20, 11 | fill_fraction = 0.01, 12 | alpha = 1, 13 | fg_alpha = 1, 14 | colour = "#000000", 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{id}{id to use for pattern. If NULL then generate rando ID} 20 | 21 | \item{angle}{rotation angle (degrees)} 22 | 23 | \item{spacing}{space between features} 24 | 25 | \item{fill_fraction}{size of features. In range [0, 1]} 26 | 27 | \item{alpha}{default: 1.0 (opaque)} 28 | 29 | \item{fg_alpha}{alpha of the features} 30 | 31 | \item{colour}{colour of the features. e.g. '#345678'} 32 | 33 | \item{...}{other arguments ignored} 34 | } 35 | \value{ 36 | minisvg::SVGPattern object 37 | } 38 | \description{ 39 | Create an SVG pattern which will \code{fill} an element with hexes. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | # Create an SVG document 44 | library(minisvg) 45 | doc <- minisvg::svg_doc() 46 | 47 | # Create the pattern and add to the SVG definitions 48 | my_pattern <- create_pattern_hex(id = 'mypattern') 49 | doc$defs(my_pattern) 50 | 51 | # Create a rectangle with the animation 52 | rect <- stag$rect( 53 | x = "10\%", 54 | y = "10\%", 55 | width = "80\%", 56 | height = "80\%", 57 | stroke = 'black', 58 | fill = my_pattern 59 | ) 60 | 61 | # Add this rectangle to the document, show the SVG text, then render it 62 | doc$append(rect) 63 | doc 64 | doc$show() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /man/create_pattern_stipple.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-stipple.R 3 | \name{create_pattern_stipple} 4 | \alias{create_pattern_stipple} 5 | \title{Create an SVG stipple pattern} 6 | \usage{ 7 | create_pattern_stipple( 8 | id, 9 | spacing = 20, 10 | fill_fraction = 0.2, 11 | alpha = 1, 12 | colour = "#000000", 13 | fg_alpha = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{id}{id to use for pattern. If NULL then generate rando ID} 19 | 20 | \item{spacing}{space between features} 21 | 22 | \item{fill_fraction}{size of features. In range [0, 1]} 23 | 24 | \item{alpha}{default: 1.0 (opaque)} 25 | 26 | \item{colour}{colour of the features. e.g. '#345678'} 27 | 28 | \item{fg_alpha}{alpha of the features} 29 | 30 | \item{...}{other arguments ignored} 31 | } 32 | \value{ 33 | minisvg::SVGPattern object 34 | } 35 | \description{ 36 | Create an SVG pattern which will \code{fill} an element with dots using 37 | poisson disc sampling. This makes use of the \code{poissoned} package. 38 | } 39 | \examples{ 40 | \dontrun{ 41 | # Create an SVG document 42 | library(minisvg) 43 | doc <- minisvg::svg_doc() 44 | 45 | # Create the pattern and add to the SVG definitions 46 | my_pattern <- create_pattern_stipple(id = 'mypattern') 47 | doc$defs(my_pattern) 48 | 49 | # Create a rectangle with the animation 50 | rect <- stag$rect( 51 | x = "10\%", 52 | y = "10\%", 53 | width = "80\%", 54 | height = "80\%", 55 | stroke = 'black', 56 | fill = my_pattern 57 | ) 58 | 59 | # Add this rectangle to the document, show the SVG text, then render it 60 | doc$append(rect) 61 | doc 62 | doc$show() 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /man/create_pattern_stripe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pattern-stripe.R 3 | \name{create_pattern_stripe} 4 | \alias{create_pattern_stripe} 5 | \title{Create an SVG stripe pattern} 6 | \usage{ 7 | create_pattern_stripe( 8 | id, 9 | angle = 45, 10 | spacing = 20, 11 | fill_fraction = 0.2, 12 | alpha = 1, 13 | fg_alpha = 1, 14 | colour = "#000000", 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{id}{id to use for pattern. If NULL then generate rando ID} 20 | 21 | \item{angle}{rotation angle (degrees)} 22 | 23 | \item{spacing}{space between features} 24 | 25 | \item{fill_fraction}{size of features. In range [0, 1]} 26 | 27 | \item{alpha}{default: 1.0 (opaque)} 28 | 29 | \item{fg_alpha}{alpha of the features} 30 | 31 | \item{colour}{colour of the features. e.g. '#345678'} 32 | 33 | \item{...}{other arguments ignored} 34 | } 35 | \value{ 36 | minisvg::SVGPattern object 37 | } 38 | \description{ 39 | Create an SVG pattern which will \code{fill} an element with stripes. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | # Create an SVG document 44 | library(minisvg) 45 | doc <- minisvg::svg_doc() 46 | 47 | # Create the pattern and add to the SVG definitions 48 | my_pattern <- create_pattern_stripe(id = 'mypattern') 49 | doc$defs(my_pattern) 50 | 51 | # Create a rectangle with the animation 52 | rect <- stag$rect( 53 | x = "10\%", 54 | y = "10\%", 55 | width = "80\%", 56 | height = "80\%", 57 | stroke = 'black', 58 | fill = my_pattern 59 | ) 60 | 61 | # Add this rectangle to the document, show the SVG text, then render it 62 | doc$append(rect) 63 | doc 64 | doc$show() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /man/figures/README-all-patterns.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /man/figures/README-check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /man/figures/README-dots.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /man/figures/README-example-dot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /man/figures/README-gradients.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /man/figures/README-hatch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /man/figures/README-hex.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /man/figures/README-stripes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /man/figures/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /man/svgpatternsimple.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/svgpatternsimple.R 3 | \docType{package} 4 | \name{svgpatternsimple} 5 | \alias{svgpatternsimple} 6 | \title{svgpatternsimple: A package of parameterised SVG patterns built using \code{minisvg}} 7 | \description{ 8 | svgpatternsimple: A package of parameterised SVG patterns built using \code{minisvg} 9 | } 10 | --------------------------------------------------------------------------------