Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

quassum/svg-to-swiftui-core

 
 

Repository files navigation

SVG to SwiftUI Converter Core

Build Version Downloads/month License

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.

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

  • 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

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

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