In this demo, we asynchronously load a text file, use JavaScript to count the number of times each letter appears in that file, and generate a bar chart showing the letter count in D3.js v5.
This is meant to be an introductory demo to expose students to HTML, CSS, SVG, JavaScript, D3, Bl.ocks, Blockbuilder, and VizHub for the first time.
This example can be found at: Gist, Bl.ocks, Blockbuilder, VizHub
The starter template for this example can be found at: Gist
See the Wikipedia page Peter Piper Nursery Rhyme for the origins behind the text used in this example.
This example has undergone multiple iterations:
Below you can find videos related to an older version of this example. Please note that some content was discussed in-class only:
The original inspirations come from the following excellent tutorials on creating a bar chart in D3 for the first time:
D3 Bar Chart by Mike Bostock, Observable Notebook using D3v5, published on November 2017.
Let's Make a Bar Chart by Mike Bostock, Blog Post using D3v3, published on November 2013.
Making a Bar Chart by Scott Murray, Blog Post using D3v3, updated on December 2018.
https://d3js.org/d3.v5.min.js
https://d3js.org/d3-array.v2.min.js