get_attributes: Get attributes from an imported SVG file

View source: R/get_attributes.R

get_attributesR Documentation

Get attributes from an imported SVG file

Description

SVG files and the imported representation of class 'XMLsvg' are hierarchically organized in node sets and nodes. Each node is a graphical object such as a path, rectangle, or text. The attributes of these nodes can be queried using this function. Attributes relate to the _style_ of an element. If you want to retrieve the _values_ of an element (e.g. content of a text field), use 'get_values()' instead.

Usage

get_attributes(xml, node = NULL, node_attr = "label", attr = NULL)

Arguments

xml

(XMLsvg) XMLsvg object obtained from 'read_svg()'

node

(character) node(s) to be displayed. Node names are searched using the 'node_attr' field

node_attr

(character) name of the attribute by which target nodes are filtered (default: "label")

attr

(character) the desired attribute to be displayed, such as 'id', 'style'

Value

Returns a 'tibble' with rows being the selected nodes and columns being the selected attributes


m-jahn/fluctuator documentation built on Nov. 4, 2024, 9:35 p.m.