Skip to content

Commit

Permalink
Update README files
Browse files Browse the repository at this point in the history
  • Loading branch information
amdufour committed May 9, 2022
1 parent 5326b93 commit 4dccb60
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# book-exercises
This repository contains the starting code files and solutions of the book D3.js in Action, third edition.
This repository contains the starting code files and solutions of the book D3.js in Action, 3rd edition](https://www.manning.com/books/d3js-in-action-third-edition).
7 changes: 2 additions & 5 deletions chapter_01/SVG_Shapes_Gallery/start/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# SVG Shapes Gallery

This folder contains the starter `index.html` file for the SVG Shapes Gallery exercise of chapter 1. In this exercise, you will create basic SVG shapes with code.
This folder contains the starter `index.html` file for the SVG Shapes Gallery exercise for chapter 1 of [D3.js in Action, 3rd edition](https://www.manning.com/books/d3js-in-action-third-edition). In this exercise, you will create basic SVG shapes with code.


## Techniques learned in this exercise

- Creating a responsive SVG container.
- Creating, positioning, and styling basic SVG shapes like lines, rectangles, circles, and paths.
- Creating and positioning SVG text.


## How to run this project

To view the project in your browser, locate the `index.html` file in your Windows Explorer (PC) or Finder (Mac). Right-click on the file to open a menu. Go to `Open with` and select a browser. We recommend working with Chrome or Firefox for their great inspector tools. The file will open in a new browser tab.
To view the project in your browser, locate the `index.html` (in the *start* OR the *end* folder) file in your Windows Explorer (PC) or Finder (Mac). Right-click on the file to open a menu. Go to `Open with` and select a browser. We recommend working with Chrome or Firefox for their great inspector tools. The file will open in a new browser tab.

Happy coding! 🤓
34 changes: 17 additions & 17 deletions chapter_02/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Manipulating the DOM

This folder contains the files for the coding exercise of chapter 2. In this exercise, you will start building a bar graph while learning how to manipulate the DOM with D3.


## Techniques learned in this exercise

- Selecting DOM elements with `d3.select()` and `d3.selectAll()`.
- Adding elements to a selection with the `selection.append()` and the `selection.insert()` methods.
- Setting and modifying the attributes of DOM elements with the `selection.attr()` method.
- Setting and modifying the styles of DOM elements with the `selection.style()` method.


## Development environment

To run D3 projects, you'll need a web server. In chapter 1, we explained how to set up a local development environment using [VS Code](https://code.visualstudio.com/) and its [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer).

If you use this setup, you can start the project by clicking on the "Go Live" option in the status bar, located at the bottom of your VS Code window.
This folder contains the exercise files for chapter 2 of [D3.js in Action, 3rd edition](https://www.manning.com/books/d3js-in-action-third-edition).
</br>
The project contains 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.

## How to run the project
To run this project, you'll need a local webserver. We recommend using [VS Code](https://code.visualstudio.com/)'s Live Server extension. You can find instructions on installing this extension in Appendix A of the book.
1. Open the project folder (the *start* OR the *end* folder) in VS Code.
2. To run the project with the Live Server extension, click the *Go live* button in the status bar of VS Code.
3. The project should open automatically in your browser.

## Structure of the project
* The `/data` folder contains a CSV file names `data.csv`, extracted from the results of the [2021 State of the Industry Survey](https://www.datavisualizationsociety.org/survey) by the [Data Visualization Society](https://www.datavisualizationsociety.org). 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 `/css` folder contains the CSS file `main.css`, where styles have been added for the responsive SVG container.
* The `/js` folder contains the JavaScript file `main.js`. This is where we will build our bar chart.
* `index.html` contains the markup and text that composes the project. The D3 library, `main.css`, and `main.js` are already loaded in this file.

Happy D3 coding! 🤓
44 changes: 24 additions & 20 deletions chapter_03/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Working with data

This folder contains the files for the coding exercise of chapter 3. In this exercise, you will finish building the bar graph started in chapter 2 while learning how to work with data in D3 projects.


## Techniques learned in this exercise

- Loading a dataset into a project using `d3.csv()`.
- Formatting the data in the callback function of `d3.csv()`.
- Finding the maximum and minimum values in a dataset.
- Generating DOM element with data-binding.
- Using D3 linear and band scales.
- Adding axis to a chart.


## Development environment

To run D3 projects, you'll need a web server. In chapter 1, we explained how to set up a local development environment using [VS Code](https://code.visualstudio.com/) and its [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer).

If you use this setup, you can start the project by clicking on the "Go Live" option in the status bar, located at the bottom of your VS Code window.
# Drawing lines, curves, and arcs
This folder contains the exercise files for chapter 3 of [D3.js in Action, 3rd edition](https://www.manning.com/books/d3js-in-action-third-edition).
</br>
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.

## Sections in this chapter
* [3.2-Preparing_data](https://github.com/d3js-in-action-third-edition/code-files/tree/main/chapter_03/3.2-Preparing_data)
* [3.3-Binding_data](https://github.com/d3js-in-action-third-edition/code-files/tree/main/chapter_03/3.3-Binding_data)
* [3.4-Scales](https://github.com/d3js-in-action-third-edition/code-files/tree/main/chapter_03/3.4-Scales)

## How to run the project
To run this project, you'll need a local webserver. We recommend using [VS Code](https://code.visualstudio.com/)'s Live Server extension. You can find instructions on installing this extension in Appendix A of the book.
1. Open the project folder (a *start* OR an *end* folder from the subsections mentioned above) in VS Code.
2. To run the project with the Live Server extension, click the *Go live* button in the status bar of VS Code.
3. The project should open automatically in your browser.

## Structure of the project
* The `/data` folder contains a CSV file names `data.csv`, extracted from the results of the [2021 State of the Industry Survey](https://www.datavisualizationsociety.org/survey) by the [Data Visualization Society](https://www.datavisualizationsociety.org). 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 `/css` folder contains the CSS file `main.css`, where styles have been added for the responsive SVG container.
* The `/js` folder contains the JavaScript file `main.js`. This is where we will build our bar chart.
* `index.html` contains the markup and text that composes the project. The D3 library, `main.css`, and `main.js` are already loaded in this file.

Happy D3 coding! 🤓
8 changes: 5 additions & 3 deletions chapter_04/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When changing to the next section, you can choose to keep coding in the same fil

## How to run the project
To run this project, you'll need a local webserver. We recommend using [VS Code](https://code.visualstudio.com/)'s Live Server extension. You can find instructions on installing this extension in Appendix A of the book.
1. Open the project folder (a *start* or an *end* folder from the subsections mentioned above) in VS Code.
1. Open the project folder (a *start* OR an *end* folder from the subsections mentioned above) in VS Code.
2. To run the project with the Live Server extension, click the *Go live* button in the status bar of VS Code.
3. The project should open automatically in your browser.

Expand All @@ -26,10 +26,12 @@ To run this project, you'll need a local webserver. We recommend using [VS Code]
* `daily_precipitations.csv` with the daily precipitations in New York City in 2021. The columns are organized as follows:
* `date`: The date (YEAR-MONTH-DAY).
* `total_precip_in`: The total daily precipitations in inches.
* The `/css` contains two CSS files:
* The `/css` folder contains two CSS files:
* `base.css` consists of the generic styles applied to the project page, like the font, spacings, and colors. Although you won’t need to edit this file, feel free to personalize it!
* `visualization.css` is where we will add styles for our visualizations. It already contains the style properties applied to responsive SVG containers, following the strategy described in chapter 1.
* The `/js` folder contains two JavaScript files. Since we will work on two different charts, separating our code into multiple files will make it easier to understand, write and maintain.
* `line-chart.js` is where you'll create the line chart.
* `arcs.js` is where you'll draw the arcs of a donut chart.
* `index.html` contains the markup and text that composes the project. The D3 library, the CSS files, and the JavaScript files are already loaded in this file.
* `index.html` contains the markup and text that composes the project. The D3 library, the CSS files, and the JavaScript files are already loaded in `index.html`.

Happy D3 coding! 🤓

0 comments on commit 4dccb60

Please sign in to comment.