From a76b111365dff3d7a7391cff8e025bc7498b6c85 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 14 Oct 2021 10:54:40 +0200 Subject: [PATCH] chore(examples): add old api src --- example/.gitignore | 2 ++ example/src/Undirectional/index.tsx | 27 +++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/example/.gitignore b/example/.gitignore index 4d29575d..43d022f7 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +/src_oldapi \ No newline at end of file diff --git a/example/src/Undirectional/index.tsx b/example/src/Undirectional/index.tsx index f05ad21e..9f51296a 100644 --- a/example/src/Undirectional/index.tsx +++ b/example/src/Undirectional/index.tsx @@ -68,7 +68,7 @@ const initialElements: Elements = [ target: '01', sourceHandle: 'left', targetHandle: 'bottom', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -77,7 +77,7 @@ const initialElements: Elements = [ target: '01', sourceHandle: 'top', targetHandle: 'right', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -86,7 +86,7 @@ const initialElements: Elements = [ target: '02', sourceHandle: 'top', targetHandle: 'left', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -95,7 +95,7 @@ const initialElements: Elements = [ target: '02', sourceHandle: 'right', targetHandle: 'bottom', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -104,7 +104,7 @@ const initialElements: Elements = [ target: '03', sourceHandle: 'right', targetHandle: 'top', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -113,7 +113,7 @@ const initialElements: Elements = [ target: '03', sourceHandle: 'bottom', targetHandle: 'left', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -122,7 +122,7 @@ const initialElements: Elements = [ target: '04', sourceHandle: 'bottom', targetHandle: 'right', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -131,7 +131,7 @@ const initialElements: Elements = [ target: '04', sourceHandle: 'left', targetHandle: 'top', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -140,7 +140,7 @@ const initialElements: Elements = [ target: '10', sourceHandle: 'top', targetHandle: 'bottom', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -149,7 +149,7 @@ const initialElements: Elements = [ target: '20', sourceHandle: 'right', targetHandle: 'left', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -158,7 +158,7 @@ const initialElements: Elements = [ target: '30', sourceHandle: 'bottom', targetHandle: 'top', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, { @@ -167,7 +167,7 @@ const initialElements: Elements = [ target: '40', sourceHandle: 'left', targetHandle: 'right', - type: 'smoothstep', + type: 'default', arrowHeadType: ArrowHeadType.Arrow, }, ]; @@ -181,8 +181,7 @@ const getId = (): ElementId => `${id++}`; const UpdateNodeInternalsFlow = () => { const [elements, setElements] = useState(initialElements); - const onConnect = (params: Connection | Edge) => - setElements((els) => addEdge({ ...params, type: 'smoothstep' }, els)); + const onConnect = (params: Connection | Edge) => setElements((els) => addEdge({ ...params, type: 'default' }, els)); const { project } = useZoomPanHelper(); const onEdgeUpdate = (oldEdge: Edge, newConnection: Connection) => setElements((els) => updateEdge(oldEdge, newConnection, els));