Improved SVG Importing & Rendering
In the next nightly, the SVG Importer and Drawing Component renderer have been greatly improved. These changes are foundational for the upcoming drawing editor. SVGs that didn’t work previously will likely work, so long as they’re imported and rendered with the latest nightly. SVGs imported using a previous version of Ignition will render the same as they did before.
This isn’t a guarantee that all SVG elements will import and render correctly, but most should.
In particular the following SVG elements received development attention.
- animate
- circle
- clippath
- defs
- ellipse
- filter
- feblend
- fecolormatrix
- fecomposite
- feconvolvematrix
- fedisplacementmap
- fedropshadow
- feflood
- fegaussianblur
- feimage
- femerge
- feoffset
- femorphology
- fespecularlighting
- feturbulence
- fetile
- g
- line
- lineargradient
- marker
- mask
- pattern
- path
- polygon
- polyline
- radialgradient
- rect
- svg(embedded in the root SVG)
- text
- tspan
- textpath
- tspan
- use
- symbol
Many of the filters in particular rely on DOM Ids- which should be unique
. To that end, the importer automatically imports them as is, and then the renderer automatically prefixes them to ensure that they are unique
. This includes things like filter="url(#my-id)"
or fill="url(#gradient)
Here is an example of an SVG that didn’t work previous, but now does
Convert to Drawing
There is a new item added to the right click menu for a subset of SVG based components (and pipes), “convert to drawing”. It will convert the component to a drawing- minus an bindings as those bindings don’t correspond 1 to 1 with Drawing props, and it would be incredibly difficult to do so. This allows for fine control of individual elements- including the ability to add bindings to individual pieces of a component- now a Drawing.
Affected Components
- Cylindrical Tank
- Icon
- Linear Scale
- Moving Analog Indicator
- Sparkline
- Thermometer
- All Symbols including Motor, Pump, Sensor, Valve, and Vessel
- Coordinate Container (containing pipes) - All pipes within the container will be converted to a single drawing