I am new to frontend development and would love appreciate deeper insight into how I can use the .on function in d3. Below is what I believe is the relevant part of my code.