animejs_widget: Create a bare animejs htmlwidget

View source: R/animejs.R

animejs_widgetR Documentation

Create a bare animejs htmlwidget

Description

This is the low-level constructor. Most users will not call this directly; it is the final rendering step called by anime_render().

Usage

animejs_widget(svg, config, width = NULL, height = NULL, elementId = NULL)

Arguments

svg

Character. Raw SVG markup to embed in the widget. If NULL, an empty string is used (the animation will run against existing DOM content – advanced use only).

config

List. A serialisable animation specification produced by anime_timeline() or anime_animate() and their modifiers, then serialised by anime_render().

width

Fixed width for widget (in css units). The default is NULL, which results in intelligent automatic sizing based on the widget's container.

height

Fixed height for widget (in css units). The default is NULL, which results in intelligent automatic sizing based on the widget's container.

elementId

Use an explicit element ID for the widget (rather than an automatically generated one). Useful if you have other JavaScript that needs to explicitly discover and interact with a specific widget instance.

Value

An object of class c("animejs", "htmlwidget").


animejs documentation built on Aug. 21, 2026, 5:17 p.m.