mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
remove unused code
This commit is contained in:
parent
d99a5a78e0
commit
da5bca1847
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user