Crates.io | svg_definitions |
lib.rs | svg_definitions |
version | 0.3.2 |
source | src |
created_at | 2020-02-24 14:35:04.633246 |
updated_at | 2022-12-03 15:11:06.472806 |
description | A Rust library with definitions for SVG elements |
homepage | https://github.com/coastalwhite/svg_definitions.git |
repository | https://github.com/coastalwhite/svg_definitions.git |
max_upload_size | |
id | 212033 |
size | 96,909 |
Hello fellow Rustacians! Here is a crate with SVG Definitions. This was mostly created to serve as a backend crate for wasm_svg_graphics, but feel free to use it!
I am open to pull requests so please contribute!
use svg_definitions::prelude::*;
let triangle = SVGElem::new(Tag::Path)
.set(Attr::StrokeWidth, 1)
.set(Attr::Stroke, "#000")
.set(Attr::Fill, "transparent")
.set(Attr::D, PathData::new()
.move_to((0.0, 0.0))
.line_to((10.0, 0.0))
.line_to((0.0, 10.0))
.line_to((0.0, 0.0))
.close_path()
);
let group = SVGElem::new(Tag::G)
.append(triangle);