This commit is contained in:
1 parent
128c5c6f4e
commit
46175efe1b
3 files changed
+253
-19
No files matched your search
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
class MockElkRuntime {
|
||||
layoutSync(graph) {
|
||||
const children = Array.isArray(graph?.children) ? [...graph.children] : [];
|
||||
const positioned = children.map((node, idx) => {
|
||||
const col = idx % 4;
|
||||
const row = Math.floor(idx / 4);
|
||||
return {
|
||||
...node,
|
||||
x: 120 + col * 260,
|
||||
y: 100 + row * 200
|
||||
};
|
||||
});
|
||||
return {
|
||||
id: graph?.id ?? "root",
|
||||
children: positioned,
|
||||
edges: Array.isArray(graph?.edges) ? graph.edges : []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MockElkRuntime;
|
||||
Reference in new issue
Block a user