Learn R Programming

cardargus (version 0.2.0)

parse_svg_root_dim: Parse a numeric width/height from the root <svg ...> tag

Description

Tries:

  1. width="..." / height="..." (supports px, numbers)

  2. viewBox="minx miny width height" as fallback

Usage

parse_svg_root_dim(svg_content, attr = c("width", "height"))

Value

Numeric value (in CSS px) or NA_real_ if not found.

Arguments

svg_content

Character SVG.

attr

"width" or "height".