Function sauron::svg::svg_element[][src]

pub fn svg_element<MSG>(
    tag: &'static str,
    attrs: impl IntoIterator<Item = Attribute<&'static str, &'static str, AttributeValue<MSG>>>,
    children: impl IntoIterator<Item = Node<&'static str, &'static str, &'static str, AttributeValue<MSG>>>
) -> Node<&'static str, &'static str, &'static str, AttributeValue<MSG>>
Expand description

creates an svg element with the tag, attributes and children. Example:

use sauron::prelude::*;

let circle: Node<()> = svg_element("circle", vec![cx(1.0), cy(1.0), r(1.0)], vec![]);
assert_eq!(node!{<circle cx=1.0 cy=1.0 r=1.0></circle>}, circle);