balibabu commited on
Commit
97cc326
·
1 Parent(s): f277af2

feat: change nodes to circular #918 (#1279)

Browse files

### What problem does this PR solve?
feat: change nodes to circular #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

web/src/pages/flow/canvas/node/index.less CHANGED
@@ -1,5 +1,4 @@
1
  .ragNode {
2
- // height: 50px;
3
  position: relative;
4
  box-shadow:
5
  -6px 0 12px 0 rgba(179, 177, 177, 0.08),
@@ -9,6 +8,16 @@
9
  padding: 5px;
10
  border-radius: 5px;
11
  background: white;
 
 
 
 
 
 
 
 
 
 
12
  label {
13
  display: block;
14
  color: #777;
@@ -17,6 +26,17 @@
17
  .description {
18
  font-size: 10px;
19
  }
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
  .selectedNode {
22
  border: 1px solid rgb(59, 118, 244);
 
1
  .ragNode {
 
2
  position: relative;
3
  box-shadow:
4
  -6px 0 12px 0 rgba(179, 177, 177, 0.08),
 
8
  padding: 5px;
9
  border-radius: 5px;
10
  background: white;
11
+ width: 100px;
12
+ height: 100px;
13
+ border-radius: 50%;
14
+ display: flex;
15
+ // align-items: center;
16
+ // justify-self: center;
17
+ justify-content: center;
18
+ .nodeName {
19
+ font-size: 8px;
20
+ }
21
  label {
22
  display: block;
23
  color: #777;
 
26
  .description {
27
  font-size: 10px;
28
  }
29
+ .bottomBox {
30
+ position: absolute;
31
+ bottom: -24px;
32
+ background: white;
33
+ padding: 2px 5px;
34
+ border-radius: 5px;
35
+ box-shadow:
36
+ -6px 0 12px 0 rgba(179, 177, 177, 0.08),
37
+ -3px 0 6px -4px rgba(0, 0, 0, 0.12),
38
+ -6px 0 16px 6px rgba(0, 0, 0, 0.05);
39
+ }
40
  }
41
  .selectedNode {
42
  border: 1px solid rgb(59, 118, 244);
web/src/pages/flow/canvas/node/index.tsx CHANGED
@@ -3,7 +3,7 @@ import { Handle, NodeProps, Position } from 'reactflow';
3
 
4
  import OperateDropdown from '@/components/operate-dropdown';
5
  import { CopyOutlined } from '@ant-design/icons';
6
- import { Flex, MenuProps, Space, Typography } from 'antd';
7
  import { useCallback } from 'react';
8
  import { useTranslation } from 'react-i18next';
9
  import { Operator, operatorMap } from '../../constant';
@@ -12,8 +12,6 @@ import OperatorIcon from '../../operator-icon';
12
  import useGraphStore from '../../store';
13
  import styles from './index.less';
14
 
15
- const { Text } = Typography;
16
-
17
  export function RagNode({
18
  id,
19
  data,
@@ -73,21 +71,22 @@ export function RagNode({
73
  {/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
74
  </Handle>
75
  <Handle type="source" position={Position.Bottom} id="a" isConnectable />
76
- <Flex gap={10} justify={'space-between'}>
77
  <Space size={6}>
78
  <OperatorIcon
79
  name={data.label as Operator}
80
- fontSize={12}
81
  ></OperatorIcon>
82
- <span>{id}</span>
 
 
 
 
 
83
  </Space>
84
- <OperateDropdown
85
- iconFontSize={14}
86
- deleteItem={deleteNode}
87
- items={items}
88
- ></OperateDropdown>
89
  </Flex>
90
- <div>
91
  <Text
92
  ellipsis={{ tooltip: description }}
93
  style={{ width: 130 }}
@@ -95,7 +94,10 @@ export function RagNode({
95
  >
96
  {description}
97
  </Text>
98
- </div>
 
 
 
99
  </section>
100
  );
101
  }
 
3
 
4
  import OperateDropdown from '@/components/operate-dropdown';
5
  import { CopyOutlined } from '@ant-design/icons';
6
+ import { Flex, MenuProps, Space } from 'antd';
7
  import { useCallback } from 'react';
8
  import { useTranslation } from 'react-i18next';
9
  import { Operator, operatorMap } from '../../constant';
 
12
  import useGraphStore from '../../store';
13
  import styles from './index.less';
14
 
 
 
15
  export function RagNode({
16
  id,
17
  data,
 
71
  {/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
72
  </Handle>
73
  <Handle type="source" position={Position.Bottom} id="a" isConnectable />
74
+ <Flex vertical align="center" justify="center">
75
  <Space size={6}>
76
  <OperatorIcon
77
  name={data.label as Operator}
78
+ fontSize={16}
79
  ></OperatorIcon>
80
+ {/* {data.label} */}
81
+ <OperateDropdown
82
+ iconFontSize={14}
83
+ deleteItem={deleteNode}
84
+ items={items}
85
+ ></OperateDropdown>
86
  </Space>
87
+ {/* <div className={styles.nodeName}>{id}</div> */}
 
 
 
 
88
  </Flex>
89
+ {/* <div>
90
  <Text
91
  ellipsis={{ tooltip: description }}
92
  style={{ width: 130 }}
 
94
  >
95
  {description}
96
  </Text>
97
+ </div> */}
98
+ <section className={styles.bottomBox}>
99
+ <div className={styles.nodeName}>{id}</div>
100
+ </section>
101
  </section>
102
  );
103
  }