From 922e49752a0a99f63f71e0c5b1ed93f8b68c31ee Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 12 Sep 2022 09:19:10 -0400 Subject: [PATCH] moving to arrow functions --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index c61ccad..0716ae9 100644 --- a/app.js +++ b/app.js @@ -19,7 +19,7 @@ var dAttributeFunction = d3.geoPath() d3.selectAll('path').attr('d', dAttributeFunction); var dragBehavior = d3.drag() //create a drag behavior - .on('start', function(event){ + .on('start', (event) => { d3.select('table tr:nth-child(2) td:first-child') .html(worldProjection.invert([event.x, event.y])[0]) d3.select('table tr:nth-child(2) td:last-child') @@ -30,7 +30,7 @@ var dragBehavior = d3.drag() //create a drag behavior .attr('x', event.x) .attr('y', event.y); }) - .on('drag', function(event){ + .on('drag', (event) => { d3.select('table tr:nth-child(3) td:first-child') .html(worldProjection.invert([event.x, event.y])[0]) d3.select('table tr:nth-child(3) td:last-child') @@ -42,7 +42,7 @@ var dragBehavior = d3.drag() //create a drag behavior d3.select('svg').call(dragBehavior); -d3.select('form').on('submit', function(event){ +d3.select('form').on('submit', (event) => { event.preventDefault(); d3.selectAll('rect').remove();