tiny updates to internal library examples

This commit is contained in:
peterkogo
2024-06-17 11:57:15 +02:00
parent e6b21d372e
commit 42f4f59425
3 changed files with 14 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ const defaultNodes: Node[] = [
},
{
id: '3',
type: 'output',
data: { label: 'Node 3' },
position: { x: 400, y: 100 },
className: 'light',

View File

@@ -28,6 +28,14 @@ const initialNodes: Node[] = [
data: { label: 'A Node' },
position: { x: 250, y: 0 },
},
{
id: '3',
type: 'b',
sourcePosition: Position.Right,
targetPosition: Position.Left,
data: { label: 'B Node' },
position: { x: 350, y: 0 },
},
];
const buttonStyle: CSSProperties = {
@@ -78,6 +86,7 @@ const NodeTypeChangeFlow = () => {
onEdgesChange={onEdgesChange}
onConnect={onConnect}
nodeTypes={nodeTypesObjects[nodeTypesId]}
fitView
>
<button onClick={changeType} style={buttonStyle}>
change type

View File

@@ -1,9 +1,12 @@
import { useKeyPress } from '@xyflow/react';
import { useEffect } from 'react';
const UseKeyPressComponent = () => {
const metaPressed = useKeyPress(['Meta']);
console.log({ metaPressed });
useEffect(() => {
console.log({ metaPressed });
}, [metaPressed]);
return <div />;
};