fix sub sat charts

This commit is contained in:
Mononaut
2025-06-23 03:22:47 +00:00
parent 90a011c67d
commit 2c27941bf2
3 changed files with 7 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
export const defaultMempoolFeeColors = [
'557d00',
'557d00',
'5d7d01',
'637d02',
@@ -40,6 +41,7 @@ export const defaultMempoolFeeColors = [
];
export const contrastMempoolFeeColors = [
'0082e6',
'0082e6',
'0984df',
'1285d9',
@@ -81,6 +83,7 @@ export const contrastMempoolFeeColors = [
];
export const chartColors = [
"#D81B60",
"#D81B60",
"#8E24AA",
"#5E35B1",
@@ -125,7 +128,7 @@ export const poolsColor = {
'unknown': '#FDD835',
};
export const feeLevels = [0, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200,
export const feeLevels = [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200,
250, 300, 350, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000];
export interface Language {

View File

@@ -153,7 +153,7 @@ export class AcceleratorDashboardComponent implements OnInit, OnDestroy {
return acceleratedColor;
} else {
const rate = tx.fee / tx.vsize; // color by simple single-tx fee rate
const feeLevelIndex = feeLevels.findIndex((feeLvl) => Math.max(1, rate) < feeLvl) - 1;
const feeLevelIndex = feeLevels.findIndex((feeLvl) => Math.max(0, rate) < feeLvl) - 1;
return this.theme.theme === 'contrast' || this.theme.theme === 'bukele' ? contrastColors[feeLevelIndex] || contrastColors[contrastColors.length - 1] : normalColors[feeLevelIndex] || normalColors[normalColors.length - 1];
}
}

View File

@@ -65,7 +65,7 @@ const defaultColors: { [key: string]: ColorPalette } = {
base: defaultMempoolFeeColors.map(hexToColor),
audit: [],
marginal: [],
baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(1, rate) < feeLvl) - 1
baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(0, rate) < feeLvl) - 1
},
}
for (const key in defaultColors) {
@@ -96,7 +96,7 @@ const contrastColors: { [key: string]: ColorPalette } = {
base: contrastMempoolFeeColors.map(hexToColor),
audit: [],
marginal: [],
baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(1, rate) < feeLvl) - 1
baseLevel: (tx: TxView, rate: number) => feeLevels.findIndex((feeLvl) => Math.max(0, rate) < feeLvl) - 1
},
}
for (const key in contrastColors) {