TypeError: undefined is not a function. (In 'undefined()', 'undefined' is undefined)
Looking at all gold medal winners of the Olympics by @nbremer.
- Markdown (subgoal 3)
- Readme (subgoal 3 and subgoal 4)
- GitHub (subgoal 3 and subgoal 4)
- Do you read me?! (practice)
- Debug and refactor (subgoal 5 and subgoal 6)
d3@3andd3@4(subgoal 5)d3-scale(subgoal 7)- Style (practice)
debugger;(practice)
Submit your assignments by 7 a.m. the day of class 3.
- Do you read me?! (practice)
- Style (practice)
debugger;(practice)
See class 1 for assignments due before this class.
Submit assessment 1 before the start of class 3.
Trinity College Dublin by @zeak.
- Markdown Tutorial (Markdown) — Learn how to use Markdown
- Markdown Cheatsheet (Markdown) — Quick reference and showcase
- Mastering Markdown (Markdown) — Mini series that will change how you write documentation
- Basic writing & formatting syntax (Markdown and GitHub) — Markdown specifically for GitHub
- Learn Git in 15 minutes (Git and GitHub) — Interactive Git tutorial
- Learn Git Branching (Git) — Interactive Git branching tutorial
- Intro to GitHub (Git and GitHub) — Get started using GitHub in less than an hour
- GitHub Glossary (Git and GitHub) — List of Git and GitHub specific terms
- Git Cheat Sheet (Git) — Reference sheet covering Git commands, features, and bash
💁 Before you start, add your real name and a picture to your profile on GitHub. Open source is about real people after all.
For this assignment you’re going to add a readme to the project you handed in for the Bar chart assignment of class 1.
Create a readme.md file describing your project and include the following:
- Short title
- Short description
- Background section with a longer description of why you did what you did
- Data section describing the visualised data, its format, columns, and fields
- Features section listing all d3 features used and linking to API docs
- License section (tip:
choosealicense.com) in the form “SPDX © First Second” (I often use “MIT © Titus Wormer”)
💁 The work you based your project on probably contains a license too. You cannot pick any license you’d want and disregard their license. Your license must be compatible with theirs. As a general rule of thumb: if you may create a derivative work (which is often true for free software licenses if your work is non-commercial) you can license your work under the same license as the original work.
Feel free to provide more useful information.
You may create a file, preview.png, to show a thumbnail of how your chart
looks. You can link to it in the readme like so: .
You can write this file directly on GitHub (tip: see substep 4 from step I of the Loading data assignment) or write it in your text editor and upload it when done (tip: see substep 3 from step D of the Playing with SVG assignment).
💁 You probably need to sync your fork. Unfortunately this cannot be done through the GitHub website. You can either sync a fork on the terminal or delete your fork and fork again.
Elegant man with a laptop by @flenjoore.
In this assignment you’ll learn to refactor and reformat code.
prettier(JavaScript) — Opinionated code formatterstandard(JavaScript) — Standard stylexo(JavaScript) — Happiness styleeslint(JavaScript) — Fully pluggable stylestylelint(CSS) — Mighty, modern linter- Code Guide (HTML and CSS) — Flexible, durable, and sustainable code standards
For this assignment you’re going to reformat code to make a donut chart in your own style. Feel free to use any of the tips above to check or format code. Choose any coding style that makes sense to you.
- First, copy the files
index.csv,index.css,index.html, andindex.jsfromsite/class-2/styleto your computer and get them working without changing any code yet - Note that the CSS, HTML, and JS are minified: they’re great for computers, but not so much for humans
- Now, reformat
index.css,index.html, andindex.jsto match your preferred style: something readable and usable by humans. Use the quotes and white-space you like, pick good variable names, and reorder stuff where needed - Update the
<title>element with your GitHub username:@username(in my case@wooorm) - When done, add a
readme.mdfile similar to the one from Do you readme?! that additionally lists what style choices you made
Hand in your reformatted code in a directory username (in my case wooorm) to
site/class-2-style/ by creating a pull request from a branch style.
Include index.csv, index.css, index.js, index.html, readme.md, and
optionally a preview.png file.
Yellow Ducks by @andreuuuw.
In this assignment you’ll learn to debug and upgrade code.
- Rubber Duck Debugging (method)
- How to debug small programs (article)
- The Debugging Mindset (article)
d3/d3/CHANGES.md(documentation)- D3 V4 - What’s new? (presentation)
- Chrome Developer Tools (software)
- Firefox Developer Tools (software)
- Safari Developer Tools (software)
For this assignment you’re going to fix a broken scatter plot. The HTML, CSS,
and JavaScript each contain several bugs. The chart also uses d3@3 instead
of d3@4.
- First, copy the files
index.csv,index.css,index.html, andindex.jsfromsite/class-2/debugto your computer and start a simple server. If everything went OK, you should see two errors in your web browser’s console about resources that failed to load - Fix the errors you just found. Then, fix the errors in the JavaScript and CSS. Depending on your knowledge of JavaScript, errors, and d3, this may be very hard. Feel free to ask others for help and try to fix the code together
- After all bugs are squashed, upgrade the chart from
d3@3tod3@4(tip: see the changelog and release notes) - Update the
<title>element with your GitHub username:@username(in my case@wooorm) - When done, add a
readme.mdfile similar to the one from Do you readme?! that additionally lists what bugs you fixed
Hand in your bug-free and upgraded code in a directory username (in my case
wooorm) to site/class-2-debug/ by creating a pull request from a branch
debug. Include index.csv, index.html, index.js, index.css,
readme.md, and optionally a preview.png file.



