This is the core transpiler code that you can use to convert raw SVG code into SwiftUI Shape struct that you can use directly in your SwiftUI Project.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
All you need to do is to add this package to your project using following command:
npm i svg-to-swiftui-core
and then import into your project (ES6):
import { convert } from 'svg-to-swiftui-core'
You can run the tests by running following command:
npm test
- SVG
<path>
element (except arc command) - SVG
<circle>
element - SVG
<rect>
element - Fill/stroke styling with colours
- SVG
<text>
element - SVG
<ellipse>
element - SVG
<g>
element with autmatic grouping into sub-paths in SwiftUI - SVG
<polygon>
element - SVG
<polyline>
element - Automatic animation support
This project relies on following npm packages:
- svg-parser - Parses raw SVG into a HAST (Hypertext Abstract Syntaxt Tree).
- svg-pathdata - Parses svg path
d
attribute into a list of easily interpretable objects.
Feel free to open an issue if your SVG file doesn't work or send a PR with our suggested changes!
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Antoni Silvestrovic - Initial work - bring-shrubbery
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details