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

184
Views
¿Cómo puede ejecutarse esta función que tiene un argumento indefinido?

En https://stackoverflow.com/a/44795246/3416774 , la esencia del código es:

 network.on("afterDrawing", function (ctx) { var dataURL = ctx.canvas.toDataURL(); document.getElementById('canvasImg').src = dataURL; });

¿Cómo puede funcionar? ctx no está definido en ninguna parte. En la documentación de Vis.js, el evento afterDrawing tiene esta descripción:

Nombre Propiedades Descripción
después del dibujo contexto del lienzo Despedido después de que se haya completado el dibujo en el lienzo. Se puede utilizar para dibujar en la parte superior de la red.
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

ctx es la abreviatura de contexto de lienzo. Entonces, cuando el método on() se complete, devolverá el contexto del lienzo para que la función pueda continuar. Este es un concepto llamado funciones de devolución de llamada.

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!