Draw group borders

This commit is contained in:
Ian Gulliver
2019-07-04 06:42:05 +00:00
parent 9a4e90de51
commit b86994093b
4 changed files with 58 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
class LayoutNode {
constructor(graphNode, nodesByPos, pos) {
this.graphNode = graphNode;
this.graphNode_ = graphNode;
this.nodesByPos_ = nodesByPos;
this.pos = pos;
@@ -9,7 +9,7 @@ class LayoutNode {
resolveAffinity(nodesByGraphNode) {
this.affinity_ = [];
for (let aff of this.graphNode.affinity) {
for (let aff of this.graphNode_.affinity) {
this.affinity_.push({
node: nodesByGraphNode.get(aff.node),
distanceToWeight: aff.distanceToWeight,
@@ -65,4 +65,12 @@ class LayoutNode {
restorePos() {
this.moveTo(this.savedPos_);
}
getStep() {
return {
type: 'node',
pos: this.pos,
label: this.graphNode_.label,
};
}
}