Tengo este código que funciona perfectamente cuando tengo una selección de elementos:
d3.selectAll(".myRectZone") .enter() .each((_,i) => { // This is an example, just to show that I am calling my own function and stuff curr_data = something[i] calling_my_custom_function(this, curr_data) })Y necesito lo mismo para un solo elemento. Algo como esto :
d3.select("#mySingleElement") .???(() => { // I want to call my own stuff curr_data = something[0] calling_my_custom_function(this, curr_data) }) on.("A_Precise_Event", () => something()) // I don't want to precise like this¿Qué puede reemplazar el "???" dejarme llamar a mi propia devolución de llamada?