In this chapter, we want to bring the chart to life and make the previous visualizations interactive. The biggest advantage of presenting data visualizations and graphs on the Web is that they can become interactive very easily. Interactive visualizations allow a much better understanding and processing of the data.
First, we will speak about events and event listeners in JavaScript in general. Then, we will focus on D3.js. This will enable us to understand how interactions are implemented on the lowest level and take this knowledge to implement a higher level control.
Then, we will directly use the event listeners to implement cursors for the previously developed chart directives. After a simple example, you will learn how to extract the nearest data point relative to the cursor position in order to implement snappy cursors.
In the following section, you will learn how to create custom events with D3.js in order to update the AngularJS...