update: a couple more perfomance related updates

* check for selected value inside Node instead of the wrapping renderer
* instead of "parsing" elements just return the current store.elements object
* use map funct to find index

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-19 15:41:00 +01:00
parent 08b9afb502
commit f92c5462bf
7 changed files with 49 additions and 51 deletions
+12 -7
View File
@@ -41,13 +41,18 @@ const type = (edge: TEdge) => {
<svg :width="dimensions.width" :height="dimensions.height" class="vue-flow__edges">
<MarkerDefinitions :color="props.arrowHeadColor" />
<g :transform="transform">
<template v-for="edge of store.getEdges" :key="edge.id">
<Edge :edge="edge" :type="type(edge)" :marker-end-id="props.markerEndId" :edge-updater-radius="props.edgeUpdaterRadius">
<template #default="edgeProps">
<slot :name="`edge-${edge.type}`" v-bind="edgeProps"></slot>
</template>
</Edge>
</template>
<Edge
v-for="edge of store.getEdges"
:key="edge.id"
:edge="edge"
:type="type(edge)"
:marker-end-id="props.markerEndId"
:edge-updater-radius="props.edgeUpdaterRadius"
>
<template #default="edgeProps">
<slot :name="`edge-${edge.type}`" v-bind="edgeProps"></slot>
</template>
</Edge>
<ConnectionLine
v-if="connectionLineVisible && sourceNode"
:source-node="sourceNode"