Skip to content

Commit

Permalink
fix: fixed edge link error
Browse files Browse the repository at this point in the history
  • Loading branch information
ylzon committed May 12, 2024
1 parent 16aef55 commit b531714
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/@fiagram-react/playgrounds/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const App: FC = () => {
},
]}
nodes={[
{ id: '1', x: 100, y: 150, shape: 'node1', width: 50, height: 50, label: 'Node 1' },
{ id: '2', x: 200, y: 250, shape: 'node1', width: 50, height: 50, label: 'Node 2' },
{ id: '3', x: 300, y: 350, shape: 'node1', width: 50, height: 50, label: 'Node 3' },
{ id: 'node1', x: 100, y: 150, shape: 'node1', width: 50, height: 50, label: 'Node 1' },
{ id: 'node2', x: 200, y: 250, shape: 'node1', width: 50, height: 50, label: 'Node 2' },
{ id: 'node3', x: 300, y: 350, shape: 'node1', width: 50, height: 50, label: 'Node 3' },
]}
edges={[
{ id: '1', type: 'broken-rounded', source: '1', sourceDirection: 'bottom', target: '2', targetDirection: 'top', label: 'Link 1' },
{ id: '2', type: 'broken-rounded', source: '2', sourceDirection: 'bottom', target: '3', targetDirection: 'top', label: 'Link 2' },
{ id: 'link1', type: 'broken-rounded', source: 'node1', sourceDirection: 'bottom', target: 'node2', targetDirection: 'top', label: 'Link 1' },
{ id: 'link2', type: 'broken-rounded', source: 'node2', sourceDirection: 'bottom', target: 'node3', targetDirection: 'top', label: 'Link 2' },
]}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const ConnectAnchors: FC<IProps> = (props) => {
svgInfo.svg.classed(setTargetInfoClassName(node, d.direct), true)
}
})
.on('mouseleave', (d) => {
.on('mouseleave', (_, d) => {
svgInfo.svg.classed(setTargetInfoClassName(node, d.direct), false)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/@fiagram-react/src/utils/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function uuid() {
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, c =>
return '100080000000000'.replace(/[018]/g, c =>
(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16))
}

0 comments on commit b531714

Please sign in to comment.