flowgraph-editor

1.0.2 • Public • Published

flowgraph-editor

NPM

Editor view for the flowgraph module.

var FlowGraph = require('flowgraph')
var FlowGraphView = require('flowgraph-editor')
 
var insertCss = require('insert-css')
 
// define your graph
graph = new FlowGraph()
graph.addNode('A', ['in'], ['out'])
graph.addNode('B') // default ports are in and out
graph.addNode('C', ['1', '2', '3'], ['stdout', 'stderr'])
graph.connect('B', 'C', 'out', '2')
 
var view = new FlowGraphView(graph)
document.body.appendChild(view.svg)
 
view.on('node-select', function (node) {
  console.log(node)
})
 
// insert default css, you can use your own as well
insertCss(FlowGraphView.css)

Readme

Keywords

Package Sidebar

Install

npm i flowgraph-editor

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • finnpauls