Update accelerating pie chart in real time
This commit is contained in:
		
							parent
							
								
									07a0850f99
								
							
						
					
					
						commit
						e144e139b7
					
				| @ -10,10 +10,10 @@ | ||||
|       </td> | ||||
|       <td class="field-value" [class]="chartPositionLeft ? 'chart-left' : ''"> | ||||
|         <div class="effective-fee-container"> | ||||
|           @if (accelerationInfo?.acceleratedFeeRate && (!tx.effectiveFeePerVsize || accelerationInfo.acceleratedFeeRate >= tx.effectiveFeePerVsize)) { | ||||
|           @if (accelerationInfo?.acceleratedFeeRate && (!effectiveFeeRate || accelerationInfo.acceleratedFeeRate >= effectiveFeeRate)) { | ||||
|             <app-fee-rate class="oobFees" [fee]="accelerationInfo.acceleratedFeeRate"></app-fee-rate> | ||||
|           } @else { | ||||
|             <app-fee-rate class="oobFees" [fee]="tx.effectiveFeePerVsize"></app-fee-rate> | ||||
|             <app-fee-rate class="oobFees" [fee]="effectiveFeeRate"></app-fee-rate> | ||||
|           } | ||||
|         </div> | ||||
|       </td> | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| import { Component, ChangeDetectionStrategy, Input, Output, OnChanges, SimpleChanges, EventEmitter } from '@angular/core'; | ||||
| import { Component, ChangeDetectionStrategy, Input, Output, OnChanges, SimpleChanges, EventEmitter, ChangeDetectorRef } from '@angular/core'; | ||||
| import { Transaction } from '../../../interfaces/electrs.interface'; | ||||
| import { Acceleration, SinglePoolStats } from '../../../interfaces/node-api.interface'; | ||||
| import { EChartsOption, PieSeriesOption } from '../../../graphs/echarts'; | ||||
| @ -23,7 +23,8 @@ function toRGB({r,g,b}): string { | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush, | ||||
| }) | ||||
| export class ActiveAccelerationBox implements OnChanges { | ||||
|   @Input() tx: Transaction; | ||||
|   @Input() acceleratedBy?: number[]; | ||||
|   @Input() effectiveFeeRate?: number; | ||||
|   @Input() accelerationInfo: Acceleration; | ||||
|   @Input() miningStats: MiningStats; | ||||
|   @Input() pools: number[]; | ||||
| @ -41,10 +42,12 @@ export class ActiveAccelerationBox implements OnChanges { | ||||
|   timespan = ''; | ||||
|   chartInstance: any = undefined; | ||||
| 
 | ||||
|   constructor() {} | ||||
|   constructor( | ||||
|     private cd: ChangeDetectorRef, | ||||
|   ) {} | ||||
| 
 | ||||
|   ngOnChanges(changes: SimpleChanges): void { | ||||
|     const pools = this.pools || this.accelerationInfo?.pools || this.tx.acceleratedBy; | ||||
|     const pools = this.pools || this.accelerationInfo?.pools || this.acceleratedBy; | ||||
|     if (pools && this.miningStats) { | ||||
|       this.prepareChartOptions(pools); | ||||
|     } | ||||
| @ -132,6 +135,7 @@ export class ActiveAccelerationBox implements OnChanges { | ||||
|         } | ||||
|       ] | ||||
|     }; | ||||
|     this.cd.markForCheck(); | ||||
|   } | ||||
| 
 | ||||
|   onChartInit(ec) { | ||||
|  | ||||
| @ -670,7 +670,7 @@ | ||||
| <ng-template #acceleratingRow> | ||||
|   <tr> | ||||
|     <td rowspan="2" colspan="2" style="padding: 0;"> | ||||
|       <app-active-acceleration-box [tx]="tx" [accelerationInfo]="accelerationInfo" [miningStats]="miningStats" [hasCpfp]="hasCpfp" (toggleCpfp)="showCpfpDetails = !showCpfpDetails" [chartPositionLeft]="isMobile"></app-active-acceleration-box> | ||||
|       <app-active-acceleration-box [acceleratedBy]="tx.acceleratedBy" [effectiveFeeRate]="tx.effectiveFeePerVsize" [accelerationInfo]="accelerationInfo" [miningStats]="miningStats" [hasCpfp]="hasCpfp" (toggleCpfp)="showCpfpDetails = !showCpfpDetails" [chartPositionLeft]="isMobile"></app-active-acceleration-box> | ||||
|     </td> | ||||
|   </tr> | ||||
|   <tr></tr> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user