@ -952,12 +952,12 @@ Now we're going to add functionality so that when the user releases the "mouse"
First lets create the callback function that will get called when the user releases the "mouse" button. Towards the bottom of the `render()` function declaration, add the following code just above `var drag = function(datum){`:
First lets create the callback function that will get called when the user releases the "mouse" button. Towards the bottom of the `render()` function declaration, add the following code just above `var drag = function(datum){`:
```javascript
```javascript
var dragEnd = function(datum){
const dragEnd = (event, datum) => {
var x = d3.event.x;
const x = event.x;
var y = d3.event.y;
const y = event.y;
var date = xScale.invert(x);
const date = xScale.invert(x);
var distance = yScale.invert(y);
const distance = yScale.invert(y);
datum.date = formatTime(date);
datum.date = formatTime(date);
datum.distance = distance;
datum.distance = distance;
@ -968,14 +968,14 @@ var dragEnd = function(datum){
Now attach that function to the `dragBehavior` so that it is called when the user stops dragging a circle. Change the following code:
Now attach that function to the `dragBehavior` so that it is called when the user stops dragging a circle. Change the following code: