1.0.4 • Published 2 years ago

flume v1.0.4

Weekly downloads
38
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.0.2-3

2 years ago

1.0.2-4

2 years ago

1.0.2-2

2 years ago

1.0.2-1

2 years ago

1.0.2-0

2 years ago

1.0.1-0

2 years ago

0.8.1

2 years ago

0.8.2

2 years ago

1.0.0-0

3 years ago

0.7.1

3 years ago

0.8.0

3 years ago

0.6.3

4 years ago

0.6.3-2

4 years ago

0.6.3-1

4 years ago

0.6.3-0

4 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.5.2

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.0

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.7-beta.1

5 years ago

0.2.7-beta.0

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.3

5 years ago

0.1.41

5 years ago

0.1.40-beta.2

5 years ago

0.1.40-beta.1

5 years ago

0.1.40-beta.0

5 years ago

0.1.40

5 years ago

0.1.39

5 years ago

0.1.38

5 years ago

0.1.36

5 years ago

0.1.37

5 years ago

0.1.35

5 years ago

0.1.33

5 years ago

0.1.34

5 years ago

0.1.30

5 years ago

0.1.31

5 years ago

0.1.32

5 years ago

0.1.29

5 years ago

0.1.27

5 years ago

0.1.28

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.15

5 years ago

0.1.16

5 years ago

0.1.17

5 years ago

0.1.13

5 years ago

0.1.14

5 years ago

0.1.11

5 years ago

0.1.12

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago