JSPM

react-flow-renderer

10.0.0-next.39
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 122063
  • Score
    100M100P100Q24080F
  • License MIT

Package Exports

  • react-flow-renderer
  • react-flow-renderer/dist/ReactFlow.esm.js
  • react-flow-renderer/dist/ReactFlow.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-flow-renderer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-flow

GitHub License MIT npm downloads GitHub Repo stars GitHub release (latest by date)

React Flow is a library for building node based graphs. You can easily implement custom node types and it comes with components like a mini map and graph controls.

Getting Started | Website | Documentation | Examples


Installation

npm install react-flow-renderer

Quick Start

This is a very basic example of how to use React Flow. You can find more advanced examples on the website.

import React from 'react';
import ReactFlow from 'react-flow-renderer';

const elements = [
  { id: '1', data: { label: 'Node 1' }, position: { x: 250, y: 5 } },
  // you can also pass a React component as a label
  { id: '2', data: { label: <div>Node 2</div> }, position: { x: 100, y: 100 } },
  { id: 'e1-2', source: '1', target: '2', animated: true },
];

const BasicFlow = () => <ReactFlow elements={elements} />;

Community Packages

Development

Before you start you need to install the React Flow dependencies via npm install and the ones of the examples cd example && npm install.

If you want to contribute or develop custom features the easiest way is to start the dev server:

npm start

and the example app via:

cd example && npm start 

The example app serves the content of the example folder and watches changes inside the src folder. The examples are using the source of the src folder.

Testing

Testing is done with cypress. You can find the tests in the integration/flow folder. In order to run the tests do:

npm run test