From 2c048963977349b383133f1f323c5d5f76855562 Mon Sep 17 00:00:00 2001 From: natsoni Date: Thu, 23 May 2024 18:40:48 +0200 Subject: [PATCH] Graphs loading indicators update --- .../acceleration-fees-graph.component.html | 2 +- .../block-fee-rates-graph.component.html | 2 +- .../block-fees-graph/block-fees-graph.component.html | 2 +- .../block-fees-subsidy-graph.component.ts | 1 - .../block-health-graph/block-health-graph.component.html | 2 +- .../block-rewards-graph.component.html | 2 +- .../block-sizes-weights-graph.component.html | 2 +- .../hashrate-chart/hashrate-chart.component.html | 2 +- .../hashrate-chart-pools.component.html | 2 +- .../incoming-transactions-graph.component.html | 2 +- .../incoming-transactions-graph.component.ts | 5 +---- .../mempool-graph/mempool-graph.component.html | 3 ++- .../components/mempool-graph/mempool-graph.component.ts | 4 +--- .../components/pool-ranking/pool-ranking.component.html | 4 ++-- .../app/components/statistics/statistics.component.html | 9 ++++----- .../app/components/statistics/statistics.component.scss | 5 +++++ .../app/components/statistics/statistics.component.ts | 8 +++----- 17 files changed, 27 insertions(+), 30 deletions(-) diff --git a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html index 852e92ae0..feb71903f 100644 --- a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html +++ b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html @@ -46,7 +46,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html index 9c27ecb83..684fc073d 100644 --- a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html +++ b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html @@ -63,7 +63,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/block-fees-graph/block-fees-graph.component.html b/frontend/src/app/components/block-fees-graph/block-fees-graph.component.html index 4fcbc3595..15b9d3fa3 100644 --- a/frontend/src/app/components/block-fees-graph/block-fees-graph.component.html +++ b/frontend/src/app/components/block-fees-graph/block-fees-graph.component.html @@ -37,7 +37,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts index 88d27033f..3fd7c5f46 100644 --- a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts +++ b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts @@ -98,7 +98,6 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { this.storageService.setValue('miningWindowPreference', timespan); this.timespan = timespan; this.zoomTimeSpan = timespan; - this.isLoading = true; return this.apiService.getHistoricalBlockFees$(timespan) .pipe( tap((response) => { diff --git a/frontend/src/app/components/block-health-graph/block-health-graph.component.html b/frontend/src/app/components/block-health-graph/block-health-graph.component.html index cfbee79b6..85d018f11 100644 --- a/frontend/src/app/components/block-health-graph/block-health-graph.component.html +++ b/frontend/src/app/components/block-health-graph/block-health-graph.component.html @@ -46,7 +46,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.html b/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.html index 10e6d304d..6ba32a6b1 100644 --- a/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.html +++ b/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.html @@ -38,7 +38,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.html b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.html index c21a4bebb..9a4eb9e2c 100644 --- a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.html +++ b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.html @@ -45,7 +45,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html index 4f0c76b88..30d3a7e96 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html @@ -55,7 +55,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html index e62cdd4eb..3424987c1 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.html @@ -32,7 +32,7 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.html b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.html index b3f736d34..2bbb3080e 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.html +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.html @@ -1,5 +1,5 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index a63c166d9..db76f7e67 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -32,8 +32,8 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On @Input() template: ('widget' | 'advanced') = 'widget'; @Input() windowPreferenceOverride: string; @Input() outlierCappingEnabled: boolean = false; + @Input() isLoading: boolean; - isLoading = true; mempoolStatsChartOption: EChartsOption = {}; mempoolStatsChartInitOption = { renderer: 'svg' @@ -52,8 +52,6 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On ) { } ngOnInit() { - this.isLoading = true; - this.rateUnitSub = this.stateService.rateUnits$.subscribe(rateUnits => { this.weightMode = rateUnits === 'wu'; if (this.data) { @@ -79,7 +77,6 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On if (!this.data) { return; } - this.isLoading = false; } /** diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.html b/frontend/src/app/components/mempool-graph/mempool-graph.component.html index 12b720029..155d73ecf 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.html +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.html @@ -1,4 +1,5 @@ -
+
\ No newline at end of file diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts index 1f1a0b739..63fb52a0c 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -35,8 +35,8 @@ export class MempoolGraphComponent implements OnInit, OnChanges { @Input() template: ('widget' | 'advanced') = 'widget'; @Input() showZoom = true; @Input() windowPreferenceOverride: string; + @Input() isLoading: boolean; - isLoading = true; mempoolVsizeFeesData: any; mempoolVsizeFeesOptions: EChartsOption; mempoolVsizeFeesInitOptions = { @@ -65,7 +65,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges { ) { } ngOnInit(): void { - this.isLoading = true; this.inverted = this.storageService.getValue('inverted-graph') === 'true'; this.isWidget = this.template === 'widget'; this.showCount = !this.isWidget && !this.hideCount; @@ -86,7 +85,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges { if (!this.data) { return; } - this.isLoading = false; } onChartReady(myChart: any) { diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.html b/frontend/src/app/components/pool-ranking/pool-ranking.component.html index 6753e5324..611297e1f 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.html +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.html @@ -77,14 +77,14 @@
+ (chartInit)="onChartInit($event)" [style]="{opacity: isLoading ? 0.5 : 1}">
- +
diff --git a/frontend/src/app/components/statistics/statistics.component.html b/frontend/src/app/components/statistics/statistics.component.html index fa63590b0..eeca3859e 100644 --- a/frontend/src/app/components/statistics/statistics.component.html +++ b/frontend/src/app/components/statistics/statistics.component.html @@ -21,7 +21,7 @@
-
+
-
+
@@ -94,13 +94,12 @@
-
+ [data]="mempoolStats && mempoolStats.length ? mempoolStats : null" [isLoading]="isLoading">
@@ -128,7 +127,7 @@
+ [data]="mempoolTransactionsWeightPerSecondData" [outlierCappingEnabled]="outlierCappingEnabled" [isLoading]="isLoading">
diff --git a/frontend/src/app/components/statistics/statistics.component.scss b/frontend/src/app/components/statistics/statistics.component.scss index 468d00ed7..e219edbbb 100644 --- a/frontend/src/app/components/statistics/statistics.component.scss +++ b/frontend/src/app/components/statistics/statistics.component.scss @@ -231,4 +231,9 @@ @media (max-width: 767px) { display: block; } +} + +.disabled { + pointer-events: none; + opacity: 0.5; } \ No newline at end of file diff --git a/frontend/src/app/components/statistics/statistics.component.ts b/frontend/src/app/components/statistics/statistics.component.ts index fdd5a018e..835b74227 100644 --- a/frontend/src/app/components/statistics/statistics.component.ts +++ b/frontend/src/app/components/statistics/statistics.component.ts @@ -26,8 +26,7 @@ export class StatisticsComponent implements OnInit { network = ''; - loading = true; - spinnerLoading = false; + isLoading = true; feeLevels = feeLevels; chartColors = chartColors; filterSize = 100000; @@ -90,7 +89,7 @@ export class StatisticsComponent implements OnInit { .pipe( switchMap(() => { this.timespan = this.radioGroupForm.controls.dateSpan.value; - this.spinnerLoading = true; + this.isLoading = true; if (this.radioGroupForm.controls.dateSpan.value === '2h') { this.websocketService.want(['blocks', 'live-2h-chart']); return this.apiService.list2HStatistics$(); @@ -131,8 +130,7 @@ export class StatisticsComponent implements OnInit { .subscribe((mempoolStats: any) => { this.mempoolStats = mempoolStats; this.handleNewMempoolData(this.mempoolStats.concat([])); - this.loading = false; - this.spinnerLoading = false; + this.isLoading = false; }); this.stateService.live2Chart$
Rank