Skip to main content
100%

TDD D3 Template

✓ Published0🌍 Public
GGolodhros
Last edited Jul 25, 2015
Created on Feb 21, 2015

This template demonstrates a test-driven approach to building a reusable D3 bar chart, showing the frequency of letters in a dataset. The chart is rendered as an SVG, with bars and axes built through a modular `graphs.chart` module. It uses `d3.scale.ordinal` with `rangeRoundBands` for the x-axis and `d3.scale.linear` for the y-axis, with `d3.svg.axis` for tick marks. A separate `dataManager` module handles loading TSV data via `d3.tsv`, dispatching `dataReady`, `dataLoading`, and `dataError` events, while Jasmine specs verify chart structure and getter/setter methods.

AI-generated description

Gist to serve as template for future TDD D3 blocks

Similar vizzes