diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index 7e56c7e97..5839f4f51 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -281,12 +281,12 @@ describe('Mainnet', () => { }); }); - it('loads the tv screen - mobile', () => { + it.only('loads the tv screen - mobile', () => { cy.viewport('iphone-6'); cy.visit('/tv'); cy.waitForSkeletonGone(); cy.get('.chart-holder'); - cy.get('.blockchain-wrapper').should('be.visible'); + cy.get('.blockchain-wrapper').should('not.visible'); }); it('loads the api screen', () => { 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 dd4001821..e5951c261 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 @@ -2,6 +2,7 @@ import { Component, OnInit, Input, Inject, LOCALE_ID, ChangeDetectionStrategy } import { formatDate } from '@angular/common'; import { EChartsOption } from 'echarts'; import { OnChanges } from '@angular/core'; +import { StorageService } from 'src/app/services/storage.service'; @Component({ selector: 'app-incoming-transactions-graph', @@ -15,14 +16,18 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { @Input() right: number | string = '10'; @Input() top: number | string = '20'; @Input() left: number | string = '50'; + @Input() size: ('small' | 'big') = 'small'; mempoolStatsChartOption: EChartsOption = {}; + windowPreference: string; constructor( @Inject(LOCALE_ID) private locale: string, + private storageService: StorageService, ) { } ngOnChanges(): void { + this.windowPreference = this.storageService.getValue('graphWindowPreference'); this.mountChart(); } @@ -38,6 +43,24 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { top: this.top, left: this.left, }, + dataZoom: [{ + type: 'inside', + realtime: true, + }, { + show: (this.size === 'big') ? true : false, + type: 'slider', + brushSelect: false, + realtime: true, + selectedDataBackground: { + lineStyle: { + color: '#fff', + opacity: 0.45, + }, + areaStyle: { + opacity: 0, + } + } + }], tooltip: { trigger: 'axis', position: (pos, params, el, elRect, size) => { @@ -45,25 +68,16 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 80; return obj; }, - extraCssText: `background: transparent; + extraCssText: `width: ${(['2h', '24h'].includes(this.windowPreference) || this.size === 'small') ? '105px' : '135px'}; + background: transparent; border: none; box-shadow: none;`, axisPointer: { - type: 'cross', - label: { - formatter: (axis: any) => { - if (axis.axisDimension === 'y') { - return `${Math.floor(axis.value)}`; - } - if (axis.axisDimension === 'x') { - return axis.value; - } - }, - } + type: 'line', }, formatter: (params: any) => { const colorSpan = (color: string) => `
`; - let itemFormatted = '