Expand description
OXVG Path is a library used for parsing and minifying SVG paths. It supports parsing of any valid SVG path and provides optimisations close to exactly as SVGO.
Use the Path struct for simple parsing and serializing. By only parsing and serializing, it will produce optimised formatting out of the box. It is made up individual command Data.
For more rigorous minification, try using the run function. This will use non-destructive conversions to shorten the path.
§Differences to SVGO
- Unlike SVGO, all close paths are serialized as
Zinstead of eitherzorZ. This is fine because the two commands function exactly the same. - An equivalent of the
applyTransformsoption isn’t available, but may be in the future.
§Licensing
This library is based off the convertPathData plugin from SVGO and is similarly released under MIT.
Modules§
- command
- Definitions for the commands of path data.
- convert
- A collection of utility function to filter-map SVG paths.
- geometry
- Type of shaped used for processing path data.
- parser
- Types used for parsing a string of path data.
- points
- Types used for processing polygons
- positioned
- Path representations with positional information
Structs§
- Path
- A path is a set of commands