Learn R Programming

svgedit (version 1.0.0)

get_element_dimensions: Get the dimensions of an SVG element

Description

Get the dimensions of an SVG element

Usage

get_element_dimensions(
  element,
  doc_unit,
  dpi = 150,
  call = rlang::caller_env()
)

Value

A list with x, y, width, and height of the element

Arguments

element

An xml2 node corresponding to an SVG element

doc_unit

The unit used in the SVG document (e.g., "px", "mm", "cm", "in")

dpi

The resolution to use when interpreting pixel units

call

The calling environment for error reporting

Details

The function expects the element to have 'x', 'y', 'width', and 'height' attributes.