Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Equivalent d3js selection.each() for single element

I have this code which works perfectly when i have a selection of elements:

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)
    })

And I need the same for one single element. Something like this :

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

What can replace the "???" to let me call my own callback ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!