Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/planar-graph-to-svg
Convert a planar graph to an SVG image
https://github.com/mikolalysenko/planar-graph-to-svg
Last synced: 6 days ago
JSON representation
Convert a planar graph to an SVG image
- Host: GitHub
- URL: https://github.com/mikolalysenko/planar-graph-to-svg
- Owner: mikolalysenko
- License: mit
- Created: 2015-03-09T17:32:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-09T17:41:55.000Z (almost 10 years ago)
- Last Synced: 2024-12-16T22:35:26.653Z (9 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
planar-graph-to-svg
===================
Converts a planar graph to an SVG string# Example
```javascript
var toSVG = require('planar-graph-to-svg')
var ch = require('convex-hull')
var points = []
for(var i=0; i<100; ++i) {
points.push([Math.random(), Math.random()])
}
console.log(toSVG(ch(points), points))
```Output:
# Install
```
npm i planar-graph-to-svg
```# API
#### `var svg = require('planar-graph-to-svg')(edges,positions[,options])`
* `edges` is an array of oriented edges for the planar graph
* `positions` is an array of vertex positions
* `options` is an array of options for the planar graph**Returns** An SVG string encoding the planar graph
# License
(c) 2015 Mikola Lysenko. MIT License