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

165
Views
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
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!