| Crates.io | facet-svg-legacy |
| lib.rs | facet-svg-legacy |
| version | 0.36.0 |
| created_at | 2025-12-29 20:38:58.986469+00 |
| updated_at | 2025-12-29 20:38:58.986469+00 |
| description | Legacy SVG (Scalable Vector Graphics) serialization for Facet types - use facet-svg instead |
| homepage | https://facet.rs |
| repository | https://github.com/facet-rs/facet |
| max_upload_size | |
| id | 2011307 |
| size | 96,992 |
Provides strongly-typed SVG parsing for Facet types using facet-xml.
SVG is ubiquitous in diagram generation—tools like pikchr, Graphviz, Mermaid, and countless design applications output SVG as their primary format. However, SVG parsing in Rust typically requires either:
facet-svg solves this by providing strongly-typed, compile-time-safe SVG structures derived from Facet's reflection system. You get:
This makes facet-svg ideal for:
The following SVG elements are fully supported for parsing and type-safe access:
<rect>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline><text> with styling attributes<g> with transform support, <defs>, <style>, <symbol><use> for referencing defined elements<image> for embedded or linked images<title>, <desc> for accessibility and documentationUnsupported elements (such as <filter>, <marker>, <tspan>, and specialized SVG filters) are gracefully ignored during parsing, allowing real-world SVG files to be processed without errors.
use facet_svg_legacy::Svg;
let svg_str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<rect x="10" y="10" width="80" height="80" fill="blue"/>
</svg>"#;
let svg: Svg = facet_xml_legacy::from_str(svg_str)?;
assert_eq!(svg.width, Some("100".to_string()));
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
The facet logo was drawn by Misiasart.
Licensed under either of:
at your option.