diff --git a/packages/@fiagram-react/playgrounds/App.tsx b/packages/@fiagram-react/playgrounds/App.tsx index 0b53c84..6c8247e 100644 --- a/packages/@fiagram-react/playgrounds/App.tsx +++ b/packages/@fiagram-react/playgrounds/App.tsx @@ -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' }, ]} /> ) diff --git a/packages/@fiagram-react/src/components/canvas/nodes/anchors/connect.tsx b/packages/@fiagram-react/src/components/canvas/nodes/anchors/connect.tsx index 1690f64..6cce2bb 100644 --- a/packages/@fiagram-react/src/components/canvas/nodes/anchors/connect.tsx +++ b/packages/@fiagram-react/src/components/canvas/nodes/anchors/connect.tsx @@ -237,7 +237,7 @@ export const ConnectAnchors: FC = (props) => { svgInfo.svg.classed(setTargetInfoClassName(node, d.direct), true) } }) - .on('mouseleave', (d) => { + .on('mouseleave', (_, d) => { svgInfo.svg.classed(setTargetInfoClassName(node, d.direct), false) }) diff --git a/packages/@fiagram-react/src/utils/uuid.ts b/packages/@fiagram-react/src/utils/uuid.ts index 2cca53a..2d8a396 100644 --- a/packages/@fiagram-react/src/utils/uuid.ts +++ b/packages/@fiagram-react/src/utils/uuid.ts @@ -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)) }