Difficulty

This commit is contained in:
raja.blaze 2019-08-07 13:44:06 +05:30
commit f033512ed3
7 changed files with 50 additions and 33 deletions

View File

@ -1221,7 +1221,7 @@ export class BlockchainBlockController {
response.status(200).json({ response.status(200).json({
status: 200, status: 200,
timestamp: Date.now(), timestamp: Date.now(),
message: 'Total Difficulty and Blocks Data fetched Successfully', message: 'Difficulty and Blocks Data fetched Successfully',
response: { response: {
Date: date, Date: date,
// DifficultyCuckaroo: DifficultyCuckaroo, // DifficultyCuckaroo: DifficultyCuckaroo,

View File

@ -34,6 +34,7 @@
"MINUTE" : "minute", "MINUTE" : "minute",
"BLOCKS_PER_PAGE" : "Blöcke pro Seite", "BLOCKS_PER_PAGE" : "Blöcke pro Seite",
"TOTAL_DIFFICULTY" : "Gesamtschwierigkeit", "TOTAL_DIFFICULTY" : "Gesamtschwierigkeit",
"TARGET_DIFFICULTY" : "Zielschwierigkeit",
"TRANSACTIONS_BY_TIME" : "Transaktionen im Zeitverlauf", "TRANSACTIONS_BY_TIME" : "Transaktionen im Zeitverlauf",
"BLOCKS" : "Blöcke", "BLOCKS" : "Blöcke",
"BLOCK" : "Block", "BLOCK" : "Block",

View File

@ -34,6 +34,7 @@
"BLOCKS_PER_PAGE" : "Blocks per page", "BLOCKS_PER_PAGE" : "Blocks per page",
"MINUTE" : "minute", "MINUTE" : "minute",
"TOTAL_DIFFICULTY" : "Total Difficulty", "TOTAL_DIFFICULTY" : "Total Difficulty",
"TARGET_DIFFICULTY" : "Target Difficulty",
"TRANSACTIONS_BY_TIME" : "Transactions over time", "TRANSACTIONS_BY_TIME" : "Transactions over time",
"BLOCKS" : "Blocks", "BLOCKS" : "Blocks",
"BLOCK" : "Block", "BLOCK" : "Block",

View File

@ -14,24 +14,35 @@
<div class="day_filter" *ngIf="this.title!='Transactions over time'"> <div class="day_filter" *ngIf="this.title!='Transactions over time'">
<a href="JavaScript:void(0);" *ngIf="this.title=='Total Difficulty'" (click)=" <a href="JavaScript:void(0);" *ngIf="this.title=='Total Difficulty'" (click)="
ChartFromView('', '', '1 day', true, false); selectedItem = 6 ChartFromView('', '', '1 day', comp.Type); selectedItem = 6; comp.difficultyRange = '1 day'
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a> " id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '1 week', true, false); selectedItem = 1 ChartFromView('', '', '1 week', comp.Type); selectedItem = 1; comp.difficultyRange = '1 week'
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a> " id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '15 days', true, false); selectedItem = 2 ChartFromView('', '', '15 days', comp.Type); selectedItem = 2; comp.difficultyRange = '15 days'
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a> " id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '30 days', true, false); selectedItem = 3 ChartFromView('', '', '30 days', comp.Type); selectedItem = 3; comp.difficultyRange = '30 days'
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a> " id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '60 days', true, false); selectedItem = 4 ChartFromView('', '', '60 days', comp.Type); selectedItem = 4; comp.difficultyRange = '60 days'
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a> " id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '3 months', true, false); selectedItem = 5 ChartFromView('', '', '3 months', comp.Type); selectedItem = 5; comp.difficultyRange = '3 months'
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a> " id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a>
</div> </div>
<div class="day_filter" *ngIf="this.title!='Transactions over time'">
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'cuckatoo'); selectedItem12 = 1
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'progpow'); selectedItem12 = 2
" id="2" #item122 [ngClass]="{ active: selectedItem12 == item122.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'randomx'); selectedItem12 = 3
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
</div>
<div class="day_filter" *ngIf="this.title=='Transactions over time'"> <div class="day_filter" *ngIf="this.title=='Transactions over time'">
<a href="JavaScript:void(0);" (click)="ChartFromView(GraphtDate, GraphtHour, GraphtInput,'Input'); selectedItem8 = 1" id="1" #item1 <a href="JavaScript:void(0);" (click)="ChartFromView(GraphtDate, GraphtHour, GraphtInput,'Input'); selectedItem8 = 1" id="1" #item1
[ngClass]="{ active: selectedItem8 == item1.id, txt_primay: true }">{{'home.INPUT' | translate}}</a> [ngClass]="{ active: selectedItem8 == item1.id, txt_primay: true }">{{'home.INPUT' | translate}}</a>

View File

@ -23,7 +23,10 @@ export class GraphDetailComponent implements OnInit {
public chartType : any = []; public chartType : any = [];
public selectedItem: Number = 3; public selectedItem: Number = 3;
public selectedItem8: Number = 2; public selectedItem8: Number = 2;
public selectedItem12: Number = 1;
public Type: any = '';
public GraphtInput: any; public GraphtInput: any;
public GraphtOutput: any; public GraphtOutput: any;
public GraphtKernal: any; public GraphtKernal: any;
@ -36,12 +39,11 @@ export class GraphDetailComponent implements OnInit {
private comp: GraphListComponent, private comp: GraphListComponent,
private titleService: Title, private titleService: Title,
public translate: TransServiceService public translate: TransServiceService
) { ) {}
ngOnInit() {
if(this.title=='Total Difficulty'){ if(this.title=='Total Difficulty'){
this.selectedItem = 6; this.selectedItem = 6;
} }
}
ngOnInit() {
var self = this; var self = this;
var x = setInterval(function() { var x = setInterval(function() {
self.TimeArr = self.chartService.GetTimer() self.TimeArr = self.chartService.GetTimer()
@ -194,10 +196,11 @@ export class GraphDetailComponent implements OnInit {
) { ) {
// (p1, p2, p3, p4, p5) for (fromDate, ToDate, interval, fordifficult, forblocks) for difficult and nar chart // (p1, p2, p3, p4, p5) for (fromDate, ToDate, interval, fordifficult, forblocks) for difficult and nar chart
// AND For heatmap and others - It will change // AND For heatmap and others - It will change
this.comp.Type = p4 != '' ? p4 : this.comp.Type == '' ? 'cuckatoo' : this.comp.Type;
switch (this.chartType) { switch (this.chartType) {
case 'total-difficulty': case 'total-difficulty':
this.comp.Difficultyreq(p1, p2, p3).then(res => { this.comp.Difficultyreq(p1, p2, p3, p4).then(res => {
this.hashdata = this.comp.linearGraphData; this.hashdata = this.comp.linearGraphData;
this.hashdata.layout.height = 500; this.hashdata.layout.height = 500;
this.title = 'Total Difficulty'; this.title = 'Total Difficulty';

View File

@ -2,7 +2,7 @@
<div class="col-md-6 col-lg-4 mb-4"> <div class="col-md-6 col-lg-4 mb-4">
<div class="box_shadow"> <div class="box_shadow">
<div class="blocks"> <div class="blocks">
<h2 class="chart_heading d-inline-block">{{'home.TOTAL_DIFFICULTY' | translate}}</h2> <h2 class="chart_heading d-inline-block">{{'home.TARGET_DIFFICULTY' | translate}}</h2>
<!-- <span class="txn_count" *ngIf="this.lg_last.length > 0"><span *ngFor="let l of lg_last">{{ <!-- <span class="txn_count" *ngIf="this.lg_last.length > 0"><span *ngFor="let l of lg_last">{{
this.l | number</span> this.l | number</span>
}}</span> --> }}</span> -->
@ -25,38 +25,38 @@
</div> </div>
<div class="day_filter"> <div class="day_filter">
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day',''); selectedItem = 6 Difficultyreq('', '', '1 day',''); selectedItem = 6; difficultyRange = '1 day'
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a> " id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 week',''); selectedItem = 1 Difficultyreq('', '', '1 week',''); selectedItem = 1; difficultyRange = '1 week'
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a> " id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '15 days',''); selectedItem = 2 Difficultyreq('', '', '15 days',''); selectedItem = 2; difficultyRange = '15 days'
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a> " id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '30 days',''); selectedItem = 3 Difficultyreq('', '', '30 days',''); selectedItem = 3; difficultyRange = '30 days'
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a> " id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '60 days',''); selectedItem = 4 Difficultyreq('', '', '60 days',''); selectedItem = 4; difficultyRange = '60 days'
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a> " id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)=" <a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '3 months',''); selectedItem = 5 Difficultyreq('', '', '3 months',''); selectedItem = 5; difficultyRange = '3 months'
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a> " id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a>
</div> </div>
<div class="day_filter">
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','cuckatoo'); selectedItem12 = 1
" id="1" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','progpow'); selectedItem12 = 2
" id="2" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','randomx'); selectedItem12 = 3
" id="3" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">RandomX</a>
</div>
<div class="explore_all text-right"> <div class="explore_all text-right">
<a routerLink="/chart/total-difficulty"><span class="text-uppercase d-block">{{'home.EXPLORE_IT' | translate}} <i <div class="d-inline float-left difficulty_filter">
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'cuckatoo'); selectedItem12 = 1
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'progpow'); selectedItem12 = 2
" id="2" #item122 [ngClass]="{ active: selectedItem12 == item122.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'randomx'); selectedItem12 = 3
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
</div>
<a routerLink="/chart/total-difficulty"><span class="text-uppercase">{{'home.EXPLORE_IT' | translate}} <i
class="fa fa-long-arrow-right"></i></span></a> class="fa fa-long-arrow-right"></i></span></a>
</div> </div>
</div> </div>

View File

@ -24,7 +24,7 @@ export class GraphListComponent implements OnInit {
public transcationGraphData: any = []; public transcationGraphData: any = [];
public stackGraphData: any = []; public stackGraphData: any = [];
public pieGraphData: any = []; public pieGraphData: any = [];
public lg_last: any; public lg_last: any;
public ag_last: any = ''; public ag_last: any = '';
public dg_last: any = ''; public dg_last: any = '';
@ -56,7 +56,8 @@ export class GraphListComponent implements OnInit {
public tDate: any; public tDate: any;
public tHour: any; public tHour: any;
public Type: any = ''; public Type: any = '';
public difficultyRange: any = '1 day';
viewchartvar: boolean; viewchartvar: boolean;
constructor(private chartService: ChartService, private http: HttpClient,public translate: TransServiceService, private router: Router, constructor(private chartService: ChartService, private http: HttpClient,public translate: TransServiceService, private router: Router,
@ -380,7 +381,7 @@ export class GraphListComponent implements OnInit {
interval = '', interval = '',
type = '' type = ''
) { ) {
this.Type = this.Type == '' ? type != '' ? type : 'cuckatoo' : this.Type; this.Type = type != '' ? type : this.Type == '' ? 'cuckatoo' : this.Type;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let params = new HttpParams(); let params = new HttpParams();
params = params.append('FromDate', fromDate); params = params.append('FromDate', fromDate);