tests/test-draw.R

library(drawsvg)

foo <- function(a = 0L, b, ...) {
    drawsvg:::args2attributes()
}

stopifnot(
    foo() == " a='0'",
    foo(a = 1L) == " a='1'",
    foo(b = "") == " a='0' b=''",
    foo(a = 1L, b = "test") == " a='1' b='test'",
    draw_text("test") == "<text x='0' y='0'>test</text>",
    feoffset() == "<feOffset dx='0' dy='0'/>",
    feoffset(dx = 3.2345) == "<feOffset dx='3.23' dy='0'/>"
)
be-pr/drawsvg documentation built on Dec. 8, 2020, 3:34 a.m.