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

166
Vistas
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 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