This folder contains the exercise files for chapter 3 of D3.js in Action, 3rd edition.
The folder is separated into subfolders corresponding to each section of the chapter. In these subfolders, you'll find a start and an end folder. To follow along with the book's instructions, write your code in the start folder. You'll find the solution in the end folder if ever you get stuck.
When changing to the next section, you can choose to keep coding in the same files or use the start folder for that section.
To run this project, you'll need a local webserver. We recommend using VS Code's Live Server extension. You can find instructions on installing this extension in Appendix A of the book.
- Open the project folder (a start OR an end folder from the subsections mentioned above) in VS Code.
- To run the project with the Live Server extension, click the Go live button in the status bar of VS Code.
- The project should open automatically in your browser.
- The
/datafolder contains a CSV file namesdata.csv, extracted from the results of the 2021 State of the Industry Survey by the Data Visualization Society. The columns are organized as follows:technology: A list of technologies used for data visualization.count: The number of respondents who mentioned using this tool.
- The
/cssfolder contains the CSS filemain.css, where styles have been added for the responsive SVG container. - The
/jsfolder contains the JavaScript filemain.js. This is where we will build our bar chart. index.htmlcontains the markup and text that composes the project. The D3 library,main.css, andmain.jsare already loaded in this file.
Happy D3 coding! 🤓