https://github.com/ektx/sto
svg to object
https://github.com/ektx/sto
json svg
Last synced: 3 months ago
JSON representation
svg to object
- Host: GitHub
- URL: https://github.com/ektx/sto
- Owner: ektx
- Created: 2017-04-28T07:23:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T06:10:30.000Z (about 8 years ago)
- Last Synced: 2025-06-06T11:06:42.091Z (about 1 year ago)
- Topics: json, svg
- Language: JavaScript
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# S.T.O
SVG to Object
使 SVG 转换成可以使用的 JSON 格式代码
### 说明
目前支持属性有:
`path` `polygon` 对其进行整理输出
示例: 将以下代码复制到左侧的文本框
```html
```
点击 Go ,得到
```js
[
{
"x": 0,
"y": 2,
"width": 14,
"height": 12,
"type": "path",
"d": "M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"
}
]
```