chore(svelte): run prettier
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
<script lang="ts">
|
||||
import type { Node, Edge, NodeTypes } from '../lib/types';
|
||||
import SvelteFlow, { Controls, Background, BackgroundVariant, Minimap, Panel } from '../lib/index';
|
||||
import SvelteFlow, {
|
||||
Controls,
|
||||
Background,
|
||||
BackgroundVariant,
|
||||
Minimap,
|
||||
Panel
|
||||
} from '../lib/index';
|
||||
import CustomNode from '../customnodes/Custom.svelte';
|
||||
|
||||
const nodeTypes: NodeTypes = {
|
||||
custom: CustomNode,
|
||||
custom: CustomNode
|
||||
};
|
||||
|
||||
// const yNodes = 10;
|
||||
@@ -13,8 +19,6 @@
|
||||
// const nodes: Node[] = [];
|
||||
// const edges: Edge[] = [];
|
||||
|
||||
|
||||
|
||||
// let source = null;
|
||||
|
||||
// for (let y = 0; y < yNodes; y++) {
|
||||
@@ -43,61 +47,70 @@
|
||||
// }
|
||||
// }
|
||||
|
||||
let nodes: Node<{ label: string }>[] = [{
|
||||
id: '1',
|
||||
type: 'input',
|
||||
data: { label: 'Input Node' },
|
||||
position: { x: 150, y: 5 }
|
||||
}, {
|
||||
id: '2',
|
||||
type: 'default',
|
||||
data: { label: 'Node' },
|
||||
position: { x: 0, y: 150 },
|
||||
}, {
|
||||
id: 'A',
|
||||
type: 'default',
|
||||
data: { label: 'Styled with class' },
|
||||
class: 'custom-style',
|
||||
position: { x: 150, y: 150 },
|
||||
}, {
|
||||
id: '3',
|
||||
type: 'output',
|
||||
data: { label: 'Output Node' },
|
||||
position: { x: 300, y: 150 },
|
||||
},
|
||||
{
|
||||
id: 'B',
|
||||
type: 'default',
|
||||
data: { label: 'Styled with style' },
|
||||
style: 'border: 2px solid #ff5050;',
|
||||
position: { x: 450, y: 150 },
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
type: 'custom',
|
||||
data: { label: 'Custom Node' },
|
||||
position: { x: 150, y: 300 },
|
||||
}];
|
||||
let nodes: Node<{ label: string }>[] = [
|
||||
{
|
||||
id: '1',
|
||||
type: 'input',
|
||||
data: { label: 'Input Node' },
|
||||
position: { x: 150, y: 5 }
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
type: 'default',
|
||||
data: { label: 'Node' },
|
||||
position: { x: 0, y: 150 }
|
||||
},
|
||||
{
|
||||
id: 'A',
|
||||
type: 'default',
|
||||
data: { label: 'Styled with class' },
|
||||
class: 'custom-style',
|
||||
position: { x: 150, y: 150 }
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
type: 'output',
|
||||
data: { label: 'Output Node' },
|
||||
position: { x: 300, y: 150 }
|
||||
},
|
||||
{
|
||||
id: 'B',
|
||||
type: 'default',
|
||||
data: { label: 'Styled with style' },
|
||||
style: 'border: 2px solid #ff5050;',
|
||||
position: { x: 450, y: 150 }
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
type: 'custom',
|
||||
data: { label: 'Custom Node' },
|
||||
position: { x: 150, y: 300 }
|
||||
}
|
||||
];
|
||||
|
||||
let edges: Edge[] = [
|
||||
{
|
||||
id: '1-2',
|
||||
type: 'default',
|
||||
source: '1',
|
||||
target: '2',
|
||||
label: 'Edge Text'
|
||||
},
|
||||
{
|
||||
id: '1-3',
|
||||
type: 'smoothstep',
|
||||
source: '1',
|
||||
target: '3'
|
||||
},
|
||||
{
|
||||
id: '2-4',
|
||||
type: 'default',
|
||||
source: '2',
|
||||
target: '4',
|
||||
animated: true
|
||||
}
|
||||
];
|
||||
|
||||
let edges: Edge[] = [{
|
||||
id: '1-2',
|
||||
type: 'default',
|
||||
source: '1',
|
||||
target: '2',
|
||||
label: 'Edge Text'
|
||||
}, {
|
||||
id: '1-3',
|
||||
type: 'smoothstep',
|
||||
source: '1',
|
||||
target: '3'
|
||||
}, {
|
||||
id: '2-4',
|
||||
type: 'default',
|
||||
source: '2',
|
||||
target: '4',
|
||||
animated: true
|
||||
}];
|
||||
|
||||
function updateNode() {
|
||||
nodes[0].position = { x: nodes[0].position.x + 20, y: nodes[0].position.y };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user