Skip to content

chingloong/flowgraph-editor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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)

About

View for the flowgraph module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.1%
  • CSS 9.9%