fix(elements): change data from outside

This commit is contained in:
moklick
2019-07-17 17:34:42 +02:00
parent a5aa78f02a
commit 1dbeebfb27
8 changed files with 59 additions and 33 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import { separateElements } from './graph-utils';
import { parseElements, separateElements } from './graph-utils';
import GraphView from './GraphView';
import { Provider } from './GraphContext';
import { createNodeTypes } from './NodeRenderer/utils';
@@ -23,7 +23,9 @@ class ReactGraph extends PureComponent {
style, onNodeClick, children, onLoad, onMove, onChange, elements
} = this.props;
const { nodes, edges } = separateElements(elements);
const { nodes, edges } = elements
.map(parseElements)
.reduce(separateElements, {});
return (
<div style={style} className="react-graph">