1.0.7 • Published 2 years ago
@chocolate-pie/vopa-js v1.0.7
Set SVG Obejct Element (rect
, circle
, polygon
, polyline
, eclipse
, line
) to SVG Path Element (path). The following attributes are inherited when converting to SVG Path Element (path): fill
,stroke
, stroke-width
, style
Tags | Attributes |
---|---|
rect | x y width height |
circle | cx cy r |
polygon | points |
polyline | points |
eclipse | rx ry cx cy |
line | x1 y1 x2 y2 |
| x y font-size ( Not Required. default: 30 ) |
VopaCreate(svgPath, (err, res) => {
// function
})
import VopaCreate from '@chocolate-pie/vopa-js'
VopaCreate('<svg xmlns="http://www.w3c.org/2000/svg"><rect x="20" y="20" width="20" height="20" /></svg>', (err, res) => {
console.log(res)
})
// => <svg xmlns="http://www.w3c.org/2000/svg"><path d="M 20,20 l 0,20l -20,0 l 0 -20 Z"></path></svg>
git clone https://github.com/chocolate-pie/vopa-js.git
cd vopa-js
npm install
npm run dev