Use log10 scale for projected block fee graph
This commit is contained in:
		
							parent
							
								
									8b012a96f3
								
							
						
					
					
						commit
						945a8ce92e
					
				@ -74,14 +74,14 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr
 | 
				
			|||||||
    this.labelInterval = this.numSamples / this.numLabels;
 | 
					    this.labelInterval = this.numSamples / this.numLabels;
 | 
				
			||||||
    while (nextSample <= maxBlockVSize) {
 | 
					    while (nextSample <= maxBlockVSize) {
 | 
				
			||||||
      if (txIndex >= txs.length) {
 | 
					      if (txIndex >= txs.length) {
 | 
				
			||||||
        samples.push([(1 - (sampleIndex / this.numSamples)) * 100, 0]);
 | 
					        samples.push([(1 - (sampleIndex / this.numSamples)) * 100, 0.000001]);
 | 
				
			||||||
        nextSample += sampleInterval;
 | 
					        nextSample += sampleInterval;
 | 
				
			||||||
        sampleIndex++;
 | 
					        sampleIndex++;
 | 
				
			||||||
        continue;
 | 
					        continue;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      while (txs[txIndex] && nextSample < cumVSize + txs[txIndex].vsize) {
 | 
					      while (txs[txIndex] && nextSample < cumVSize + txs[txIndex].vsize) {
 | 
				
			||||||
        samples.push([(1 - (sampleIndex / this.numSamples)) * 100, txs[txIndex].rate]);
 | 
					        samples.push([(1 - (sampleIndex / this.numSamples)) * 100, txs[txIndex].rate || 0.000001]);
 | 
				
			||||||
        nextSample += sampleInterval;
 | 
					        nextSample += sampleInterval;
 | 
				
			||||||
        sampleIndex++;
 | 
					        sampleIndex++;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -118,7 +118,9 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      yAxis: {
 | 
					      yAxis: {
 | 
				
			||||||
        type: 'value',
 | 
					        type: 'log',
 | 
				
			||||||
 | 
					        min: 1,
 | 
				
			||||||
 | 
					        max: this.data.reduce((min, val) => Math.max(min, val[1]), 1),
 | 
				
			||||||
        // name: 'Effective Fee Rate s/vb',
 | 
					        // name: 'Effective Fee Rate s/vb',
 | 
				
			||||||
        // nameLocation: 'middle',
 | 
					        // nameLocation: 'middle',
 | 
				
			||||||
        splitLine: {
 | 
					        splitLine: {
 | 
				
			||||||
@ -129,12 +131,16 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        axisLabel: {
 | 
					        axisLabel: {
 | 
				
			||||||
 | 
					          show: true,
 | 
				
			||||||
          formatter: (value: number): string => {
 | 
					          formatter: (value: number): string => {
 | 
				
			||||||
            const unitValue = this.weightMode ? value / 4 : value;
 | 
					            const unitValue = this.weightMode ? value / 4 : value;
 | 
				
			||||||
            const selectedPowerOfTen = selectPowerOfTen(unitValue);
 | 
					            const selectedPowerOfTen = selectPowerOfTen(unitValue);
 | 
				
			||||||
            const newVal = Math.round(unitValue / selectedPowerOfTen.divider);
 | 
					            const newVal = Math.round(unitValue / selectedPowerOfTen.divider);
 | 
				
			||||||
            return `${newVal}${selectedPowerOfTen.unit}`;
 | 
					            return `${newVal}${selectedPowerOfTen.unit}`;
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        axisTick: {
 | 
				
			||||||
 | 
					          show: true,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      series: [{
 | 
					      series: [{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user