Change filters to dropdown selection menu.

This commit is contained in:
Miguel Medeiros
2021-10-06 01:08:13 -03:00
parent 86b31d0ef2
commit 8ed8ddabb4
5 changed files with 103 additions and 18 deletions

View File

@@ -45,19 +45,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
ngOnInit(): void {
this.inverted = this.storageService.getValue('inverted-graph') === 'true';
for (let i = 0; i < feeLevels.length; i++) {
if (feeLevels[i] === this.limitFee) {
this.feeLimitIndex = i;
}
if (feeLevels[i] <= this.limitFee) {
if (i === 0) {
this.feeLevelsOrdered.push('0 - 1');
} else {
this.feeLevelsOrdered.push(`${feeLevels[i - 1]} - ${feeLevels[i]}`);
}
}
}
this.chartColorsOrdered = chartColors.slice(0, this.feeLevelsOrdered.length);
this.mountFeeChart();
}
@@ -136,6 +123,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
}
mountFeeChart() {
this.orderLevels();
const { labels, series } = this.mempoolVsizeFeesData;
const seriesGraph = series.map((value: Array<number>, index: number) => {
@@ -201,7 +189,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
pageTextStyle: {
color: '#666',
},
show: (this.template === 'advanced') ? true : false,
show: false,
textStyle: {
color: '#888',
},
@@ -392,5 +380,21 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
totalValueArray: totalValueArray.reverse(),
};
}
orderLevels() {
for (let i = 0; i < feeLevels.length; i++) {
if (feeLevels[i] === this.limitFee) {
this.feeLimitIndex = i;
}
if (feeLevels[i] <= this.limitFee) {
if (i === 0) {
this.feeLevelsOrdered.push('0 - 1');
} else {
this.feeLevelsOrdered.push(`${feeLevels[i - 1]} - ${feeLevels[i]}`);
}
}
}
this.chartColorsOrdered = chartColors.slice(0, this.feeLevelsOrdered.length);
}
}