All Projects → fibo → Flow View

fibo / Flow View

Licence: mit
is a visual editor for Dataflow programming

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Flow View

graflow
A graph stream library for Javascript
Stars: ✭ 53 (-64.19%)
Mutual labels:  data-flow, dataflow-programming
Htmlrenderer
C# HTML Layout and HTML Rendering Engine
Stars: ✭ 143 (-3.38%)
Mutual labels:  svg
Svg
Useful SVGs
Stars: ✭ 137 (-7.43%)
Mutual labels:  svg
Plutovg
Tiny 2D vector graphics library in C
Stars: ✭ 141 (-4.73%)
Mutual labels:  svg
Javafbp
Java Implementation of Flow-Based Programming (FBP)
Stars: ✭ 138 (-6.76%)
Mutual labels:  dataflow-programming
Drawbot
Drawing robot capable of rendering SVG paths over WebSockets. Powered by a Raspberry Pi running Node.js.
Stars: ✭ 142 (-4.05%)
Mutual labels:  svg
Flowchart Vue
flowchart的vue版本
Stars: ✭ 136 (-8.11%)
Mutual labels:  svg
Vivid
a JavaScript library which is built to easily customize and use the SVG Icons with a blaze.
Stars: ✭ 1,797 (+1114.19%)
Mutual labels:  svg
Coreui Icons
CoreUI Free Icons - Premium designed free icon set with marks in SVG, Webfont and raster formats
Stars: ✭ 1,813 (+1125%)
Mutual labels:  svg
Ijsvg
MacOS SVG rendering and exporting library
Stars: ✭ 139 (-6.08%)
Mutual labels:  svg
Svglib
Read SVG files and convert them to other formats.
Stars: ✭ 139 (-6.08%)
Mutual labels:  svg
Styled Icons
💅 Popular icon packs like Font Awesome, Material Design, and Octicons, available as React Styled Components
Stars: ✭ 1,878 (+1168.92%)
Mutual labels:  svg
Pyecharts Snapshot
renders the output of pyecharts as png, jpeg, gif, svg, eps, pdf and raw base64
Stars: ✭ 142 (-4.05%)
Mutual labels:  svg
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 (-7.43%)
Mutual labels:  data-flow
Svglite
A lightweight svg graphics device for R
Stars: ✭ 143 (-3.38%)
Mutual labels:  svg
Svgren
📷 SVG rendering library in C++
Stars: ✭ 136 (-8.11%)
Mutual labels:  svg
Circle Flags
A collection of 300+ minimal circular SVG country flags
Stars: ✭ 139 (-6.08%)
Mutual labels:  svg
Alien.js
Future web pattern
Stars: ✭ 141 (-4.73%)
Mutual labels:  svg
Gantt
Gantt chart library using jsx support SVG, Canvas and SSR
Stars: ✭ 148 (+0%)
Mutual labels:  svg
Svg Banners
Styled banners for your Readme made with html/css in SVG !!
Stars: ✭ 145 (-2.03%)
Mutual labels:  svg

flow-view

is a visual editor for Dataflow programming

Installation | API | Graph schema | License

NPM version Dependency Status JavaScript Style Guide

Basic usage

Installation

Using npm

With npm do

npm install flow-view

Using a CDN

Adding this to your HTML page

<link rel="stylesheet" href="https://unpkg.com/flow-view/dist/flow-view.min.css">
<script type="module">
  import { FlowViewCanvas } from 'https://unpkg.com/flow-view/dist/flow-view.min.js'

  // Your code here.
</script>

API

FlowViewCanvas constructor

Suppose your container is a div with id drawing. In your HTML, place a div where you want to mount flow-view canvas.

<style>
  #drawing { height: 400px; }
</style>

<div id="drawing"></div>

Create an empty canvas.

const container = document.getElementById('drawing')

const canvas = new FlowViewCanvas(container)

It is supposed to use a FlowViewCanvas graphically; nevertheless you can create nodes, links, inputs and outputs programmatically. For example:

const node1 = canvas.createNode({ x: 20, y: 50, text: 'Drag me' })
const node2 = canvas.createNode({ x: 100, y: 100, text: 'I am a node' })

const link = canvas.createLink()

const source1 = node1.createOutput()
const target1 = node2.createInput()

canvas.connect(source1).to(link)
canvas.connect(target1).to(link)

loadGraph

You can load a graph using the loadGraph method, like in the following example.

const graph = {
  nodes: [
    {
      id: 'a', x: 80, y: 100, text: 'Drag me',
      outs: [ { id: 'out1' }, { id: 'out2' }, { id: 'out3' } ]
    },
    {
      id: 'b', x: 180, y: 200, text: 'Click me',
      ins: [ { id: 'in1' }, { id: 'in2' } ],
      outs: [ { id: 'out4' } ]
    }
  ],
  links: [
    { id: 'c', from: 'out1', to: 'in1' }
  ]
}

canvas.loadGraph(graph)

getGraph

Get the canvas graph using the getGraph method which returns an object, you can then serialize into JSON.

const graph = canvas.getGraph()

console.log(JSON.stringify(graph))

Graph schema

This section defines flow-view JSON Schema using cson. It is parsed by markdown2code to generate flow-view schema.json file.

$schema: 'http://json-schema.org/schema#'
id: 'http://g14n.info/flow-view/schema.json'
properties:

A flow-view graph has links and nodes.

Nodes

A graph can have none, one or many nodes.

  nodes:
    type: 'array'
    items:

Every node must have a unique id.

      title: 'nodes'
      type: 'object'
      properties:
        id:
          type: 'string'

A node has a text.

        text:
          type: 'string'

A node has a position identified by x and y coordinates.

        x:
          type: 'number'
        y:
          type: 'number'

A node at the end is a block with inputs and outputs. Both ins and outs must have an id.

        ins:
          type: 'array'
          items:
            title: 'inputs'
            type: 'object'
            properties:
              id:
                type: 'string'
            required: [
              'id'
            ]
        outs:
          type: 'array'
          items:
            title: 'outputs'
            type: 'object'
            properties:
              id:
                type: 'string'
            required: [
              'id'
            ]

Properties ins and outs are not required. A node with ins not defined is a root, a node with outs not defined is a leaf.

      required: [
        'id'
        'text'
        'x'
        'y'
      ]

Links

A graph can have none, one or many links.

  links:
    type: 'array'
    items:

Every link must have a unique id.

      title: 'links'
      type: 'object'
      properties:
        id:
          type: 'string'

A link connects two nodes, in particular connects an output of a node to an input of another node.

It starts from a node output, where from holds the output id.

        from:
          type: 'string'

It goes to a node input, where to holds the input id.

        to:
          type: 'string'

All properties are required.

      required: [
        'id'
        'from'
        'to'
      ]

License

MIT

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].