remove unused code

This commit is contained in:
c9s 2022-05-18 02:57:00 +08:00
parent d99a5a78e0
commit da5bca1847
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1,25 +1,3 @@
import { tsvParse, csvParse } from "d3-dsv"; import { tsvParse, csvParse } from "d3-dsv";
import { timeParse } from "d3-time-format"; import { timeParse } from "d3-time-format";
function parseData(parse) {
return function(d) {
d.date = parse(d.date);
d.open = +d.open;
d.high = +d.high;
d.low = +d.low;
d.close = +d.close;
d.volume = +d.volume;
return d;
};
}
const parseDate = timeParse("%Y-%m-%d");
export function getData() {
// original source: https://cdn.rawgit.com/rrag/react-stockcharts/master/docs/data/MSFT.tsv
const promiseMSFT = fetch("https://cdn.jsdelivr.net/gh/rrag/react-stockcharts@master/docs/data/MSFT.tsv")
.then(response => response.text())
.then(data => tsvParse(data, parseData(parseDate)))
return promiseMSFT;
}