Merge branch 'master' of github.com:wbkd/react-graph

This commit is contained in:
moklick
2019-07-29 22:11:58 +02:00
34 changed files with 43948 additions and 102 deletions
+6
View File
@@ -23,8 +23,13 @@ export const removeElements = (elements, elementsToRemove) => {
});
};
let internalNodeId = 0;
const getId = () => internalNodeId++;
export const parseElements = e => {
e.type = e.type || 'default';
e.id = e.id ? e.id : getId();
if (isEdge(e)) {
return e;
@@ -32,6 +37,7 @@ export const parseElements = e => {
return {
...e,
id: e.id.toString(),
__rg: {
position: e.position,
width: null,