Skip to content

Commit

Permalink
feat: set the anchor points of all nodes to be enterable and exitable i…
Browse files Browse the repository at this point in the history
…nfiniflow#918 (infiniflow#1119)

### What problem does this PR solve?

feat: set the anchor points of all nodes to be enterable and exitable
infiniflow#918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
cike8899 authored Jun 11, 2024
1 parent eeb10e8 commit 081b143
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/src/pages/flow/canvas/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback } from 'react';
import ReactFlow, {
Background,
ConnectionMode,
Controls,
MarkerType,
NodeMouseHandler,
Expand Down Expand Up @@ -64,6 +65,7 @@ function FlowCanvas({ sideWidth, chatDrawerVisible, hideChatDrawer }: IProps) {
<div className={styles.canvasWrapper}>
<ReactFlow
ref={ref}
connectionMode={ConnectionMode.Loose}
nodes={nodes}
onNodesChange={onNodesChange}
onNodeContextMenu={onNodeContextMenu}
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/flow/canvas/node/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.textUpdaterNode {
// height: 50px;
border: 1px solid gray;
box-shadow:
-6px 0 12px 0 rgba(179, 177, 177, 0.08),
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
-6px 0 16px 6px rgba(0, 0, 0, 0.05);

padding: 5px;
border-radius: 5px;
background: white;
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/flow/canvas/node/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ export function TextUpdaterNode({
})}
>
<Handle
type="target"
id="c"
type="source"
position={Position.Left}
isConnectable={isConnectable}
className={styles.handle}
>
{/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
</Handle>
<Handle type="source" position={Position.Top} id="d" isConnectable />
<Handle
type="source"
position={Position.Right}
isConnectable={isConnectable}
className={styles.handle}
id="b"
>
{/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
</Handle>
<Handle type="source" position={Position.Bottom} id="a" isConnectable />
<div>
<Space>
<OperatorIcon
Expand Down

0 comments on commit 081b143

Please sign in to comment.