diff --git a/package-lock.json b/package-lock.json index 1e1223f94..e40452edf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12291,7 +12291,7 @@ }, "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-regex%2Fdownload%2Fansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "browserslist": { @@ -12306,7 +12306,7 @@ }, "cli-cursor": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/cli-cursor/download/cli-cursor-2.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcli-cursor%2Fdownload%2Fcli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "requires": { "restore-cursor": "^2.0.0" @@ -12319,7 +12319,7 @@ }, "figures": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/figures/download/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "requires": { "escape-string-regexp": "^1.0.5" @@ -12347,7 +12347,7 @@ }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "json5": { @@ -12384,12 +12384,12 @@ }, "mute-stream": { "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "resolved": "https://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" }, "onetime": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/onetime/download/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "requires": { "mimic-fn": "^1.0.0" @@ -12436,7 +12436,7 @@ }, "restore-cursor": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/restore-cursor/download/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "requires": { "onetime": "^2.0.0", @@ -12454,7 +12454,7 @@ "dependencies": { "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz?cache=0&sync_timestamp=1573280549549&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-ansi%2Fdownload%2Fstrip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { "ansi-regex": "^3.0.0" diff --git a/src/App.js b/src/App.js index 9d0b1b58c..1773d77f9 100755 --- a/src/App.js +++ b/src/App.js @@ -24,7 +24,6 @@ import StateGraph from "./StateGraph"; import MbMap from "./ConfirmedMap"; import "./App.css"; -import axios from "axios"; import uuid from "react-uuid"; import ReactPlayer from "react-player"; @@ -56,13 +55,7 @@ const GoogleMap = React.lazy(() => import("./GoogleMap")); const provincesByName = keyBy(provinces, "name"); const provincesByPinyin = keyBy(provinces, "pinyin"); -const fetcher = url => - axios(url).then(data => { - return data.data.data; - }); - function HistoryGraph({ countryData }) { - let newData = [[{ type: "date", label: "Day" }, "New Cases", "Deaths"]]; let today = Date.now(); const [loading, setLoading] = useState(true); const [options, setOptions] = useState(null); @@ -100,12 +93,6 @@ function HistoryGraph({ countryData }) { name: "Recovered", showInLegend: true, dataPoints: [] - }, - { - type: "spline", - name: "Existing", - showInLegend: true, - dataPoints: [] } ]; let newData = [ @@ -127,8 +114,7 @@ function HistoryGraph({ countryData }) { let arr = key.split("-"); let date = new Date(arr[0], arr[1] - 1, arr[2]); if ((today - date) / (1000 * 3600 * 24) <= 14) { - let labelName = - monthTrans[date.getMonth()] + " " + date.getDate().toString(); + let labelName = monthTrans[date.getMonth()] + " " + date.getDate().toString(); historyData[0]["dataPoints"].push({ y: countryData[key][0], label: labelName @@ -141,10 +127,6 @@ function HistoryGraph({ countryData }) { y: countryData[key][1], label: labelName }); - historyData[3]["dataPoints"].push({ - y: countryData[key][3], - label: labelName - }); newData[0]["dataPoints"].push({ y: countryData[key][0] - pre[0], label: labelName @@ -207,10 +189,7 @@ function HistoryGraph({ countryData }) { // content:"{label}, {name}: {y}" , } }); - // newData.push([historyData[2][0],historyData[2][1]-historyData[1][1],historyData[2][2]-historyData[1][2]]) - // for(let i = 3; i < historyData.length; i++) { - // newData.push([historyData[i][0], historyData[i][1] - historyData[i - 1][1], historyData[i][2]-historyData[i-1][2]]) - // } + setLoading(false); }, [countryData]); @@ -222,23 +201,6 @@ function HistoryGraph({ countryData }) {

Historical Data

- {/*Loading Chart...}*/} - {/*data={historyData}*/} - {/*options={options}*/} - {/*rootProps={{ 'data-testid': '3' }}*/} - {/*/>*/} - {/**/} ); }