Skip to content

Commit 82cccbd

Browse files
committed
Take rule into account when calculating tableau visualization node width (#79)
1 parent 495f3f1 commit 82cccbd

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

frontend/src/app/annotate/tableau-svg/tableau-node.component.svg

Lines changed: 1 addition & 1 deletion
Loading

frontend/src/app/annotate/tableau-svg/tableau-node.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export class TableauNode {
4242
@ViewChild('argsText')
4343
argsText?: ElementRef<SVGTextElement>;
4444

45+
@ViewChild('ruleText')
46+
ruleText?: ElementRef<SVGTextElement>;
47+
4548
@Output()
4649
public onSize = new EventEmitter<Dimensions>();
4750

@@ -65,12 +68,16 @@ export class TableauNode {
6568
this.headW = this.headText ? this.headText.nativeElement.getComputedTextLength() : 0;
6669
this.headX = this.modX + this.modW;
6770
this.argsX = this.headX + this.headW + this.padding;
68-
this.totalW = (
71+
72+
const mainW = (
6973
this.headText ?
7074
this.argsW + this.idW + this.headW + this.modW :
7175
0
7276
);
7377

78+
const ruleW = this.ruleText ? this.ruleText.nativeElement.getComputedTextLength() : 0;
79+
this.totalW = Math.max(mainW, ruleW)
80+
7481
this.onSize.emit({width: this.totalW, height: this.height});
7582
}
7683

0 commit comments

Comments
 (0)