Unless you create your datasets yourself, it's usually necessary to prepare the data so that it can be used in your visualization. This might involve changing its structure; filtering unwanted fields; sorting, merging and splitting values; and deriving new fields, or even generating data values. You don't need much more than the standard ES6 methods and functions for manipulating arrays, objects, and collections, but D3 extends that set with extra tools that have been optimized for transforming datasets.
The d3-array module contains most of the data manipulation tools that you will need. It includes functions for sorting and transforming data, generating sequences, obtaining statistical information, grouping, and nesting. You can use these functions with standard JavaScript arrays, objects, maps, and sets, combined with native functions...