Book Image

Data Visualization with D3 and AngularJS

By : Erik Hanchett, Christoph Körner
Book Image

Data Visualization with D3 and AngularJS

By: Erik Hanchett, Christoph Körner

Overview of this book

Table of Contents (16 chapters)
Data Visualization with D3 and AngularJS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


This chapter gave an introduction to the basic usage of D3.js. You learned how to properly use CSS Selectors to find elements by name, #id, .class, and [attribute] in the DOM tree. We saw how to combine selectors with selector1selector2 by logical AND and with selector1,selector2 by logical OR, and how to apply hierarchically selector1 selector2 or by direct ancestors selector1 > selector2.

We also discussed how to modify all elements in Selections of HTML and the SVG elements with the usage of the methods .attr(), .style(), .property(), .text(), and so on. It's important to remember that most of the time we will use the .append() function to insert new elements to a Selection.

Later in this chapter, we learned how to use data binding with D3.js. We used the .data() function to bind data to a Selection and access dynamic properties with a function similar to the (d, i){ return d; } function. In D3.js data, the .enter() and .exit() functions give the developer access to the enter...