All examples By author By category About

sjengle

Letter Count Bar Chart (2020 Edition)

Letter Count Bar Chart

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.

References

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.

Inspirations

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: