update: set zindex to 0 on initial parse

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent a50101bfd3
commit 9344365aff
+2 -2
View File
@@ -74,7 +74,7 @@ export const parseNode = (node: Node, nodeExtent: CoordinateExtent, defaults?: P
target: [], target: [],
}, },
computedPosition: { computedPosition: {
z: typeof node.style?.zIndex === 'string' ? parseInt(node.style?.zIndex as string) : node.style?.zIndex ?? 0, z: 0,
...clampPosition(node.position, nodeExtent), ...clampPosition(node.position, nodeExtent),
}, },
dragging: false, dragging: false,
@@ -100,7 +100,7 @@ export const parseEdge = (edge: Edge, defaults?: Partial<GraphEdge>): GraphEdge
type: edge.type ?? 'default', type: edge.type ?? 'default',
source: edge.source.toString(), source: edge.source.toString(),
target: edge.target.toString(), target: edge.target.toString(),
z: typeof edge.style?.zIndex === 'string' ? parseInt(edge.style?.zIndex as string) : edge.style?.zIndex ?? 0, z: 0,
sourceX: 0, sourceX: 0,
sourceY: 0, sourceY: 0,
targetX: 0, targetX: 0,