All Projects β†’ pmros β†’ graflow

pmros / graflow

Licence: MIT license
A graph stream library for Javascript

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to graflow

Flow View
is a visual editor for Dataflow programming
Stars: ✭ 148 (+179.25%)
Mutual labels:  data-flow, dataflow-programming
Redux First History
πŸŽ‰ Redux First History - Redux history binding support react-router - @reach/router - wouter
Stars: ✭ 163 (+207.55%)
Mutual labels:  data-flow
React In Patterns Cn
React in patterns δΈ­ζ–‡η‰ˆ
Stars: ✭ 1,107 (+1988.68%)
Mutual labels:  data-flow
Pipedream
Connect APIs, remarkably fast. Free for developers.
Stars: ✭ 2,068 (+3801.89%)
Mutual labels:  data-flow
Fluxor
Unidirectional Data Flow in Swift πŸš€ based on Combine 🚜
Stars: ✭ 87 (+64.15%)
Mutual labels:  data-flow
React In Patterns
A free book that talks about design patterns/techniques used while developing with React.
Stars: ✭ 10,948 (+20556.6%)
Mutual labels:  data-flow
Sidecar
Some old C++ code I developed while at MIT. Could be useful if you have an old radar lying around.
Stars: ✭ 20 (-62.26%)
Mutual labels:  data-flow
Reactpatterns
React patterns & techniques to use in development for React Developer βš› .
Stars: ✭ 201 (+279.25%)
Mutual labels:  data-flow
Refraction
A guard that represents a central point of control in your application
Stars: ✭ 151 (+184.91%)
Mutual labels:  data-flow
Asakusafw
Asakusa Framework
Stars: ✭ 114 (+115.09%)
Mutual labels:  data-flow
Cyclow
A reactive frontend framework for JavaScript
Stars: ✭ 105 (+98.11%)
Mutual labels:  data-flow
Cleanarchitecture
Android Kotlin Clean Architecture
Stars: ✭ 94 (+77.36%)
Mutual labels:  data-flow
Ngx Model
Angular Model. Simple state management with minimalistic API, one way data flow, multiple model support and immutable data exposed as RxJS Observable.
Stars: ✭ 137 (+158.49%)
Mutual labels:  data-flow
Goflow
Flow-based and dataflow programming library for Go (golang)
Stars: ✭ 1,276 (+2307.55%)
Mutual labels:  data-flow
N8n
Free and open fair-code licensed node based Workflow Automation Tool. Easily automate tasks across different services.
Stars: ✭ 19,252 (+36224.53%)
Mutual labels:  data-flow
Datakit
Connect processes into powerful data pipelines with a simple git-like filesystem interface
Stars: ✭ 951 (+1694.34%)
Mutual labels:  data-flow
Dffml
The easiest way to use Machine Learning. Mix and match underlying ML libraries and data set sources. Generate new datasets or modify existing ones with ease.
Stars: ✭ 123 (+132.08%)
Mutual labels:  data-flow
Dnai.Editor
Dnai Editor - Visual Scripting (Node Editor)
Stars: ✭ 117 (+120.75%)
Mutual labels:  dataflow-programming
Cenit
πŸš€ Cenit IO - 100% open source integration Platform (iPaaS)
Stars: ✭ 186 (+250.94%)
Mutual labels:  data-flow
Programl
Graph-based Program Representation & Models for Deep Learning
Stars: ✭ 102 (+92.45%)
Mutual labels:  data-flow

graflow

npm version Standard - JavaScript Style Guide Build Status

graflow is a stream library for Javascript where flow is defined as a graph. It's small and has no dependencies.

Why graflow?

There are many stream libraries for Javascript, for example RxJS, most, bacon. They are very good but most of them don't support cycles in stream flow. So if you need a cycle, you need a proxy or a workaround like that (see cycle). However cycles aren't something strange in graflow, since you define stream flow like a graph.

On the other hand, most stream libraries use to define data flow through method chaining. graflow defines data flow declaratively, through a data structure: a graph. And you can apply many transformations or opeations to a graph, for example, you could convert the graph into a diagram or apply automatic optimizatins or verifications.

Installation

graflow is packaged as an UMD module and you can find it at npm repository. It works on node.js and moder browsers.

You can use at node.js

npm install graflow

or at your browser through bower

bower install graflow

or loading graph.js or graph.min.js (/dist directory) directly

<script src="graflow.min.js"></script>

Usage

graflow is a set of component factories, that is functions that return a new component. By convention, every factory name is capitalized. Don't use new keyword with graflow factories.

You can think about a component like a blackbox that receive async signals and outputs async signals. It's like a microchip in a electric circuit.

A component example:

  import { Component, Mapper, Filter } from 'graflow'

  const myComponent = Component({
    components: {
      inc: Mapper(v => v + 1),
      limit: Filter(v => v <= 5)
    },
    connections: [
      ['in', 'inc'],
      ['inc', 'limit'],
      ['limit', 'out'],
      ['limit', 'inc']
    ]
  })

  myComponent.on(console.log)
  myComponent.send(2)

Try it online! The result is:

  3
  4
  5

myComponent receive an input (2) and emit values up to 5. It doesn't look awesome, I know. But this is just little example. The important things here are:

  • Async inputs/outputs (from, item).
  • Cycles easily made (inc->limit->inc).
  • Declarative way: a graph (inputs, outputs, components are nodes, connections are edges).
  • Easy to compose (map and filter are just components, like myComponent).
  • Easy to sketch graphically.

example diagram

Note that previous example can be coded in a shorter way:

  import Component from 'graflow'

  const myComponent = Component((v, next) => {
    for(let i = v+1; i<=5; i++) next(i)
  })

  myComponent.on(console.log)
  myComponent.send(2)

More examples.

Component

A graflow component is an object with async inputs and outputs (also called ports). Every component has at least a default input and a default output.

You can send messages to component with send method:

  • send(port, value): port is the name of the input you send the value.
  • send(value): send to default input.
  • send(): send default value {} to default input.

You can listen to component outputs with on method:

  • on(port, listener): port is the name of the output that listener function is listenning.
  • on(listener): listen to default output.

API

Logger(options={})

Creates a component that takes the input (default input), logs it and finally outputs it (default output).

Arguments:

  • options:
    • log: A function that takes the input value (default: console.log).
    • prefix: If specified, a value passed to log function before the input value.

Projects using graflow

TODO

  • Better documentation
  • A logo
  • An easier way to define connections
  • More component factories
  • More tests
  • Performance tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].