svg-to-swiftui-core
v0.3.5
Published
SVG to SwiftUI Shape converter core package. Will transform the raw SVG code into SwiftUI Shape via the JavaScript API.
Downloads
42
Maintainers
Readme
SVG to SwiftUI Converter Core
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.
Before we start
This package is written for JavaScript projects, so it's only meant to be used in a Node.js projects. If you just need to convert an SVG to SwiftUI Shape you should use this tool.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Installing
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'
Running the tests
You can run the tests by running following command:
npm test
Roadmap
- [x] SVG
<path>
element- [ ] Line commands
- [x]
M
- [ ]
m
- [x]
L
- [ ]
l
- [x]
H
- [ ]
h
- [x]
V
- [ ]
v
- [x]
Z
- [ ]
z
- [x]
- [ ] Curve commands
- [ ]
C
- [ ]
c
- [ ]
S
- [ ]
s
- [ ]
Q
- [ ]
q
- [ ]
T
- [ ]
t
- [ ]
A
- [ ]
a
- [ ]
- [ ] Line commands
- [x] SVG
<circle>
element - [x] SVG
<rect>
element - [x] SVG
<ellipse>
element - [ ] Fill/stroke styling with colours
- [ ] SVG
<text>
element - [ ] SVG
<g>
element with autmatic grouping into sub-paths in SwiftUI - [ ] SVG
<polygon>
element - [ ] SVG
<polyline>
element - [ ] AVG
<arc>
element - [ ] Automatic animation support
Built With
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.
Contributing
Feel free to open an issue if your SVG file doesn't work or send a PR with our suggested changes!
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Antoni Silvestrovic - Initial work - bring-shrubbery
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details