0.2.18 • Published 7 years ago

vflow v0.2.18

Weekly downloads
28
License
MIT
Repository
-
Last release
7 years ago

Inspired by flow based programming. Now support browser only.

const g = vflow();

// == Nodes ==
const appStart = g.addNode({
  id: 'Start'
})

g.addNode({
  id: 'Plus',
  inPorts: ['a', 'b'],
  process: ({state, send}, portName) => {
    const { a, b } = state;
    send(a + b);
  }
})

g.addNode({
  id: 'MapTo5',
  component: 'core/Mapper',
  data: {
    map: () => 5
  }
})

// == Network ==
g.loadGraph({
  "nodes": {
    "Start": {
      "pos": "72,36,72,72"
    },
    "Plus": {
      "pos": "432,72,72,72",
      "data": {
        "a": 5
      }
    },
    "MapTo5": {
      "pos": "288,-216,72,72"
    }
  },
  "edges": [
    "Start:out -> MapTo5:in",
    "MapTo5:out -> Plus:b"
  ]
})

// == Bootstrap ==
appStart.send()

Dev

npm run start

Build (webpack production)

npm run build

0.2.18

7 years ago

0.2.17

7 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago