5
Loading and Parsing Data
Most of the data used in your D3 visualizations will probably be loaded from external sources. This chapter explores tools provided by D3 that you can use to asynchronously load and parse data, converting it to a native format that can be manipulated in JavaScript and used in a web-based data visualization.
JSON and XML sources have a hierarchical structure. Once loaded, they can be parsed using native code, but D3 provides functions to efficiently load and parse them in a single step, returning JavaScript promises. These functions are part of the d3-fetch module, which also provides asynchronous loaders and parsers for CSV, plain text, and binary data.
If you need more control, D3 provides additional support for tabular ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access