refactor(core): allow setting handleId in useNodeConnections (#1732)

* refactor(core): allow setting handleId in useNodeConnections

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): deprecate useHandleConnections

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(examples): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(docs): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(docs): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2025-01-07 17:57:22 +01:00
parent 268ed0e84e
commit 3d1b85fce2
12 changed files with 122 additions and 114 deletions

View File

@@ -1,15 +1,15 @@
<script setup lang="ts">
import type { NodeProps } from '@vue-flow/core'
import { Handle, useHandleConnections } from '@vue-flow/core'
import { Handle, useNodeConnections } from '@vue-flow/core'
import type { ProcessNodeData } from './types'
const props = defineProps<NodeProps<ProcessNodeData>>()
const sourceConnections = useHandleConnections({
const sourceConnections = useNodeConnections({
type: 'target',
})
const targetConnections = useHandleConnections({
const targetConnections = useNodeConnections({
type: 'source',
})

View File

@@ -1,13 +1,13 @@
<script setup lang="ts">
import type { GraphNode } from '@vue-flow/core'
import { Handle, Position, useHandleConnections, useNodeConnections, useNodesData } from '@vue-flow/core'
import { Handle, Position, useNodeConnections, useNodesData } from '@vue-flow/core'
import type { OperatorNodeData, ValueNodeData } from './types'
import { mathFunctions } from './utils'
defineProps<{ id: string }>()
// Get the source connections of the result node. In this example it's only one operator node.
const sourceConnections = useHandleConnections({
const sourceConnections = useNodeConnections({
// type target means all connections where *this* node is the target
// that means we go backwards in the graph to find the source of the connection(s)
type: 'target',