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

132
Views
Retorno de línea en D3.js en un evento de mouseover

Estoy tratando de estructurar mi salida en la visualización D3.js y estoy usando \n retornos de línea, pero JS no los lee, ¿alguna idea sobre cómo se puede resolver?

Muchas gracias por adelantado :)

 .on('mousemove', function(d) { tooltip .style('top', d3.event.pageY - 10 + 'px') .style('left', d3.event.pageX + 10 + 'px') .text(`Number of clones in the class: ${d.data.value/2} \r\n \n \r Code of the class: ${d.data.code} Lines at which the clone appears: ${d.data.lines}`); })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

puede usar tspan para cada nueva línea y jugar con los atributos dy para la altura de la línea

 .on('mousemove', function(d) { tooltip .style('top', d3.event.pageY - 10 + 'px') .style('left', d3.event.pageX + 10 + 'px') .html(`<tspan x='0' dy='1.2em'>Number of clones in the class: ${d.data.value/2}</tspan> <tspan x='0' dy='1.2em'>Code of the class: ${d.data.code}</tspan> <tspan x='0' dy='1.2em'>Lines at which the clone appears: ${d.data.lines}</tspan>`); })
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!