liveBook · Manning

Array iterator method

As explained in D3.js in Action, Third Edition

An array iterator method is a JavaScript array method that traverses elements while producing a test result or transformed selection.

Array iterator methods traverse dataset elements to inspect, transform, select, or locate values. They are especially useful during data wrangling for visualizations. section 1.2.5

Preparing employee data

Given an employee array, run data.forEach(d => { d.id = +d.id; }); before using map(), filter(), or find() for visualization work.

How D3.js in Action, Third Edition covers it

How deep it goes
Defines forEach(), map(), filter(), and find() with short dataset examples, but does not survey all manipulation techniques.
Examples
Demonstrates employee objects, numeric ID conversion, name extraction, employee filtering, and unique-record lookup.
What it assumes
Assumes basic JavaScript arrays, objects, properties, loops, and arrow functions.
What you can do after
Apply JavaScript array methods to convert, reshape, select, and locate records in visualization datasets.
How it connects
Connects array iteration to data wrangling, CSV data, JavaScript objects, and D3.js visualizations.

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.