xujunjie 2 years ago
parent
commit
9c477bbb91
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/components/Flow/index.tsx

+ 9 - 0
src/components/Flow/index.tsx

@@ -68,6 +68,7 @@ export const Demo: React.FC<IProps> = props => {
   const onLoad: IAppLoad = async app => {
     appRef.current = app;
     graphRef.current = await app.getGraphInstance();
+    // graphRef.current.disableSnapline()
     renderGraph();
   };
 
@@ -88,11 +89,19 @@ export const Demo: React.FC<IProps> = props => {
   };
   const getConfig = () => {
     const defaultOption = {
+      grid: 1,
       mousewheel: {
         enabled: true,
         /** 将鼠标位置作为中心缩放 */
         zoomAtMousePosition: true,
       },
+      resizing: {
+        enabled: true,
+        minWidth: 0,
+        minHeight: 0,
+        preserveAspectRatio: false,
+      },
+      snapline: false
     };
     return isEdit
       ? defaultOption