Add visualization to mined blocks

This commit is contained in:
Mononaut
2022-06-14 16:39:37 +00:00
parent 225decd286
commit 7f4c6352ba
8 changed files with 366 additions and 140 deletions

View File

@@ -15,6 +15,8 @@ export class BlockOverviewGraphComponent implements AfterViewInit {
@Input() isLoading: boolean;
@Input() resolution: number;
@Input() blockLimit: number;
@Input() orientation = 'left';
@Input() flip = true;
@Output() txPreviewEvent = new EventEmitter<TransactionStripped | void>();
@ViewChild('blockCanvas')
@@ -67,9 +69,9 @@ export class BlockOverviewGraphComponent implements AfterViewInit {
}
}
replace(transactions: TransactionStripped[], direction: string): void {
replace(transactions: TransactionStripped[], direction: string, sort: boolean = true): void {
if (this.scene) {
this.scene.replace(transactions, direction);
this.scene.replace(transactions || [], direction, sort);
}
}
@@ -139,8 +141,9 @@ export class BlockOverviewGraphComponent implements AfterViewInit {
if (this.scene) {
this.scene.resize({ width: this.displayWidth, height: this.displayHeight });
} else {
this.scene = this.scene = new BlockScene({ width: this.displayWidth, height: this.displayHeight, resolution: this.resolution,
blockLimit: this.blockLimit, vertexArray: this.vertexArray });
this.scene = new BlockScene({ width: this.displayWidth, height: this.displayHeight, resolution: this.resolution,
blockLimit: this.blockLimit, orientation: this.orientation, flip: this.flip, vertexArray: this.vertexArray });
this.start();
}
}