All examples By author By category About

mell0kat

Animated Bar Chart

Built with blockbuilder.org

Credit goes to Ben Clinkinbeard's "Learn D3 in 5 Days" course

This is the finished product of the course.

And here are the notes I took throughout the course:

Day 1

d3 Overview

Core Concepts

Selections

Scales

Day 2

Selections

Element CRUD

selection.attr

function(d, i, nodes){

}

selection.style

selection.property

selection.classed

selection.text

selection.append('type')

selection.insert

selection.remove

Handling Events

selection.on('type', listener)

Day 3

Joining Data and Selections

Dynamic Charts

The Data Join

Day 4

D3 Scales

Fundamentals

const decimalToPercent = d3.scaleLinear()
    .domain([0, 1])
    .range([0, 100])

decimalToPercent.invert(50) // 0.5

Outliers

const percentToDecimal = d3.scaleLinear()
    .domain([0, 100])
    .range([0, 1])
    .clamp(true)

percentToDecimal(-10) // 0
percentToDecimal(150) // 1
percentToDecimal(200) // 1

Scales in practice

Day 5

Axes

Axes come from scales

Moving axes into view

d3 Margin Convention