Published
Edited
Oct 3, 2020
Insert cell
md`# Day 40, 2020-10-03`
Insert cell
md`
I was redoing [Task 9-2-1](https://d3.hongtaoh.com/task-9-2.html). The answer is [Chapter 09/17_randomized_data.html](https://github.com/scotthmurray/d3-book/blob/master/chapter_09/17_randomized_data.html).

The only difference is that I have already updated the \`xScale\` and \`yScale\` within the bar and text updating codes. Also, I made a "small" mistake: I put \`dataset = []\` **inside** the \`for\` loop.

To make the changes more noticeable, change the color of the bar to red within within the bar and text updating codes. Here are the things I didn't understand:

- Why isn't the red obsuring the colors of previous rects?

- Why is there a larger gap between the start of the first bar?
`
Insert cell
md`
[A good article](https://www.codementor.io/@milesbryony/d3-js-join-14gqdz3hfj) about \`.join()\`.
`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more