Git Product home page Git Product logo

visualize's Introduction

NoFlo: Flow-based programming for JavaScript

NoFlo is an implementation of flow-based programming for JavaScript running on both Node.js and the browser. From WikiPedia:

In computer science, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.

Developers used to the Unix philosophy should be immediately familiar with FBP:

This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

It also fits well in Alan Kay's original idea of object-oriented programming:

I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).

NoFlo components can be written in any language that transpiles down to JavaScript, including ES6. The system is heavily inspired by J. Paul Morrison's book Flow-Based Programming.

Read more at https://noflojs.org/.

Suitability

NoFlo is not a web framework or a UI toolkit. It is a way to coordinate and reorganize data flow in any JavaScript application. As such, it can be used for whatever purpose JavaScript can be used for. We know of NoFlo being used for anything from building web servers and build tools, to coordinating events inside GUI applications, driving robots, or building Internet-connected art installations.

Tools and ecosystem

NoFlo itself is just a library for implementing flow-based programs in JavaScript. There is an ecosystem of tools around NoFlo and the fbp protocol that make it more powerful. Here are some of them:

  • Flowhub -- browser-based visual programming IDE for NoFlo and other flow-based systems
  • noflo-nodejs -- command-line interface for running NoFlo programs on Node.js
  • noflo-browser-app -- template for building NoFlo programs for the web
  • noflo-assembly -- industrial approach for designing NoFlo programs
  • fbp-spec -- data-driven tests for NoFlo and other FBP environments
  • flowtrace -- tool for retroactive debugging of NoFlo programs. Supports visual replay with Flowhub

See also the list of reusable NoFlo modules on NPM.

Requirements and installing

NoFlo is available for Node.js via NPM, so you can install it with:

$ npm install noflo --save

You can make a browser build of NoFlo using webpack. For webpack builds, you need configure the component loader statically with noflo-component-loader. For projects using Grunt, grunt-noflo-browser plugin makes this easy.

Installing from Git

NoFlo requires a reasonably recent version of Node.js, and some npm packages. Ensure that you have NoFlo checked out from Git, and all NPM dependencies installed. Build NoFlo with:

$ npm run build

Then you can install everything needed by a simple:

$ npm link

NoFlo is available from GitHub under the MIT license.

Changes

Please refer to the Release Notes and the CHANGES.md document.

Usage

Please refer to http://noflojs.org/documentation/. For visual programming with NoFlo, see https://docs.flowhub.io/.

Development

NoFlo development happens on GitHub. Just fork the main repository, make modifications and send a pull request.

We have an extensive suite of tests available for NoFlo. Run them with:

$ npm run build
$ npm test

Platform-specific tests

By default, the tests are run for both Node.js and the browser. You can also run only the tests for a particular target platform:

$ npm run test:node

or:

$ npm run test:browser

Discussion

There is a #noflo channel on the Flow-Based Programming Slack, and questions can be posted with the noflo tag on Stack Overflow. See http://noflojs.org/support/ for other ways to get in touch.

visualize's People

Contributors

automata avatar bergie avatar forresto avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visualize's Issues

Errors with a simple net

Example of a net:

P1(C1) OUT -> IN P2(C2)
P2 OUT -> IN P3(C3)

Result:

Invariant Violation: replaceState(...): Cannot update during an existing state transition (such as within render). This could potentially cause an infinite loop so it is forbidden.

An in-range update of fbp is breaking the build 🚨

Version 1.7.0 of fbp was just published.

Branch Build failing 🚨
Dependency fbp
Current Version 1.6.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

fbp is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 23 commits.

  • 4a87a60 Release 1.7.0
  • eac460d Merge pull request #88 from flowbased/annotations
  • dbb4660 Move newline matching to a named rule
  • 9f15f3d Include node names in data validation errors
  • 0ce2fcd Clean up tests and ensure node names are there
  • 65214c1 Fix FBP serialization in case sensitive mode
  • bd28c52 Document annotations
  • c629173 Add test to verify that multiple arrayport connections on same line are fine, fixes #19
  • 2219408 Allow whitespace in annotation values
  • 8d80841 Move prop check to separate test case
  • 86e3d3b Check properties with roundtrip
  • 55120c7 Add parsing and serialization for annotations
  • 0944d2d We now provide default values
  • 265476d Name is inside props
  • 43e5797 Export textual properties as annotations

There are 23 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Some scanning errors in visualize

4 problems that jumped out at me when I tried visualize (added as per discussion with @bergie and @oleksandr):

  • It doesn't seem to support the "flow" convention that has been in .fbp notation from the start, e.g. A OUT -> IN B OUT -> IN C
  • it doesn't support array notation. e.g. A OUT[0] -> IN B . Well, it doesn't object, but it doesn't show the index on the diagram
  • ENTER both splits lines and starts the display, so you have to make sure the cursor is at the end of the network definition - sounds like it needs a Send button!
  • It doesn't recognize a process without a component name - for top-down design you have to be able to just say Gen OUT -> IN Sort OUT... etc.

Plus one minor one:

  • visualize lowercases port names. However I had understood from @bergie (maybe I misunderstood) that NoFlo only lowercases when generating JSON. I guess it doesn't matter much as I believe that port names are case-insensitive, but it would be nice to see on the diagram what you actually typed in (same applies to array notation)!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.