https://github.com/ivanseidel/noflow
A (really-simple) flow based programming framework
https://github.com/ivanseidel/noflow
Last synced: over 1 year ago
JSON representation
A (really-simple) flow based programming framework
- Host: GitHub
- URL: https://github.com/ivanseidel/noflow
- Owner: ivanseidel
- Created: 2016-02-24T19:38:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-24T19:38:55.000Z (over 10 years ago)
- Last Synced: 2025-02-14T00:54:18.537Z (over 1 year ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Box Flow
#### *A simple warpper for Flow Based Programming in Node.js*
*Note: This Library is under development. Although documentation is explained, some methods are not implemented yet.*
### Create a component:
```
var Component = {};
BoxComponent.prototype.inputs = [
[BoxPort],
[BoxPort]
];
BoxComponent.prototype.type = 'compoenent-name';
```
### Buld graph
```
var graph = new GraphComponent();
graph.addNode('node-id', 'component-name');
graph.getNode('node-id').getPort('out').connect(graph.getNode('other-node').getPort('in'));
```
### Serialized Graph
```
{
nodes: [
{
active: true,
id: 'unique-identifier',
component: 'component-name',
settings: {...},
},
{
active: true,
id: 'other-identifier',
component: 'component-name',
settings: {...},
},
{
active: false,
id: 'old-component',
component: 'othertype',
settings: {...},
},
],
ports: [
{
from: 'unique-identifier.out',
to: 'other-identifier.in',
}
],
}
```
### Load from file
```
var graph = Graph.fromJSON(json)
```
### Save to Json
```
var json = graph.toJSON();
```