mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 14:22:44 +01:00
Merge branch 'master' into nymkappa/bugfix/remove-dead-view-more-links
This commit is contained in:
commit
01a5748c02
3 changed files with 30 additions and 10 deletions
|
@ -15,6 +15,11 @@ li.nav-item {
|
||||||
margin: auto 10px;
|
margin: auto 10px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
@media (max-width: 992px) {
|
||||||
|
margin: auto 7px;
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
.widget > .chart {
|
.widget > .chart {
|
||||||
-webkit-mask: linear-gradient(180deg, #11131f00 0%, #11131fff 20%);
|
-webkit-mask: linear-gradient(180deg, #11131f00 0%, #11131fff 20%);
|
||||||
|
min-height: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart {
|
.chart {
|
||||||
|
@ -43,23 +44,18 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
@media (max-width: 992px) {
|
||||||
padding-bottom: 25px;
|
padding-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 829px) {
|
@media (max-width: 829px) {
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
padding-bottom: 25px;
|
padding-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 629px) {
|
@media (max-width: 629px) {
|
||||||
padding-bottom: 55px;
|
padding-bottom: 55px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 567px) {
|
@media (max-width: 567px) {
|
||||||
padding-bottom: 55px;
|
padding-bottom: 55px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ChangeDetectionStrategy, Component, Input, NgZone, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, HostListener, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
import { ApiService } from 'src/app/services/api.service';
|
import { ApiService } from 'src/app/services/api.service';
|
||||||
import { Observable, switchMap, tap, zip } from 'rxjs';
|
import { Observable, switchMap, tap, zip } from 'rxjs';
|
||||||
|
@ -26,7 +26,7 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
|
||||||
chartOptions: EChartsOption = {};
|
chartOptions: EChartsOption = {};
|
||||||
chartInitOptions = {
|
chartInitOptions = {
|
||||||
renderer: 'canvas',
|
renderer: 'canvas',
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
|
@ -98,6 +98,7 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chartOptions = {
|
this.chartOptions = {
|
||||||
|
silent: true,
|
||||||
title: title ?? undefined,
|
title: title ?? undefined,
|
||||||
geo3D: {
|
geo3D: {
|
||||||
map: 'world',
|
map: 'world',
|
||||||
|
@ -110,9 +111,10 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
viewControl: {
|
viewControl: {
|
||||||
center: this.style === 'widget' ? [0, 0, -1] : undefined,
|
center: this.style === 'widget' ? [0, 0, -10] : undefined,
|
||||||
minDistance: 0.1,
|
minDistance: this.style === 'widget' ? 22 : 0.1,
|
||||||
distance: this.style === 'widget' ? 45 : 60,
|
maxDistance: this.style === 'widget' ? 22 : 60,
|
||||||
|
distance: this.style === 'widget' ? 22 : 60,
|
||||||
alpha: 90,
|
alpha: 90,
|
||||||
panMouseButton: 'left',
|
panMouseButton: 'left',
|
||||||
rotateMouseButton: undefined,
|
rotateMouseButton: undefined,
|
||||||
|
@ -167,6 +169,14 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HostListener('window:wheel', ['$event'])
|
||||||
|
onWindowScroll(e): void {
|
||||||
|
// Not very smooth when using the mouse
|
||||||
|
if (this.style === 'widget' && e.target.tagName === 'CANVAS') {
|
||||||
|
window.scrollBy({left: 0, top: e.deltaY, behavior: 'auto'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onChartInit(ec) {
|
onChartInit(ec) {
|
||||||
if (this.chartInstance !== undefined) {
|
if (this.chartInstance !== undefined) {
|
||||||
return;
|
return;
|
||||||
|
@ -174,6 +184,15 @@ export class NodesChannelsMap implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.chartInstance = ec;
|
this.chartInstance = ec;
|
||||||
|
|
||||||
|
if (this.style === 'widget') {
|
||||||
|
this.chartInstance.getZr().on('click', (e) => {
|
||||||
|
this.zone.run(() => {
|
||||||
|
const url = new RelativeUrlPipe(this.stateService).transform(`/graphs/lightning/nodes-channels-map`);
|
||||||
|
this.router.navigate([url]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.chartInstance.on('click', (e) => {
|
this.chartInstance.on('click', (e) => {
|
||||||
if (e.data && e.data.publicKey) {
|
if (e.data && e.data.publicKey) {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue