Home

Awesome

SVG Generation

This Motoko library generates SVGs (as defined by the Scalable Vector Graphics 1.1 Specification)

Usage

import SVG "mo:svg/SVG";

let width  : Int = 1200;
let height : Int = 400;

let canvas = SVG.SVG();
canvas.start(width, height, []);

canvas.circle(
    600, 200, 100,
    ["fill=\"red\"", "stroke=\"blue\"", "stroke-width=\"10\""],
);

let svg = canvas.end();

circle01

More examples can be found here.

Supported SVG Elements and Functions

Shapes, Lines, Text

Paths

Image and Gradients

Transforms

Animation

Filter Effects

Metadata Elements