Skip to main content
100%

d3.tsv

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Aug 9, 2012

This example demonstrates loading and plotting tab-separated values from an external TSV file using the D3.js library. The chart displays five data points as circles on a simple scatterplot, with linear scales mapping x and y coordinates to SVG positions. The code uses the `d3.tsv` method to fetch and parse the file, then converts string values to numbers with the unary plus operator. Axes are rendered via `d3.svg.axis`, and the SVG circles are appended with the `.point` class, showing basic data parsing and visualization in a minimal setup.

AI-generated description

D3 2.10 adds support for tab-separated values via d3.tsv. Similar to the previous d3.csv method, this makes it easy to load and parse TSV files.

d3.tsv("data.tsv", function(data) {
  console.log(data[0].x);
});
gpl-3.0 Licensed

Similar vizzes