liveBook · Manning

D3-fetch

As explained in D3.js in Action, Third Edition

d3-fetch is a D3.js module that provides utilities for loading data resources through the web Fetch API.

d3-fetch provides D3 utilities for loading datasets into a visualization project. Choose a loader that matches the file format, pass the file path, then prepare the returned data for visualization. section 1.1.3 section 3.2.1

Use the format-specific functions to load common resources:

  • Load CSV files with d3.csv(path). section 3.2.1
  • Load JSON files with d3.json(path). section 3.2.1
  • Use the module’s other functions for text and XML files. section 3.2.1
  • Pass a relative path carefully; for a data file outside a js folder, a path such as ../data/data.csv goes up one directory. section 3.2.1

Load a survey dataset

A bar-chart project can load a CSV of data-visualization tools with d3.csv("../data/data.csv");. The file contains technology and count columns, including D3.js with a count of 414 and Python with 530. After loading, format the values and use them to build the chart. section 3.2.1

How D3.js in Action, Third Edition covers it

How deep it goes
Explains format selection and relative paths, then stops before detailed data manipulation or visualization construction.
Examples
Uses a survey CSV, a bar-chart exercise, and the expression d3.csv("../data/data.csv").
What it assumes
Assumes a D3 project with a dataset and teaches format-specific loaders and relative file paths.
What you can do after
Apply it via d3.csv() or d3.json() to load a dataset into a D3 project.
How it connects
Connects D3.js, data preparation, CSV, JSON, and data visualization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.