MCPcopy Index your code
hub / github.com/bhagatsaurabh/flow-connect

github.com/bhagatsaurabh/flow-connect @v2.0.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.7 ↗ · + Follow
880 symbols 1,930 edges 71 files 12 documented · 1% updated 48d agov2.0.7 · 2023-06-24★ 38
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FlowConnect logo

Build & Deploy status npm bundle size npm GitHub last commit

FlowConnect is a highly-customizable library for creating node-based editors, graphs and diagrams.

\ \ \ :globe_with_meridians: Docs

:mag: Guide

:books: API \

Installation

NPM or Yarn

npm i flow-connect
yarn add flow-connect

CDN

<script src="https://cdn.jsdelivr.net/npm/flow-connect@latest/dist/flow-connect.js"></script>

Example Usage

ESM

Note: Seperate dependency required for '@flow-connect/*' packages, check flow-connect-standard-nodes monorepo for further details.

import { FlowConnect, Vector } from "flow-connect";

Example

const flowConnect = new FlowConnect(canvasElement);

const flow = flowConnect.createFlow({ name: "New Flow" }, rules: {});

const timer = flow.createNode('common/timer', Vector.create(50, 50), {
  state: { delay: 500 },
});
const log = flow.createNode('common/log', Vector.create(250, 100), {});

timer.outputs[0].connect(log.inputs[0]);

flowConnect.render(flow);
flow.start();

Testing

Run unit tests using Jest

npm run test

Build

Build UMD, ESM and CommonJS modules

npm run build

or

npm run build:cjs
npm run build:esm
npm run build:umd

Docs

Develop & Build docs using VuePress

Develop Docs

npm run docs:dev

Build Docs

npm run docs:build

Local development

All the local development setup is pre-configured under /dev with tools that provides seamless development experience.

FlowConnect logo

  • Create a new script that you want to test in dev/scripts/examples

  • Run local developement setup

npm run dev
  • All the scripts defined in above directory will be available to test

Feedback

Feel free to send any feedback on saurabhbhagat98die@gmail.com

MIT licensed

Copyright © 2021-present | Saurabh Bhagat

Extension points exported contracts — how you extend this code

Serializable (Interface)
(no doc) [8 implementers]
src/common/interfaces.ts
CanvasRenderingContext2D (Interface)
(no doc)
src/flow-connect.ts
SubFlowNodeOptions (Interface)
(no doc)
src/core/subflow-node.ts
InputStyle (Interface)
(no doc)
src/ui/input.ts
Renderable (Interface)
(no doc) [4 implementers]
src/common/interfaces.ts
SerializedSubFlowNode (Interface)
(no doc)
src/core/subflow-node.ts
InputOptions (Interface)
(no doc)
src/ui/input.ts
Events (Interface)
(no doc) [2 implementers]
src/common/interfaces.ts

Core symbols most depended-on inside this repo

create
called by 131
src/core/flow.ts
connect
called by 107
src/core/graph.ts
on
called by 99
src/core/hooks.ts
forEach
called by 90
src/utils/linked-list.ts
call
called by 90
src/core/hooks.ts
createNode
called by 51
src/core/flow.ts
assign
called by 47
src/core/vector.ts
get
called by 36
src/utils/linked-list.ts

Shape

Method 501
Function 176
Class 104
Interface 87
Enum 12

Languages

TypeScript100%

Modules by API surface

src/core/node.ts68 symbols
src/flow-connect.ts67 symbols
src/core/terminal.ts37 symbols
src/ui/ui-node.ts32 symbols
src/core/flow.ts32 symbols
src/core/vector.ts30 symbols
src/common/interfaces.ts27 symbols
src/ui/envelope.ts25 symbols
src/core/group.ts25 symbols
dev/scripts/examples/sample.js25 symbols
src/core/graph.ts24 symbols
src/utils/lexer.ts21 symbols

For agents

$ claude mcp add flow-connect \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact