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

127
Views
D3 - No se puede hacer que aparezca popover en la coordenada xy del cursor

Estoy tratando de hacer que los nodos muestren una ventana emergente adyacente cuando se hace clic. Aquí hay un codepen sobre dónde estoy: https://codepen.io/SavanaPope/pen/abLdmbz?editors=1000

Me he acercado mucho, la ventana emergente actualmente se muestra en la esquina superior izquierda y está tomando datos x/y al hacer clic. Simplemente no obtiene la ubicación correcta del cursor; no estoy seguro de cómo obtiene los datos de píxeles actualmente.

Supongo que el problema tiene algo que ver con la función clicknode:

 function clicknode(nodes) { const[x, y] = d3.pointer(event); tooltip.style("left", (x)+"px") .style("top", (y)+"px") .transition().duration(200).style("opacity", 0.9) loadTooltipContent(nodes); }

Pero simplemente no puedo entender dónde mi (probable) formato está mal.

Si tienes alguna idea de cómo solucionar esto, te lo agradecería mucho.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para D3 V7 , reescriba clicknode de la siguiente manera:

 function clicknode(event, nodes) { tooltip .style("left", `${event.layerX}px`) .style("top", `${event.layerY}px`); }
about 4 years ago · Juan Pablo Isaza Report
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!