UNPKG

swiftvg

Version:

Convert SVG path data to a Swift 3 UIBezierPath

17 lines (12 loc) 399 B
const swiftvg = require('../index') const inputEl = document.querySelector('[data-hook="input"]') const outputEl = document.querySelector('[data-hook="output"]') const updateOutput = (evt) => { const data = evt.target.value if (data) { outputEl.innerText = swiftvg(evt.target.value).join('\n') } else { outputEl.innerText = '' } } inputEl.addEventListener('input', updateOutput)