These are a couple of examples from a talk I gave recently.
N.B. for simplicity, they intentionally don't make the best use of D3 (e.g. not using an ordinal scale, d3.extent, etc.). They are designed instead to show the progression from procedural code to components.
The master
branch is the template I fill in during the talk and the gh-pages
branch contains the working examples (which means they're visible here and here).