chore(examples): lint
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -31,7 +31,9 @@ onPaneReady((instance) => instance.fitView())
|
|||||||
|
|
||||||
function changeType() {
|
function changeType() {
|
||||||
elements.value.forEach((el) => {
|
elements.value.forEach((el) => {
|
||||||
if (isEdge(el) || el.type === 'input') return
|
if (isEdge(el) || el.type === 'input') {
|
||||||
|
return
|
||||||
|
}
|
||||||
el.type = el.type === 'default' ? 'output' : 'default'
|
el.type = el.type === 'default' ? 'output' : 'default'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,16 +120,26 @@ const initialElements: Elements = [
|
|||||||
const snapGrid: SnapGrid = [16, 16]
|
const snapGrid: SnapGrid = [16, 16]
|
||||||
|
|
||||||
function nodeStrokeColor(n: Node): string {
|
function nodeStrokeColor(n: Node): string {
|
||||||
if ((n.style as Styles)?.background) return (n.style as Styles).background as string
|
if ((n.style as Styles)?.background) {
|
||||||
if (n.type === 'input') return '#0041d0'
|
return (n.style as Styles).background as string
|
||||||
if (n.type === 'output') return '#ff0072'
|
}
|
||||||
if (n.type === 'default') return '#1a192b'
|
if (n.type === 'input') {
|
||||||
|
return '#0041d0'
|
||||||
|
}
|
||||||
|
if (n.type === 'output') {
|
||||||
|
return '#ff0072'
|
||||||
|
}
|
||||||
|
if (n.type === 'default') {
|
||||||
|
return '#1a192b'
|
||||||
|
}
|
||||||
|
|
||||||
return '#eee'
|
return '#eee'
|
||||||
}
|
}
|
||||||
|
|
||||||
function nodeColor(n: Node): string {
|
function nodeColor(n: Node): string {
|
||||||
if ((n.style as Styles)?.background) return (n.style as Styles).background as string
|
if ((n.style as Styles)?.background) {
|
||||||
|
return (n.style as Styles).background as string
|
||||||
|
}
|
||||||
|
|
||||||
return '#fff'
|
return '#fff'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!closestNode.node) return
|
if (!closestNode.node) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
canSnap.value = closestNode.distance < SNAP_DISTANCE
|
canSnap.value = closestNode.distance < SNAP_DISTANCE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user