Skip to content

Commit

Permalink
chore(examples): lint
Browse files Browse the repository at this point in the history
Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Apr 11, 2023
1 parent 4454867 commit 544fd05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ onPaneReady((instance) => instance.fitView())
function changeType() {
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'
})
}
Expand Down
20 changes: 15 additions & 5 deletions examples/vite/src/Overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,26 @@ const initialElements: Elements = [
const snapGrid: SnapGrid = [16, 16]
function nodeStrokeColor(n: Node): string {
if ((n.style as Styles)?.background) return (n.style as Styles).background as string
if (n.type === 'input') return '#0041d0'
if (n.type === 'output') return '#ff0072'
if (n.type === 'default') return '#1a192b'
if ((n.style as Styles)?.background) {
return (n.style as Styles).background as string
}
if (n.type === 'input') {
return '#0041d0'
}
if (n.type === 'output') {
return '#ff0072'
}
if (n.type === 'default') {
return '#1a192b'
}
return '#eee'
}
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'
}
Expand Down
4 changes: 3 additions & 1 deletion examples/vite/src/SnapHandle/SnappableConnectionLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => {
},
)
if (!closestNode.node) return
if (!closestNode.node) {
return
}
canSnap.value = closestNode.distance < SNAP_DISTANCE
Expand Down

2 comments on commit 544fd05

@vercel
Copy link

@vercel vercel bot commented on 544fd05 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 544fd05 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.