refactor(parsedata): destruct data

This commit is contained in:
moklick
2019-08-06 16:41:58 +02:00
parent fbbd0a93ba
commit 59cd72ddef
5 changed files with 46 additions and 39 deletions
+14 -12
View File
@@ -29835,21 +29835,23 @@
};
var parseElement = function parseElement(e) {
e.type = e.type || 'default';
if (isEdge(e)) {
e.id = e.id ? e.id.toString() : getEdgeId(e);
return e;
return _objectSpread2({}, e, {
type: e.type || 'default',
id: e.id ? e.id.toString() : getEdgeId(e)
});
}
e.id = e.id.toString();
e.__rg = {
position: e.position,
width: null,
height: null,
handleBounds: {}
};
return _objectSpread2({}, e);
return _objectSpread2({}, e, {
id: e.id.toString(),
type: e.type || 'default',
__rg: {
position: e.position,
width: null,
height: null,
handleBounds: {}
}
});
};
var getBoundingBox = function getBoundingBox(nodes) {
var bbox = nodes.reduce(function (res, node) {