Files
vue-flow/examples/vite/src/Math/initialElements.ts
T
BraksandGitHub a8ba97331f examples: add math example (#1461)
* examples: add math example

* docs: add math example
2024-06-08 20:35:18 +02:00

35 lines
787 B
TypeScript

import type { Edge, Node } from '@vue-flow/core'
// these are some math nodes, inputs and outputs
export const initialNodes: Node[] = [
{
id: '1',
position: { x: 0, y: 0 },
type: 'value',
data: { value: 10 },
},
{
id: '2',
position: { x: 0, y: 100 },
type: 'value',
data: { value: 30 },
},
{
id: '3',
position: { x: 400, y: 35 },
type: 'operator',
data: { operator: '+' },
},
{
id: '4',
position: { x: 700, y: 40 },
type: 'result',
},
]
export const initialEdges: Edge[] = [
{ id: 'e1-3', source: '1', target: '3', animated: true, targetHandle: 'target-a' },
{ id: 'e2-3', source: '2', target: '3', animated: true, targetHandle: 'target-b' },
{ id: 'e3-4', source: '3', target: '4', animated: true },
]