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

265
Views
refactorizando el código d3 js de v5.16 a v6.6.2, d3.event rompiendo el cambio

Nuevo en d3 y arreglando un error. Estoy trabajando con un archivo js usando la biblioteca d3. La siguiente línea de código no da error en v5.16:

 function br(d) { let s = d3.event.selection || xScaleSelector.range() let extent = s.map(xScaleSelector.invert, xScaleSelector); let window = data.filter(d => d.date >= extent[0] && d.date <= extent[1]) update(window) }

Sin embargo, al migrar a v6.6.2 y superior, aparece un error. El error que recibo está en línea: let s = d3.event.selection || xScaleSelector.range() con el siguiente error: Uncaught TypeError: Cannot read properties of undefined (reading 'selection') .

El origen del error, según https://github.com/d3/d3/releases/tag/v6.0.0 , v6.0.0 ha eliminado el d3.event . (d3.event no está definido en v6). ¿Puede alguien ayudarme a sugerir qué cambios puedo hacer para corregir este error al migrar a >= v6?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Por favor, inténtalo:

 function br(d) { let s = d.selection || xScaleSelector.range() let extent = s.map(xScaleSelector.invert, xScaleSelector); let window = data.filter(d => d.date >= extent[0] && d.date <= extent[1]) update(window) }

Según la guía de migración aquí

about 4 years ago · Santiago Trujillo 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!