Merge branch 'master' into simon/angular-universal
* master: Add the Commons Clause License Condition v1.0 to our MIT License fix legend bug on resize Correcting new chartist import path. Flip mempool chart by using patched chartist package by @techmix # Conflicts: # frontend/package-lock.json
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnChanges, ChangeDetectionStrategy } from '@angular/core';
|
||||
import * as Chartist from 'chartist';
|
||||
import * as Chartist from '@mempool/chartist';
|
||||
|
||||
@Component({
|
||||
selector: 'app-fee-distribution-graph',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, Input, Inject, LOCALE_ID, ChangeDetectionStrategy, OnChanges } from '@angular/core';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { VbytesPipe } from 'src/app/shared/pipes/bytes-pipe/vbytes.pipe';
|
||||
import * as Chartist from 'chartist';
|
||||
import * as Chartist from '@mempool/chartist';
|
||||
import { OptimizedMempoolStats } from 'src/app/interfaces/node-api.interface';
|
||||
import { StateService } from 'src/app/services/state.service';
|
||||
|
||||
@@ -62,6 +62,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
|
||||
showLine: false,
|
||||
fullWidth: true,
|
||||
showPoint: false,
|
||||
stackedLine: true,
|
||||
low: 0,
|
||||
axisX: {
|
||||
labelInterpolationFnc: labelInterpolationFnc,
|
||||
@@ -71,11 +72,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
|
||||
labelInterpolationFnc: (value: number): any => this.vbytesPipe.transform(value, 2),
|
||||
offset: showLegend ? 160 : 60,
|
||||
},
|
||||
plugins: [
|
||||
Chartist.plugins.ctTargetLine({
|
||||
value: 1000000
|
||||
}),
|
||||
]
|
||||
plugins: []
|
||||
};
|
||||
|
||||
if (showLegend) {
|
||||
@@ -134,9 +131,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
|
||||
feesArray.push(0);
|
||||
}
|
||||
});
|
||||
if (finalArray.length) {
|
||||
feesArray = feesArray.map((value, i) => value + finalArray[finalArray.length - 1][i]);
|
||||
}
|
||||
finalArray.push(feesArray);
|
||||
}
|
||||
finalArray.reverse();
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
|
||||
import * as Chartist from 'chartist';
|
||||
import * as Chartist from '@mempool/chartist';
|
||||
|
||||
/**
|
||||
* Possible chart types
|
||||
@@ -319,7 +319,11 @@ Chartist.plugins.legend = function (options: any) {
|
||||
|
||||
chart.on('created', function (data: any) {
|
||||
|
||||
if (isSelfUpdate)
|
||||
const useLabels = chart instanceof Chartist.Pie && chart.data.labels && chart.data.labels.length;
|
||||
const legendNames = getLegendNames(useLabels);
|
||||
var dirtyChartData = (chart.data.series.length < legendNames.length);
|
||||
|
||||
if (isSelfUpdate || dirtyChartData)
|
||||
return;
|
||||
|
||||
function removeLegendElement() {
|
||||
@@ -476,8 +480,6 @@ Chartist.plugins.legend = function (options: any) {
|
||||
removeLegendElement();
|
||||
|
||||
const legendElement = createLegendElement();
|
||||
const useLabels = chart instanceof Chartist.Pie && chart.data.labels && chart.data.labels.length;
|
||||
const legendNames = getLegendNames(useLabels);
|
||||
const seriesMetadata = initSeriesMetadata(useLabels);
|
||||
const legends: any = [];
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { OptimizedMempoolStats } from '../../interfaces/node-api.interface';
|
||||
import { WebsocketService } from '../../services/websocket.service';
|
||||
import { ApiService } from '../../services/api.service';
|
||||
|
||||
import * as Chartist from 'chartist';
|
||||
import * as Chartist from '@mempool/chartist';
|
||||
import { StateService } from 'src/app/services/state.service';
|
||||
import { SeoService } from 'src/app/services/seo.service';
|
||||
|
||||
@@ -30,7 +30,6 @@ export class StatisticsComponent implements OnInit {
|
||||
mempoolUnconfirmedTransactionsData: any;
|
||||
mempoolTransactionsWeightPerSecondData: any;
|
||||
|
||||
mempoolVsizeFeesOptions: any;
|
||||
transactionsWeightPerSecondOptions: any;
|
||||
|
||||
radioGroupForm: FormGroup;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { OptimizedMempoolStats } from '../interfaces/node-api.interface';
|
||||
import { MempoolInfo, TransactionStripped } from '../interfaces/websocket.interface';
|
||||
import { ApiService } from '../services/api.service';
|
||||
import { StateService } from '../services/state.service';
|
||||
import * as Chartist from 'chartist';
|
||||
import * as Chartist from '@mempool/chartist';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { WebsocketService } from '../services/websocket.service';
|
||||
import { SeoService } from '../services/seo.service';
|
||||
|
||||
@@ -237,7 +237,7 @@ $ct-series-colors: (
|
||||
#6188e2,
|
||||
);
|
||||
|
||||
@import "../node_modules/chartist/dist/scss/chartist.scss";
|
||||
@import "../node_modules/@mempool/chartist/dist/scss/chartist.scss";
|
||||
|
||||
.ct-bar-label {
|
||||
font-size: 20px;
|
||||
|
||||
Reference in New Issue
Block a user