Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
how can i increment an (x,y) value for a graph location

im trying to increment the y value inside of this class "Point" which can only take an x value and a y value. is there a way that i can increment the 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 Respuestas
Responde la pregunta

0

Either increment an external variable or use the foreach method, which provides an optional index:

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 Denunciar

0

From the documentation, you might wanna try:

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda