Spaces:
Build error
Build error
Create src/App.js
Browse files- src/App.js +30 -0
src/App.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import ReactFlow from 'reactflow';
|
| 3 |
+
|
| 4 |
+
import 'reactflow/dist/style.css';
|
| 5 |
+
|
| 6 |
+
const initialNodes = [
|
| 7 |
+
{
|
| 8 |
+
id: '1',
|
| 9 |
+
type: 'input',
|
| 10 |
+
data: { label: 'Hello' },
|
| 11 |
+
position: { x: 250, y: 0 },
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
id: '2',
|
| 15 |
+
data: { label: 'World' },
|
| 16 |
+
position: { x: 250, y: 100 },
|
| 17 |
+
},
|
| 18 |
+
];
|
| 19 |
+
|
| 20 |
+
const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];
|
| 21 |
+
|
| 22 |
+
const App = () => {
|
| 23 |
+
return (
|
| 24 |
+
<div style={{ width: '100%', height: '500px' }}>
|
| 25 |
+
<ReactFlow nodes={initialNodes} edges={initialEdges} />
|
| 26 |
+
</div>
|
| 27 |
+
);
|
| 28 |
+
};
|
| 29 |
+
|
| 30 |
+
export default App;
|