Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda