Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

planar-graph-to-svg

1.0.0 • Public • Published

planar-graph-to-svg

Converts a planar graph to an SVG string

Example

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

install

npm i planar-graph-to-svg

Downloadsweekly downloads

5

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar