Learn R Programming

cograph (version 2.0.0)

register_svg_shape: Register Custom SVG Shape

Description

Register an SVG file or string as a custom node shape.

Usage

register_svg_shape(name, svg_source)

Value

Invisible NULL. The shape is registered for use with sn_nodes().

Arguments

name

Character: unique name for this shape (used in node_shape parameter).

svg_source

Character: path to SVG file OR inline SVG string.

Examples

Run this code
if (FALSE) {
# Register from file
register_svg_shape("custom_icon", "path/to/icon.svg")

# Register from inline SVG
register_svg_shape("simple_star",
  '
    
  ')

# Use in network
cograph(adj) |> sn_nodes(shape = "custom_icon")
}

Run the code above in your browser using DataLab