* docs(readme): add plugin section

* refactor(examples): use func components

* docs(readme): format

* refactor: NodeRenderer (#51)

* refactor: NodeRenderer

* fix getNodesInside partially param

* add `skipInvisible` prop

* refactor(noderenderer): rename skipInvisble to onlyRenderVisibleNodes

closes #40
This commit is contained in:
Moritz
2019-10-22 21:03:48 +02:00
committed by GitHub
parent 8ca5c0f84b
commit f85f2f8c9a
17 changed files with 402 additions and 2493 deletions
+27 -1
View File
@@ -1,6 +1,6 @@
# :ocean: React Flow
React library for rendering an interactive node-based flow editor
React library for building node-based graphs.
# Installation
@@ -8,6 +8,27 @@ React library for rendering an interactive node-based flow editor
npm install github:wbkd/react-flow
```
# Usage
This is a very basic example of how to use react-flow. There are more advanced examples in the [example](/example/src) folder.
```javascript
import React from 'react';
import Graph from 'react-flow';
const elements = [
{ id: '1', data: { label: 'Node 1' }, position: { x: 250, y: 5 } },
{ id: '2', data: { label: 'Node 2' }, position: { x: 100, y: 100 } },
{ id: 'e1-2', source: '1', target: '2', animated: true },
];
const graphStyles = { width: '100%', height: '100%' };
const BasicGraph = () => (
<Graph elements={elements} style={graphStyles} />
);
```
# Props
- `elements`: array with nodes and edges
@@ -29,3 +50,8 @@ npm install github:wbkd/react-flow
- `backgroundType`: background type = `dots` or `lines`
- `snapToGrid`: boolean
- `snapGrid`: [x, y] array
# Plugins
- Mini map
- Controls: zoom & fit view