© Marcos Iglesias 2019
M. IglesiasPro D3.jshttps://doi.org/10.1007/978-1-4842-5203-1_5

5. Making the Bar Chart Production-Ready

Marcos Iglesias1 
(1)
San Francisco, CA, USA
 

In this chapter, we are going to refactor the standard D3.js bar chart we reviewed in the second chapter. It will become a professional-grade bar chart component. We will see how the Reusable API pattern proposed in the previous chapter allows us to encapsulate D3.js charts.

The resulting chart component is going to be extensible, and it will specify an explicit interface to interact with it. The Reusable API pattern supports that interface because we can create new getters and setters by adding a few extra lines of code.

The Path to Professional Code

We have seen the issues of example ...

Get Pro D3.js: Use D3.js to Create Maintainable, Modular, and Testable Charts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.