-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
74 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import type { Node, NodeTypes } from "reactflow"; | ||
import { PositionLoggerNode } from "./PositionLoggerNode"; | ||
import type { NodeTypes } from '@xyflow/react'; | ||
|
||
export const initialNodes = [ | ||
{ id: "a", type: "input", position: { x: 0, y: 0 }, data: { label: "wire" } }, | ||
import { PositionLoggerNode } from './PositionLoggerNode'; | ||
import { AppNode } from './types'; | ||
|
||
export const initialNodes: AppNode[] = [ | ||
{ id: 'a', type: 'input', position: { x: 0, y: 0 }, data: { label: 'wire' } }, | ||
{ | ||
id: "b", | ||
type: "position-logger", | ||
id: 'b', | ||
type: 'position-logger', | ||
position: { x: -100, y: 100 }, | ||
data: { label: "drag me!" }, | ||
data: { label: 'drag me!' }, | ||
}, | ||
{ id: "c", position: { x: 100, y: 100 }, data: { label: "your ideas" } }, | ||
{ id: 'c', position: { x: 100, y: 100 }, data: { label: 'your ideas' } }, | ||
{ | ||
id: "d", | ||
type: "output", | ||
id: 'd', | ||
type: 'output', | ||
position: { x: 0, y: 200 }, | ||
data: { label: "with React Flow" }, | ||
data: { label: 'with React Flow' }, | ||
}, | ||
] satisfies Node[]; | ||
]; | ||
|
||
export const nodeTypes = { | ||
"position-logger": PositionLoggerNode, | ||
'position-logger': PositionLoggerNode, | ||
// Add any of your custom nodes here! | ||
} satisfies NodeTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { Node, BuiltInNode } from '@xyflow/react'; | ||
|
||
export type PositionLoggerNode = Node<{ label: string }, 'position-logger'>; | ||
export type AppNode = BuiltInNode | PositionLoggerNode; |