Skip to main content
100%

MasteringD3-Resusable-ProD3js-2.4.2

✓ Published2🌍 Public
JJimMaltby
Last edited Dec 22, 2021
Created on Dec 4, 2021

This example shows a reusable bar code chart exploring radial layout with hourly data groupings, displayed as five separate chart instances arranged horizontally. The implementation builds on Mike Bostock's reusable chart principles and the ProD3.js pattern, using d3.v5’s SVG rendering with `d3.arc`-based drawing and an interval-driven update mechanism. Each chart animates through four datasets sequentially, then calls `closeInterval()` to stop changes. The code loads data with timestamps, groups items by hour via `getHours()`, and visualizes counts using angle-based segments within a circular layout, demonstrating modular chart construction and dynamic data updates.

AI-generated description

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

Expanded to show each chart across the page horizonatlly

and apply closeInterval() to stop interval change after the 4 data sets shown.

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