Before we start with a step-by-step example, you should have a basic understanding of how D3 manipulates DOM elements and binds them to data sources. You already had a basic introduction to selections in the previous chapters. This section will provide some more details about selecting, appending, and removing elements.
This section will also provide an introduction to data binding, which will be necessary for the step-by-step example and will be covered in detail in Chapter 4, Data Binding. We will investigate what happens to an element when D3's data-driven mechanism is applied. You should try running these examples by using the files available in the GitHub repository for this chapter, or by typing the commands directly in your browser's JavaScript console. The code for this section is in the Selecting/ and Binding/ subfolders.
...