fix(edges): connection line not showing up when no edges are defined

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent d730869443
commit 9abd768bce
7 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ export const groupEdgesByZLevel = (edges: GraphEdge[], nodes: GraphNode[]) => {
return tree
}, {})
return Object.entries(levelLookup).map(([key, edges]) => {
return Object.entries(Object.keys(levelLookup).length ? levelLookup : { 0: [] }).map(([key, edges]) => {
const level = +key
return {
+2 -2
View File
@@ -335,8 +335,8 @@ export const getTransformForBounds = (
export const getXYZPos = (node: GraphNode, result: XYZPosition): XYZPosition => {
if (!node.parentNode) return result
return getXYZPos(node.parentNode, {
x: result.x + node.parentNode.position.x,
y: result.y + node.parentNode.position.y,
x: result.x + node.parentNode.computedPosition.x,
y: result.y + node.parentNode.computedPosition.y,
z:
node.parentNode.computedPosition.z > node.computedPosition.z ? node.parentNode.computedPosition.z : node.computedPosition.z,
})