create_usgs_pattern: Create an SVG pattern from the USGS library

Description Usage Arguments Value Examples

View source: R/pattern-usgs.R

Description

Create an SVG pattern from the USGS library

Usage

1
2
3
4
5
6
7
8
create_usgs_pattern(
  usgs_code = 601,
  spacing = 20,
  fill = "#ffffff",
  alpha = 1,
  angle = 0,
  id = NULL
)

Arguments

usgs_code

USGS code for a pattern

spacing

size of pattern

fill

fill colour

alpha

default: 1.0 (opaque)

angle

angle

id

id to use for pattern. default: NULL means to generate automatically

Value

minisvg::SVGPattern object

Examples

 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
## Not run: 
# Create an SVG document
library(minisvg)
doc   <- minisvg::svg_doc()

# Create the pattern and add to the SVG definitions
my_pattern <- create_usgs_pattern(usgs_code = 601, spacing = 100)
doc$defs(my_pattern)

# Create a rectangle with the animation
rect  <- stag$rect(
  x      = "10%",
  y      = "10%",
  width  = "80%",
  height = "80%",
  stroke = 'black',
  fill   = my_pattern
)

# Add this rectangle to the document, show the SVG text, then render it
doc$append(rect)
doc
doc$show()

## End(Not run)

coolbutuseless/svgpatternusgs documentation built on Feb. 2, 2020, 12:05 a.m.