chore(svelte): run prettier

This commit is contained in:
moklick
2023-02-28 12:48:52 +01:00
parent 62a6278682
commit dda21e1fd2
64 changed files with 1669 additions and 1646 deletions
+71 -58
View File
@@ -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 };
}