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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more