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;
new SVGArrangePlugin(),
new SVGEdgeHoverPlugin(),
new SVGNodeMovePlugin({
- movementSpeed: 10
+ movementSpeed: 2
}),
new SVGPortDragPlugin(),
new SelectionPlugin(),
workflow.draw();
}
+ componentDidMount() {
+ this.setGraph();
+ }
+
+ componentDidUpdate() {
+ this.setGraph();
+ }
+
render() {
return <svg
ref={this.svgRoot}