From 124338b8d438e22bb825f39681cbcec06d5ed392 Mon Sep 17 00:00:00 2001
From: Braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Mon, 20 Dec 2021 19:22:46 +0100
Subject: [PATCH] update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
---
examples/Basic/Basic.vue | 42 +++----
examples/CustomNode/CustomNode.vue | 5 +-
examples/Edges/CustomEdge.vue | 8 +-
examples/Edges/CustomEdge2.vue | 5 +-
examples/Edges/EdgesExample.vue | 18 ++-
examples/Nesting/Nesting.vue | 108 +++++++++++++-----
.../UpdatableEdge/UpdatableEdgeExample.vue | 5 +-
7 files changed, 124 insertions(+), 67 deletions(-)
diff --git a/examples/Basic/Basic.vue b/examples/Basic/Basic.vue
index cad84e73..9308d057 100644
--- a/examples/Basic/Basic.vue
+++ b/examples/Basic/Basic.vue
@@ -1,42 +1,44 @@
-
+
diff --git a/examples/CustomNode/CustomNode.vue b/examples/CustomNode/CustomNode.vue
index ea54ab29..7c406dca 100644
--- a/examples/CustomNode/CustomNode.vue
+++ b/examples/CustomNode/CustomNode.vue
@@ -5,13 +5,14 @@ import {
Elements,
FlowElement,
isEdge,
- MiniMap,
Node,
Position,
SnapGrid,
useNodesState,
useVueFlow,
VueFlow,
+ Controls,
+ MiniMap,
} from '~/index'
const elements = ref([])
@@ -84,7 +85,7 @@ onPaneReady((flowInstance) => {
-import { getBezierPath, getMarkerEnd, Position, EdgeProps } from '~/index'
+import { getBezierPath, getMarkerId, Position, EdgeProps } from '~/index'
interface CustomEdgeProps extends EdgeProps {
source: string
@@ -13,7 +13,7 @@ interface CustomEdgeProps extends EdgeProps {
targetY: number
sourcePosition: Position
targetPosition: Position
- markerEndId?: string
+ markerEnd?: string
data?: T
}
@@ -28,7 +28,9 @@ const edgePath = computed(() =>
targetPosition: props.targetPosition,
}),
)
-const markerEnd = computed(() => getMarkerEnd(props.markerEnd, props.markerEndId))
+console.log(props)
+const markerEnd = computed(() => getMarkerId(props.markerEnd))
+console.log(markerEnd.value)
-
-
-
-
+
+
+
+
diff --git a/examples/UpdatableEdge/UpdatableEdgeExample.vue b/examples/UpdatableEdge/UpdatableEdgeExample.vue
index 1ed6f3ad..93682a0b 100644
--- a/examples/UpdatableEdge/UpdatableEdgeExample.vue
+++ b/examples/UpdatableEdge/UpdatableEdgeExample.vue
@@ -37,8 +37,9 @@ const elements = ref(initialElements)
const onLoad = (flowInstance: FlowInstance) => flowInstance.fitView()
const onEdgeUpdateStart = (edge: Edge) => console.log('start update', edge)
const onEdgeUpdateEnd = (edge: Edge) => console.log('end update', edge)
-const onEdgeUpdate = ({ edge, connection }: FlowEvents['edgeUpdate']) =>
- (elements.value = updateEdge(edge, connection, elements.value))
+const onEdgeUpdate = ({ edge, connection }: FlowEvents['edgeUpdate']) => {
+ elements.value = updateEdge(edge, connection, elements.value)
+}
const onConnect = (params: Connection | Edge) => (elements.value = addEdge(params, elements.value))