feat(rg): add onConnect callback
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user