{"url":"https://api.github.com/gists/8031385","forks_url":"https://api.github.com/gists/8031385/forks","commits_url":"https://api.github.com/gists/8031385/commits","id":"8031385","node_id":"MDQ6R2lzdDgwMzEzODU=","git_pull_url":"https://gist.github.com/8031385.git","git_push_url":"https://gist.github.com/8031385.git","html_url":"https://gist.github.com/8031385","files":{".block":{"filename":".block","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/8031385/raw/703d310b399098a243a76a50bc209167e924cfd2/.block","size":17,"truncated":false,"content":"license: gpl-3.0\n"},"Makefile":{"filename":"Makefile","type":"text/plain","language":"Makefile","raw_url":"https://gist.githubusercontent.com/mbostock/8031385/raw/734a79ad82f992b2c3c0a6446f265a8c258efbf4/Makefile","size":340,"truncated":false,"content":"GENERATED_FILES = \\\n\tunemployment.tsv\n\n.PHONY: all clean\n\nall: $(GENERATED_FILES)\n\nclean:\n\trm -rf -- $(GENERATED_FILES)\n\n# http://www.bls.gov/lau/metrossa.htm\nbuild/ssamatab1.txt:\n\tmkdir -p build\n\tcurl -o $@ 'http://www.bls.gov/lau/ssamatab1.txt'\n\nunemployment.tsv: process-data build/ssamatab1.txt\n\t./process-data build/ssamatab1.txt > $@\n"},"README.md":{"filename":"README.md","type":"text/plain","language":"Markdown","raw_url":"https://gist.githubusercontent.com/mbostock/8031385/raw/8b776908e9df48813b0e52dfb870ce6805e2631b/README.md","size":1295,"truncated":false,"content":"This example demonstrates how to convert awkward fixed-width text data, such as that released by the [U.S. Bureau of Labor Statistics](http://www.bls.gov/), into [tab-separated values](https://github.com/mbostock/d3/wiki/CSV).\n\nThe source data file for this chart of [seasonally-adjusted unemployment rates](http://www.bls.gov/lau/metrossa.htm) for 380 metropolitan areas is a whopping 9.9 MB. However, by pulling out only the data needed for this chart and by converting to a more efficient representation that eliminates redundant information, we can reduce it to a svelte 258 KB (44 KB gzipped). This is a savings of 98%! The resulting file is small enough to download and display quickly, despite having more than 63,000 data points.\n\nThe [Makefile](http://bost.ocks.org/mike/make/) is responsible for downloading the source file from the BLS. Then, the `process-data` script converts and reduces the source data to TSV. The resulting tabular file is very wide, containing a row for each metropolitan area and a column for each month. You can run this example locally by [cloning this gist](https://gist.github.com/mbostock/8031385), and then running the following commands:\n\n```bash\nnpm install\nmake\n```\n\nWhen the BLS releases new data, you can update the chart by running `make clean all`."},"index.html":{"filename":"index.html","type":"text/html","language":"HTML","raw_url":"https://gist.githubusercontent.com/mbostock/8031385/raw/4a0ddc7b0f0a39db47bd889c22ae959b591a926e/index.html","size":2233,"truncated":false,"content":"\n\n\n