Chapter 16D3 in Practice
If you choose to incorporate D3-based charts into your application, you will have to deal with challenges inherent in general web design:
-
Will the person implementing the visualization also be styling it? If not, you have to be mindful of the separation of styles and visual logic. You also need to create some standards around what class names you use.
-
Will visualizations be one-off or will they be reused in many places? Making visualizations reusable requires more care than making one-off examples. This chapter explores an example of how to make a reusable visualization.
-
How much control do you have over the data that will be displayed?
Unless you are making a visualization on top of a specific data set, you need to make sure your code works with extreme values.
Making D3 Look Perfect
This section covers some techniques that come in very handy when working with D3.
Inline Styles Versus CSS
An SVG (or HTML) element's appearance can be set in two ways: using a .style()
operator that modifies the element's own style or using a CSS selector to assign styles to the element. ...
Get JavaScript and jQuery for Data Analysis and Visualization 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.