SymbolDef
A reusable fragment, emitted once as <symbol> and drawn with <use>.
The markup is in the symbol's own view_box coordinates. A fragment that should take the colour of the place it is used paints with currentColor, since the renderer sets color on the <use> element.
Used as Input
0
functions accept this type(+1 nested)
Used as Output
0
functions return this type(+8 nested)
Type Definition
20 nested items
struct— A reusable fragment, emitted once as
<symbol> and drawn with <use>.class:Vec<String>= []— Class names, joined with spaces into one
class attribute.data:Vec<(String, String)>= []—
(name, value) pairs, each emitted as data-<name>="<value>".extra:Vec<(String, String)>= []— Free-form attributes, escaped but otherwise untouched.
id:Option<String>= null— The element's
id.style:Option<String>= null— Inline CSS, emitted as the
style attribute.markup*:String— SVG markup, emitted unescaped inside the
<symbol>.Example JSON Value
json
{
"id": "893f8ab9",
"markup": "example",
"view_box": {
"h": 0.2,
"w": 0.2,
"x": 0.2,
"y": 0.2
}
}