I am having d3 read a TSV file. Then I want a particular column of that file to be graphed on a line.
I've tried a lot of variations all with undefined errors.
Below is what I am trying to do in concept:
d3.tsv("file.txt").then( foo => {
var svg = d3.select("graph").append("svg").attr(etc... )
svg.selectAll(".dot")
-----> .data(foo[all indexes]['nameofcolumn'])
.enter().append("circle")
.attr("class", "dot")
.attr("cx", function(d, i) { return xScale(i) })
.attr("cy", function(d) { return yScale(d.y) })
.attr("r", 5)
...etc...
Even if I hardcode foo[1]['columnname'] (which console.log confirms is a number) my graph just falls through. No images, no error.
.data()expects an array of objects. What is the result of console.logging outfoo[1]['nameofcolumn']?