Merge branch 'master' into 14452-my-account
[arvados-workbench2.git] / src / views / workflow-panel / workflow-graph.tsx
index de2903288f6e8520e6fc1beab935aab8a008a460..a2faf322fc0f41d333c0b9948620fedbecd372c4 100644 (file)
@@ -20,7 +20,7 @@ interface WorkflowGraphProps {
 export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
     private svgRoot: React.RefObject<SVGSVGElement> = React.createRef();
 
-    componentDidMount(): void {
+    setGraph() {
         const graphs = yaml.safeLoad(this.props.workflow.definition, { json: true });
 
         let workflowGraph = graphs;
@@ -37,7 +37,7 @@ export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
                 new SVGArrangePlugin(),
                 new SVGEdgeHoverPlugin(),
                 new SVGNodeMovePlugin({
-                    movementSpeed: 10
+                    movementSpeed: 2
                 }),
                 new SVGPortDragPlugin(),
                 new SelectionPlugin(),
@@ -47,6 +47,14 @@ export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
         workflow.draw();
     }
 
+    componentDidMount() {
+        this.setGraph();
+    }
+
+    componentDidUpdate() {
+        this.setGraph();
+    }
+
     render() {
         return <svg
             ref={this.svgRoot}