1. Use data attached to a visual element to affect its appearance
1. Use data attached to a visual element to affect its appearance
1. Create a time scale
1. Parse and format times
## Add link to d3 library
## Add link to d3 library
@ -87,7 +89,7 @@ d3.select('svg')
## Create some fake data for our app
## Create some fake data for our app
In `app.js` let's create an array of "run" objects (**NOTE I'm storing the date as a string on purpose**):
In `app.js` let's create an array of "run" objects (**NOTE I'm storing the date as a string on purpose. Also, it's important that this be an array of objects, in order to work with D3**):
```javascript
```javascript
var WIDTH = 800;
var WIDTH = 800;
@ -148,6 +150,7 @@ and link to it in `index.html`
## Create a linear scale
## Create a linear scale
- Let's position the circles vertically, based on the distance run
- One of the most important things that D3 does is provide the ability to map points in the "domain" of data to points in the visual "range" using what's called a `scale`.
- One of the most important things that D3 does is provide the ability to map points in the "domain" of data to points in the visual "range" using what's called a `scale`.
- There are lots of different kinds of scales, but for now we're just going to use a `linear` scale which will map numeric data values to numeric visual values.
- There are lots of different kinds of scales, but for now we're just going to use a `linear` scale which will map numeric data values to numeric visual values.