docs(readme): dev section

This commit is contained in:
Moritz
2020-05-11 22:57:26 +02:00
committed by GitHub
parent f8507fff51
commit 4730ab06b1
+8 -7
View File
@@ -56,7 +56,7 @@ const elements = [
const graphStyles = { width: '100%', height: '100%' }; const graphStyles = { width: '100%', height: '100%' };
const BasicGraph = () => ( const BasicFlow = () => (
<ReactFlow elements={elements} style={graphStyles} /> <ReactFlow elements={elements} style={graphStyles} />
); );
``` ```
@@ -109,8 +109,8 @@ The same applies to the nodes (className: `react-flow__node`) and edges (classNa
You could achieve the same effect by passing a style prop to the React Flow component: You could achieve the same effect by passing a style prop to the React Flow component:
``` ```javascript
<ReactFlow elements={element} style={{ background: 'red', width: '100%' height: '300px' }}/> <ReactFlow elements={element} style={{ background: 'red', width: '100%' height: '300px' }} />
``` ```
@@ -260,7 +260,7 @@ The control panel contains a zoom-in, zoom-out, fit-view and a lock/unlock butto
```javascript ```javascript
import ReactFlow, { Controls } from 'react-flow-renderer'; import ReactFlow, { Controls } from 'react-flow-renderer';
const GraphWithControls = () => ( const FlowWithControls = () => (
<ReactFlow <ReactFlow
elements={elements} elements={elements}
> >
@@ -292,13 +292,15 @@ You can find all examples in the [example](example) folder or check out the live
## Development ## Development
If you want to contribute or develop some custom features the easiest way is to start the dev server: First of all you need to install the React Flow dependencies `npm install` and the ones of the examples `cd example && npm install`.
If you want to contribute or develop some custom features the easiest way is to start the dev server.
``` ```
npm run dev npm run dev
``` ```
This serves the content of the `examples` folder and watches changes inside the `src` folder. The examples are using the source of the `src` folder. This 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
@@ -308,7 +310,6 @@ Testing is done with cypress. You can find all test in the [`integration/flow`](
npm run test npm run test
``` ```
## Thanks! ## Thanks!
Special thanks to [Andy Lindemann](https://github.com/AndyLnd) for a lot of helpful contributions! Special thanks to [Andy Lindemann](https://github.com/AndyLnd) for a lot of helpful contributions!