tiny updates to internal library examples
This commit is contained in:
@@ -25,6 +25,7 @@ const defaultNodes: Node[] = [
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
type: 'output',
|
||||
data: { label: 'Node 3' },
|
||||
position: { x: 400, y: 100 },
|
||||
className: 'light',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user