Files
fa-diagrams/README.md
T
Clément GOUIN 682e84914c svg list build
2019-07-10 11:03:26 +02:00

58 lines
1.2 KiB
Markdown

[![Build Status](https://img.shields.io/travis/Klemek/fa-diagrams.svg?branch=master)](https://travis-ci.org/Klemek/fa-diagrams)
[![Coverage Status](https://img.shields.io/coveralls/github/Klemek/fa-diagrams.svg?branch=master)](https://coveralls.io/github/Klemek/fa-diagrams?branch=master)
# fa-diagrams
## (WIP) SVG diagrams built from Font-Awesome icons
## Build from sources
You will need subversion installed (used for precise folder fetching in GitHub)
```
git clone https://github.com/klemek/fa-diagrams.git
cd fa-diagrams
npm install
node build.sh
```
## Usage
How to use (theorically)
```javascript
const diag = require('fa-diagrams');
const data = {
options: {
font: 'Courier New'
},
nodes: [
{
name: 'node1',
icon: 'server',
bottom: {text: 'myserver' },
top: {icon: 'node'}
},
{
name: 'node2',
icon: 'globe',
bottom: {text: 'world'}
}
],
links: [
{
from: 'node1',
to: 'node2',
bottom: {text: 'Hello World!'}
}
]
};
const svg = diag.compute(data); // string containing xml data
```
Will produce the following diagram :
![sample](sample.png)