D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
EmbraceLife
Full window
Github gist
d3.tsv usage
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> // d3.tsv(url/"fileName.tsv", callback) d3.tsv("data.tsv", function(error, data) { if (error) throw error; console.log("example1: ", data, data[0].Hello, data[0].World); }); console.log("tsv(url, callback) is an alias tsv(url).get(callback)"); d3.tsv("data.tsv").get(function(error, data) { if (error) throw error; console.log("example2: ", data, data[0].Hello, data[0].World); }); console.log("tsv(url, row, callback) observes the specified row conversion function"); d3.tsv("data.tsv", function(d) { d.Hello = -d.Hello; d.World = d.World + ".d3"; return d; }, function(error, data) { if (error) throw error; console.log("example3", data, data[1].Hello, data[1].World); }); console.log("tsv(url, row, callback) is an alias for tsv(url).row(row).get(callback)"); d3.tsv("data.tsv").row(function(d) { d.Hello = -d.Hello; return d; }).get(function(error, data) { if (error) throw error; console.log("example4", data); }); console.log("tsv(url).mimeType(type).get(callback) observes the specified mime type");// function(test) { d3.tsv("data.tsv").mimeType("text/plain").get(function(error, data) { if (error) throw error; console.log("example5", data); }); </script> </body>
https://d3js.org/d3.v4.min.js