Skip to content

Commit b019387

Browse files
Update packages/compass-data-modeling/src/components/diagram-editor.tsx
Co-authored-by: Anna Henningsen <[email protected]>
1 parent 66534e7 commit b019387

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/compass-data-modeling/src/components/diagram-editor.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,12 @@ const DiagramEditor: React.FunctionComponent<{
219219
'LEFT_RIGHT'
220220
);
221221
onApplyInitialLayout(
222-
positionedNodes.reduce((obj, node) => {
223-
obj[node.id] = [node.position.x, node.position.y];
224-
return obj;
225-
}, {} as Record<string, [number, number]>)
222+
Object.fromEntries(
223+
positionedNodes.map((node) => [
224+
node.id,
225+
[node.position.x, node.position.y],
226+
])
227+
)
226228
);
227229
} catch (err) {
228230
log.error(

0 commit comments

Comments
 (0)