liveBook · Manning

D3.min()

As explained in D3.js in Action, Third Edition

d3.min() is a D3-array function that returns the minimum value in an iterable, optionally by applying an accessor function.

d3.min() returns the smallest value in an iterable. With an accessor, it compares a selected property from each data object. section 3.2.3

Use it while exploring data, commonly inside a Promise’s then() callback. For technology records, d3.min(data, d => d.count) returns 20. section 3.2.3

Measure bar-chart data

After loading and transforming the CSV, log the minimum count before creating the visualization: console.log(d3.min(data, d => d.count)); // => 20. Comparing this with d3.max() helps estimate the range required by the bars; d3.extent() returns both values together. section 3.2.3

How D3.js in Action, Third Edition covers it

How deep it goes
Defines iterable and accessor parameters, demonstrates output, and stops short of implementation internals.
Examples
Uses technology survey records, count accessors, console output, and a loaded CSV dataset containing 33 technologies.
What it assumes
Assumes iterable data objects, arrow functions, and Promise-based CSV loading while demonstrating property access from zero.
What you can do after
Apply d3.min() to identify the smallest value or accessor-selected property in loaded visualization data.
How it connects
Connects minimum measurement with d3.max(), d3.extent(), data loading, Promises, accessors, and bar charts.

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.