Skip to contents

Renders manimR scenes to SVG format. Produces scalable vector graphics that can be embedded in web pages or printed without loss of quality.

Super class

manimR::AbstractRenderer -> SVGRenderer

Public fields

svg_lines

Accumulated SVG element strings

output_path

Current output file path

viewbox_x_range

X range in scene units

viewbox_y_range

Y range in scene units

Methods

Inherited methods


Method new()

Create SVGRenderer

Usage

SVGRenderer$new(...)

Arguments

...

Arguments passed to AbstractRenderer


Method begin_frame()

Begin a new SVG frame

Usage

SVGRenderer$begin_frame(output_path = NULL)

Arguments

output_path

Path to save SVG file


Method end_frame()

End the SVG frame and write to file

Usage

SVGRenderer$end_frame()


Method draw_path()

Draw a path in SVG

Usage

SVGRenderer$draw_path(
  x,
  y,
  fill_color = NULL,
  fill_opacity = 0,
  stroke_color = "#FFFFFF",
  stroke_opacity = 1,
  stroke_width = 2
)


Method draw_text()

Draw text in SVG

Usage

SVGRenderer$draw_text(
  text,
  x,
  y,
  color = "#FFFFFF",
  font_size = 24,
  font_family = "sans",
  opacity = 1
)


Method draw_raster()

Draw raster image in SVG (base64 embedded)

Usage

SVGRenderer$draw_raster(raster, xleft, ybottom, xright, ytop, opacity = 1)


Method get_svg_string()

Get the SVG content as a string

Usage

SVGRenderer$get_svg_string()


Method clone()

The objects of this class are cloneable with this method.

Usage

SVGRenderer$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.