1.0.4 • Published 8 months ago

flume v1.0.4

Weekly downloads
38
License
MIT
Repository
github
Last release
8 months ago

npm.io

NPM JavaScript Style Guide Minzip Size

Flume

Guides & Examples

flume.dev

Install

npm install --save flume

Usage

Defining your nodes

Import FlumeConfig and use it to define the nodes and ports that will make up your node editor.

import { FlumeConfig, Controls, Colors } from "flume";

const flumeConfig = new FlumeConfig()

flumeConfig
  .addPortType({
    type: "number",
    name: "number",
    label: "Number",
    color: Colors.red,
    controls: [
      Controls.number({
        name: "num",
        label: "Number"
      })
    ]
  })
  .addNodeType({
    type: "number",
    label: "Number",
    initialWidth: 150,
    inputs: ports => [
      ports.number()
    ],
    outputs: ports => [
      ports.number()
    ]
  })
  .addNodeType({
    type: "addNumbers",
    label: "Add Numbers",
    initialWidth: 150,
    inputs: ports => [
      ports.number({name: "num1"}),
      ports.number({name: "num2"})
    ],
    outputs: ports => [
      ports.number({name: "result"})
    ]
  })

Rendering the node editor

To render the node editor, import NodeEditor and pass it your nodeTypes and portTypes from the configuration you created.

import React from 'react'
import { NodeEditor } from 'flume'
import config from './config'

const App = () => {

  return (
    <div style={{width: 600, height: 800}}> // Give the wrapper a width & height
      <NodeEditor
        nodeTypes={config.nodeTypes}
        portTypes={config.portTypes}
      />
    </div>
  )
}

For more complete documentation visit: flume.dev

License

MIT © chrisjpatty

1.0.4

8 months ago

1.0.2-3

9 months ago

1.0.2-4

9 months ago

1.0.2-2

1 year ago

1.0.2-1

1 year ago

1.0.2-0

1 year ago

1.0.1-0

1 year ago

0.8.1

1 year ago

0.8.2

1 year ago

1.0.0-0

2 years ago

0.7.1

2 years ago

0.8.0

2 years ago

0.6.3

3 years ago

0.6.3-2

3 years ago

0.6.3-1

3 years ago

0.6.3-0

3 years ago

0.6.2

3 years ago

0.6.1

4 years ago

0.5.2

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.0

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.7-beta.1

4 years ago

0.2.7-beta.0

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.3

4 years ago

0.1.41

4 years ago

0.1.40-beta.2

4 years ago

0.1.40-beta.1

4 years ago

0.1.40-beta.0

4 years ago

0.1.40

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.36

4 years ago

0.1.37

4 years ago

0.1.35

4 years ago

0.1.33

4 years ago

0.1.34

4 years ago

0.1.30

4 years ago

0.1.31

4 years ago

0.1.32

4 years ago

0.1.29

4 years ago

0.1.27

4 years ago

0.1.28

4 years ago

0.1.26

4 years ago

0.1.25

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.15

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.13

4 years ago

0.1.14

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago