An open API service indexing awesome lists of open source software.

https://github.com/dawee/svg-flat-document

Parse and manipulate to a flat SVG object
https://github.com/dawee/svg-flat-document

Last synced: 2 months ago
JSON representation

Parse and manipulate to a flat SVG object

Awesome Lists containing this project

README

          

# SVGFlatDocument

ES6 SVG document without tree (flat)

## Install

```
npm install svg-flat-document
```

## Usage

## Parse from SVG string

```js
import SVGFlatDocument from 'svg-flat-document';

let doc = SVGFlatDocument.parse(svgString);
```

*With svgString =*

```xml



```

## Retreive element

```js

let node = doc.mapping.me;
let attr = node.attributes;

console.log(attr.x, attr.y, attr.width, attr.height);
// 0 0 100 200

console.log(attr.transform);
// matrix(1,0,0,1,100,0)

```

So groups are ignored and children absorb every parents transforms.