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

220
Views
¿Cómo puedo incrementar un valor (x, y) para la ubicación de un gráfico?

Estoy tratando de incrementar el valor y dentro de esta clase "Punto", que solo puede tomar un valor x y un valor y. ¿Hay alguna manera de que pueda incrementar la y?

 for (const port of node.ports) { const p = new Point(-10, 0); const j = new Point(8,0); if (port.tag.portConnector.charAt(0) === "P") { graph.setRelativePortLocation(port, p); } else { graph.setRelativePortLocation(port, j); } } };
about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

Incremente una variable externa o use el método foreach , que proporciona un índice opcional:

 node.ports.forEach((port, i) => { const p = new Point(-10, i * 42); const j = new Point(8, i + 1337 / 42); if (port.tag.portConnector.charAt(0) === "P") { graph.setRelativePortLocation(port, p); } else { graph.setRelativePortLocation(port, j); } })
about 4 years ago · Santiago Gelvez Report

0

De la documentación, es posible que desee probar:

 const additionalY = 10 //Or any amount you wanna increase const addition = new Point(0, additionalY ) const newPoint = p.add(addition)
about 4 years ago · Santiago Gelvez 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!