Upgrade react-chartjs-2 to v4; make code tree-shakeable
This commit is contained in:
parent
b17a1d4f27
commit
18b834c852
|
@ -39,7 +39,7 @@
|
||||||
"query-string": "^7.0.1",
|
"query-string": "^7.0.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-blockies": "^1.4.1",
|
"react-blockies": "^1.4.1",
|
||||||
"react-chartjs-2": "^3.3.0",
|
"react-chartjs-2": "^4.0.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-error-boundary": "^3.1.4",
|
"react-error-boundary": "^3.1.4",
|
||||||
"react-helmet-async": "^1.1.2",
|
"react-helmet-async": "^1.1.2",
|
||||||
|
@ -14388,9 +14388,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-chartjs-2": {
|
"node_modules/react-chartjs-2": {
|
||||||
"version": "3.3.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-4.0.0.tgz",
|
||||||
"integrity": "sha512-4Mt0SR2aiUbWi/4762odRBYSnbNKSs4HWc0o3IW43py5bMfmfpeZU95w6mbvtuLZH/M3GsPJMU8DvDc+5U9blQ==",
|
"integrity": "sha512-0kx41EVO6wIoeU6zvdwovX9kKcdrs7O62DGTSNmwAXZeLGJ3U+n4XijO1kxcMmAi4I6PQJWGD5oRwxVixHSp6g==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"chart.js": "^3.5.0",
|
"chart.js": "^3.5.0",
|
||||||
"react": "^16.8.0 || ^17.0.0"
|
"react": "^16.8.0 || ^17.0.0"
|
||||||
|
@ -29181,9 +29181,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-chartjs-2": {
|
"react-chartjs-2": {
|
||||||
"version": "3.3.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-4.0.0.tgz",
|
||||||
"integrity": "sha512-4Mt0SR2aiUbWi/4762odRBYSnbNKSs4HWc0o3IW43py5bMfmfpeZU95w6mbvtuLZH/M3GsPJMU8DvDc+5U9blQ==",
|
"integrity": "sha512-0kx41EVO6wIoeU6zvdwovX9kKcdrs7O62DGTSNmwAXZeLGJ3U+n4XijO1kxcMmAi4I6PQJWGD5oRwxVixHSp6g==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"react-dev-utils": {
|
"react-dev-utils": {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"query-string": "^7.0.1",
|
"query-string": "^7.0.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-blockies": "^1.4.1",
|
"react-blockies": "^1.4.1",
|
||||||
"react-chartjs-2": "^3.3.0",
|
"react-chartjs-2": "^4.0.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-error-boundary": "^3.1.4",
|
"react-error-boundary": "^3.1.4",
|
||||||
"react-helmet-async": "^1.1.2",
|
"react-helmet-async": "^1.1.2",
|
||||||
|
|
|
@ -8,6 +8,15 @@ import React, {
|
||||||
import { Block } from "@ethersproject/abstract-provider";
|
import { Block } from "@ethersproject/abstract-provider";
|
||||||
import { FixedNumber } from "@ethersproject/bignumber";
|
import { FixedNumber } from "@ethersproject/bignumber";
|
||||||
import { Line } from "react-chartjs-2";
|
import { Line } from "react-chartjs-2";
|
||||||
|
import {
|
||||||
|
Chart as ChartJS,
|
||||||
|
LinearScale,
|
||||||
|
CategoryScale,
|
||||||
|
PointElement,
|
||||||
|
LineElement,
|
||||||
|
Filler,
|
||||||
|
Tooltip,
|
||||||
|
} from "chart.js";
|
||||||
import { Transition } from "@headlessui/react";
|
import { Transition } from "@headlessui/react";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { faBurn } from "@fortawesome/free-solid-svg-icons/faBurn";
|
import { faBurn } from "@fortawesome/free-solid-svg-icons/faBurn";
|
||||||
|
@ -25,6 +34,15 @@ import {
|
||||||
gasChartData,
|
gasChartData,
|
||||||
} from "./chart";
|
} from "./chart";
|
||||||
|
|
||||||
|
ChartJS.register(
|
||||||
|
LinearScale,
|
||||||
|
CategoryScale,
|
||||||
|
PointElement,
|
||||||
|
LineElement,
|
||||||
|
Filler,
|
||||||
|
Tooltip
|
||||||
|
);
|
||||||
|
|
||||||
const MAX_BLOCK_HISTORY = 20;
|
const MAX_BLOCK_HISTORY = 20;
|
||||||
|
|
||||||
const PREV_BLOCK_COUNT = 15;
|
const PREV_BLOCK_COUNT = 15;
|
||||||
|
|
Loading…
Reference in New Issue