-
Notifications
You must be signed in to change notification settings - Fork 1k
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
32 changed files
with
448 additions
and
343 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
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,8 @@ | ||
2024-12-04T00:52:39.144082Z WARN turborepo_lib::package_changes_watcher: changed_files: {AnchoredSystemPathBuf("packages/x-flow/package.json")} | ||
2024-12-04T00:52:39.144107Z WARN turborepo_lib::package_changes_watcher: changed_packages: Ok(Some({WorkspacePackage { name: Other("@xrenders/xflow"), path: AnchoredSystemPathBuf("packages/x-flow") }})) | ||
2024-12-04T00:54:43.043002Z WARN turborepo_lib::package_changes_watcher: changed_files: {AnchoredSystemPathBuf("docs/data-render/index.md")} | ||
2024-12-04T00:54:43.043046Z WARN turborepo_lib::package_changes_watcher: changed_packages: Ok(Some({WorkspacePackage { name: Root, path: AnchoredSystemPathBuf("") }})) | ||
2024-12-04T00:55:35.341519Z WARN turborepo_lib::package_changes_watcher: changed_files: {AnchoredSystemPathBuf("docs/xflow/index.md")} | ||
2024-12-04T00:55:35.341535Z WARN turborepo_lib::package_changes_watcher: changed_packages: Ok(Some({WorkspacePackage { name: Root, path: AnchoredSystemPathBuf("") }})) | ||
2024-12-04T00:56:31.240344Z WARN turborepo_lib::package_changes_watcher: changed_files: {AnchoredSystemPathBuf(".dumi/theme/slots/Header/Navigation.tsx")} | ||
2024-12-04T00:56:31.240359Z WARN turborepo_lib::package_changes_watcher: changed_packages: Ok(Some({WorkspacePackage { name: Root, path: AnchoredSystemPathBuf("") }})) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const edges = [{ source: '1', target: '2', id: '234123' }]; |
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,48 @@ | ||
import React from "react"; | ||
|
||
import XFlow, { FlowProvider, useNodes } from '@xrenders/xflow'; | ||
import { edges as initialEdges } from './edges'; | ||
import { nodes as initialNodes } from './nodes'; | ||
import settings from './setting'; | ||
|
||
const App = () => { | ||
return ( | ||
<FlowProvider> | ||
<div style={{ height: '600px' }}> | ||
<XFlow | ||
initialValues={{ nodes: initialNodes, edges: initialEdges }} | ||
settings={settings} | ||
nodeSelector={{ | ||
showSearch: true, | ||
}} | ||
/> | ||
</div> | ||
<Sidebar /> | ||
</FlowProvider> | ||
); | ||
}; | ||
|
||
function Sidebar() { | ||
// This hook will only work if the component it's used in is a child of a | ||
// <FlowProvider />. | ||
const nodes = useNodes(); | ||
|
||
return ( | ||
<aside> | ||
{nodes?.map(node => ( | ||
<div key={node.id}> | ||
Node {node.id} - x: {node.position.x.toFixed(2)}, y:{' '} | ||
{node.position.y.toFixed(2)} | ||
</div> | ||
))} | ||
</aside> | ||
); | ||
} | ||
|
||
export default () => { | ||
return ( | ||
<FlowProvider> | ||
<App /> | ||
</FlowProvider> | ||
); | ||
}; |
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,20 @@ | ||
export const nodes = [ | ||
{ | ||
id: '1', | ||
type: 'Start', | ||
data: {}, | ||
position: { | ||
x: 40, | ||
y: 240, | ||
}, | ||
}, | ||
{ | ||
id: '2', | ||
type: 'End', | ||
data: {}, | ||
position: { | ||
x: 500, | ||
y: 240, | ||
}, | ||
}, | ||
]; |
File renamed without changes.
This file was deleted.
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 was deleted.
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
Oops, something went wrong.