diff --git a/docs/guide/demos/flowViewIntro/groupNode.tsx b/docs/guide/demos/flowViewIntro/groupNode.tsx new file mode 100644 index 0000000..e7831ca --- /dev/null +++ b/docs/guide/demos/flowViewIntro/groupNode.tsx @@ -0,0 +1,62 @@ +/** + * compact: true + * defaultShowCode: true + */ +import { FlowView } from '@ant-design/pro-flow'; +import useStyles from './css/index.style'; +// import { edges, nodes } from './data/data3'; + +const GroupNode = () => { + return ( +
+ ); +}; + +const nodeTypes = { GroupNode }; + +const nodes = [ + { + id: '1', + type: 'GroupNode', + position: { x: 0, y: 0 }, + zIndex: -1, + }, + { + id: '2', + position: { x: 50, y: 10 }, + parentNode: '1', + extent: 'parent', + }, + { + id: '3', + position: { x: 50, y: 190 }, + parentNode: '1', + extent: 'parent', + }, +]; + +const edges = [ + { + id: 'e1', + source: '2', + target: '3', + }, +]; + +function App() { + const { styles } = useStyles(); + + return ( +
+
+
## 参数配置
### FlowView
diff --git a/package.json b/package.json
index a9fa27f..9fd8653 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@ant-design/pro-flow",
- "version": "1.3.6",
+ "version": "1.3.7",
"description": "A React based Flow components",
"keywords": [
"flow",
diff --git a/src/FlowView/helper.tsx b/src/FlowView/helper.tsx
index fa1a917..a3cf7a7 100644
--- a/src/FlowView/helper.tsx
+++ b/src/FlowView/helper.tsx
@@ -161,6 +161,7 @@ export function getRenderEdges(edges: FlowViewEdge[]) {
} = edge;
return {
+ ...edge,
id,
source,
target,
diff --git a/src/FlowView/index.tsx b/src/FlowView/index.tsx
index c0d16ab..62ae343 100644
--- a/src/FlowView/index.tsx
+++ b/src/FlowView/index.tsx
@@ -147,6 +147,7 @@ const FlowView: React.FC