Refactor checkin: drawing (but not iterating?)

This commit is contained in:
Ian Gulliver
2019-07-03 18:27:32 +00:00
parent b91b92eef3
commit dcc8981693
5 changed files with 73 additions and 74 deletions

View File

@@ -143,6 +143,29 @@ class Layout {
max[1] - min[1] + 1,
];
}
getDrawSteps() {
let steps = [
{
type: 'size',
size: this.size,
},
];
let nodes = Array.from(this.nodesByPos_.values());
for (let i of [1, 0]) {
nodes.sort((a, b) => a.pos[i] - b.pos[i]);
}
for (let node of nodes) {
steps.push({
type: 'node',
pos: node.pos,
label: node.graphNode.label,
});
}
return steps;
}
}
<!--# include file="LayoutGroup.js" -->