feat(rg): add onConnect callback

This commit is contained in:
moklick
2019-07-29 18:18:27 +02:00
parent cc14c724d0
commit 8fb45f4894
26 changed files with 434 additions and 120 deletions
+6
View File
@@ -14,8 +14,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;
@@ -23,6 +28,7 @@ export const parseElements = e => {
return {
...e,
id: e.id.toString(),
__rg: {
position: e.position,
width: null,