Skip to main content
100%

MasteringD3-Resusable-ProD3js-2.3B1

✓ Published0🌍 Public
JJimMaltby
Last edited Dec 3, 2021
Created on Dec 3, 2021

This example presents a reusable bar code chart built from the principles in Mike Bostock’s “Towards Reusable Charts” and the Pro D3.js pattern. It visualizes time-series data by rendering vertical line marks for each daily mention value, using d3.scaleTime to map dates to x-coordinates. The code demonstrates a modular chart factory pattern with separate functions for building scales, SVG containers, and drawing the bars, and it relies on d3.select and data joins to append the lines. Animated transitions are also included in the chart’s rendering process.

AI-generated description

Exploration of bar code chart example, from Chapter 2 of Mastering D3.

It is derived from Mike Bostock's Towards Reusable Charts (https://bost.ocks.org/mike/chart/) as the source of the foundational principles.

Using the ProD3 pattern (Pro D3.js Use D3.js to Create Maintainable, Modular, and Testable Charts by Marcos Iglesias https://www.apress.com/gp/book/9781484252024) as the basis for charts pattern.

MIT Licensed

Similar vizzes