refactor(examples): cleanup

This commit is contained in:
moklick
2020-07-27 12:36:47 +02:00
parent a436260a1c
commit cbc41f244e
4 changed files with 30 additions and 19 deletions
+6 -5
View File
@@ -41,9 +41,13 @@ const initialElements = [
labelBgStyle: { fill: '#eee', fillOpacity: 0.7 },
arrowHeadType: 'arrowclosed',
},
{ id: 'e5-8', source: '5', target: '8', type: 'custom', label: 'custom edge' },
{ id: 'e5-8', source: '5', target: '8', type: 'custom', data: { text: 'custom edge' } },
];
const edgeTypes = {
custom: CustomEdge,
};
const EdgesFlow = () => {
const [elements, setElements] = useState(initialElements);
@@ -57,12 +61,9 @@ const EdgesFlow = () => {
onElementsRemove={onElementsRemove}
onConnect={onConnect}
onNodeDragStop={onNodeDragStop}
style={{ width: '100%', height: '100%' }}
onLoad={onLoad}
snapToGrid={true}
edgeTypes={{
custom: CustomEdge,
}}
edgeTypes={edgeTypes}
>
<MiniMap />
<Controls />