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

163
Visualizações
d3js: Draw line - attach one end to g and one end to svg

I simply want to draw a line which is attached to g with x1/y1 and to svg with the other end x2/y2.

The reason is because I have a div at the right side of my map and the line should point to it. Now when scrolling around in the map, the one end should always point to the div at the right side and the other end should point i.e. on california.

I've created a JSFiddle where you can change g to svg to see what I mean. How can I use both?

g.append('line')
 .style("stroke", "lightgreen")
 .style("stroke-width", 10)
 .attr("x1", 960)
 .attr("y1", 200)
 .attr("x2", 200)
 .attr("y2", 400);
});

https://jsfiddle.net/cmn81xk3/9/

about 4 years ago · Juan Pablo Isaza
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