SVG Image
An imported SVG file, drawn as one object you can move, rotate and scale.
Node id core/svg-image
The SVG Image node holds an existing SVG file, such as a logo, an icon or a
drawing made in another editor, and outputs it as one object. Import a file
with File › Import SVG…, by dropping it on the graph editor, or with
Choose file… in the node's inspector (see
Importing SVG files). Its
position, rotation and scale place it; the drawing itself can't be
changed or taken apart into shapes.
Parameters
| Name | Type | Default |
|---|---|---|
| markup | string | "" |
| fileName | string | "" |
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| position | Point | { x: 0, y: 0 } | |
| rotation | number | 0 | |
| scale | number | 1 |
Outputs
| Name | Type | Notes |
|---|---|---|
| image | SvgImage |
Behaviour
- Size and position. The image is drawn at the file's own size (its
widthandheight, or else itsviewBox), centred onposition, like a rectangle. Absolute units such asmmorinare converted at 96 pixels per inch. - Units.
rotationis in radians;scaleis a uniform factor (1 keeps the file's size). - One object. The image connects anywhere an object does: into the Output, into a Group, or through the transform nodes (Translate, Rotate, Scale, Move To), which keep it an SVG image. AABB and OOBB give its box.
- No outline. Path nodes such as Sample or Length report an error for an SVG image, as they do for a group.
- Drawn as an image. The file is drawn the way a browser shows an SVG
in an
<img>: scripts in it don't run, and anything it loads from elsewhere (linked images, web fonts) isn't shown. The downloaded SVG keeps it as one embedded image, not as editable paths. - Saved with the graph. The file's content is stored in the node, so a saved graph file includes it.
Errors
- A node with no SVG file reports "no SVG imported".
- A file that isn't an SVG, or whose size can't be read (no
widthandheightoutside of percentages, and noviewBox), is an error saying which.